-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Blank black image output with stable diffusion 2.1 using autocast #1614
Comments
Hey @fralumz, It is not recommended to use autocast - it is both slower then pure fp16 and more instable/controllabel |
After removing |
Hey @HughPH, Could you please post a reproducible code snippet including your current diffusers, pytorch, etc.. versions (you can get them with |
Yes, when I finish work I'll duplicate my environment, get a minimal script together, and then make sure it breaks with 0.10.2 |
Since a couple of people seem to be following this issue, I'd like to clarify a couple of things regarding the 2.1 model. The 2.1 model was trained with xformers flash attention. Upon release, it was noticed that without using xformers, the model produces black images for If you cannot use xformers, then there is a chance that you run into precision problems in half precision. Note: This fixes inference only for pure fp16, not for autocast. Autocast is much harder to control as it will automatically downcast weights to fp16 before the softmax computation which will then lead to black images. Conclusion:
Also trying to make this a bit clearer in the docs: #2021 |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
Describe the bug
Using stable diffusion pipeline with torch.autocast and the stabilityai/stable-diffusion-2-1 model, the images generate are all blank black images.
Reproduction
Logs
System Info
diffusers
version: 0.10.0.dev0The text was updated successfully, but these errors were encountered: