stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: extensions errors in 1.4.0 version

Open tbelousov opened this issue 1 year ago • 22 comments

Is there an existing issue for this?

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

What happened?

When generating images, both img2img and txt2img, there are errors of this kind for the installed extensions:

*** Error running postprocess_batch: C:\WORK\NEURO\stable-diffusion-webui\extensions\multidiffusion-upscaler-for-automatic1111\scripts\tilediffusion.py
    Traceback (most recent call last):
      File "C:\WORK\NEURO\stable-diffusion-webui\modules\scripts.py", line 506, in postprocess_batch
        script.postprocess_batch(p, *script_args, images=images, **kwargs)
    TypeError: Script.postprocess_batch() missing 1 required positional argument: 'enabled'

---
*** Error running postprocess_batch: C:\WORK\NEURO\stable-diffusion-webui\extensions\sd-dynamic-thresholding\scripts\dynamic_thresholding.py
    Traceback (most recent call last):
      File "C:\WORK\NEURO\stable-diffusion-webui\modules\scripts.py", line 506, in postprocess_batch
        script.postprocess_batch(p, *script_args, images=images, **kwargs)
    TypeError: Script.postprocess_batch() missing 8 required positional arguments: 'enabled', 'mimic_scale', 'threshold_percentile', 'mimic_mode', 'mimic_scale_min', 'cfg_mode', 'cfg_scale_min', and 'sched_val'

There were no errors on version 1.3.0. All extensions have been updated to the latest versions. I'm using --xformers flag (xformers ver.0.0.20).

Steps to reproduce the problem

  1. Install multidiffusion-upscaler-for-automatic1111 (or another) extension
  2. Run Automatic1111 with --xformers flag
  3. Try to generate txt2img or img2img with default settings
  4. Here is the error

What should have happened?

There shouldn't be any errors. Extensions should work

Version or Commit where the problem happens

Version: v1.4.0

What Python version are you running on ?

None

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

xformers

What browsers do you use to access the UI ?

No response

Command Line Arguments

--xformers

List of extensions

SD-CN-Animation https://github.com/volotat/SD-CN-Animation main 2e257bbf Tue May 30 16:49:03 2023 unknown multidiffusion-upscaler-for-automatic1111 https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111 main de488810 Sun Jun 18 21:39:44 2023 unknown sd-dynamic-thresholding https://github.com/mcmonkeyprojects/sd-dynamic-thresholding master fa12a88e Thu Jun 22 01:39:35 2023 unknown sd-webui-3d-open-pose-editor https://github.com/nonnonstop/sd-webui-3d-open-pose-editor.git main f2d5aac5 Sat Apr 15 13:21:06 2023 unknown sd-webui-controlnet https://github.com/Mikubill/sd-webui-controlnet.git main 8e143d35 Sun Jun 25 04:45:53 2023 unknown sd-webui-mov2mov https://github.com/Scholar01/sd-webui-mov2mov master 0ba11a1a Wed Apr 19 08:44:24 2023 unknown sd-webui-photopea-embed https://github.com/yankooliveira/sd-webui-photopea-embed main f3874a0c Sat Jun 17 09:46:50 2023 unknown sd-webui-roop https://github.com/s0md3v/sd-webui-roop main ddc02ee1 Sun Jun 25 03:26:53 2023 unknown stable-diffusion-webui-two-shot https://github.com/opparco/stable-diffusion-webui-two-shot main 9936c52e Sun Feb 19 08:40:41 2023 unknown ultimate-upscale-for-automatic1111 https://github.com/Coyote-A/ultimate-upscale-for-automatic1111 master c99f382b Tue Jun 13 04:29:35 2023 unknown LDSR built-in None Tue Jun 27 07:32:29 2023 Lora built-in None Tue Jun 27 07:32:29 2023 ScuNET built-in None Tue Jun 27 07:32:29 2023 SwinIR built-in None Tue Jun 27 07:32:29 2023 canvas-zoom-and-pan built-in None Tue Jun 27 07:32:29 2023 extra-options-section built-in None Tue Jun 27 07:32:29 2023 prompt-bracket-checker built-in None Tue Jun 27 07:32:29 2023

Console logs

Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: v1.4.0
Commit hash: 394ffa7b0a7fff3ec484bcd084e673a8b301ccc8
Installing requirements
Installing SD-CN-Animation requirement: scikit-image

Checking roop requirements
Install insightface==0.7.3
Installing sd-webui-roop requirement: insightface==0.7.3
Install onnx==1.14.0
Installing sd-webui-roop requirement: onnx==1.14.0
Install onnxruntime==1.15.0
Installing sd-webui-roop requirement: onnxruntime==1.15.0
Install opencv-python==4.7.0.72
Installing sd-webui-roop requirement: opencv-python==4.7.0.72

Launching Web UI with arguments: --xformers
2023-06-27 11:54:34,682 - ControlNet - INFO - ControlNet v1.1.227
ControlNet preprocessor location: C:\WORK\NEURO\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2023-06-27 11:54:34,760 - ControlNet - INFO - ControlNet v1.1.227
2023-06-27 11:54:35,332 - roop - INFO - roop v0.0.2
2023-06-27 11:54:35,333 - roop - INFO - roop v0.0.2
Loading weights [81086e2b3f] from C:\WORK\NEURO\stable-diffusion-webui\models\Stable-diffusion\Realistic_Vision_V2.0.ckpt
Creating model from config: C:\WORK\NEURO\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Loading VAE weights specified in settings: C:\WORK\NEURO\stable-diffusion-webui\models\VAE\vae-ft-mse-840000-ema-pruned.ckpt
Applying attention optimization: xformers... done.
Textual inversion embeddings loaded(2): tbelousov, tbelousov-2600
Model loaded in 8.7s (load weights from disk: 3.7s, create model: 0.7s, apply weights to model: 0.7s, apply half(): 0.6s, load VAE: 0.4s, move model to device: 2.3s, calculate empty prompt: 0.4s).
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 16.8s (import torch: 2.1s, import gradio: 1.1s, import ldm: 0.6s, other imports: 1.0s, load scripts: 2.4s, create ui: 9.2s, gradio launch: 0.4s).
preload_extensions_git_metadata for 18 extensions took 1.41s
2023-06-27 11:55:12,881 - ControlNet - WARNING - No ControlNetUnit detected in args. It is very likely that you are having an extension conflict.Here are args received by ControlNet: ().
*** Error running process: C:\WORK\NEURO\stable-diffusion-webui\extensions\multidiffusion-upscaler-for-automatic1111\scripts\tilediffusion.py
    Traceback (most recent call last):
      File "C:\WORK\NEURO\stable-diffusion-webui\modules\scripts.py", line 474, in process
        script.process(p, *script_args)
    TypeError: Script.process() missing 21 required positional arguments: 'enabled', 'method', 'overwrite_size', 'keep_input_size', 'image_width', 'image_height', 'tile_width', 'tile_height', 'overlap', 'tile_batch_size', 'upscaler_name', 'scale_factor', 'noise_inverse', 'noise_inverse_steps', 'noise_inverse_retouch', 'noise_inverse_renoise_strength', 'noise_inverse_renoise_kernel', 'control_tensor_cpu', 'enable_bbox_control', 'draw_background', and 'causal_layers'

---
*** Error running process: C:\WORK\NEURO\stable-diffusion-webui\extensions\multidiffusion-upscaler-for-automatic1111\scripts\vae_optimize.py
    Traceback (most recent call last):
      File "C:\WORK\NEURO\stable-diffusion-webui\modules\scripts.py", line 474, in process
        script.process(p, *script_args)
    TypeError: Script.process() missing 7 required positional arguments: 'enabled', 'encoder_tile_size', 'decoder_tile_size', 'vae_to_gpu', 'fast_decoder', 'fast_encoder', and 'color_fix'

---
2023-06-27 11:55:12,883 - ControlNet - WARNING - No ControlNetUnit detected in args. It is very likely that you are having an extension conflict.Here are args received by ControlNet: ().
*** Error running process: C:\WORK\NEURO\stable-diffusion-webui\extensions\sd-webui-roop\scripts\faceswap.py
    Traceback (most recent call last):
      File "C:\WORK\NEURO\stable-diffusion-webui\modules\scripts.py", line 474, in process
        script.process(p, *script_args)
    TypeError: FaceSwapScript.process() missing 11 required positional arguments: 'img', 'enable', 'faces_index', 'model', 'face_restorer_name', 'face_restorer_visibility', 'upscaler_name', 'upscaler_scale', 'upscaler_visibility', 'swap_in_source', and 'swap_in_generated'

---
*** Error running process: C:\WORK\NEURO\stable-diffusion-webui\extensions\stable-diffusion-webui-two-shot\scripts\two_shot.py
    Traceback (most recent call last):
      File "C:\WORK\NEURO\stable-diffusion-webui\modules\scripts.py", line 474, in process
        script.process(p, *script_args)
    TypeError: Script.process() missing 5 required positional arguments: 'enabled', 'raw_divisions', 'raw_positions', 'raw_weights', and 'raw_end_at_step'

---
*** Error running process_batch: C:\WORK\NEURO\stable-diffusion-webui\extensions\sd-dynamic-thresholding\scripts\dynamic_thresholding.py
    Traceback (most recent call last):
      File "C:\WORK\NEURO\stable-diffusion-webui\modules\scripts.py", line 490, in process_batch
        script.process_batch(p, *script_args, **kwargs)
    TypeError: Script.process_batch() missing 8 required positional arguments: 'enabled', 'mimic_scale', 'threshold_percentile', 'mimic_mode', 'mimic_scale_min', 'cfg_mode', 'cfg_scale_min', and 'sched_val'

---
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:04<00:00,  4.23it/s]
*** Error running postprocess_batch: C:\WORK\NEURO\stable-diffusion-webui\extensions\multidiffusion-upscaler-for-automatic1111\scripts\tilediffusion.py
    Traceback (most recent call last):
      File "C:\WORK\NEURO\stable-diffusion-webui\modules\scripts.py", line 506, in postprocess_batch
        script.postprocess_batch(p, *script_args, images=images, **kwargs)
    TypeError: Script.postprocess_batch() missing 1 required positional argument: 'enabled'

---
*** Error running postprocess_batch: C:\WORK\NEURO\stable-diffusion-webui\extensions\sd-dynamic-thresholding\scripts\dynamic_thresholding.py
    Traceback (most recent call last):
      File "C:\WORK\NEURO\stable-diffusion-webui\modules\scripts.py", line 506, in postprocess_batch
        script.postprocess_batch(p, *script_args, images=images, **kwargs)
    TypeError: Script.postprocess_batch() missing 8 required positional arguments: 'enabled', 'mimic_scale', 'threshold_percentile', 'mimic_mode', 'mimic_scale_min', 'cfg_mode', 'cfg_scale_min', and 'sched_val'

---
*** Error running postprocess_batch: C:\WORK\NEURO\stable-diffusion-webui\extensions\sd-webui-roop\scripts\faceswap.py
    Traceback (most recent call last):
      File "C:\WORK\NEURO\stable-diffusion-webui\modules\scripts.py", line 506, in postprocess_batch
        script.postprocess_batch(p, *script_args, images=images, **kwargs)
      File "C:\WORK\NEURO\stable-diffusion-webui\extensions\sd-webui-roop\scripts\faceswap.py", line 177, in postprocess_batch
        if self.enable:
    AttributeError: 'FaceSwapScript' object has no attribute 'enable'

---
*** Error running postprocess_image: C:\WORK\NEURO\stable-diffusion-webui\extensions\sd-webui-roop\scripts\faceswap.py
    Traceback (most recent call last):
      File "C:\WORK\NEURO\stable-diffusion-webui\modules\scripts.py", line 514, in postprocess_image
        script.postprocess_image(p, pp, *script_args)
      File "C:\WORK\NEURO\stable-diffusion-webui\extensions\sd-webui-roop\scripts\faceswap.py", line 181, in postprocess_image
        if self.enable and self.swap_in_generated:
    AttributeError: 'FaceSwapScript' object has no attribute 'enable'

---
*** Error running postprocess: C:\WORK\NEURO\stable-diffusion-webui\extensions\multidiffusion-upscaler-for-automatic1111\scripts\tilediffusion.py
    Traceback (most recent call last):
      File "C:\WORK\NEURO\stable-diffusion-webui\modules\scripts.py", line 498, in postprocess
        script.postprocess(p, processed, *script_args)
    TypeError: Script.postprocess() missing 1 required positional argument: 'enabled'

---
*** Error running postprocess: C:\WORK\NEURO\stable-diffusion-webui\extensions\multidiffusion-upscaler-for-automatic1111\scripts\vae_optimize.py
    Traceback (most recent call last):
      File "C:\WORK\NEURO\stable-diffusion-webui\modules\scripts.py", line 498, in postprocess
        script.postprocess(p, processed, *script_args)
    TypeError: Script.postprocess() missing 1 required positional argument: 'enabled'

---

Additional information

No response

tbelousov avatar Jun 27 '23 07:06 tbelousov

same question

mengcius avatar Jun 27 '23 08:06 mengcius

When plugins (SD-CN-Animation, multidiffusion-upscaler-for-automatic1111) is turned off, txt2img is fine. But img2img still reports error, controlnet does not work in img2img.

mengcius avatar Jun 27 '23 08:06 mengcius

So until the extensions are updated, use the previous version or disable these extensions

chrme avatar Jun 27 '23 08:06 chrme

same eeror with x/y/z plot:

    TypeError: Script.run() missing 14 required positional arguments: 'x_type', 'x_values', 'x_values_dropdown', 'y_type', 'y_values', 'y_values_dropdown', 'z_type', 'z_values', 'z_values_dropdown', 'draw_legend', 'include_lone_images', 'include_sub_grids', 'no_fixed_seeds', and 'margin_size'```

h43lb1t0 avatar Jun 27 '23 10:06 h43lb1t0

Extension I use that are broken by this update:

UnivAiCharGen adetailer multi-diffusion lora block weights regional prompter composable lora two-shot dynamic thresholding

I-ShadowStar avatar Jun 27 '23 14:06 I-ShadowStar

Also, command line arguments aren't changing. I was reinstalling xformers and used --reinstall-xformers arg. but after reinstalling it(I wanted 0.0.20 but it somehow still installed 0.0.17) and deleting the argument and leaving only the xformers, it still sees the -reinstall argument. Every time I open sd it reinstalls it again, not looking at webui-user.bat at all

Monshilstraze avatar Jun 27 '23 14:06 Monshilstraze

same issue with x/y/z plot. TypeError: Script.run() missing 14 required positional arguments: 'x_type', 'x_values', 'x_values_dropdown', 'y_type', 'y_values', 'y_values_dropdown', 'z_type', 'z_values', 'z_values_dropdown', 'draw_legend', 'include_lone_images', 'include_sub_grids', 'no_fixed_seeds', and 'margin_size' Edit: keep getting this error only with img2img. txt2img with x/y/z plot enabled works as before. Solution: downloaded a clean version without any extensions.

StanislawKarnacky avatar Jun 27 '23 17:06 StanislawKarnacky

Also, command line arguments aren't changing. I was reinstalling xformers and used --reinstall-xformers arg. but after reinstalling it(I wanted 0.0.20 but it somehow still installed 0.0.17) and deleting the argument and leaving only the xformers, it still sees the -reinstall argument. Every time I open sd it reinstalls it again, not looking at webui-user.bat at all

Launching Web UI with arguments: --xformers

You are running xformers 0.0.17. The program is tested to work with xformers 0.0.20. To reinstall the desired version, run with commandline flag --reinstall-xformers.

Tried --reinstall-xformers, same message comes up

Davey212 avatar Jun 27 '23 17:06 Davey212

Screenshot 2023-06-27 125337 This is really weird, Webui says the xformers is version 0.0.20, but in the cmd it says about reinstalling 0.0.17 every time I boot it up...

Monshilstraze avatar Jun 27 '23 19:06 Monshilstraze

Screenshot 2023-06-27 130351 This is kinda annoying...

Monshilstraze avatar Jun 27 '23 20:06 Monshilstraze

When plugins (SD-CN-Animation, multidiffusion-upscaler-for-automatic1111) is turned off, txt2img is fine. But img2img still reports error, controlnet does not work in img2img.

Thanks for this. When I removed SD-CN-Animation, my upscaling works again. :)

SChalice avatar Jun 27 '23 21:06 SChalice

Screenshot 2023-06-27 125337 This is really weird, Webui says the xformers is version 0.0.20, but in the cmd it says about reinstalling 0.0.17 every time I boot it up...

I am getting this:

You are running xformers 0.0.20.dev526. The program is tested to work with xformers 0.0.20

SChalice avatar Jun 27 '23 21:06 SChalice

My bug disappeared on its own... I just restarted once. I hope that the extensions will be updated soon.

Monshilstraze avatar Jun 27 '23 22:06 Monshilstraze

Similar issue here but: ControlNet - WARNING - No ControlNetUnit detected in args. It is very likely that you are having an extension conflict.Here are args received by ControlNet: [].

Fine before recent update

Ainaemaet avatar Jun 28 '23 01:06 Ainaemaet

I have encountered the same problem, and for this reason, I have reinstalled SD, Python, pip, vene, and extensions. It can only run when all extensions are removed. Once multiple extensions are installed, problems will occur again. Therefore, I have only retained the control net&openposition&stableSR. The problem phenomenon has caused errors in img2img&control net&script

  • ControlNet - WARNING - No ControlNetUnit detected in args. It is very likely that you are having an extension conflict.Here are args received by ControlNet: (). 无标题

BingcaiOfficial avatar Jun 29 '23 06:06 BingcaiOfficial

Same problem: 2023-06-29 14:10:25,940 - ControlNet - WARNING - No ControlNetUnit detected in args. It is very likely that you are having an extension conflict.Here are args received by ControlNet: (). 2023-06-29 14:10:25,940 - ControlNet - WARNING - No ControlNetUnit detected in args. It is very likely that you are having an extension conflict.Here are args received by ControlNet: (). *** Error running process: G:\stable-diffusion-webui\extensions\stable-diffusion-webui-composable-lora\scripts\composable_lora_script.py Traceback (most recent call last): File "G:\stable-diffusion-webui\modules\scripts.py", line 474, in process script.process(p, *script_args) TypeError: ComposableLoraScript.process() missing 7 required positional arguments: 'enabled', 'opt_composable_with_step', 'opt_uc_text_model_encoder', 'opt_uc_diffusion_model', 'opt_plot_lora_weight', 'opt_single_no_uc', and 'opt_hires_step_as_global'


*** Error running process: G:\stable-diffusion-webui\extensions\stable-diffusion-webui-two-shot\scripts\two_shot.py Traceback (most recent call last): File "G:\stable-diffusion-webui\modules\scripts.py", line 474, in process script.process(p, *script_args) File "G:\stable-diffusion-webui\extensions\stable-diffusion-webui-two-shot\scripts\two_shot.py", line 557, in process enabled, raw_divisions, raw_positions, raw_weights, raw_end_at_step, alpha_blend, *cur_weight_sliders = args ValueError: not enough values to unpack (expected at least 6, got 0)


100%|██████████████████████████████████████████████████████████████████████████████████| 25/25 [00:26<00:00, 1.05s/it] 100%|██████████████████████████████████████████████████████████████████████████████████| 25/25 [03:27<00:00, 8.29s/it] *** Error running postprocess: G:\stable-diffusion-webui\extensions\stable-diffusion-webui-composable-lora\scripts\composable_lora_script.py Traceback (most recent call last): File "G:\stable-diffusion-webui\modules\scripts.py", line 498, in postprocess script.postprocess(p, processed, *script_args) File "G:\stable-diffusion-webui\extensions\stable-diffusion-webui-composable-lora\scripts\composable_lora_script.py", line 138, in postprocess composable_lora_function_handler.on_disable() File "G:\stable-diffusion-webui\extensions\stable-diffusion-webui-composable-lora\composable_lora_function_handler.py", line 45, in on_disable torch.nn.Linear.forward = composable_lora.backup_lora_Linear_forward AttributeError: module 'composable_lora' has no attribute 'backup_lora_Linear_forward'

zerotwoo002 avatar Jun 29 '23 10:06 zerotwoo002

Everything breaks the SD-CN-Animation extension, disable it and everything will work.

bismark211 avatar Jun 29 '23 10:06 bismark211

Can confirm, after disabling SD-CN-Animation extension everything seems to work as expected. My active Extensions:

CFG-Schedule-for-Automatic1111-SD Cozy-Nest Stable-Diffusion-Webui-Civitai-Helper a1111-sd-webui-lycoris canvas-zoom deforum-for-automatic1111-webui infinite-zoom-automatic1111-webui loopback_scaler multidiffusion-upscaler-for-automatic1111 posex prompt-fusion-extension sd-dynamic-thresholding sd-extension-steps-animation sd-webui-3d-open-pose-editor sd-webui-check-tensors sd-webui-color-enhance sd-webui-controlnet sd-webui-cutoff sd-webui-enable-checker sd-webui-llul sd-webui-lora-block-weight sd-webui-openpose-editor sd-webui-stopmotion sdweb-merge-block-weighted-gui seed_travel shift-attention stable-diffusion-webui-composable-lora stable-diffusion-webui-daam stable-diffusion-webui-sonar ultimate-upscale-for-automatic1111

Kansaku avatar Jun 29 '23 17:06 Kansaku

I don't have that SD-CN-Animation extension installed but errors are still there. Screenshot 2023-07-01 044522

Monshilstraze avatar Jul 01 '23 00:07 Monshilstraze

When I removed sd-webui-mov2mov, ultimate-upscale-for-automatic1111 is work.

ggyydream avatar Jul 01 '23 15:07 ggyydream

I don’t have mov2mov, after disabling SD CN Animation everything worked fine, but after enabling ControlNet in Deforum, they climbed again.

bismark211 avatar Jul 01 '23 16:07 bismark211

When I removed sd-webui-mov2mov, ultimate-upscale-for-automatic1111 is work.

it's worked to me ty

dhtpdud avatar Jul 02 '23 15:07 dhtpdud

Seems to affect scripts across the board, line 455 or so of modules/scripts.py attempts to extract script parameters, but script.args_from and script.args_to are out of bounds values by then and an empty dictionary is returned which leads to the error message above.

Also, removing all of the above extensions seems like a temporary fix.

scottlegrand avatar Jul 05 '23 20:07 scottlegrand

Removing all these applications does not solve the problem with the non-working controlnet in the deforum.

bismark211 avatar Jul 05 '23 20:07 bismark211

You should look at the console log to see if controlnet is failing to load. In my experience, that's usually what that means.

scottlegrand avatar Jul 05 '23 21:07 scottlegrand

I looked, that's why I wrote) I turned off all applications and the controlnet does not work in the deforum, and it works for some) The controlnet error appears in the list of conflicting extensions.

bismark211 avatar Jul 05 '23 21:07 bismark211

When I removed sd-webui-mov2mov, ultimate-upscale-for-automatic1111 is work.

Same here. Disabled mov2mov and everything works fine again.

jcvijr avatar Jul 09 '23 16:07 jcvijr

Same problem here, any idea who is the party to blame? A1111's extension mechanism or the extensions? It looks like to me that somewhere in the A1111's code (maybe script.before_process() or earlier/later) didn't check if the script itself is enabled or not, or maybe somehow it couldn't get the value to this param? It is hard to imagine an extension is allowed to screw up so much...

edwios avatar Jul 10 '23 06:07 edwios

SD-CN-webui seemed to be the biggest culprit. I am going to guess the script API changed and the extensions that screw everything up haven't been updated to reflect that. If I understood the change, I'd be happy to submit potential MRs to fix them, but nope, the extension mechanism of A1111 is pretty opaque to me ATM.

scottlegrand avatar Jul 10 '23 13:07 scottlegrand

after disabling all extensions except deforum and controlnet, the same error appears with controlnet.

bismark211 avatar Jul 10 '23 15:07 bismark211