Nodes/Mecha Merge Node Pack/SD1-KOHYA Components Params
ComfyUI Node

SD1-KOHYA Components Params

Per-part weights for SD1 in kohya's key layout — the LoRA merger's param node

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

    SD1-KOHYA Components Params (class SD1-KOHYA Defaults Hyper) is the per-component weight node for SD1 models that use kohya's key naming. Where the plain SD1-LDM Components Params covers classic LDM checkpoints, this one targets kohya-style models - the layout produced by kohya's training scripts (lora_te_* / lora_unet_* style prefixes) and by any checkpoint that keeps those names. Its three inputs are clip_l, diffuser, and vae.

    If you've spent any time training or merging LoRAs for SD1, you already speak kohya. kohya's format is the lingua franca of the SD1 fine-tune world - most LoRA trainers (kohya_ss, and effectively the whole ecosystem) write it, and it's what "merge a LoRA into a checkpoint" usually means in mecha. This node gives you per-component control over that layout, which is exactly the control you want when a merge is a text-encoder change, a UNet change, or a VAE swap.

    How it works

    Same mechanism as its LDM sibling: sd-mecha's config for sd1-kohya defines which keys belong to which component, and the node turns each float input into a per-component scalar recipe, OR'd into one param recipe. When wired into a merge method's alpha/weight input, the engine applies the right weight per key. The differences are purely in the key layout - this config covers the te/unet naming instead of cond_stage_model/model.diffusion_model - so you feed it recipes in kohya's merge space.

    The inputs that matter:

    • clip_l - the text encoder part (lora_te_* / text-encoder keys). Weight 1 = fully merge the CLIP part; 0 = leave it.
    • diffuser - the UNet part (lora_unet_* / UNet keys). Usually the bulk of a fine-tune's effect.
    • vae - the VAE part, where present in kohya-layout checkpoints.
    • recipe (output, param space) - the combined per-component param for the sd1-kohya config.

    The classic use: merging a LoRA (or a merged checkpoint) onto an SD1 base and wanting the text encoder effect at half strength while the UNet goes full - or excluding the VAE entirely. Two numbers and the merge respects them per part.

    Install

    This is part of the Mecha Merge Node Pack (ljleb/comfy-mecha):

    • ComfyUI Manager → Install Custom Nodes → 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; the node is under mecha. The only dependency is sd-mecha==1.1.7; nothing here downloads models.

    Common issues

    • Config must match the recipe. If you wire kohya-config params into an LDM-space merge, the components won't line up and the recipe validation will complain. Use this node only with kohya-layout recipes - mecha's Mecha Model Recipe/Mecha Lora Recipe nodes tell you (or let you convert) which config a file landed in.
    • 0 means "no override," not "skip." As with all the components params nodes, 0 leaves the component at the merge method's default treatment. To truly leave the VAE out of a merge, Omit Component is the honest tool.
    • LoRA merging is the real target here. If you're merging checkpoints, the LDM components node usually suffices; this one shines when you're folding LoRAs into models, where kohya naming is the norm.

    Component params are one of the two big reasons people kept A1111 around (SuperMerger's block weights are the other). This node is the kohya-flavored half of that feature in ComfyUI - and paired with the pack's block-weight nodes, it closes most of the "no equivalent on ComfyUI" gap.

    Categorymecha

    Inputs (3)

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

    Outputs (1)

    NameTypeDescription
    recipeMECHA_RECIPE