stable-diffusion-webui-forge icon indicating copy to clipboard operation
stable-diffusion-webui-forge copied to clipboard

[Bug]: ControlNet Batch Folder takes the first file as input instead of all files

Open AIconfig opened this issue 1 year ago • 17 comments

Checklist

  • [X] The issue exists after disabling all extensions
  • [X] The issue exists on a clean installation of webui
  • [ ] The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • [X] The issue exists in the current version of the webui
  • [X] The issue has not been reported before recently
  • [ ] The issue has been reported before but has not been fixed yet

What happened?

ControlNet has a functionality "Batch Folder" which takes all the files from the folder and uses them as input sequentially (producing N outputs, where N equals to the number of images in the folder). This functionality works correctly in vanilla Automatic1111, however in Forge it takes only the first file as an input and produces only 1 output.

Steps to reproduce the problem

  1. Enable ControlNet and switch to "Batch Folder".
  2. Use the path with multiple images (for example multiple depth masks).
  3. Generate the output

What should have happened?

Forge had to generate output for each image in the Batch Folder and not for the first image only.

What browsers do you use to access the UI ?

Mozilla Firefox

Sysinfo

sysinfo-2024-02-17-01-58.json

Console logs

Starting job task(xthkxas0ldvaznl)
Token merging is under construction now and the setting will not take effect.
2024-02-17 01:49:33,953 - ControlNet - INFO - ControlNet Input Mode: InputMode.BATCH
2024-02-17 01:49:33,953 - ControlNet - INFO - Try to read image: /srv/shared/AI/AUTOMATIC1111/stable-diffusion-webui/models/POSES/DEPTH/characterHeadConceptPoses_v10/head_poses/single_depth_black/front.png
2024-02-17 01:49:33,959 - ControlNet - INFO - Try to read image: /srv/shared/AI/AUTOMATIC1111/stable-diffusion-webui/models/POSES/DEPTH/characterHeadConceptPoses_v10/head_poses/single_depth_black/front_downwards.png
2024-02-17 01:49:33,965 - ControlNet - INFO - Try to read image: /srv/shared/AI/AUTOMATIC1111/stable-diffusion-webui/models/POSES/DEPTH/characterHeadConceptPoses_v10/head_poses/single_depth_black/front_upwards.png
2024-02-17 01:49:33,970 - ControlNet - INFO - Try to read image: /srv/shared/AI/AUTOMATIC1111/stable-diffusion-webui/models/POSES/DEPTH/characterHeadConceptPoses_v10/head_poses/single_depth_black/left_1.png
2024-02-17 01:49:33,975 - ControlNet - INFO - Try to read image: /srv/shared/AI/AUTOMATIC1111/stable-diffusion-webui/models/POSES/DEPTH/characterHeadConceptPoses_v10/head_poses/single_depth_black/left_2.png
2024-02-17 01:49:33,980 - ControlNet - INFO - Try to read image: /srv/shared/AI/AUTOMATIC1111/stable-diffusion-webui/models/POSES/DEPTH/characterHeadConceptPoses_v10/head_poses/single_depth_black/left_downwards_1.png
2024-02-17 01:49:33,985 - ControlNet - INFO - Try to read image: /srv/shared/AI/AUTOMATIC1111/stable-diffusion-webui/models/POSES/DEPTH/characterHeadConceptPoses_v10/head_poses/single_depth_black/left_downwards_2.png
2024-02-17 01:49:33,990 - ControlNet - INFO - Try to read image: /srv/shared/AI/AUTOMATIC1111/stable-diffusion-webui/models/POSES/DEPTH/characterHeadConceptPoses_v10/head_poses/single_depth_black/left_upwards_1.png
2024-02-17 01:49:33,997 - ControlNet - INFO - Try to read image: /srv/shared/AI/AUTOMATIC1111/stable-diffusion-webui/models/POSES/DEPTH/characterHeadConceptPoses_v10/head_poses/single_depth_black/left_upwards_2.png
2024-02-17 01:49:34,002 - ControlNet - INFO - Try to read image: /srv/shared/AI/AUTOMATIC1111/stable-diffusion-webui/models/POSES/DEPTH/characterHeadConceptPoses_v10/head_poses/single_depth_black/right_1.png
2024-02-17 01:49:34,007 - ControlNet - INFO - Try to read image: /srv/shared/AI/AUTOMATIC1111/stable-diffusion-webui/models/POSES/DEPTH/characterHeadConceptPoses_v10/head_poses/single_depth_black/right_2.png
2024-02-17 01:49:34,012 - ControlNet - INFO - Try to read image: /srv/shared/AI/AUTOMATIC1111/stable-diffusion-webui/models/POSES/DEPTH/characterHeadConceptPoses_v10/head_poses/single_depth_black/right_downwards_1.png
2024-02-17 01:49:34,018 - ControlNet - INFO - Try to read image: /srv/shared/AI/AUTOMATIC1111/stable-diffusion-webui/models/POSES/DEPTH/characterHeadConceptPoses_v10/head_poses/single_depth_black/right_downwards_2.png
2024-02-17 01:49:34,023 - ControlNet - INFO - Try to read image: /srv/shared/AI/AUTOMATIC1111/stable-diffusion-webui/models/POSES/DEPTH/characterHeadConceptPoses_v10/head_poses/single_depth_black/right_upwards_1.png
2024-02-17 01:49:34,028 - ControlNet - INFO - Try to read image: /srv/shared/AI/AUTOMATIC1111/stable-diffusion-webui/models/POSES/DEPTH/characterHeadConceptPoses_v10/head_poses/single_depth_black/right_upwards_2.png
  0%|                                                                                                                                                                                | 0/15 [00:00<?, ?it/s]2024-02-17 01:49:34,033 - ControlNet - INFO - Using preprocessor: None
2024-02-17 01:49:34,033 - ControlNet - INFO - preprocessor resolution = 1024
2024-02-17 01:49:34,033 - ControlNet - INFO - Using preprocessor: None
2024-02-17 01:49:34,033 - ControlNet - INFO - preprocessor resolution = 1024
2024-02-17 01:49:34,033 - ControlNet - INFO - Using preprocessor: None
2024-02-17 01:49:34,033 - ControlNet - INFO - preprocessor resolution = 1024
2024-02-17 01:49:34,033 - ControlNet - INFO - Using preprocessor: None
2024-02-17 01:49:34,033 - ControlNet - INFO - preprocessor resolution = 1024
2024-02-17 01:49:34,033 - ControlNet - INFO - Using preprocessor: None
2024-02-17 01:49:34,034 - ControlNet - INFO - preprocessor resolution = 1024
2024-02-17 01:49:34,034 - ControlNet - INFO - Using preprocessor: None
2024-02-17 01:49:34,034 - ControlNet - INFO - preprocessor resolution = 1024
2024-02-17 01:49:34,034 - ControlNet - INFO - Using preprocessor: None
2024-02-17 01:49:34,034 - ControlNet - INFO - preprocessor resolution = 1024
2024-02-17 01:49:34,034 - ControlNet - INFO - Using preprocessor: None
2024-02-17 01:49:34,034 - ControlNet - INFO - preprocessor resolution = 1024
2024-02-17 01:49:34,034 - ControlNet - INFO - Using preprocessor: None
2024-02-17 01:49:34,034 - ControlNet - INFO - preprocessor resolution = 1024
2024-02-17 01:49:34,034 - ControlNet - INFO - Using preprocessor: None
2024-02-17 01:49:34,034 - ControlNet - INFO - preprocessor resolution = 1024
2024-02-17 01:49:34,034 - ControlNet - INFO - Using preprocessor: None
2024-02-17 01:49:34,034 - ControlNet - INFO - preprocessor resolution = 1024
2024-02-17 01:49:34,034 - ControlNet - INFO - Using preprocessor: None
2024-02-17 01:49:34,034 - ControlNet - INFO - preprocessor resolution = 1024
2024-02-17 01:49:34,034 - ControlNet - INFO - Using preprocessor: None
2024-02-17 01:49:34,034 - ControlNet - INFO - preprocessor resolution = 1024
2024-02-17 01:49:34,034 - ControlNet - INFO - Using preprocessor: None
2024-02-17 01:49:34,034 - ControlNet - INFO - preprocessor resolution = 1024
2024-02-17 01:49:34,034 - ControlNet - INFO - Using preprocessor: None
2024-02-17 01:49:34,034 - ControlNet - INFO - preprocessor resolution = 1024
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 15/15 [00:00<00:00, 9692.58it/s]
2024-02-17 01:49:34,700 - ControlNet - INFO - Current ControlNet ControlNetPatcher: /srv/shared/AI/AUTOMATIC1111/stable-diffusion-webui/models/ControlNet/diffusers_xl_depth_full.safetensors
                                                                                                                                                                                                           2024-02-17 01:49:35,049 - ControlNet - INFO - ControlNet Method None patched.                                                                                                         | 0/40 [00:00<?, ?it/s]
To load target model SDXL
To load target model ControlNet
Begin to load 2 models
Moving model(s) has taken 1.06 seconds
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 40/40 [00:32<00:00,  1.23it/s]
Moving model(s) skipped. Freeing memory has taken 0.80 seconds██████████████████████████████████▌                                                                           | 40/80 [00:33<00:26,  1.53it/s]
Upscale script freed memory successfully.
tiled upscale: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 36/36 [00:09<00:00,  3.99it/s]
Moving model(s) skipped. Freeing memory has taken 0.55 seconds
Token merging is under construction now and the setting will not take effect.
2024-02-17 01:50:26,702 - ControlNet - INFO - ControlNet Method None patched.
To load target model SDXL
To load target model ControlNet
Begin to load 2 models
Moving model(s) has taken 1.25 seconds
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 40/40 [02:33<00:00,  3.84s/it]
Token merging is under construction now and the setting will not take effect.███████████████████████████████████████████████████████████████████████████████████████████████| 80/80 [03:24<00:00,  3.87s/it]
To load target model AutoencoderKL
Begin to load 1 model
Moving model(s) has taken 1.11 seconds
Total progress: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 80/80 [03:38<00:00,  2.73s/it]
INFO:modules.shared_state:Ending job task(xthkxas0ldvaznl) (219.56 seconds)█████████████████████████████████████████████████████████████████████████████████████████████████| 80/80 [03:38<00:00,  3.87s/it]
Ending job task(xthkxas0ldvaznl) (219.56 seconds)
INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"

Additional information

As seen from the console, there was many images detected by ControlNet. However, for some reason, only 1 was used and only 1 generated image was produced.

AIconfig avatar Feb 17 '24 02:02 AIconfig

I was about to report same.

VeteranXT avatar Feb 17 '24 11:02 VeteranXT

Same problem here

ArnorWing avatar Feb 17 '24 13:02 ArnorWing

I have the same problem, but also if your generation batch size 4, it will use the first 4 images instead of making 4 of the first like Automatic1111, but also will increment the seed number even when the "Increment seed after each controlnet batch iteration" is unchecked in settings.

So in a automatic1111 a batch count of 6, batch size 4, seed 1 and Controlnet batch 6 images a,b,c,d,e,f will create:

1a, 2a, 3a, 4a, 1b, 2b, 3b, 4b, 1c, 2c, 3c, 4c, 1d, 2d, 3d, 4d, 1e, 2e, 3e, 4e, 1f, 2f, 3f, 4f,__________Only 4 seeds reused and will use the 6 ControlNet Images. Good.

But in Forge a batch count of 6, batch size 4, seed 1 and Controlnet batch 6 images a,b,c,d,e,f will create:

1a, 2b, 3c, 4d, 5a, 6b, 7c, 8d, 9a, 10b, 11c, 12d, 13a, 14b, 15c, 16d,__________Instead 16 Seeds used and only the first 4 ControlNet Images. Bad.

I hope that make sense.

fergalicia avatar Feb 19 '24 23:02 fergalicia

"batch folder" and "batch upload" both options only take in first image and ignores the rest

FruitPigFoot avatar Feb 20 '24 05:02 FruitPigFoot

check #344 to add multi

Capture d'écran 2024-02-22 023050

DA-Charlie avatar Feb 22 '24 01:02 DA-Charlie

the same bug

zhoutingxi avatar Feb 22 '24 15:02 zhoutingxi

same issue there: https://github.com/lllyasviel/stable-diffusion-webui-forge/issues/208 and batch folder not working for me either on forge

Wildboy85 avatar Mar 03 '24 22:03 Wildboy85

Got the same issue.

zifnub avatar Mar 05 '24 01:03 zifnub

same issue as well, 3/21/24

MIDG3Tp3nguin avatar Mar 21 '24 15:03 MIDG3Tp3nguin

Seems still to persist, 3/31/24

benjamin-bertram avatar Mar 31 '24 12:03 benjamin-bertram

I came here looking for a fix for this same issue. Still broken 4/12/2024

coderCK2 avatar Apr 12 '24 16:04 coderCK2

One addition... it does do the preprocessing of all the images... only just renders 1 image of the batch in controlnet. So the code to repeat is still in there, only not the call to render the preprocessed image.

Xipomus avatar May 14 '24 19:05 Xipomus

I dont understand how this still hasnt been fixed. i mean i definitely appreciate illyasviel's work and in the end its all free but this is such a crucial feature and it worked fine in 1111...

ByteSh0ck avatar May 26 '24 11:05 ByteSh0ck

I think forge was abandoned? No movement in 2 months...

fergalicia avatar May 27 '24 14:05 fergalicia

这个问题依然存在,预计在forge上不会得到解决了;

dadadanaloon avatar Jun 29 '24 04:06 dadadanaloon