Discover and explore top open-source AI tools and projects—updated daily.
Script for latent diffusion model merging
Top 96.8% on SourcePulse
This repository provides a Python script for merging two latent diffusion models (like Stable Diffusion checkpoints) at a user-defined ratio. It's designed for users of Stable Diffusion, particularly those using Automatic1111's Web UI, to easily combine model weights and create new, hybrid models.
How It Works
The script implements a weighted average of the model weights. Given two models, model0
and model1
, and an alpha value, it calculates the merged model's weights as (1 - alpha) * model0_weights + alpha * model1_weights
. This allows for fine-grained control over the influence of each base model on the resulting merged model.
Quick Start & Requirements
merge.bat
(Windows) or python merge.py model0 model1 --alpha 0.5 --output merged
(command line).torch
library.Highlighted Details
--alpha
) for precise control.--output
).--device "cuda:x"
) for faster processing if sufficient VRAM is available.Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
The script's licensing is unclear, which may impact commercial use. The README does not detail compatibility with different Stable Diffusion versions or other model merging tools.
2 years ago
Inactive