Skip to content

Instantly share code, notes, and snippets.

Last active September 29, 2022 00:37
What would you like to do?
Script to convert Stable Diffusion weights file into float16
import torch
model = torch.load("model.ckpt")
for x in model['state_dict'].keys():
model['state_dict'][x] = model['state_dict'][x].to(torch.float16),"model_f16.ckpt")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment