openvinotoolkit/stable-diffusion-webui

[Bug]: NameError: free variable 'maybe_fs_cached_name' referenced before assignment in enclosing scope

palant opened this issue · 2 comments

palant commented

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

The error NameError: free variable 'maybe_fs_cached_name' referenced before assignment in enclosing scope always pops up if “Cache the compiled models on disk for faster model load in subsequent launches” setting is disabled.

And if you look at function openvino_fx() in openvino_accelerate.py, this makes perfect sense. The variable maybe_fs_cached_name is set only in the branch entered if OPENVINO_TORCH_MODEL_CACHING environment variable is present. Yet it is being used unconditionally in the _call() function outside that branch:

res = execute(compiled_model, *args, executor="openvino",
executor_parameters=executor_parameters, file_name=maybe_fs_cached_name)

Steps to reproduce the problem

  1. Enable OpenVINO script.
  2. Make sure “Cache the compiled models on disk for faster model load in subsequent launches” is switched off.
  3. Click “Generate”

What should have happened?

The image should be generated without error.

same error on intel iris XE graphic , is this project is going on ?

d172a08

this should fix it by defining maybe_fs_cached_name = None