anapnoe / stable-diffusion-webui-ux

Stable Diffusion web UI UX
GNU Affero General Public License v3.0
964 stars 60 forks source link

[Bug]: `Error running before_process` #174

Closed devioa closed 8 months ago

devioa commented 1 year ago

Is there an existing issue for this?

What happened?

getting an error in console when I click Generate button:

*** Error running before_process: D:\stable-diffusion-webui-ux\extensions-builtin\extra-options-section\scripts\extra_options_section.py
    Traceback (most recent call last):
      File "D:\stable-diffusion-webui-ux\modules\scripts.py", line 467, in before_process
        script.before_process(p, *script_args)
      File "D:\stable-diffusion-webui-ux\extensions-builtin\extra-options-section\scripts\extra_options_section.py", line 40, in before_process
        for name, value in zip(self.setting_names, args):
    TypeError: 'NoneType' object is not iterable

Steps to reproduce the problem

  1. Click Generate button in WebUI
  2. an error will display in console

What should have happened?

no errors

Version or Commit where the problem happens

355c0efed9f185d0f2259aa845e201ca44b53d49

What Python version are you running on ?

Python 3.10.x

What platforms do you use to access the UI ?

Windows

What device are you running WebUI on?

Nvidia GPUs (RTX 20 above)

Cross attention optimization

Automatic

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

--xformers --opt-split-attention --deepdanbooru --disable-nan-check --no-half-vae

List of extensions

ddetection-detailer | https://github.com/Bing-su/dddetailer.git | master | ed32e3b0 | Sun May 28 04:16:03 2023 | unknown dynamic-thresholding | https://github.com/mcmonkeyprojects/sd-dynamic-thresholding.git | master | f02cacfc | Mon May 22 14:20:30 2023 | unknown multidiffusion | https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111.git | main | b28c03b1 | Fri Jun 9 17:45:33 2023 | unknown sd-webui-additional-networks | https://github.com/kohya-ss/sd-webui-additional-networks.git | main | e9f3d622 | Tue May 23 12:31:15 2023 | unknown sd-webui-controlnet | https://github.com/Mikubill/sd-webui-controlnet.git | main | caf54076 | Tue Jun 13 07:39:32 2023 | unknown sd-webui-locon | https://github.com/KohakuBlueleaf/a1111-sd-webui-locon.git | main | 161ba405 | Fri May 26 16:01:42 2023 | unknown sd-webui-lycoris | https://github.com/KohakuBlueleaf/a1111-sd-webui-lycoris.git | main | 123d1da1 | Thu Jun 8 01:19:40 2023 | unknown sd-webui-tagcomplete | https://github.com/DominikDoom/a1111-sd-webui-tagcomplete | main | f4218a71 | Fri Jun 9 14:15:27 2023 | unknown LDSR | built-in | None |   | Wed Jun 14 06:56:07 2023 |   Lora | built-in | None |   | Wed Jun 14 06:56:07 2023 |   ScuNET | built-in | None |   | Wed Jun 14 06:56:07 2023 |   SwinIR | built-in | None |   | Wed Jun 14 06:56:07 2023 |   canvas-zoom-and-pan | built-in | None |   | Wed Jun 14 06:56:07 2023 |   extra-options-section | built-in | None |   | Wed Jun 14 06:56:07 2023 |   prompt-bracket-checker | built-in | None |   | Wed Jun 14 06:56:07 2023 |   sd_theme_editor | built-in | None |   | Wed Jun 14 06:56:07 2023

Console logs

venv "D:\stable-diffusion-webui-ux\venv\Scripts\Python.exe"
fatal: No names found, cannot describe anything.
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: ## 1.4.0
Commit hash: 355c0efed9f185d0f2259aa845e201ca44b53d49
Installing requirements

Launching Web UI with arguments: --xformers --opt-split-attention --deepdanbooru --disable-nan-check --no-half-vae
[AddNet] Updating model hashes...
100%|█████████████████████████████████████████████████████████████████████████████| 116/116 [00:00<00:00, 58004.20it/s]
[AddNet] Updating model hashes...
100%|████████████████████████████████████████████████████████████████████████████| 116/116 [00:00<00:00, 115815.11it/s]
2023-06-14 14:55:56,168 - ControlNet - INFO - ControlNet v1.1.224
ControlNet preprocessor location: D:\stable-diffusion-webui-ux\extensions\sd-webui-controlnet\annotator\downloads
2023-06-14 14:55:56,244 - ControlNet - INFO - ControlNet v1.1.224
Additional Network extension not installed, Only hijack built-in lora
LoCon Extension hijack built-in lora successfully
Loading weights [3e9211917c] from D:\stable-diffusion-webui-ux\models\Stable-diffusion\2.5D\YesMix.safetensors
Creating model from config: D:\stable-diffusion-webui-ux\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying attention optimization: xformers... done.
Textual inversion embeddings loaded(8): bad-artist, bad-hands-5, bad-picture-chill-75v, bad_prompt_version2, easynegative, fast-negative_v2, negative-hand, ng_deepnegative_v1_75t
Model loaded in 6.1s (load weights from disk: 0.3s, create model: 0.5s, apply weights to model: 1.7s, apply half(): 0.4s, move model to device: 2.7s, calculate empty prompt: 0.5s).
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 17.7s (import torch: 1.8s, import gradio: 1.0s, import ldm: 0.6s, other imports: 4.1s, opts onchange: 1.3s, list SD models: 0.1s, load scripts: 2.1s, create ui: 6.5s, gradio launch: 0.1s).
preload_extensions_git_metadata for 16 extensions took 1.79s
*** Error running before_process: D:\stable-diffusion-webui-ux\extensions-builtin\extra-options-section\scripts\extra_options_section.py
    Traceback (most recent call last):
      File "D:\stable-diffusion-webui-ux\modules\scripts.py", line 467, in before_process
        script.before_process(p, *script_args)
      File "D:\stable-diffusion-webui-ux\extensions-builtin\extra-options-section\scripts\extra_options_section.py", line 40, in before_process
        for name, value in zip(self.setting_names, args):
    TypeError: 'NoneType' object is not iterable

---
locon load lora method
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:05<00:00,  5.43it/s]
 90%|██████████████████████████████████████████████████████████████████████████▋        | 9/10 [00:21<00:02,  2.38s/it]
Loading VAE weights specified in settings: D:\stable-diffusion-webui-ux\models\VAE\kl-f8-anime2.ckpt
Applying attention optimization: xformers... done.
VAE weights loaded.
Calculating sha256 for D:\stable-diffusion-webui-ux\models\Stable-diffusion\2.5D\GhostMix.safetensors: e3edb8a26f44dfddc124129004b5ded3378be974b8d3bf82f43b9660d416d3d1
Loading weights [e3edb8a26f] from D:\stable-diffusion-webui-ux\models\Stable-diffusion\2.5D\GhostMix.safetensors
Loading VAE weights specified in settings: D:\stable-diffusion-webui-ux\models\VAE\kl-f8-anime2.ckpt
Applying attention optimization: xformers... done.
Weights loaded in 3.0s (calculate hash: 1.6s, load weights from disk: 0.3s, apply weights to model: 0.3s, load VAE: 0.2s, move model to device: 0.6s).
*** Error running before_process: D:\stable-diffusion-webui-ux\extensions-builtin\extra-options-section\scripts\extra_options_section.py
    Traceback (most recent call last):
      File "D:\stable-diffusion-webui-ux\modules\scripts.py", line 467, in before_process
        script.before_process(p, *script_args)
      File "D:\stable-diffusion-webui-ux\extensions-builtin\extra-options-section\scripts\extra_options_section.py", line 40, in before_process
        for name, value in zip(self.setting_names, args):
    TypeError: 'NoneType' object is not iterable

---
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:04<00:00,  7.15it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 10/10 [00:22<00:00,  2.24s/it]

Additional information

No response

DanielTClark commented 1 year ago

I haven't touched code in forever, but I'll say what I could figure out. It looks like extra_options_section.py is supposed to let you add options like clip skip or other things to the main text2img and img2img interfaces. I couldn't get it working. It might work in main AUTOMATIC1111, but I haven't checked. To get the error to go away I moved the "extra-options-section" folder out of "extensions-builtin". It's not really doing much there as far as I can tell. You can try that and see if it works for you.

blooest commented 1 year ago

Seems like there are two arguable oversights in the code resulting in this error: 1) It runs on every generation even when the "extra options" accordion that that extension provides is entirely disabled, as it is by default. 2) It doesn't have sanity-checking for there not actually being any settings configured in the options to show up there. This is the actual bulk of the error, as it's trying to iterate over the empty setting field. I haven't tested this, because I don't have intent to use that accordion so I just removed it as silvri did, but I would suspect that adding a setting to it in its section at the bottom of the User Interface page of the options menu (and then fully restarting the app, not just the UI) would solve the error.

NamelessButler commented 1 year ago

Quick way to reproduce....

  1. Start Webui
  2. Go to script, and select x/y/z (haven't tested with others),
  3. Generate any images

After this gens will print out that error/warning even if Scripts are disabled.

Butterfly-Dragon commented 1 year ago

I haven't touched code in forever, but I'll say what I could figure out. It looks like extra_options_section.py is supposed to let you add options like clip skip or other things to the main text2img and img2img interfaces. I couldn't get it working. It might work in main AUTOMATIC1111, but I haven't checked. To get the error to go away I moved the "extra-options-section" folder out of "extensions-builtin". It's not really doing much there as far as I can tell. You can try that and see if it works for you.

can confirm, thanks, removing this specific file removed the problem for me.

I do not know if it is supposed to do anything, but i see no loss of functionality for what i use.

anapnoe commented 8 months ago

you are right close the issue