import torch from safetensors.torch import load_file, save_file # Load all three models model_1 = load_file("merged_model.safetensors") model_2 = load_file("merged_model0.safetensors") model_3 = load_file("merged_model2.safetensors") # Combine the models into a single dictionary combined_model = {**model_1, **model_2, **model_3} # Save the combined model as flowgram.safetensors save_file(combined_model, "flowgram.safetensors") print("Successfully merged the models into flowgram.safetensors")