AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
131.71k stars 25.27k forks source link

AttributeError: 'UiControlNetUnit' object has no attribute 'enable'[Bug]: at last version #15604

Open Laisvydas3030 opened 4 weeks ago

Laisvydas3030 commented 4 weeks ago

Checklist

What happened?

txt2img an img2img not generate images

AttributeError: 'UiControlNetUnit' object has no attribute 'enable'

Steps to reproduce the problem

1 strats generate image

  1. Error AttributeError: 'UiControlNetUnit' object has no attribute 'enable'

What should have happened?

must generait image

What browsers do you use to access the UI ?

Microsoft Edge

Sysinfo

sysinfo-2024-04-22-20-16.json sysinfo-2024-04-22-20-16.json

Console logs

venv "C:\Users\Server17\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: v1.9.3
Commit hash: 1c0a0c4c26f78c32095ebc7f8af82f5c04fca8c0
Launching Web UI with arguments:
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
[-] ADetailer initialized. version: 24.4.2, num models: 10
ControlNet preprocessor location: C:\Users\Server17\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2024-04-22 23:19:34,355 - ControlNet - INFO - ControlNet v1.1.445
2024-04-22 23:19:34,459 - ControlNet - INFO - ControlNet v1.1.445
Loading weights [0724518c6b] from C:\Users\Server17\stable-diffusion-webui\models\Stable-diffusion\juggernautXL_v7Rundiffusion.safetensors
*** Error calling: C:\Users\Server17\stable-diffusion-webui\extensions\sd-webui-animatediff\scripts\animatediff.py/ui
    Traceback (most recent call last):
      File "C:\Users\Server17\stable-diffusion-webui\modules\scripts.py", line 528, in wrap_call
        return func(*args, **kwargs)
      File "C:\Users\Server17\stable-diffusion-webui\extensions\sd-webui-animatediff\scripts\animatediff.py", line 43, in ui
        from scripts.animatediff_mm import mm_animatediff as motion_module
    ModuleNotFoundError: No module named 'scripts.animatediff_mm'

---
*** Error calling: C:\Users\Server17\stable-diffusion-webui\extensions\sd-webui-animatediff\scripts\animatediff.py/ui
Creating model from config: C:\Users\Server17\stable-diffusion-webui\repositories\generative-models\configs\inference\sd_xl_base.yaml
    Traceback (most recent call last):
      File "C:\Users\Server17\stable-diffusion-webui\modules\scripts.py", line 528, in wrap_call
        return func(*args, **kwargs)
      File "C:\Users\Server17\stable-diffusion-webui\extensions\sd-webui-animatediff\scripts\animatediff.py", line 43, in ui
        from scripts.animatediff_mm import mm_animatediff as motion_module
    ModuleNotFoundError: No module named 'scripts.animatediff_mm'

---
2024-04-22 23:19:34,819 - ControlNet - INFO - ControlNet UI callback registered.
*Deforum ControlNet support: enabled*
2024-04-22 23:19:35,480 - ControlNetFastload - INFO - Load Controlnet Fastload Filter on isRemote=None and accessLevel=2
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 11.9s (prepare environment: 1.8s, import torch: 2.5s, import gradio: 0.5s, setup paths: 0.9s, initialize shared: 1.8s, other imports: 0.5s, load scripts: 2.6s, create ui: 1.0s, gradio launch: 0.4s).
Applying attention optimization: Doggettx... done.
Model loaded in 7.9s (load weights from disk: 0.2s, create model: 1.0s, apply weights to model: 5.3s, calculate empty prompt: 1.3s).
*** Error running before_process: C:\Users\Server17\stable-diffusion-webui\extensions\sd-webui-animatediff\scripts\animatediff.py
    Traceback (most recent call last):
      File "C:\Users\Server17\stable-diffusion-webui\modules\scripts.py", line 817, in before_process
        script.before_process(p, *script_args)
    TypeError: AnimateDiffScript.before_process() missing 1 required positional argument: 'params'

---
*** Error completing request
*** Arguments: ('task(i3dnr7t5d4r3ero)', <gradio.routes.Request object at 0x000001CC629B78E0>, 'tiny cute bunny, vibrant diffraction, highly detailed, intricate, ultra hd, sharp photo, crepuscular rays, in focus', 'nsfw, nude', [], 1, 1, 7, 512, 512, True, 0.35, 2, 'Latent', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', 'Use same scheduler', '', '', [], 0, 25, 'Euler a', 'Automatic', False, '', 0.8, 977459588, False, -1, 0, 0, 0, False, False, {'ad_model': 'face_yolov8n.pt', 'ad_model_classes': '', 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_k_largest': 0, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 4, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_checkpoint': False, 'ad_checkpoint': 'Use same checkpoint', 'ad_use_vae': False, 'ad_vae': 'Use same VAE', 'ad_use_sampler': False, 'ad_sampler': 'DPM++ 2M', 'ad_scheduler': 'Use same scheduler', 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_use_clip_skip': False, 'ad_clip_skip': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'None', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, {'ad_model': 'None', 'ad_model_classes': '', 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_k_largest': 0, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 4, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_checkpoint': False, 'ad_checkpoint': 'Use same checkpoint', 'ad_use_vae': False, 'ad_vae': 'Use same VAE', 'ad_use_sampler': False, 'ad_sampler': 'DPM++ 2M', 'ad_scheduler': 'Use same scheduler', 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_use_clip_skip': False, 'ad_clip_skip': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'None', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, UiControlNetUnit(enabled=False, module='none', model='None', weight=1, image=None, resize_mode='Crop and Resize', low_vram=False, processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', inpaint_crop_input_image=False, hr_option='Both', save_detected_map=True, advanced_weighting=None, ipadapter_input=None), UiControlNetUnit(enabled=False, module='none', model='None', weight=1, image=None, resize_mode='Crop and Resize', low_vram=False, processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', inpaint_crop_input_image=False, hr_option='Both', save_detected_map=True, advanced_weighting=None, ipadapter_input=None), UiControlNetUnit(enabled=False, module='none', model='None', weight=1, image=None, resize_mode='Crop and Resize', low_vram=False, processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', inpaint_crop_input_image=False, hr_option='Both', save_detected_map=True, advanced_weighting=None, ipadapter_input=None), False, 'Load Only', None, '', 'Send to txt2img', 'Send to img2img', 'Run', None, [], None, False, False, 'positive', 'comma', 0, False, False, 'start', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, False, False, False, 0, False, None, None, False, None, None, False, None, None, False, 50) {}
    Traceback (most recent call last):
      File "C:\Users\Server17\stable-diffusion-webui\modules\call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "C:\Users\Server17\stable-diffusion-webui\modules\call_queue.py", line 36, in f
        res = func(*args, **kwargs)
      File "C:\Users\Server17\stable-diffusion-webui\modules\txt2img.py", line 109, in txt2img
        processed = processing.process_images(p)
      File "C:\Users\Server17\stable-diffusion-webui\modules\processing.py", line 845, in process_images
        res = process_images_inner(p)
      File "C:\Users\Server17\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 47, in processing_process_images_hijack
        if ad_params and ad_params.enable:
    AttributeError: 'UiControlNetUnit' object has no attribute 'enable'

---

Additional information

I updated stable diffusion automtic from v1.90 to v1.93

Laisvydas3030 commented 4 weeks ago

if i delet anima diff extension all good. but with anima diff same eror

SwingerDude commented 4 weeks ago

Error is preventing the generation of any images. Same error returned. Was not an issue until @huchenlei came in 7 hours ago to "fix" something specifically with the ControlNet and without having any idea of the fumble I updated A1111 and every attempt to generate gets "AttributeError: 'UiControlNetUnit' object has no attribute 'enable'" Yesterday it was working fine. Update all the extensions today, boom, error. Last person to fiddle with the Controlnet was @huchenlei

ZafariJ0e commented 4 weeks ago

if i delet anima diff extension all good. but with anima diff same eror

thanks for the help. The problem is definitely animatediff, disable that extension and the problem will be solved.

huchenlei commented 4 weeks ago

Related issue: https://github.com/Mikubill/sd-webui-controlnet/issues/2787

huchenlei commented 4 weeks ago

I think here the issue is that ControlNetUnit is somehow assigned to ad_params, which indicates the logic of getting ad params having problem accessing correct script params, it might be caused by preceeding ad errors.

huchenlei commented 4 weeks ago

Error is preventing the generation of any images. Same error returned. Was not an issue until @huchenlei came in 7 hours ago to "fix" something specifically with the ControlNet and without having any idea of the fumble I updated A1111 and every attempt to generate gets "AttributeError: 'UiControlNetUnit' object has no attribute 'enable'" Yesterday it was working fine. Update all the extensions today, boom, error. Last person to fiddle with the Controlnet was @huchenlei

I don't think recent commits to sd-webui-controlnet causes this bug. You can try roll back sd-webui-controlnet to a commit 1 week earlier and see if the issue still persists.

BlastedRemnants commented 4 weeks ago

@Laisvydas3030 Update your animate diff extension and it should work again, there is an update available that fixes it for 1.9.3

Edit: Wrote 1.9 but it's actually fixed for 1.9.3

Ichimikichiki commented 3 weeks ago

if i delet anima diff extension all good. but with anima diff same eror

thanks for the help. The problem is definitely animatediff, disable that extension and the problem will be solved.

The issue persists even with animatediff disabled. It breaks the entire stable-diffusion-webui.

TheACT24 commented 3 weeks ago

if i delet anima diff extension all good. but with anima diff same eror

Disabling animatediff fixed the issue for me as well. Thank you.

BlastedRemnants commented 3 weeks ago

Disabling animatediff fixed the issue for me as well. Thank you.

There is an update for animate diff that fixes it for version 1.9.3, there is no need to disable or delete it.