Script to convert Stable Diffusion weights file into float16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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