Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

Image Batch Processing #23

Merged
merged 6 commits into from
Nov 12, 2023
Merged

Image Batch Processing #23

merged 6 commits into from
Nov 12, 2023

Conversation

saddam213
Copy link
Member

@saddam213 saddam213 commented Nov 12, 2023

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

  • Diffusers to return an IAsyncEnumerable
  • Seed Batch - What batching does now, same prompt multiple images
  • Step Batch - Same seed/prompt but increment a range of steps
  • Guidance Batch - Same seed/prompt but increment a range of Guidance values
  • Strength Batch - Same seed/prompt but increment a range of Strength values (ImageToImage)
  • Scheduler Batch - Same seed/prompt but use all Schedulers
  • 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.

@saddam213 saddam213 marked this pull request as ready for review November 12, 2023 06:34
@saddam213 saddam213 merged commit 7e58b38 into master Nov 12, 2023
@saddam213 saddam213 deleted the Automation branch November 12, 2023 06:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant