Nodes/comfy-mecha-utils/Mecha Utils Blocks
ComfyUI Node

Mecha Utils Blocks

Block-weight model merging with sliders, not JSON spaghetti

By jupo-ai·Created 2 years ago·Updated 4 months ago· 8
Mecha Utils Blocks
    • blocks_recipe
    values
    options
    model_configauto
    default0.00

    The classic way to mix two checkpoints is a plain weighted sum - one alpha slider, whole model at once. The power-user move is block weighting: pulling the input blocks from model A, the output blocks from model B, the text encoder from whichever one you trust. It's how a lot of the good merged checkpoints on CivitAI get made. The problem has always been the ergonomics - in comfy-mecha you'd hand-roll the block weights as a dictionary, and in SuperMerger you're editing a wall of text.

    This node is the good-ergonomics version. It's the flagship of jupo's comfy-mecha-utils pack: a GUI where you drag sliders for each block group, and it emits a MECHA_RECIPE that plugs straight into the alpha input of comfy-mecha's WeightedSum. If you merge often, this is the one you'll reach for.

    How it works

    The node is really two halves. There's a custom DOM widget that opens a block-editing dialog: you pick a Model Type (SD1.5, SDXL, or Anima), drag sliders for each block group, and the layout changes per architecture. SD1.5 shows INPUT 00–11, MIDDLE, OUTPUT 00–11, plus a TE slider for the CLIP; SDXL swaps in TE1 and TE2 (it has two text encoders); Anima gets a BASE group, an LLM Adapter group, and 28 diffusion block sliders in two columns. You can save multiple named rows and organize them with separator rows - handy when you're A/B testing a few ratios.

    The dialog serializes all of that into a hidden JSON string, which the backend parses to find the active row and expand each block prefix into the real sd-mecha tensor keys (it even handles the cond_stage_model / conditioner.embedders prefix remapping for CLIP on SD1.5 and SDXL). The result is a literal param recipe combined with your default value.

    The inputs that matter

    • model_config - auto is the right choice in almost every case. It maps your chosen Model Type to sd-mecha's config id: SD1.5 → sd1-ldm, SDXL → sdxl-sgm, Anima → anima-comfyui. Note this isn't full auto-detection from file contents - it trusts the Model Type you picked, so pick it correctly.
    • default - the value applied to any key your slider groups didn't touch. 0.0 means "keep the base model everywhere I didn't explicitly set," which is what you usually want. Set 1.0 and the unset parts pull fully from the merge target instead - the README explains this exact swap and it's worth internalizing before you wonder why a merge "ignored" your sliders.
    • values and options - hidden strings written by the dialog; you never touch them directly.

    Output is blocks_recipe (MECHA_RECIPE), which feeds comfy-mecha's WeightedSum alpha input (or a similar recipe input), and from there into Merger to produce an actual model.

    Installing it

    Same story as the rest of the pack: install comfy-mecha first (this node's output is meaningless without it), then:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jupo-ai/comfy-mecha-utils
    

    Restart, or use ComfyUI Manager → "comfy-mecha-utils", which handles the sd-mecha pip dependency for you. Nothing to download, no API key.

    Common issues

    The most common failure is feeding the recipe to the wrong node - MECHA_RECIPE only plugs into comfy-mecha's recipe inputs, not into a model loader. If model_config is on auto and you get an "Unsupported ... model type" error, the active row's Model Type is off, or the row is a separator being mistaken for a config. And if a merge looks like it ignored your slider work entirely, check default - with default = 1.0 the blocks you didn't touch are pulling from the merge target, which reads as "nothing moved" if you expected base.

    Categoryjupo/MechaUtils

    Inputs (4)

    NameTypeDefaultDescription
    valuesoptSTRING
    optionsoptSTRING
    model_configoptCOMBOauto4 options: auto, sd1-ldm, sdxl-sgm, anima-comfyui
    defaultoptFLOAT0.00-18446744073709550000–18446744073709550000

    Outputs (1)

    NameTypeDescription
    blocks_recipeMECHA_RECIPE