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 height and width flags #52

Merged
merged 1 commit into from
Mar 4, 2023
Merged

Conversation

mspronesti
Copy link
Contributor

This PR aims at supporting height and width flags, solving #31 . I tried to keep your design of the pipelines unchanged: if not specified, the SD pipelines uses the default values previously assigned depending on the chosen version of stable diffusion (512x512 for v1.5, 768x768 for v2.1).

@LaurentMazare
Copy link
Owner

Looks pretty good thanks! Could you add some samples of the tests that you ran with this?

@mspronesti
Copy link
Contributor Author

mspronesti commented Mar 4, 2023

Sure. Here's how I tested it.

Not passing any arg

TORCH_CUDA_VERSION=cu116 cargo run --example stable-diffusion --features clap -- --prompt "A very rusty robot holding a fire torch."  --sd-version=v1-5 --n-steps=50 --seed=1297 

Final size: 512x512

diffusers-rs HF diffusers
sd_final image

Only passing height

!TORCH_CUDA_VERSION=cu116 cargo run --example stable-diffusion --features clap -- --prompt "A very rusty robot holding a fire torch."  --sd-version=v1-5 --n-steps=50 --seed=1297 --height=496

Final size: 512x496

diffusers-rs HF diffusers
image image

Only passing width

!TORCH_CUDA_VERSION=cu116 cargo run --example stable-diffusion --features clap -- --prompt "A very rusty robot holding a fire torch."  --sd-version=v1-5 --n-steps=50 --seed=1297 --width=768

Final size: 768x512

diffusers-rs HF diffusers
sd_final image

Passing both

!TORCH_CUDA_VERSION=cu116 cargo run --example stable-diffusion --features clap -- --prompt "A very rusty robot holding a fire torch."  --sd-version=v1-5 --n-steps=30 --seed=1297 --width=600 --height=600

Final size: 600x600

diffusers-rs HF diffusers
sd_final image

@LaurentMazare
Copy link
Owner

Nice thanks (somehow I didn't see any images for the diffusers-rs version on the two last size but that might just be github not liking having too many large images).

@LaurentMazare LaurentMazare merged commit 4ce3c04 into LaurentMazare:main Mar 4, 2023
@mspronesti
Copy link
Contributor Author

I just edited the last pair using 600 instead of 768. It should be visible now, I hope. Thanks for merging :-)

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.

2 participants