Stability-AI / StableSwarmUI

StableSwarmUI, A Modular Stable Diffusion Web-User-Interface, with an emphasis on making powertools easily accessible, high performance, and extensibility.
MIT License
4.54k stars 361 forks source link

img2img Batch Tool #90

Closed AIMusicExperiment closed 1 year ago

AIMusicExperiment commented 1 year ago

Hi Alex. is there any plan to implement a batch mode any time soon? Almost all of my work in Stable diffusion involves animation, often with thousands of frames. I can't currently leverage the power of multi-gpu implementation on StableSwarm, with these huge animation generations because with a batch mode I would have to generate my videos frame by frame with manually advancing the animation nodes individually, between each frame. That more than negates the speed advantage that the quicker generation would afford me. Thanks for your thoughts on this and for all the hard work that you and your team have been doing, hopefully you can someday bring this awesome speed enhancement to those of us that really need it. . .

mcmonkey4eva commented 1 year ago

There are three queue-batch modes currently:

For video animation, you'd need very specifically a way to batch img2img a folder-full of source images, which is a specific case not yet covered by those options, but a tool for that could be added. For video animation I feel like the tools could be taken a lot further (just look at deforum! it's got ten million parameters and functions), which is an entire project of its own, but small parts of it along the way like a bulk img2img tool could easily be added.

If there's any specific tools beyond just init-image-input-batcher you'd want, that wouldn't be necessarily massive video-animation-focused-projects of their own, feel free to suggest.

AIMusicExperiment commented 1 year ago

https://www.youtube.com/watch?v=WIGqDDfOVHk

mcmonkey4eva commented 1 year ago

If (- IF! -) simply incrementing a primitive node works, you can:

A lil jank but would achieve the hypothetical goal, with automatic GPU splitting.

however I do not think it is the case that incrementing the node suffices - that animation shown in the video looks to be linearly self-referential (ie, every frame depends on the content of the prior frame, meaning you cannot split it in parallel across multiple GPUs as that would cause it to lose temporal context).

This is unfortunately a very difficult case to solve in any context, not just limited to here - the animation being built from a linear process means it's naturally resistant to parallelization, regardless of UI/toolset work. With that setup, you cannot generate the next frame until the previous one is done.


btw you don't need to manually enable every node - leaving them disabled implicitly uses whatever value is in the workflow, turning them on is only needed if you want to customize them while on the generate tab.


For examples of what can be parallelized easily here:

mcmonkey4eva commented 1 year ago

For bulk frame overriding, the new Image Edit Batch tool should handle that quite nicely.

mcmonkey4eva commented 1 year ago

Pardon the indecisive edits above, I was going to reformat this as an open-ended discussion (as the highly actionable part was added, and past that it's kinda open-ended) then remembered https://github.com/Stability-AI/StableSwarmUI/discussions exists and so further discussion of the topic should continue there.

More issues can be made if/when we find more actionable feature improvements to make here.