AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: img2img batch error with control net #12401

Closed artthili closed 1 year ago

artthili commented 1 year ago

Is there an existing issue for this?

What happened?

image

when I tried to upscale image batch with img2img using controlnet tile, always keep getting this attached error. but the first image always getting complete and once 2nd image need to load this happened

Steps to reproduce the problem

  1. Go to img2image
  2. use batch tab
  3. add input directory
  4. add output directory
  5. go to controlnet
  6. use batch tab
  7. add directory
  8. select control type tile
  9. select control mode ControlNet is more important
  10. go to scripts
  11. use Ultimate SD Upscale
  12. select Target size type to scale form image size - 2
  13. select upscaler 4x-ultrasharp
  14. type liner + half tile offset pass+inters
  15. tic Seams fix
  16. finally click generate

What should have happened?

yes normal should be run for full batch of image instead on only first one

Version or Commit where the problem happens

Latest Version

What Python version are you running on ?

Python 3.10.x

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 ?

Google Chrome

Command Line Arguments

--xformers

List of extensions

Extension URL Branch Version Date Update SD-CN-Animation https://github.com/volotat/SD-CN-Animation.git main 2e257bbf Tue May 30 16:49:03 2023 unknown adetailer https://github.com/Bing-su/adetailer.git main f18e00b4 Mon Jul 31 12:03:01 2023 unknown canvas-zoom https://github.com/richrobber2/canvas-zoom.git main be66fb61 Sat Jul 29 12:55:22 2023 unknown deforum-for-automatic1111-webui https://github.com/deforum-art/deforum-for-automatic1111-webui.git automatic1111-webui 46475d9b Fri Jul 28 06:08:12 2023 unknown openpose-editor https://github.com/fkunn1326/openpose-editor.git master 722bca6f Sat Jun 3 04:54:52 2023 unknown posex https://github.com/hnmr293/posex.git master 292f92d5 Wed May 3 08:59:57 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-agent-scheduler https://github.com/ArtVentureX/sd-webui-agent-scheduler.git main 1a5be3bf Mon Jul 31 10:40:08 2023 unknown sd-webui-ar https://github.com/alemelis/sd-webui-ar.git main 04ee2c6c Thu Jul 6 10:14:29 2023 unknown sd-webui-controlnet https://github.com/Mikubill/sd-webui-controlnet.git main 5ae9b4a1 Fri Jul 28 14:28:41 2023 unknown sd-webui-inpaint-anything https://github.com/Uminosachi/sd-webui-inpaint-anything.git main a914b3b3 Tue Aug 1 03:44:17 2023 unknown sd-webui-openpose-editor https://github.com/huchenlei/sd-webui-openpose-editor.git main d352f29e Sat Jul 22 21:15:12 2023 unknown sd-webui-photopea-embed https://github.com/yankooliveira/sd-webui-photopea-embed.git main f3874a0c Sat Jun 17 09:46:50 2023 unknown sd-webui-refiner https://github.com/wcde/sd-webui-refiner.git main 6bbffe85 Sun Jul 30 19:34:49 2023 unknown sd-webui-roop https://github.com/s0md3v/sd-webui-roop main e6333fbe Fri Jul 7 09:22:59 2023 unknown stable-diffusion-webui-two-shot https://github.com/ashen-sensored/stable-diffusion-webui-two-shot.git main 6b55dd52 Sun Apr 2 11:24:25 2023 unknown stable-diffusion-webui-wildcards https://github.com/AUTOMATIC1111/stable-diffusion-webui-wildcards.git master c7d49e18 Sun Jul 30 20:08:05 2023 unknown ultimate-upscale-for-automatic1111 https://github.com/Coyote-A/ultimate-upscale-for-automatic1111.git master c99f382b Tue Jun 13 04:29:35 2023 unknown

Console logs

Total progress: 87it [01:47,  1.23s/it]
*** Error completing request  1.05it/s]
*** Arguments: ('task(ggf3u48wy59eb2j)', 5, '(masterpiece:1.2) (photorealistic:1.2) (bokeh) (best quality) (detailed skin) (intricate) (8k) (HDR) (cinematic lighting) (sharp focus)', '(monochrome) (bad hands) (disfigured) (grain) (Deformed) (poorly drawn) (mutilated) (lowres) (deformed) (dark) (lowpoly) (CG) (3d) (blurry) (man) (male) (boy) (guy) (duplicate) (watermark) (label) (signature) (frames) (text)', [], None, None, None, None, None, None, None, 30, 16, 4, 0, 1, False, False, 1, 1, 7, 1.5, 0.25, -1.0, -1.0, 0, 0, 0, False, 1, 512, 512, 2, 0, 0, 32, 0, 'E:\\Stock\\Shutterstock Adobe Stock\\1 - New', 'E:\\Stock\\Shutterstock Adobe Stock\\2 - Upscaled', '', [], False, [], '', <gradio.routes.Request object at 0x000001AA479B75E0>, 10, False, {'ad_model': 'face_yolov8n.pt', 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 32, '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_sampler': False, 'ad_sampler': 'Euler a', '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': 'inpaint_global_harmonious', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, {'ad_model': 'None', 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 32, '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_sampler': False, 'ad_sampler': 'Euler a', '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': 'inpaint_global_harmonious', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, False, '', 0, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000001AA4796B820>, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000001AA4796AF20>, <scripts.controlnet_ui.controlnet_ui_group.UiControlNetUnit object at 0x000001AA471435B0>, False, 'None', 10, None, False, '0', 'E:\\AUTO1111\\stable-diffusion-webui\\models\\roop\\inswapper_128 (2).onnx', 'CodeFormer', 1, '', 1, 1, False, True, False, '1:1,1:2,1:2', '0:0,0:0,0:1', '0.2,0.8,0.8', 150, 0.2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, '<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, None, None, False, None, None, False, None, None, False, 50, '<p style="margin-bottom:0.75em">Will upscale the image depending on the selected target size type</p>', 1024, 0, 8, 32, 64, 0.35, 32, 3, True, 0, True, 8, 3, 2, 2048, 2048, 2) {}
    Traceback (most recent call last):
      File "E:\AUTO1111\stable-diffusion-webui\modules\call_queue.py", line 58, in f
        res = list(func(*args, **kwargs))
      File "E:\AUTO1111\stable-diffusion-webui\modules\call_queue.py", line 37, in f
        res = func(*args, **kwargs)
      File "E:\AUTO1111\stable-diffusion-webui\modules\img2img.py", line 226, in img2img
        process_batch(p, img2img_batch_input_dir, img2img_batch_output_dir, img2img_batch_inpaint_mask_dir, args, to_scale=selected_scale_tab == 1, scale_by=scale_by, use_png_info=img2img_batch_use_png_info, png_info_props=img2img_batch_png_info_props, png_info_dir=img2img_batch_png_info_dir)
      File "E:\AUTO1111\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 30, in img2img_process_batch_hijack
        return getattr(img2img, '__controlnet_original_process_batch')(p, *args, **kwargs)
      File "E:\AUTO1111\stable-diffusion-webui\modules\img2img.py", line 118, in process_batch
        infotext = proc.infotext(p, n)
      File "E:\AUTO1111\stable-diffusion-webui\modules\processing.py", line 457, in infotext
        return create_infotext(p, self.all_prompts, self.all_seeds, self.all_subseeds, comments=[], position_in_batch=index % self.batch_size, iteration=index // self.batch_size)
      File "E:\AUTO1111\stable-diffusion-webui\modules\processing.py", line 624, in create_infotext
        "Seed": p.all_seeds[0] if use_main_prompt else all_seeds[index],
    IndexError: list index out of range

---

Additional information

No response

catboxanon commented 1 year ago

Duplicate of pinned issue https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/12286

w-e-w commented 1 year ago

I tried🙃

artthili commented 1 year ago

I have check the "Do not append detectmap to output", but still getting same error, is there any way to do this without downgrading to 1.4.0 or switch to dev brunch image

w-e-w commented 1 year ago

I have check the "Do not append detectmap to output", but still getting same error, is there any way to do this without downgrading to 1.4.0 or switch to dev brunch

did you apply / save your setting

artthili commented 1 year ago

yes, I also completely closed the cmd and restart the webui, but still getting same error message

skubolek commented 1 year ago

I check "Do not append detectmap to output" and problem is gone. thanks !