Nodes/ComfyUI_fsdymy/IPAdapter Layer Weight (fsdymy)
ComfyUI Node

IPAdapter Layer Weight (fsdymy)

Per-layer IPAdapter weights, without hand-typing the string

By fsdymy1024·Created 2 years ago·Updated 2 years ago· 12
IPAdapter Layer Weight (fsdymy)
    • ipadapter_layer_weight
    index_001.0
    index_011.0
    index_021.0
    index_031.0
    index_041.0
    index_051.0
    index_061.0
    index_071.0
    index_081.0
    index_091.0
    index_101.0
    index_111.0

    IP-Adapter injects image conditioning through its own cross-attention path - a 22M-parameter adapter that adds the reference image's meaning alongside your text prompt without touching the text path. The community has long known that one global strength number is a blunt instrument: the KB's notes on IP-Adapter point out that running it at full strength across all sampling steps measurably softens detail. The finer-grained fix is per-layer weighting, where you tell the adapter to lean harder on some attention layers than others. That's the job this node exists for.

    What it does

    In cubiq's ComfyUI_IPAdapter_plus (the de facto IP-Adapter node pack), the dev-category IPAdapterMS node takes a layer_weights string that controls individual attention layers. Cubiq's code parses it like this: split on commas, then each index: value pair becomes a per-layer multiplier. Hand-typing that string means remembering the format and counting indices. This node is a GUI for it: twelve sliders in, the correctly formatted string out.

    Mechanically it's trivial - the source builds:

    0: 1.0, 1: 1.0, 2: 1.0, 3: 1.0, 4: 1.0, 5: 1.0, 6: 1.0, 7: 1.0, 8: 1.0, 9: 1.0, 10: 1.0, 11: 1.0
    

    Each index_00 through index_11 input is a FLOAT from 0.0 to 5.0 in 0.1 steps, default 1.0. Zero kills that layer's contribution; values above 1 amplify it. The single output, ipadapter_layer_weight (STRING), feeds directly into the layer_weights input on IPAdapterMS. In cubiq's code each per-layer value is multiplied by the node's main weight, so treat these as fine-tuning around your global strength.

    Where it wires in

    This is the part people miss: the target is IPAdapterMS, which sits in the ipadapter/dev category of ComfyUI_IPAdapter_plus - not IPAdapterAdvanced, which has no layer_weights input at all. So you need the cubiq pack installed, you need to reach into its dev section, and then this output plugs into that one input. If you wire it into any other IP-Adapter node, nothing happens.

    Honest sizing

    One caveat worth knowing before you get excited: 12 sliders don't cover every model. The SDXL variants of IP-Adapter have 11 attention layers (indices 0–10), so this node covers them all. The SD 1.5 variants have 16 (0–15), and this node stops at index 11 - the last four SD 1.5 layers aren't settable here, so they fall back to whatever the global weight produces. And in practice, the mapping from "which attention layer" to "what that does to your image" is opaque; nobody tunes these by understanding the index table, they tune by ear. It's fiddly, it's dev-category, and it's squarely for people who've already got an IP-Adapter workflow they love and want the last 10% of control.

    Install

    Same pack as the siblings: ComfyUI Manager → "ComfyUI_fsdymy", or

    cd ComfyUI/custom_nodes
    git clone https://github.com/fsdymy1024/ComfyUI_fsdymy
    

    then restart, and grab ComfyUI_IPAdapter_plus too if you haven't. No models to download for the node itself - the adapter weights are loaded by the cubiq pack as usual.

    If you're just starting with IP-Adapter, skip this node and use a single weight slider until you can articulate what's wrong with a one-number approach. If you're already there - strong early layers for composition, weaker late ones to protect detail - this is the shortest path from slider to string.

    Categoryfsdymy/ipadapter

    Inputs (12)

    NameTypeDefaultDescription
    index_00FLOAT1.00–5
    index_01FLOAT1.00–5
    index_02FLOAT1.00–5
    index_03FLOAT1.00–5
    index_04FLOAT1.00–5
    index_05FLOAT1.00–5
    index_06FLOAT1.00–5
    index_07FLOAT1.00–5
    index_08FLOAT1.00–5
    index_09FLOAT1.00–5
    index_10FLOAT1.00–5
    index_11FLOAT1.00–5

    Outputs (1)

    NameTypeDescription
    ipadapter_layer_weightSTRING