openvinotoolkit / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
290 stars 45 forks source link

[Bug]: animatediff support #65

Open Wing13 opened 1 year ago

Wing13 commented 1 year ago

Is there an existing issue for this?

What happened?

I'd like to use Animatediff extention: https://github.com/continue-revolution/sd-webui-animatediff

But when I press "Generate", an error is thrown after the picture is generated: *** Error running postprocess: D:\StableDiffusion\stable-diffusion-webui\extensions\sd-webui-animatediff\scripts\animatediff.py Traceback (most recent call last): File "D:\StableDiffusion\stable-diffusion-webui\modules\scripts.py", line 651, in postprocess script.postprocess(p, processed, *script_args) File "D:\StableDiffusion\stable-diffusion-webui\extensions\sd-webui-animatediff\scripts\animatediff.py", line 77, in postprocess self.prompt_scheduler.save_infotext_txt(res) AttributeError: 'NoneType' object has no attribute 'save_infotext_txt'

Steps to reproduce the problem

  1. Install extention Animatediff
  2. tex2img > AnimateDiff > Enable AnimateDiff
  3. Set more then 0 frames
  4. Press Generate

What should have happened?

A video should be generated

Sysinfo

sysinfo-2023-10-21-21-54.txt

What browsers do you use to access the UI ?

Mozilla Firefox

Console logs

venv "D:\StableDiffusion\stable-diffusion-webui\venv\Scripts\Python.exe"
Launching Web UI with arguments: --no-half --skip-prepare-environment --update-check
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled
2023-10-22 00:46:42,152 - ControlNet - INFO - ControlNet v1.1.411
ControlNet preprocessor location: D:\StableDiffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2023-10-22 00:46:42,757 - ControlNet - INFO - ControlNet v1.1.411
Loading weights [aadddd3d75] from D:\StableDiffusion\stable-diffusion-webui\models\Stable-diffusion\deliberate_v3.safetensors
fatal: No names found, cannot describe anything.
Running on local URL:  http://127.0.0.1:7860
Creating model from config: D:\StableDiffusion\stable-diffusion-webui\configs\v1-inference.yaml

To create a public link, set `share=True` in `launch()`.
Startup time: 79.4s (import torch: 36.3s, import gradio: 7.8s, setup paths: 8.3s, initialize shared: 1.5s, other imports: 6.8s, setup codeformer: 1.0s, setup gfpgan: 0.1s, load scripts: 10.7s, initialize extra networks: 0.2s, create ui: 3.9s, gradio launch: 2.1s).
Applying attention optimization: InvokeAI... done.
Model loaded in 34.1s (load weights from disk: 5.8s, create model: 2.6s, apply weights to model: 23.2s, apply float(): 1.7s, calculate empty prompt: 0.6s).
Loading weights [aadddd3d75] from D:\StableDiffusion\stable-diffusion-webui\models\Stable-diffusion\deliberate_v3.safetensors
OpenVINO Script:  created model from config : D:\StableDiffusion\stable-diffusion-webui\configs\v1-inference.yaml
D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\transformers\models\clip\feature_extraction_clip.py:28: FutureWarning: The class CLIPFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please use CLIPImageProcessor instead.
  warnings.warn(
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [03:30<00:00, 10.54s/it]
*** Error running postprocess: D:\StableDiffusion\stable-diffusion-webui\extensions\sd-webui-animatediff\scripts\animatediff.py
    Traceback (most recent call last):
      File "D:\StableDiffusion\stable-diffusion-webui\modules\scripts.py", line 651, in postprocess
        script.postprocess(p, processed, *script_args)
      File "D:\StableDiffusion\stable-diffusion-webui\extensions\sd-webui-animatediff\scripts\animatediff.py", line 77, in postprocess
        self.prompt_scheduler.save_infotext_txt(res)
    AttributeError: 'NoneType' object has no attribute 'save_infotext_txt'

---

Additional information

No response

taotaow commented 1 year ago

1.find scripts/openvino_accelerate.py,find "def process_images_openvino(" method 2.add script below:

if p.scripts is not None: p.scripts.before_process(p)

3.have a try

Wing13 commented 1 year ago

Thank you! It seems to be working now, but it throws a different error. It seems to be related to memory, so the problem is probably with the hardware.

Error: RuntimeError: Exception from src\inference\src\core.cpp:116: [ GENERAL_ERROR ] [CL ext] Can not allocate nullptr for USM type.

Full error text:

*** Error completing request *** Arguments: ('task(snue670neuxy19k)', 'cat', '', [], 20, 'DPM++ 2M Karras', 1, 1, 7, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', '', '', [], <gradio.routes.Request object at 0x000002A84D1AABF0>, 1, False, '', 0.8, -1, False, -1, 0, 0, 0, False, 7, 100, 'Constant', 0, 'Constant', 0, 4, True, 'MEAN', 'AD', 1, <scripts.animatediff_ui.AnimateDiffProcess object at 0x000002A84D1BAFB0>, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000002A84D1B8EE0>, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000002A84D2337C0>, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000002A84D214790>, 'None', 'None', 'GPU', True, 'Euler a', True, False, 'None', 0.8, False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False, None, None, False, None, None, False, None, None, False, 50) {} Traceback (most recent call last): File "D:\StableDiffusion\stable-diffusion-webui\modules\call_queue.py", line 57, in f res = list(func(*args, **kwargs)) File "D:\StableDiffusion\stable-diffusion-webui\modules\call_queue.py", line 36, in f res = func(*args, **kwargs) File "D:\StableDiffusion\stable-diffusion-webui\modules\txt2img.py", line 52, in txt2img processed = modules.scripts.scripts_txt2img.run(p, *args) File "D:\StableDiffusion\stable-diffusion-webui\modules\scripts.py", line 601, in run processed = script.run(p, *script_args) File "D:\StableDiffusion\stable-diffusion-webui\scripts\openvino_accelerate.py", line 1135, in run processed = process_images_openvino(p, model_config, vae_ckpt, p.sampler_name, enable_caching, openvino_device, mode, is_xl_ckpt, refiner_ckpt, refiner_frac) File "D:\StableDiffusion\stable-diffusion-webui\scripts\openvino_accelerate.py", line 885, in process_images_openvino output = shared.sd_diffusers_model( File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\diffusers\pipelines\stable_diffusion\pipeline_stable_diffusion.py", line 680, in __call__ noise_pred = self.unet( File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl return forward_call(*args, **kwargs) File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\torch\_dynamo\eval_frame.py", line 328, in _fn return fn(*args, **kwargs) File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl return forward_call(*args, **kwargs) File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\diffusers\models\unet_2d_condition.py", line 734, in forward def forward( File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\torch\_dynamo\eval_frame.py", line 328, in _fn return fn(*args, **kwargs) File "D:\StableDiffusion\stable-diffusion-webui\scripts\openvino_accelerate.py", line 188, in _call res = execute(compiled_model, *args, executor="openvino", File "D:\StableDiffusion\stable-diffusion-webui\scripts\openvino_accelerate.py", line 217, in execute return openvino_execute_partitioned(gm, *args, executor_parameters=executor_parameters, file_name=file_name) File "D:\StableDiffusion\stable-diffusion-webui\scripts\openvino_accelerate.py", line 319, in openvino_execute_partitioned return partitioned_modules[signature](*args) File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\torch\fx\graph_module.py", line 678, in call_wrapped return self._wrapped_call(self, *args, **kwargs) File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\torch\fx\graph_module.py", line 284, in __call__ raise e File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\torch\fx\graph_module.py", line 274, in __call__ return super(self.cls, obj).__call__(*args, **kwargs) # type: ignore[misc] File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl return forward_call(*args, **kwargs) File "<eval_with_key>.3", line 5, in forward fused_0 = self.fused_0(arg2_1, arg1_1, arg0_1); arg2_1 = arg1_1 = arg0_1 = None File "D:\StableDiffusion\stable-diffusion-webui\scripts\openvino_accelerate.py", line 240, in __call__ result = openvino_execute(self.gm, *args, executor_parameters=self.executor_parameters, partition_id=self.partition_id, file_name=self.file_name) File "D:\StableDiffusion\stable-diffusion-webui\scripts\openvino_accelerate.py", line 284, in openvino_execute compiled = openvino_compile(gm, *args, model_hash_str=model_hash_str, file_name=file_name) File "D:\StableDiffusion\stable-diffusion-webui\scripts\openvino_accelerate.py", line 449, in openvino_compile compiled = core.compile_model(om, device) File "D:\StableDiffusion\stable-diffusion-webui\venv\lib\site-packages\openvino\runtime\ie_api.py", line 543, in compile_model super().compile_model(model, device_name, {} if config is None else config), RuntimeError: Exception from src\inference\src\core.cpp:116: [ GENERAL_ERROR ] [CL ext] Can not allocate nullptr for USM type.

lk-box commented 10 months ago

It's because there's not enough memory left. https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/OpenVINO-cannot-run-on-gpu-device-stable-diffusion-Script/m-p/1551331