-
Notifications
You must be signed in to change notification settings - Fork 78
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
Some Generation Resolutions Fail #8
Comments
Same here |
Ah, the merge function assumes the image is divisible by sx and sy, but the image gets downsampled by 8x in each direction for the latent space, so in reality if sx and sy are 2, then the image needs to be divisible by 16 in each direction. 1080 is not divisible by 16, which is why you get that error. I can fix this though by setting the extra tokens to be src tokens. Give me one sec. |
Fixed. Tested and was able to generate 1920x1080 images. Feel free to re-open if there are still any issues. |
Unfortunately, I do not believe it worked entirely. Or at all.
|
Hmm odd, I was able to generate a 1080p image on my end with the web ui. Admittedly though this was my own implementation, I haven't used the plugin. I also tested with the diffusers implementation I just merged and it also worked. I had to use 640x1080 as an example because 1920x1080 runs out of memory without xformers for me, but here's the code to reproduce: import torch, tomesd
from diffusers import StableDiffusionPipeline
pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16).to("cuda")
# Apply ToMe with a 50% merging ratio
tomesd.apply_patch(pipe, ratio=0.5)
image = pipe(
"a photo of an astronaut riding a horse on mars",
width=640, height=1080, num_inference_steps=20).images[0]
image.save("astronaut.png") |
Ah, I see the issue now. I can reproduce your error with tomesd.apply_patch(pipe, ratio=0.3, max_downsample=2) Seems an assumption I made didn't hold for max_downsample > 1. I'll work on a fix. |
Okay, turns out I'm dumb and forgot to apply one of the changes to the width and height of the image. Should work now. |
Some resolutions cause errors while running the model.
The following error is from a 1920x1080 run.
1024x1024 works though.
I am running as part of Auto1111, but the extension is working fine and calling the tomesd library fine.
Settings are
The text was updated successfully, but these errors were encountered: