CivArchive
    ← All articles
    Published April 1, 2025by Herrscher_AGGA

    🚀 Merge multiple LoRAs into a single file (4 steps)

    1.1K views10 reactions6 comments on CivitAI38 collected
    lora mergetool guidemerging loramergeloraagga_test

    I refined it again, the conversion from sd to sdxl failed, so I'll keep trying u.u)/

    OPEN IN COLAB: Open In Colab1️⃣ Clone the sd-scripts repository

    !git clone https://github.com/kohya-ss/sd-scripts.git

    2️⃣ Install necessary dependencies

    !pip install torch torchvision
    !cd /content/sd-scripts && pip install -r requirements.txt
    !pip install --upgrade "numpy<2" tensorflow jax albumentations

    3️⃣ Download LoRAs from CivitAI

    PS: If CivitAI blocks the download, please download manually and upload it to Google Drive.

    !wget "URL_DEL_LORA1" -O "/content/LORA1.safetensors"
    !wget "URL_DEL_LORA2" -O "/content/LORA2.safetensors"

    4️⃣ Merge multiple LoRAs into a single file

    !python /content/sd-scripts/networks/sdxl_merge_lora.py \
        --save_precision fp16 \
        --save_to "/content/Lora_fusionado.safetensors" \
        --models \
            "/content/lora1_sdxl.safetensors" \
            "/content/lora2_sdxl.safetensors" \
        --ratios 0.5 0.5

    📌 Change the values ​​0.5 0.5 depending on the weight you want to give to each LoRA.