Skip to content

Instantly share code, notes, and snippets.

@Filarius
Last active September 29, 2022 00:37
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
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)
torch.save(model,"model_f16.ckpt")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment