Mikubill / sd-webui-controlnet

WebUI extension for ControlNet
GNU General Public License v3.0
17.05k stars 1.96k forks source link

[Bug]: AttributeError: 'list' object has no attribute 'enabled' #1127

Closed WaveF closed 1 year ago

WaveF commented 1 year ago

Is there an existing issue for this?

What happened?

When I updated the stable diffusion webui to the latest version, img2img cannot run properly with ControlNet enabled, and it gives an error message: AttributeError: 'list' object has no attribute 'enabled'.

Steps to reproduce the problem

  1. Go to img2img
  2. Add any image as hint
  3. Use any prompt
  4. Press "Generate" button
  5. No image output and showing: AttributeError: 'list' object has no attribute 'enabled'

What should have happened?

img2img should generate an image as usual

Commit where the problem happens

webui: 5ab7f213 controlnet: 4366c66

What browsers do you use to access the UI ?

No response

Command Line Arguments

if [[ -x "$(command -v python3.10)" ]]
then
    python_cmd="python3.10"
fi

export install_dir="$HOME"
export COMMANDLINE_ARGS="--skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate --no-gradio-queue --theme dark --disable-safe-unpickle"
export TORCH_COMMAND="pip install torch torchvision"
export SADTALKER_CHECKPOINTS="/Users/wavef/stable-diffusion-webui/extensions/SadTalker/checkpoints"
export K_DIFFUSION_REPO="https://github.com/brkirch/k-diffusion.git"
export K_DIFFUSION_COMMIT_HASH="51c9778f269cedb55a4d88c79c0246d35bdadb71"
export PYTORCH_ENABLE_MPS_FALLBACK=1

Console logs

Error completing request
Arguments: ('task(udgcyat8zzet2aa)', 0, '1boy', '', [], <PIL.Image.Image image mode=RGBA size=512x768 at 0x312EC6800>, None, None, None, None, None, None, 20, 0, 4, 0, 1, False, False, 1, 1, 7, 1.5, 0.75, -1.0, -1.0, 0, 0, 0, False, 0, 512, 512, 1, 0, 0, 32, 0, '', '', '', [], 0, False, 'MultiDiffusion', False, 10, 1, 1, 64, False, True, 1024, 1024, 96, 96, 48, 1, 'None', 2, False, False, False, False, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, True, True, True, False, 512, 64, False, '', 0, True, False, 1, False, False, False, 1.1, 1.5, 100, 0.7, False, False, True, False, False, 0, 'Gustavosta/MagicPrompt-Stable-Diffusion', '', False, 7, 100, 'Constant', 0, 'Constant', 0, 4, <controlnet.py.UiControlNetUnit object at 0x312eed720>, False, '', 0.5, True, False, '', 'Lerp', False, False, 1, 0.15, False, 'OUT', ['OUT'], 5, 0, 'Bilinear', False, 'Pooling Max', False, 'Lerp', '', '', False, False, None, False, False, 0, None, [], 0, False, [], [], False, 0, 1, False, False, 0, None, [], -2, False, [], 1, 0.9, 5, '0.0001', False, 'None', '', 0.1, False, 100, 0.6, 20, 0.0, 0.0, '', True, True, '', 10, 40, 'VP9 (webm)', '', True, 20, '<ul>\n<li><code>CFG Scale</code> should be 2 or lower.</li>\n</ul>\n', True, True, '', '', True, 50, True, 1, 0, False, 4, 0.5, 'Linear', 'None', '<p style="margin-bottom:0.75em">Recommended settings: Sampling Steps: 80-100, Sampler: Euler a, Denoising strength: 0.8</p>', 128, 8, ['left', 'right', 'up', 'down'], 1, 0.05, 128, 4, 0, ['left', 'right', 'up', 'down'], False, False, 'positive', 'comma', 0, False, False, '', '<p style="margin-bottom:0.75em">Will upscale the image by the selected scale factor; use width and height sliders to set tile size</p>', 64, 0, 2, 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, 1.6, 0.97, 0.4, 0.15, 20, 0, 0, '', False, False, False, None, False, 50, 0, 0, 512, 512, False, True, False, False, 0, 1, False, 1, True, True, False, False, ['left-right', 'red-cyan-anaglyph'], 2.5, 'polylines_sharp', 0, False, False, False, False, False, False, 'u2net', False, True, False, 'Illustration', 'svg', True, True, False, 0.5, False, 16, True, 16, '<p style="margin-bottom:0.75em">Will upscale the image depending on the selected target size type</p>', 512, 0, 8, 32, 64, 0.35, 32, 0, True, 0, False, 8, 0, 0, 2048, 2048, 2) {}
Traceback (most recent call last):
  File "/Users/wavef/stable-diffusion-webui/modules/call_queue.py", line 57, in f
    res = list(func(*args, **kwargs))
  File "/Users/wavef/stable-diffusion-webui/modules/call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "/Users/wavef/stable-diffusion-webui/modules/img2img.py", line 181, in img2img
    processed = process_images(p)
  File "/Users/wavef/stable-diffusion-webui/modules/processing.py", line 515, in process_images
    res = process_images_inner(p)
  File "/Users/wavef/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 39, in processing_process_images_hijack
    cn_is_batch, batches, output_dir, input_file_names = get_cn_batches(p)
  File "/Users/wavef/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 185, in get_cn_batches
    units = [copy(unit) for unit in units if unit.enabled]
  File "/Users/wavef/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 185, in <listcomp>
    units = [copy(unit) for unit in units if unit.enabled]
AttributeError: 'list' object has no attribute 'enabled'

Additional information

No response

havok2-htwo commented 1 year ago

For me on TXT2Image it also shows no Images, when using Batch Count >1. [4366c66e]

Naccl commented 1 year ago

I have the same version and problem. The following error messages are the same whether I enable(in img2img tab) controlnet or not.

When I change Multi ControlNet: Max models amount (requires restart) to 1, error msg is AttributeError: 'list' object has no attribute 'enabled'.

But I change it to 10 and restart, error msg is AttributeError: 'int' object has no attribute 'enabled'.

Now I change it to 8 and restart, it works.

lllyasviel commented 1 year ago

fixed in 1.1.132 https://github.com/Mikubill/sd-webui-controlnet/pull/1130