Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CLI image variations #121

Merged
merged 2 commits into from
Jan 23, 2024
Merged

Add CLI image variations #121

merged 2 commits into from
Jan 23, 2024

Conversation

monstruosoft
Copy link
Contributor

Add CLI image variations mode by setting the img2img argument without writing a prompt.

This commit also defines two new CLI arguments:
strength, used to define the image variation denoising strength.
batch_count, used to define the number of times that image generation will be run; on low end PCs with low RAM, it might be better to generate, for example, 4 batches of 1 image than 1 batch of 4 images. Total number of generated images should be batch_count * number_of_images.

Add CLI image variations mode by setting the img2img argument
without writing a prompt.
Add basic CLI tiled upscale using image variations mode
@monstruosoft
Copy link
Contributor Author

I have now added to the CLI branch a basic tiled upscale option that upscales the input image using the image variations mode. Please note that it's currently hardcoded to perform a 2x upscale using 512x512 output tiles. Also note that, since there's no guarantee for image variations tiles to be consistent, it's recommended to use a low denoising strength, the default value of 0.3 might be a good start.

@rupeshs
Copy link
Owner

rupeshs commented Jan 23, 2024

@monstruosoft Nice work, I will review it later

@rupeshs
Copy link
Owner

rupeshs commented Jan 23, 2024

@monstruosoft could you please share some inputs/outputs of tiled upscale?

@monstruosoft
Copy link
Contributor Author

Sure, here's a couple of, somewhat cherrypicked, examples:

Original:
ffe1606f-7eb9-4c40-997b-afe8efd484b3-1
Upscaled:
fastSD-1705961756

Original:
08ae4812-7959-4763-b273-a5b6e14f0cbc
Upscaled:
fastSD-1705950397

The upscaled versions were done using SD Turbo 1 step inference for each tile. Note that this is just a basic attempt at doing tiled SD upscale using FastSD CPU and it can be improved; for example, the black bars in the images are caused by the transparency used to try and make the tile seams less noticeable but those black bars can be removed relatively easy. Also, I didn't want to mess with the actual image generation code so currently the individual tiles are saved as well as the final images. Also, output path is currently hardcoded as results.

@rupeshs
Copy link
Owner

rupeshs commented Jan 23, 2024

@monstruosoft Yes, there is room for improvement. We can keep this as experimental.

@rupeshs rupeshs merged commit 04b9182 into rupeshs:main Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants