Replies: 1 comment 2 replies
-
To merge the split import safetensors.torch
merge_state_dict ={}
files = ["name1.safetensors", "name2.safetensors"...] #file you want to be merged
merged_file = "merged_file.safetensors"
for file in files:
load_files_dict = safetensors.torch.load_file(your.safetensors files)
merge_state_dict.update(load_files_dict)
# save
safetensors.torch.save_file(merge_state_dict, merged_file)
this merged_file will be now saved to the combined state dictionary with .safetensors file |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there, I got diffusion_pytorch_model-00001-of-00003.safetensors, diffusion_pytorch_model-00002-of-00003.safetensors and diffusion_pytorch_model-00003-of-00003.safetensors after full finetuned Flux with Ostris AI tool kit, I guess at this point I will have to fusion/merge theses 3 parts for created the whole checkpoint usable for a1111 Forge . Is anyone know a script or a tool who can allow this last step ?
Thanks a lot
Beta Was this translation helpful? Give feedback.
All reactions