CompVis / stable-diffusion

A latent text-to-image diffusion model
https://ommer-lab.com/research/latent-diffusion-models/
Other
67.51k stars 10.08k forks source link

non-square output #109

Open ciavolella opened 2 years ago

ciavolella commented 2 years ago

python errors when I use a H/W combination that isn't square.

nerdyrodent commented 2 years ago

You're probably going OOM so try reducing the image size. Tends to work best with one side staying at 512. Difficult to say for sure, of course, as you've not provided any actual error information.

Vargol commented 2 years ago

From my experiments (but on the Apple Silicon fork) this only works if the sizes are multiples of 64, I've rendered 384x512, 384x448 successfully so non square do work.

patrickvonplaten commented 2 years ago

This might also be of interest: https://huggingface.co/blog/stable_diffusion#usage and it's Google Colab: https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/stable_diffusion.ipynb#scrollTo=0SXnxd-ZrSfy&line=2&uniqifier=1

Those lines of code show how to get non-square outputs