How to convert Stable Diffusion model from FP16 to FP32

Futuristic

I found that my videocard GTX 1660 Super doesn’t fully support FP16 models. So sometimes I need to convert FP16 models to FP32. Here is the python scripts that I usually use for that…

How to use the scripts

Find your python, in my case it located in

  • D:\AI\automatic1111\system\python\python.exe

Then you can execute python.exe and paste the script code OR you can save the script to some file, eg script.py and run it as from the folder where your script is

Script to check which FP is used in the model

(!) Don’t forget to change model’s path to yours.

Script will output something like

and from here you can understand that FP16 is used

Script to convert safetensors FP16 model to FP32 model

(!) As previously don’t forget to change path to your model.

Script will output something like

Script to convert safetensors FP16 model to ckpt FP32 model

(!) As previously don’t forget to change path to your model.

Script will output something like

Script to check your videocard compatability with FP16

Output

You May Also Like

About the Author: vo