openvinostable-diffusion

Stable diffusion with openVino: Failed to set input blob with precision: I64, if CNNNetwork input blob precision is: FP64


I'm trying to make this version work on my CPU (Linux): https://github.com/bes-dev/stable_diffusion.openvino

And it works fine without any initial image. But when I try to pass an initial image, I get this error:

Traceback (most recent call last):
  File "/home/ideruga/workspace/stable_diffusion.openvino/demo.py", line 79, in <module>
    main(args)
  File "/home/ideruga/workspace/stable_diffusion.openvino/demo.py", line 39, in main
    image = engine(
  File "/home/ideruga/workspace/stable_diffusion.openvino/stable_diffusion_engine.py", line 188, in __call__
    noise_pred = result(self.unet.infer_new_request({
  File "/home/ideruga/anaconda3/lib/python3.9/site-packages/openvino/runtime/ie_api.py", line 266, in infer_new_request
    return self.create_infer_request().infer(inputs)
......
  File "/home/ideruga/anaconda3/lib/python3.9/site-packages/openvino/runtime/ie_api.py", line 31, in set_scalar_tensor
    request.set_tensor(key, tensor)
RuntimeError: [ PARAMETER_MISMATCH ] Failed to set input blob with precision: I64, if CNNNetwork input blob precision is: FP64

It's bizarre, because I am not messing with any parameters. It's as if model that it downloads is not compatible with parsed input image.


Solution

  • I've actually found a bug in the linked repository, I'll submit a fix later today. The used model expects f64 but is fed with i64 value. I'll post a comment with the PR when it's submitted.