Nodes/Mecha Merge Node Pack/SDXL-KOHYA_LYCORIS_LORA Components Params
ComfyUI Node

SDXL-KOHYA_LYCORIS_LORA Components Params

Per-component weights for kohya checkpoints with LyCORIS LoRAs

By ljleb·Created 3 years ago·Updated about a month ago· 101
SDXL-KOHYA_LYCORIS_LORA Components Params
    • recipe
    vae0.00
    clip_l0.00
    clip_g0.00
    diffuser0.00

    LoRAs don't all speak the same language. The standard kohya lora_unet_* naming is one dialect; LyCORIS networks - LoCon, LoHa, and friends from KohakuBlueleaf's LyCORIS library - use a different set of keys. If you want to merge a kohya-style SDXL checkpoint with a LyCORIS-trained LoRA in comfy-mecha, the SDXL-KOHYA_LYCORIS_LORA Components Params node is the param node built for that exact combination.

    Name breakdown: SDXL-KOHYA = kohya-layout SDXL checkpoint, LYCORIS_LORA = LyCORIS-layout LoRA. It's the config that keeps both key families consistent inside one merge recipe, so you don't have to hand-map keys.

    Its inputs:

    • diffuser - UNet weight
    • clip_l, clip_g - the two SDXL text encoders
    • vae - autoencoder weight

    Output is one MECHA_RECIPE of per-component weights. Wire it into a merge method's (delta|param|weight) input - for LoRA-on-checkpoint work that's usually Add Difference, which is mecha's "apply this delta to a base" operation. Zero means "don't touch that component."

    How it works

    Identical to its siblings: each float becomes a literal per-key weight restricted to one component of the sdxl-kohya + LyCORIS-LoRA config, then combined into a single recipe. Because the config understands both the checkpoint keys and the LyCORIS network keys, a merge spanning both stays in one key universe.

    Install

    Standard pack install: ComfyUI Manager → search "mecha" → Mecha Merge Node Pack, or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ljleb/comfy-mecha.git
    pip install -r comfy-mecha/requirements.txt
    

    Restart ComfyUI after. Dependency is just sd-mecha; no models to download.

    Gotchas

    The LoRA clause must match how the LoRA was trained. LyCORIS LoRAs (.safetensors with lora_unet_* keys plus LyCORIS-specific structure) → this node. Plain kohya LoRAs → SDXL-KOHYA_KOHYA_LORA. Mixing them up is the classic "the LoRA silently contributes nothing" failure, and the pack naming is your map: pick the variant whose clauses match your files, and the key guessing disappears.

    Categorymecha

    Inputs (4)

    NameTypeDefaultDescription
    vaeFLOAT0.00-18446744073709550000–18446744073709550000
    clip_lFLOAT0.00-18446744073709550000–18446744073709550000
    clip_gFLOAT0.00-18446744073709550000–18446744073709550000
    diffuserFLOAT0.00-18446744073709550000–18446744073709550000

    Outputs (1)

    NameTypeDescription
    recipeMECHA_RECIPE