How to truly avoid NaN errors #13908
freecoderwaifu
started this conversation in
Show and tell
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Use the WD 1.4 VAE for anime and 2D (you can convert that ckpt to safetensors with the Toolkit extension or just the regular merger, or just use it as is)
https://huggingface.co/hakurei/waifu-diffusion-v1-4/tree/main/vae
Use the SD 1.5 VAE for realism, 3D CGI and less 2D models. (get the safetensors)
https://huggingface.co/stabilityai/sd-vae-ft-mse-original/tree/main
Try other VAEs.
https://civitai.com/search/models?sortBy=models_v3&query=vae
If any of the VAEs from Civitai gives you a NaN error, it's just the NAI VAE renamed.
If your checkpoint has the NAI VAE baked in, manually set a different VAE in Settings, instead of setting it to Automatic or None.
If you absolutely must use the NAI VAE for whatever reason, add
--no-half-vae
to your webui-user.bat args.https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings
For SDXL, try the SDXL fixed VAE instead of the official one
https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/tree/main
If using ControlNet, try the FP16 converted models instead.
https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/tree/main
If using Adetailer, I'm not sure if their models are FP32 or FP16, but there could FP16 alternatives.
Try
--upcast-sampling
or--no-half
. Note that it will be slower, since it will force full precision instead of half.https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings
Your graphics card might not fully support FP16 or mixing precision. This applies to some older GTX cards. For AMD cards, even if they support FP16 and mixed precision, it could also be an issue with them due to their Windows implementation. Same with CPU only mode due to its particularities.
Adding
--disable-nan-check
only disables the warning, not the root cause.Beta Was this translation helpful? Give feedback.
All reactions