AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: img2img batch process does not change the seed #14273

Open VetalmGit opened 11 months ago

VetalmGit commented 11 months ago

Is there an existing issue for this?

What happened?

I start img2img batch process from directory with image sequence, and seed remained the same for all images in the batch, despite any changes in the seed settings. -1, or extra variations + variation strenght, etc.. even controlNet settings "Increment seed after each controlnet batch iteration" has no effect settings: Screenshot_9 Screenshot_10 result, input&output Screenshot_11

Steps to reproduce the problem

typical img2img batch process, ask me if it need to be explained

What should have happened?

seed settings should affect process like in other generation scenarious

Sysinfo

sysinfo-2023-12-09-22-32.txt

What browsers do you use to access the UI ?

Google Chrome

Console logs

Already up to date.
venv "D:\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.6.1
Commit hash: 4afaaf8a020c1df457bcf7250cb1c7f609699fa7
Launching Web UI with arguments: --no-gradio-queue
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
2023-12-10 00:43:21,897 - ControlNet - INFO - ControlNet v1.1.419
ControlNet preprocessor location: D:\stable-diffusion-webui\extensions\sd-webui-controlnet\annotator\downloads
2023-12-10 00:43:22,112 - ControlNet - INFO - ControlNet v1.1.419
Loading weights [7eb8672531] from D:\stable-diffusion-webui\models\Stable-diffusion\realcartoonRealistic_v11.safetensors2023-12-10 00:43:22,603 - AnimateDiff - INFO - Injecting LCM to UI.
2023-12-10 00:43:22,867 - AnimateDiff - INFO - Hacking i2i-batch.
*** Error executing callback ui_tabs_callback for D:\stable-diffusion-webui\extensions\SD-Prompt-Enhancer\scripts\sd_prompt_enhancer.py
    Traceback (most recent call last):
      File "D:\stable-diffusion-webui\modules\script_callbacks.py", line 166, in ui_tabs_callback
        res += c.callback() or []
      File "D:\stable-diffusion-webui\extensions\SD-Prompt-Enhancer\scripts\sd_prompt_enhancer.py", line 194, in on_ui_tabs
        extra_networks_ui = ui_extra_networks.create_ui(extra_networks_formrow, extra_networks_button,
      File "D:\stable-diffusion-webui\modules\ui_extra_networks.py", line 384, in create_ui
        for tab in unrelated_tabs:
    TypeError: 'ToolButton' object is not iterable

---
*Deforum ControlNet support: enabled*
Running on local URL:  http://127.0.0.1:7860
Creating model from config: D:\stable-diffusion-webui\configs\v1-inference.yaml

To create a public link, set `share=True` in `launch()`.
Startup time: 19.0s (prepare environment: 4.0s, import torch: 4.7s, import gradio: 2.5s, setup paths: 1.0s, initialize shared: 0.3s, other imports: 0.9s, setup codeformer: 0.3s, load scripts: 3.4s, create ui: 1.1s, gradio launch: 0.8s).
Applying attention optimization: Doggettx... done.
Model loaded in 11.5s (load weights from disk: 1.5s, create model: 0.6s, apply weights to model: 8.8s, apply half(): 0.1s, load VAE: 0.1s, calculate empty prompt: 0.3s).
Will process 3 images, creating 1 new images for each.
100%|██████████████████████████████████████████████████████████████████████████████████| 16/16 [00:02<00:00,  6.36it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 16/16 [00:02<00:00,  7.61it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 16/16 [00:02<00:00,  7.31it/s]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 48/48 [00:07<00:00,  6.70it/s]
Total progress: 100%|██████████████████████████████████████████████████████████████████| 48/48 [00:07<00:00,  7.29it/s]

Additional information

No response

w-e-w commented 11 months ago

this is not a bug

seed -1 itself it's not a generation parameter, seed -1 is just signal for webui randomized the seed that is used "prior" to generation for that "entire" job

image batch processing as the name suggest it is meant for you to do a "batch" of images not a sequence,

is just performs img2img for each input image with the same generation parameter (which includes the seed)

if you process two batches of images with the same generation parameter the result would be the same as if you processed them or at once

if seed -1 randomize seed for each input image, the batch results will not be reproducible


batch count and batch size does increment the seed, and generate multiple outputs form the same input image I don't know what you're doing, but if you're trying to generate multiple outputs of the same image then you should just increase the batch count


no comment on controlnet beheavro

VetalmGit commented 11 months ago

Can I run a batch for image sequance? yes, with the same prompt, but with random seed? if I wanted to run make it with the same seed, I could put a certain number (that I have picked up before, without batch)..

w-e-w commented 11 months ago

well in that case that is a feature request not a bug

I think this can be implemented as a extension

bigmover commented 9 months ago

reproducible

hi guys! batch size for img2img can improve how much in speed for generate image? I can enable it by using 'batch_size' parameters in request json?