Download convert_model.py from zootkitty/gonzalomoChroma_converted: direct link, hf CLI and curl.
- Browser
- Download file 479 Bytes
-
https://huggingface.co/zootkitty/gonzalomoChroma_converted/resolve/main/convert_model.py
- Command line
-
hf download hf://zootkitty/gonzalomoChroma_converted/convert_model.py
-
curl -L -o convert_model.py https://huggingface.co/zootkitty/gonzalomoChroma_converted/resolve/main/convert_model.py
479 Bytes
| from safetensors.torch import load_file, save_file | |
| source_model = load_file("Chroma1-HD.safetensors") | |
| target_model = load_file("gonzalomoChroma_v12FP8UNET.safetensors") | |
| converted_model = {} | |
| for key in source_model: | |
| if key not in target_model: | |
| converted_model[key] = source_model[key] | |
| for key in target_model: | |
| if key in source_model: | |
| converted_model[key] = target_model[key] | |
| save_file(converted_model, "gonzalomoChroma_v12FP8UNET_converted.safetensors") | |