Merge Diffusion Tool is an open-source solution developed by EnhanceAI.art, providing seamless ways to blend LoRA models, integrate LoRA into checkpoints, and merge Stable Diffusion checkpoints. Enhance your AI workflows with this powerful merging tool, designed to support a wide range of diffusion models like Flux Dev, Flux Schnell, Stable Diffusion 1.5, SD2, SD3, and SDXL.
Discover more advanced AI tools at EnhanceAI.art.
- Merge Two LoRA Models with adjustable blending ratios.
- Integrate LoRA into a Checkpoint for enhanced model performance.
- Merge Two Checkpoints using custom blend ratios.
- Full support for
.safetensors
format, ensuring efficient and safe handling.
- Streamline your AI model merging process.
- Built with flexibility to cater to diverse AI model formats.
- Completely open-source with community support via Discord.
To set up the tool, follow these steps:
-
Clone the repository:
git clone https://github.com/itspranavajay/Merge-Diffusion-Tool.git cd merge-diffusion-tool
-
Install the required dependencies:
pip install -r requirements.txt
- Python 3.8+
- PyTorch for deep learning operations.
- Safetensors library for model file handling.
The Merge Diffusion Tool provides three main operations:
- Merge Two LoRA Models
- Merge LoRA into a Checkpoint
- Merge Two Checkpoints
Argument | Description |
---|---|
--operation |
Select operation: merge_loras , merge_lora_checkpoint , merge_checkpoints |
--model1 |
Path to the first model file. |
--model2 |
Path to the second model file (optional for LoRA into checkpoint). |
--output |
Output path for the merged model. |
--alpha |
Blend ratio for merging models (default: 0.5). |
--merge_weight |
Weight for merging LoRA into checkpoint (default: 0.5). |
python main.py --operation merge_loras --model1 lora1.safetensors --model2 lora2.safetensors --output output_lora.safetensors --alpha 0.7
This command merges lora1.safetensors
and lora2.safetensors
, with 70% contribution from lora1
.
python main.py --operation merge_lora_checkpoint --model1 lora_model.safetensors --model2 checkpoint_model.safetensors --output output_checkpoint.safetensors --merge_weight 0.6
In this example, the LoRA model merges into the checkpoint with 60% influence.
python main.py --operation merge_checkpoints --model1 checkpoint1.safetensors --model2 checkpoint2.safetensors --output output_checkpoint.safetensors --alpha 0.5
Merges both checkpoint models in a 50-50 blend.
.safetensors
: Ensures safe, optimized storage and handling of AI models.
👏 If you find this tool helpful, please consider supporting the development by checking out our pricing plans at enhanceai.art/pricing. By purchasing any plan, not only will you be supporting future open-source projects like this, but you'll also unlock many exclusive AI features that will greatly enhance yourself AI workflows!
For assistance, join our Discord server to connect with the community and developers.
We welcome contributions! Feel free to open issues, submit pull requests, or suggest features that would improve this tool. All contributions are highly appreciated.