camenduru / stable-diffusion-webui-colab

stable diffusion webui colab
The Unlicense
15.59k stars 2.61k forks source link

[Bug]: sd-webui-additional-networks error #431

Closed Runarry closed 1 year ago

Runarry commented 1 year ago

What happened?

When using the latest drive branch, the sd-webui-additional-networks plugin throws an error.

I checked the updates of the sd-webui-additional-networks plugin, and in its latest code, it added weight.release(lambda w: (w, w), inputs=[weight], outputs=[weight_unet, weight_tenc]). However, weight.release is only supported in newer versions of Gradio.

Colab cell output

Loading weights [cc6cb27103] from /content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.ckpt
Creating model from config: /content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(9): ng_deepnegative_v1_75t, bad-artist, EasyNegative, verybadimagenegative_v1.3, EasyNegativeV2, bad_prompt_version2, bad-image-v2-39000, bad-hands-5, bad-artist-anime
Model loaded in 11.2s (load weights from disk: 5.1s, create model: 4.9s, apply weights to model: 1.1s).
Create LRU cache (max_size=16) for preprocessor results.
Error calling: /content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/extensions/sd-webui-additional-networks/scripts/additional_networks.py/ui
Traceback (most recent call last):
  File "/content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/modules/scripts.py", line 262, in wrap_call
    res = func(*args, **kwargs)
  File "/content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/extensions/sd-webui-additional-networks/scripts/additional_networks.py", line 104, in ui
    weight.release(lambda w: (w, w), inputs=[weight], outputs=[weight_unet, weight_tenc])
AttributeError: 'Slider' object has no attribute 'release'

Create LRU cache (max_size=16) for preprocessor results.
Error calling: /content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/extensions/sd-webui-additional-networks/scripts/additional_networks.py/ui
Traceback (most recent call last):
  File "/content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/modules/scripts.py", line 262, in wrap_call
    res = func(*args, **kwargs)
  File "/content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/extensions/sd-webui-additional-networks/scripts/additional_networks.py", line 104, in ui
    weight.release(lambda w: (w, w), inputs=[weight], outputs=[weight_unet, weight_tenc])
AttributeError: 'Slider' object has no attribute 'release'

*Deforum ControlNet support: enabled*
Error executing callback ui_tabs_callback for /content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/extensions/sd-webui-additional-networks/scripts/additional_networks.py
Traceback (most recent call last):
  File "/content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/modules/script_callbacks.py", line 125, in ui_tabs_callback
    res += c.callback() or []
  File "/content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/extensions/sd-webui-additional-networks/scripts/additional_networks.py", line 290, in on_ui_tabs
    metadata_editor.setup_ui(addnet_paste_params)
  File "/content/drive/MyDrive/stable-diffusion-webui-colab/stable-diffusion-webui/extensions/sd-webui-additional-networks/scripts/metadata_editor.py", line 462, in setup_ui
    outputs=[addnet_paste_params[tabname][i]["module"], addnet_paste_params[tabname][i]["model"]],
IndexError: list index out of range

Which colab and model(s) were you using when the error occurred?

https://github.com/camenduru/stable-diffusion-webui-colab/tree/drive

Which Public WebUI Colab URL were you using when the error occurred?

gradio.live

If you used HiRes mode when the error occurred, please provide the Hires info

No response

stephonye commented 1 year ago

I had the same problem.

Runarry commented 1 year ago

I had the same problem.

Currently, I have manually deleted the code weight.release(lambda w: (w, w), inputs=[weight], outputs=[weight_unet, weight_tenc]) located at line 104 in the file sd-webui-additional-networks/scripts/additional_networks.py. This can temporarily solve the problem.

stephonye commented 1 year ago

I had the same problem.

Currently, I have manually deleted the code weight.release(lambda w: (w, w), inputs=[weight], outputs=[weight_unet, weight_tenc]) located at line 104 in the file sd-webui-additional-networks/scripts/additional_networks.py. This can temporarily solve the problem.

Thanks, I will try to follow the method you suggested.

camenduru commented 1 year ago

hi @Runarry 👋 thanks for the info ❤ please try again

nickthelegend commented 1 year ago

same problem vro

camenduru commented 1 year ago

please use One Time Install & Update colab

nickthelegend commented 1 year ago

please use One Time Install & Update colab

the runtime gets disconnected