NansException Error when made Img2Img

#5
by chenNdG - opened

Hello, first of all I'd like to thank you for your work on this model, it really is of remarkable quality.
But i got one problem, when i try to upscale a image in img2img i always got :
"NansException: A tensor with all 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 have a rtx 4060 16Go i don't thinks it's my GPU that get this error. I use A1111 V1.7, for the setting i use euler a 30 step scale x2 the initial image for exemeple 768*1024 upscale x2. I use sdxl default vae.
I've done several tests, with images generated from txt2img that I send in img2img and non-AI images, the non-AI ones work when I regenerate them normally, but when I activate the Ultimate Upscaler script it returns the error. For images created from txt2img, whether I activate the script or not, I always get the error.
I wanted to know if I'm the only one with this problem or if there are other people who have the same problems as me.

I think because the model is FP16, or the vae is FP32.
I propose 2 ways:

  1. Use this VAE instead, actually I think you don't need external VAE because it's already baked inside the model
  2. Set --no-half in the commandline args

Thanks you very much !
I will try to change it and made some test !

the VAE worked for me, thank you!

Sign up or log in to comment