[Bug]: SD 2.1 not working: NansException: A tensor with NaNs was produced in Unet. #16883
Open
3 of 6 tasks
Labels
bug-report
Report of a bug, yet to be confirmed
Checklist
What happened?
SD 1.5 is working fine, but 2.1 always gives this error:
NansException: A tensor with NaNs was produced in Unet. This could be either because there's not enough precision to represent the picture, or because your video card does not support half type. Try setting the "Upcast cross attention layer to float32" option in Settings > Stable Diffusion or using the --no-half commandline argument to fix this. Use --disable-nan-check commandline argument to disable this check.
I tried using the "Upcast cross attention layer to float32", it just produces random colors junk images.
I tried using the --no-half commandline argument, it gives a different error: "RuntimeError: Input type (float) and bias type (struct c10::Half) should be the same"
Using the --disable-nan-check just produces completely black images.
I had this issue both on my previous GPU (1080 ti) and my current GPU (5070 ti) on the latest 1111 version. The issue is somewhat fixed by using the commandline argument --opt-sdp-attention but it randomly starts producing junk images again after a while.
Steps to reproduce the problem
Launch 1111, load SD 2.1 model and try to generate any image at all.
What should have happened?
No error and the image generating correctly and no requiring workarounds that still don't quite work well.
What browsers do you use to access the UI ?
Mozilla Firefox
Sysinfo
Console logs
Additional information
As already mentioned, I already had this bug on my 1080 ti and now have it again on 5070 ti. I made a fresh install, but it's still no use.
The text was updated successfully, but these errors were encountered: