lllyasviel / stable-diffusion-webui-forge

GNU Affero General Public License v3.0
7.75k stars 743 forks source link

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

Open AIconfig opened 7 months ago

AIconfig commented 7 months ago

Checklist

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.

VeteranXT commented 7 months ago

I was about to report same.

ArnorWing commented 7 months ago

Same problem here

JoeGeeGameDev commented 7 months ago

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.

FruitPigFoot commented 7 months ago

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

DA-Charlie commented 7 months ago

check #344 to add multi

Capture d'écran 2024-02-22 023050

zhoutingxi commented 7 months ago

the same bug

Wildboy85 commented 7 months ago

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

zifnub commented 7 months ago

Got the same issue.

MIDG3Tp3nguin commented 6 months ago

same issue as well, 3/21/24

benjamin-bertram commented 6 months ago

Seems still to persist, 3/31/24

coderCK2 commented 5 months ago

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

Xipomus commented 4 months ago

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.

ByteSh0ck commented 4 months ago

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...

JoeGeeGameDev commented 4 months ago

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

dadadanaloon commented 3 months ago

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

AlexaWhite commented 1 month ago

Bug still persist. Fully reproduced easily.

Nziner commented 1 month ago

Bug still persist. Fully reproduced easily.

+1