lllyasviel / stable-diffusion-webui-forge

GNU Affero General Public License v3.0
8.37k stars 813 forks source link

[Bug]: t2i+Cn API error AttributeError: 'StableDiffusionProcessingTxt2Img' object has no attribute 'resize_mode' #413

Closed TigerHH6866 closed 8 months ago

TigerHH6866 commented 8 months ago

Checklist

What happened?

using APi CN part para

"controlnet": { "args": [{ "input_image":"...", "model": "ip-adapter-plus-face_sd15 [71693645]", "module": "InsightFace+CLIP-H (IPAdapter)", "pixel_perfect": true, "resize_mode": "1", "control_mode": "0", "weight": 1.00

                }]
        }

error log image

Steps to reproduce the problem

t2i+cn

What should have happened?

should run

What browsers do you use to access the UI ?

No response

Sysinfo

ersion: f0.0.16v1.8.0rc-latest-244-ga252bbcf  •  python: 3.10.8  •  torch: 2.1.2+cu121  •  xformers: 0.0.23.post1  •  gradio: 3.41.2  •  checkpoint: 5a44dad2e0

Console logs

2024-02-26 13:10:56,536 - ControlNet - INFO - ControlNet Input Mode: InputMode.SIMPLE
*** Error running process: /root/autodl-tmp/stable-diffusion-webui-forge/extensions-builtin/sd_forge_controlnet/scripts/controlnet.py
    Traceback (most recent call last):
      File "/root/autodl-tmp/stable-diffusion-webui-forge/modules/scripts.py", line 803, in process
        script.process(p, *script_args)
      File "/root/miniconda3/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
      File "/root/autodl-tmp/stable-diffusion-webui-forge/extensions-builtin/sd_forge_controlnet/scripts/controlnet.py", line 548, in process
        self.process_unit_after_click_generate(p, unit, params, *args, **kwargs)
      File "/root/miniconda3/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
      File "/root/autodl-tmp/stable-diffusion-webui-forge/extensions-builtin/sd_forge_controlnet/scripts/controlnet.py", line 298, in process_unit_after_click_generate
        input_list, resize_mode = self.get_input_data(p, unit, preprocessor, h, w)
      File "/root/autodl-tmp/stable-diffusion-webui-forge/extensions-builtin/sd_forge_controlnet/scripts/controlnet.py", line 203, in get_input_data
        resize_mode = external_code.resize_mode_from_value(p.resize_mode)
    AttributeError: 'StableDiffusionProcessingTxt2Img' object has no attribute 'resize_mode'

---
*** Error running process_before_every_sampling: /root/autodl-tmp/stable-diffusion-webui-forge/extensions-builtin/sd_forge_controlnet/scripts/controlnet.py
    Traceback (most recent call last):
      File "/root/autodl-tmp/stable-diffusion-webui-forge/modules/scripts.py", line 835, in process_before_every_sampling
        script.process_before_every_sampling(p, *script_args, **kwargs)
      File "/root/miniconda3/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
      File "/root/autodl-tmp/stable-diffusion-webui-forge/extensions-builtin/sd_forge_controlnet/scripts/controlnet.py", line 555, in process_before_every_sampling
        self.process_unit_before_every_sampling(p, unit, self.current_params[i], *args, **kwargs)
    KeyError: 0

---
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:01<00:00, 19.50it/s]
*** Error running postprocess_batch_list: /root/autodl-tmp/stable-diffusion-webui-forge/extensions-builtin/sd_forge_controlnet/scripts/controlnet.py███████████▌               | 18/20 [00:00<00:00, 19.86it/s]
    Traceback (most recent call last):
      File "/root/autodl-tmp/stable-diffusion-webui-forge/modules/scripts.py", line 859, in postprocess_batch_list
        script.postprocess_batch_list(p, pp, *script_args, **kwargs)
      File "/root/miniconda3/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
      File "/root/autodl-tmp/stable-diffusion-webui-forge/extensions-builtin/sd_forge_controlnet/scripts/controlnet.py", line 561, in postprocess_batch_list
        self.process_unit_after_every_sampling(p, unit, self.current_params[i], pp, *args, **kwargs)
    KeyError: 0

---
Total progress: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:01<00:00, 13.30it/s]
API 2024-02-26 13:10:58.305337 200 http/1.1 POST /sdapi/v1/txt2img 180.158.15.236 1.7744███████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:01<00:00, 19.86it/s]

Additional information

No response

TigerHH6866 commented 8 months ago

input_image->image

DA-Charlie commented 8 months ago

Hi, what was the solution?