Closed TimothyKrell closed 8 months ago
I'm not sure if I classified this issue right. I probably should have written it as an "extension" issue, but since controlnet is included by default, I wasn't sure.
if issue is not reproducible without controlnet, then its an extension issue. but ok, leave it and i'll reclassify.
Same problem, but using Ultimate Upscaler and controlnet in img2img. Cannot be reproduced in A1111. https://github.com/Mikubill/sd-webui-controlnet/issues/2285
Same problem, but using Ultimate Upscaler and controlnet in img2img. Cannot be reproduced in A1111. Mikubill/sd-webui-controlnet#2285
I need exact and detailed workflow as I cannot guess what exactly you're doing nor I can click around randomly until I get to something that may look like your workflow.
Same problem, but using Ultimate Upscaler and controlnet in img2img. Cannot be reproduced in A1111. Mikubill/sd-webui-controlnet#2285
I need exact and detailed workflow as I cannot guess what exactly you're doing nor I can click around randomly until I get to something that may look like your workflow.
Sorry, I will provide the workflow where I have an error.
Version Platform Description
Python 3.10.12 on Linux
Version: app=sd.next updated=2023-11-30 hash=c957a2fb url=https://github.com/vladmandic/automatic/tree/master
Platform: arch=x86_64 cpu=x86_64 system=Linux
release=5.15.0-89-generic python=3.10.12,
Device: device=AMD Radeon RX 6900 XT n=1
hip=5.5.30201-c1741e9b
Workflow
20:56:30-027954 ERROR Running script process:
extensions-builtin/sd-webui-controlnet/scripts/controln
et.py: IndexError
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /home/Turokosh/Table/automatic/modules/scripts.py:519 in process │
│ │
│ 518 │ │ │ │ args = p.per_script_args.get(script.title(), p.script_ │
│ ❱ 519 │ │ │ │ script.process(p, *args, **kwargs) │
│ 520 │ │ │ except Exception as e: │
│ │
│ /home/Turokosh/Table/automatic/extensions-builtin/sd-webui-controlnet/scripts/co │
│ ntrolnet.py:993 in process │
│ │
│ 992 │ │ if not Script.process_has_sdxl_refiner(p): │
│ ❱ 993 │ │ │ self.controlnet_hack(p) │
│ 994 │ │ return │
│ │
│ /home/Turokosh/Table/automatic/extensions-builtin/sd-webui-controlnet/scripts/co │
│ ntrolnet.py:982 in controlnet_hack │
│ │
│ 981 │ │ t = time.time() │
│ ❱ 982 │ │ self.controlnet_main_entry(p) │
│ 983 │ │ if len(self.enabled_units) > 0: │
│ │
│ /home/Turokosh/Table/automatic/extensions-builtin/sd-webui-controlnet/scripts/co │
│ ntrolnet.py:747 in controlnet_main_entry │
│ │
│ 746 │ │ │ │ │
│ ❱ 747 │ │ │ │ input_image = [np.asarray(x)[:, :, 0] for x in input_ │
│ 748 │ │ │ │ input_image = np.stack(input_image, axis=2) │
│ │
│ /home/Turokosh/Table/automatic/extensions-builtin/sd-webui-controlnet/scripts/co │
│ ntrolnet.py:747 in <listcomp> │
│ │
│ 746 │ │ │ │ │
│ ❱ 747 │ │ │ │ input_image = [np.asarray(x)[:, :, 0] for x in input_ │
│ 748 │ │ │ │ input_image = np.stack(input_image, axis=2) │
╰──────────────────────────────────────────────────────────────────────────────╯
IndexError: too many indices for array: array is 2-dimensional, but 3 were
indexed
20:56:30-194971 DEBUG Sampler: sampler="UniPC" config={}
Progress 5.0it/s ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00 0:00:03
20:56:33-902313 INFO Processed: images=1 time=3.71 its=5.39 memory={'ram':
{'used': 7.48, 'total': 62.54}, 'gpu': {'used': 2.6,
'total': 15.98}, 'retries': 0, 'oom': 0}
20:56:33-922968 ERROR Running script process:
extensions-builtin/sd-webui-controlnet/scripts/controln
et.py: IndexError
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /home/Turokosh/Table/automatic/modules/scripts.py:519 in process │
│ │
│ 518 │ │ │ │ args = p.per_script_args.get(script.title(), p.script_ │
│ ❱ 519 │ │ │ │ script.process(p, *args, **kwargs) │
│ 520 │ │ │ except Exception as e: │
│ │
│ /home/Turokosh/Table/automatic/extensions-builtin/sd-webui-controlnet/scripts/co │
│ ntrolnet.py:993 in process │
│ │
│ 992 │ │ if not Script.process_has_sdxl_refiner(p): │
│ ❱ 993 │ │ │ self.controlnet_hack(p) │
│ 994 │ │ return │
│ │
│ /home/Turokosh/Table/automatic/extensions-builtin/sd-webui-controlnet/scripts/co │
│ ntrolnet.py:982 in controlnet_hack │
│ │
│ 981 │ │ t = time.time() │
│ ❱ 982 │ │ self.controlnet_main_entry(p) │
│ 983 │ │ if len(self.enabled_units) > 0: │
│ │
│ /home/Turokosh/Table/automatic/extensions-builtin/sd-webui-controlnet/scripts/co │
│ ntrolnet.py:747 in controlnet_main_entry │
│ │
│ 746 │ │ │ │ │
│ ❱ 747 │ │ │ │ input_image = [np.asarray(x)[:, :, 0] for x in input_ │
│ 748 │ │ │ │ input_image = np.stack(input_image, axis=2) │
│ │
│ /home/Turokosh/Table/automatic/extensions-builtin/sd-webui-controlnet/scripts/co │
│ ntrolnet.py:747 in <listcomp> │
│ │
│ 746 │ │ │ │ │
│ ❱ 747 │ │ │ │ input_image = [np.asarray(x)[:, :, 0] for x in input_ │
│ 748 │ │ │ │ input_image = np.stack(input_image, axis=2) │
╰──────────────────────────────────────────────────────────────────────────────╯
IndexError: too many indices for array: array is 2-dimensional, but 3 were
indexed
20:56:34-074205 DEBUG Sampler: sampler="UniPC" config={}
Progress 5.33it/s ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00 0:00:03
20:56:37-460316 INFO Processed: images=1 time=3.39 its=5.91 memory={'ram':
{'used': 7.48, 'total': 62.54}, 'gpu': {'used': 3.27,
'total': 15.98}, 'retries': 0, 'oom': 0}
20:56:37-481006 ERROR Running script process:
extensions-builtin/sd-webui-controlnet/scripts/controln
et.py: IndexError
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /home/Turokosh/Table/automatic/modules/scripts.py:519 in process │
│ │
│ 518 │ │ │ │ args = p.per_script_args.get(script.title(), p.script_ │
│ ❱ 519 │ │ │ │ script.process(p, *args, **kwargs) │
│ 520 │ │ │ except Exception as e: │
│ │
│ /home/Turokosh/Table/automatic/extensions-builtin/sd-webui-controlnet/scripts/co │
│ ntrolnet.py:993 in process │
│ │
│ 992 │ │ if not Script.process_has_sdxl_refiner(p): │
│ ❱ 993 │ │ │ self.controlnet_hack(p) │
│ 994 │ │ return │
│ │
│ /home/Turokosh/Table/automatic/extensions-builtin/sd-webui-controlnet/scripts/co │
│ ntrolnet.py:982 in controlnet_hack │
│ │
│ 981 │ │ t = time.time() │
│ ❱ 982 │ │ self.controlnet_main_entry(p) │
│ 983 │ │ if len(self.enabled_units) > 0: │
│ │
│ /home/Turokosh/Table/automatic/extensions-builtin/sd-webui-controlnet/scripts/co │
│ ntrolnet.py:747 in controlnet_main_entry │
│ │
│ 746 │ │ │ │ │
│ ❱ 747 │ │ │ │ input_image = [np.asarray(x)[:, :, 0] for x in input_ │
│ 748 │ │ │ │ input_image = np.stack(input_image, axis=2) │
│ │
│ /home/Turokosh/Table/automatic/extensions-builtin/sd-webui-controlnet/scripts/co │
│ ntrolnet.py:747 in <listcomp> │
│ │
│ 746 │ │ │ │ │
│ ❱ 747 │ │ │ │ input_image = [np.asarray(x)[:, :, 0] for x in input_ │
│ 748 │ │ │ │ input_image = np.stack(input_image, axis=2) │
╰──────────────────────────────────────────────────────────────────────────────╯
IndexError: too many indices for array: array is 2-dimensional, but 3 were
indexed
20:56:37-636363 DEBUG Sampler: sampler="UniPC" config={}
Progress 5.33it/s ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00 0:00:03
20:56:41-023913 INFO Processed: images=1 time=3.39 its=5.90 memory={'ram':
{'used': 7.48, 'total': 62.54}, 'gpu': {'used': 3.27,
'total': 15.98}, 'retries': 0, 'oom': 0}
20:56:41-044789 ERROR Running script process:
extensions-builtin/sd-webui-controlnet/scripts/controln
et.py: IndexError
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /home/Turokosh/Table/automatic/modules/scripts.py:519 in process │
│ │
│ 518 │ │ │ │ args = p.per_script_args.get(script.title(), p.script_ │
│ ❱ 519 │ │ │ │ script.process(p, *args, **kwargs) │
│ 520 │ │ │ except Exception as e: │
│ │
│ /home/Turokosh/Table/automatic/extensions-builtin/sd-webui-controlnet/scripts/co │
│ ntrolnet.py:993 in process │
│ │
│ 992 │ │ if not Script.process_has_sdxl_refiner(p): │
│ ❱ 993 │ │ │ self.controlnet_hack(p) │
│ 994 │ │ return │
│ │
│ /home/Turokosh/Table/automatic/extensions-builtin/sd-webui-controlnet/scripts/co │
│ ntrolnet.py:982 in controlnet_hack │
│ │
│ 981 │ │ t = time.time() │
│ ❱ 982 │ │ self.controlnet_main_entry(p) │
│ 983 │ │ if len(self.enabled_units) > 0: │
│ │
│ /home/Turokosh/Table/automatic/extensions-builtin/sd-webui-controlnet/scripts/co │
│ ntrolnet.py:747 in controlnet_main_entry │
│ │
│ 746 │ │ │ │ │
│ ❱ 747 │ │ │ │ input_image = [np.asarray(x)[:, :, 0] for x in input_ │
│ 748 │ │ │ │ input_image = np.stack(input_image, axis=2) │
│ │
│ /home/Turokosh/Table/automatic/extensions-builtin/sd-webui-controlnet/scripts/co │
│ ntrolnet.py:747 in <listcomp> │
│ │
│ 746 │ │ │ │ │
│ ❱ 747 │ │ │ │ input_image = [np.asarray(x)[:, :, 0] for x in input_ │
│ 748 │ │ │ │ input_image = np.stack(input_image, axis=2) │
╰──────────────────────────────────────────────────────────────────────────────╯
IndexError: too many indices for array: array is 2-dimensional, but 3 were
indexed
20:56:41-198634 DEBUG Sampler: sampler="UniPC" config={}
Progress 5.33it/s ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00 0:00:03
20:56:44-588044 INFO Processed: images=1 time=3.39 its=5.90 memory={'ram':
{'used': 7.48, 'total': 62.54}, 'gpu': {'used': 3.27,
'total': 15.98}, 'retries': 0, 'oom': 0}
20:56:44-589412 DEBUG Saving:
image="outputs/image/00008-v1-5-pruned-emaonly-cat.jpg"
type=JPEG size=1024x1024
```python
20:55:30-214557 DEBUG Logger: file=/home/Turokosh/Table/automatic/sdnext.log
level=10 size=0 mode=create
20:55:30-216348 INFO Starting SD.Next
20:55:30-216977 INFO Python 3.10.12 on Linux
20:55:30-221302 INFO Version: app=sd.next updated=2023-11-30 hash=c957a2fb
url=https://github.com/vladmandic/automatic/tree/master
20:55:30-587632 INFO Platform: arch=x86_64 cpu=x86_64 system=Linux
release=5.15.0-89-generic python=3.10.12
20:55:30-591673 DEBUG Setting environment tuning
20:55:30-594329 DEBUG Cache folder: /home/Turokosh/.cache/huggingface/hub
20:55:30-596949 DEBUG Torch overrides: cuda=False rocm=False ipex=False
diml=False openvino=False
20:55:30-599555 DEBUG Torch allowed: cuda=True rocm=True ipex=True diml=True
openvino=True
20:55:30-602211 INFO AMD ROCm toolkit detected
20:55:30-700600 DEBUG ROCm agents detected: ['gfx1030']
20:55:30-701205 DEBUG ROCm agent used by default: idx=0 gpu=gfx1030
arch=navi2x
20:55:30-702078 DEBUG ROCm hipconfig failed: local variable 'rocm_ver'
referenced before assignment
20:55:30-710584 DEBUG Repository update time: Thu Nov 30 10:18:05 2023
20:55:30-713085 INFO Startup: standard
20:55:30-714768 INFO Verifying requirements
20:55:30-727877 INFO Verifying packages
20:55:30-728890 INFO Verifying submodules
20:55:31-267633 DEBUG Submodule: extensions-builtin/sd-extension-chainner /
main
20:55:31-284667 DEBUG Submodule: extensions-builtin/sd-extension-system-info
/ main
20:55:31-301108 DEBUG Submodule: extensions-builtin/sd-webui-agent-scheduler
/ main
20:55:31-317514 DEBUG Submodule: extensions-builtin/sd-webui-controlnet /
main
20:55:31-337218 DEBUG Submodule:
extensions-builtin/stable-diffusion-webui-images-browse
r / main
20:55:31-350407 DEBUG Submodule:
extensions-builtin/stable-diffusion-webui-rembg /
master
20:55:31-366662 DEBUG Submodule: modules/k-diffusion / master
20:55:31-382314 DEBUG Submodule: modules/lora / main
20:55:31-399032 DEBUG Submodule: wiki / master
20:55:31-411229 DEBUG Register paths
20:55:31-452730 DEBUG Installed packages: 215
20:55:31-453214 DEBUG Extensions all: ['stable-diffusion-webui-rembg',
'sd-extension-chainner', 'sd-extension-system-info',
'Lora', 'stable-diffusion-webui-images-browser',
'sd-webui-agent-scheduler', 'sd-webui-controlnet']
20:55:31-453787 DEBUG Running extension installer:
/home/Turokosh/Table/automatic/extensions-builtin/stable-di
ffusion-webui-rembg/install.py
20:55:31-562447 DEBUG Running extension installer:
/home/Turokosh/Table/automatic/extensions-builtin/sd-extens
ion-system-info/install.py
20:55:31-672093 DEBUG Running extension installer:
/home/Turokosh/Table/automatic/extensions-builtin/stable-di
ffusion-webui-images-browser/install.py
20:55:31-760271 DEBUG Running extension installer:
/home/Turokosh/Table/automatic/extensions-builtin/sd-webui-
agent-scheduler/install.py
20:55:31-847970 DEBUG Running extension installer:
/home/Turokosh/Table/automatic/extensions-builtin/sd-webui-
controlnet/install.py
20:55:31-936310 DEBUG Extensions all: ['ultimate-upscale-for-automatic1111']
20:55:31-956294 INFO Extensions enabled: ['stable-diffusion-webui-rembg',
'sd-extension-chainner', 'sd-extension-system-info',
'Lora', 'stable-diffusion-webui-images-browser',
'sd-webui-agent-scheduler', 'sd-webui-controlnet',
'ultimate-upscale-for-automatic1111']
20:55:31-957005 INFO Verifying requirements
20:55:31-964023 DEBUG Setup complete without errors: 1701370532
20:55:31-965498 INFO Extension preload: {'extensions-builtin': 0.0,
'extensions': 0.0}
20:55:31-966190 DEBUG Starting module:
this seems to be issue inside controlnet - please report there. i've added my notes to controlnet code here:
logger.debug("A1111 inpaint mask START")
input_image = [input_image[:, :, i] for i in range(input_image.shape[2])] # split rgb image into 3 bw images
input_image = [Image.fromarray(x) for x in input_image] # convert to 3 pil images model=L
mask = prepare_mask(a1111_mask_image, p)
crop_region = masking.get_crop_region(np.array(mask), p.inpaint_full_res_padding)
crop_region = masking.expand_crop_region(crop_region, p.width, p.height, mask.width, mask.height)
input_image = [ # resize all 3 images
images.resize_image(resize_mode.int_value(), i, mask.width, mask.height)
for i in input_image
]
input_image = [x.crop(crop_region) for x in input_image] # crop all 3 images
input_image = [ # resize all 3 images
images.resize_image(external_code.ResizeMode.OUTER_FIT.int_value(), x, p.width, p.height)
for x in input_image
]
input_image = [np.asarray(x)[:, :, 0] for x in input_image] # but this AGAIN tries to read RGB channels - input_image here is 2D!
input_image = np.stack(input_image, axis=2)
logger.debug("A1111 inpaint mask END")
Is there a workaround for now?
closing issue here as it was closed upstream in controlnet repo.
Issue Description
After a fresh install, I can't use ControlNet with inpainting with "only masked" setting. It works fine with img2img and inpainting "whole picture", though.
I used openpose and inpaint masked.
Version Platform Description
Python 3.10.6 on Windows Version: app=sd.next updated=2023-11-27 hash=8136723f url=https://github.com/vladmandic/automatic/tree/master Platform: arch=AMD64 cpu=AMD64 Family 25 Model 33 Stepping 0, AuthenticAMD system=Windows release=Windows-10-10.0.19045-SP0 python=3.10.6 Device: device=NVIDIA GeForce RTX 3090 n=1 arch=sm_90 cap=(8, 6) cuda=12.1 cudnn=8801 driver=536.23
Relevant log output
Backend
Original
Branch
Master
Model
SD 1.5
Acknowledgements