Nodes/ComfyUI_yanc/😼> Layer Weights (for IPAMS)
ComfyUI Node

😼> Layer Weights (for IPAMS)

Sliders instead of hand-typing an IPAdapter layer string

By ALatentPlaceΒ·Created 2 years agoΒ·Updated 2 years agoΒ· 80
😼> Layer Weights (for IPAMS)
    • layer_weights
    • help
    β—„layer_00.0β–Ί
    β—„layer_10.0β–Ί
    β—„layer_20.0β–Ί
    β—„layer_30.0β–Ί
    β—„layer_40.0β–Ί
    β—„layer_50.0β–Ί
    β—„layer_60.0β–Ί
    β—„layer_70.0β–Ί
    β—„layer_80.0β–Ί
    β—„layer_90.0β–Ί
    β—„layer_100.0β–Ί
    β—„layer_110.0β–Ί

    If you've never touched IPAdapter's "Mad Scientist" node, this one will look pointless. If you have, you already know the pain it's fixing: Mad Scientist (part of cubiq's ComfyUI_IPAdapter_plus, a separate pack you need installed) takes a layer_weights parameter as a raw comma-separated string, and typing that string by hand from memory is exactly as fun as it sounds. This node is a form. Twelve sliders, one per layer, and it hands you back the string Mad Scientist actually wants.

    How it works

    IPAdapter doesn't inject your reference image into the model all at once - it pushes through the cross-attention layers at different depths of the UNet, and each of those layers ends up influencing a slightly different aspect of the result. Mad Scientist exposes that as a per-layer weight so you can, say, keep the early layers low to preserve your prompt's composition while cranking the later ones for texture and style transfer from the reference. It's a real, if fiddly, technique - I found a thread where someone was using the mad-scientist layer controls specifically to try to isolate body shape from an IPAdapter reference without also dragging the clothing along for the ride. It half-worked, which is honestly about typical for this kind of surgery: per-layer weighting gives you a knob, not a scalpel.

    This node doesn't run any of that logic itself - it's pure plumbing. Twelve layer_N float sliders in, one formatted string out, so you can drag sliders and watch results instead of hand-editing text and guessing at syntax.

    The inputs and outputs that matter

    • layer_0 through layer_11 - twelve independent FLOAT sliders, each 0–10 in steps of 0.1, all defaulting to 0. There's no tooltip mapping index to UNet block, so treat this as "layer 0 is the first one Mad Scientist lists" and confirm against its own UI rather than guessing blind.
    • layer_weights (STRING) - the packed string. This is the only output that matters; wire it straight into Mad Scientist's layer_weights input.
    • help (STRING) - a second output with explanatory text baked in. It doesn't need to go anywhere for the pipeline to work; pipe it into a Show Text / Preview Text node if you want to actually read it.

    How to install it

    Through ComfyUI Manager: search "yanc" or "ComfyUI_yanc" and install. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ALatentPlace/ComfyUI_yanc
    

    Restart ComfyUI afterward. No extra Python dependencies or model downloads for this node specifically - it's string formatting, nothing more. What it does need is ComfyUI_IPAdapter_plus installed separately, since that's where the Mad Scientist node this feeds actually lives. Without it, you'll build a perfectly valid string that has nowhere to plug in.

    Common issues & troubleshooting

    All twelve sliders default to 0. That means IPAdapter's influence through those layers is effectively zeroed out until you raise something - if Mad Scientist seems to be ignoring your reference image entirely, check that you haven't just wired in an all-zero layer string.

    You built the string but nothing changed. Double-check the output actually lands on Mad Scientist's layer_weights input and not some other field - this node produces one specific string format for one specific consumer, it isn't a general-purpose color/weight utility.

    You don't have Mad Scientist installed. This node is useless on its own; if you searched for it hoping it was IPAdapter weighting, go grab ComfyUI_IPAdapter_plus first.

    Per-layer weighting won't cleanly separate concepts. Don't expect to dial in "just the pose" or "just the color palette" with surgical precision - real-world reports (including the body-shape example above) describe it as a genuine improvement over uniform weighting, not a perfect isolation tool. Treat it as a fine-tuning knob on top of a decent base IPAdapter setup, not a fix for a fundamentally wrong reference image.

    CategoryYANC/😼 Experimental

    Inputs (12)

    NameTypeDefaultDescription
    layer_0FLOAT0.00–10β€”
    layer_1FLOAT0.00–10β€”
    layer_2FLOAT0.00–10β€”
    layer_3FLOAT0.00–10β€”
    layer_4FLOAT0.00–10β€”
    layer_5FLOAT0.00–10β€”
    layer_6FLOAT0.00–10β€”
    layer_7FLOAT0.00–10β€”
    layer_8FLOAT0.00–10β€”
    layer_9FLOAT0.00–10β€”
    layer_10FLOAT0.00–10β€”
    layer_11FLOAT0.00–10β€”

    Outputs (2)

    NameTypeDescription
    layer_weightsSTRINGβ€”
    helpSTRINGβ€”