ototadana / sd-face-editor

Face Editor for Stable Diffusion
MIT License
1.03k stars 86 forks source link

Error when using batch controlnet #128

Closed timmyhk852 closed 1 year ago

timmyhk852 commented 1 year ago

I used controlnet batch - depth Only the 1st image was processed, but when processing 2nd image, it showed error

Error running postprocess: C:\Stable Diffusion\stable-diffusion-webui\extensions\sd-face-editor\scripts\face_editor_extension.py Traceback (most recent call last): File "C:\Stable Diffusion\stable-diffusion-webui\modules\scripts.py", line 498, in postprocess script.postprocess(p, processed, script_args) File "C:\Stable Diffusion\stable-diffusion-webui\extensions\sd-face-editor\scripts\face_editor_extension.py", line 53, in postprocess ImageProcessor(WorkflowManager.get(option.workflow)).proc_images(o, res, option) File "C:\Stable Diffusion\stable-diffusion-webui\extensions\sd-face-editor\scripts\use_cases\image_processor.py", line 61, in proc_images proc = self.proc_image(p, option, image) File "C:\Stable Diffusion\stable-diffusion-webui\extensions\sd-face-editor\scripts\use_cases\image_processor.py", line 152, in proc_image proc_image = self.workflow.process(jobs, face, p, option) File "C:\Stable Diffusion\stable-diffusion-webui\extensions\sd-face-editor\scripts\use_cases\workflow_manager.py", line 146, in process image = face_processor.process(face, p, params) File "C:\Stable Diffusion\stable-diffusion-webui\extensions\sd-face-editor\scripts\inferencers\img2img_face_processor.py", line 36, in process proc = process_images(p) File "C:\Stable Diffusion\stable-diffusion-webui\modules\processing.py", line 620, in process_images res = process_images_inner(p) File "C:\Stable Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 37, in processing_process_images_hijack return self.process_images_cn_batch(p, *args, *kwargs) File "C:\Stable Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 70, in process_images_cn_batch self.dispatch_callbacks(self.process_batch_each_callbacks, p) File "C:\Stable Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 162, in dispatch_callbacks callback(args) File "C:\Stable Diffusion\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\controlnet.py", line 997, in batch_tab_process_each unit.image = next(unit.batch_images) StopIteration


Total progress: 82%|█████████████████████████████████████████████████████▉ | 49/60 [00:41<00:09, 1.19it/s] Total progress: 82%|█████████████████████████████████████████████████████▉ | 49/60 [00:41<00:09, 1.12it/s]

ototadana commented 1 year ago

@timmyhk852 Thanks for using this extension.

I also tried it and indeed I got the same error. I couldn't image how to fix it, but I did notice one thing while reading the ControlNet source code.

By setting "[Loopback] Automatically send generated images to this ControlNet unit" to Enabled, this error can be avoided.

I don't know how this configuration change will affect your desired results, but it is worth a try.