twodgirl_diffusers_to_flux_script / flux_devpro_ckpt.py
John6666's picture
Upload 6 files
b716b6e verified
raw
history blame contribute delete
448 Bytes
import gc
from map_from_diffusers import convert_diffusers_to_flux_checkpoint
from safetensors.torch import load_file, save_file
import sys
import torch
###
# Code from huggingface/twodgirl
# License: apache-2.0
if __name__ == '__main__':
sd = convert_diffusers_to_flux_checkpoint(load_file(sys.argv[1]))
assert sd['time_in.in_layer.weight'].dtype == torch.float8_e4m3fn
print(len(sd))
gc.collect()
save_file(sd, sys.argv[2])