This PR is to introduce batch processing of images.
Some background, support for batch prompt processing was added, however this has some fallbacks IMO, as it stands now if you create a batch of 4 images, it will process the prompt etc once, however the expensive parts really gain no benefit, you just end up waiting 4x longer for 4 images, and you can only run a Batch on one set of Scheduler settings
I propose a solution to this and also provide more options for batch results.
Adding a new DiffuseBatchAsync method in the base diffusers that returns a collection of tensors, this method will take in a new BatchOptions parameter, this we can use to provide all the parameter for the batch type we want to run
[x] Diffusers to return an IAsyncEnumerable
[x] Seed Batch - What batching does now, same prompt multiple images
[x] Step Batch - Same seed/prompt but increment a range of steps
[x] Guidance Batch - Same seed/prompt but increment a range of Guidance values
[x] Strength Batch - Same seed/prompt but increment a range of Strength values (ImageToImage)
[x] Scheduler Batch - Same seed/prompt but use all Schedulers
[x] UI Integration
Each image will be returned to the user as its generated, so no long wait, and can be canceled without losing the images already generated.
This PR is to introduce batch processing of images.
Some background, support for batch prompt processing was added, however this has some fallbacks IMO, as it stands now if you create a batch of 4 images, it will process the prompt etc once, however the expensive parts really gain no benefit, you just end up waiting 4x longer for 4 images, and you can only run a Batch on one set of Scheduler settings
I propose a solution to this and also provide more options for batch results.
Adding a new
DiffuseBatchAsync
method in the base diffusers that returns a collection of tensors, this method will take in a newBatchOptions
parameter, this we can use to provide all the parameter for the batch type we want to runEach image will be returned to the user as its generated, so no long wait, and can be canceled without losing the images already generated.