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

allow custom height, width in StableDiffusionPipeline #179

Merged
merged 2 commits into from
Aug 15, 2022
Merged

Conversation

patil-suraj
Copy link
Contributor

@patil-suraj patil-suraj commented Aug 14, 2022

This PR shows how to generate images with custom height and width, for example can be used to generate recatngular images.

pipe(prompt, height=512, width=256,  guidance_scale=7.5)["sample"]

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Aug 14, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Member

@anton-l anton-l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a check/warning that h/w need to be divisible by 2?

Comment on lines +50 to +51
if height % 8 != 0 or width % 8 != 0:
raise ValueError(f"`height` and `width` have to be divisible by 8 but are {height} and {width}.")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patil-suraj patil-suraj changed the title [POC] allow custom height, width in StableDiffusionPipeline. allow custom height, width in StableDiffusionPipeline Aug 15, 2022
@patil-suraj patil-suraj merged commit 5f25818 into main Aug 15, 2022
@patil-suraj patil-suraj deleted the custom-hw branch August 15, 2022 04:58
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
* allow custom height width

* raise if height width are not mul of 8
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.

4 participants