Home

Awesome

safetensors-merge-supermario

Combine any two models using a Super Mario merge(DARE) as described in the linked whitepaper.

About

Combine capabilities from multiple models. Works with:

Example

ModelDescriptionImage(same seed)
sd_xl_turboAttempting 1024<img src="assets/before_xl_turbo.png" alt="SDXL turbo attempting to render at 1024" width="256" height="256">
sdxl base 1.0Attempting to use SDTurboScheduler<img src="assets/before_xl.png" alt="SDXL attempting to use SDTurboScheduler" width="256" height="256">
mergedMario merged(DARE)<img src="assets/after.png" alt="Merged model successfully rendering 1024" width="256" height="256">

Usage

python3 merge.py -p [weight drop probability] -lambda [scaling factor] [base_safetensors_model_file_or_folder] [model_to_merge] [output_path]

Example

python3 merge.py -p 0.13 -lambda 3.0 sdxl_base.safetensors sd_xl_turbo_1.0_fp16.safetensors sdxl_merged.safetensors

Note: This also works with arguments reversed.

Models

ComfyUI workflow

Changelog

References