vladmandic/sdnext

[Feature]: stable code api for batch processing

Offen

#528 geöffnet am 26.04.2023

 (5 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (579 Forks)github user discovery
enhancementhelp wanted

Repository-Metriken

Stars
 (7.314 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 7h 30m) (13 gemergte PRs in 30 T)

Beschreibung

Feature description

At the moment, the code for img2img batch sequence processing is restricted to this function:

https://github.com/vladmandic/automatic/blob/93b0de7e599453027ad7cab6266b42920ebc1250/modules/img2img.py#L16

And it is impossible to know whether we are in batch mode or not from an extension without resorting to hacks. See for example how it was done for controlnet:

https://github.com/Mikubill/sd-webui-controlnet/blob/93b0f9e1b7cc246165666b7b307bc8243db2c3f4/scripts/batch_hijack.py#L99

Additionally, this batch sequence mode and the "batch count" and "batch size" sliders of the webui can easily be confused with one another.

It would be nice if it was possible for extension scripts to:

  1. know whether they are in sequential batch mode
  2. control whether the current generation is in batch mode, depending on the extension generation parameters (the gradio components returned by the ui() callback)
    • note also that this means extensions would be able to enter batch mode during txt2img generation for example, which is currently not an existing concept in the webui

Providing a unified interface to iterate over multiple images for generation would allow extensions to communicate with each other and make it possible (or at least easier) to create more complex workflows for movie2movie that are currently not possible (or at least hard to implement).

As a side concern: should I open this issue in https://github.com/AUTOMATIC1111/stable-diffusion-webui instead? I am confused as to which repo should receive this kind of code change request.

Version Platform Description

Contributor Guide