Nodes/SDVN_Comfy_node/πŸ“Š IPAdapter weight
ComfyUI Node

πŸ“Š IPAdapter weight

Build the per-block weight string without counting layers

By StableDiffusionVNΒ·Created 2 years agoΒ·Updated 29 days agoΒ· 118
πŸ“Š IPAdapter weight
    • STRING
    β—„SDXLfalseβ–Ί
    β—„Weight0:1,1:1,1,1,4-15:1β–Ί

    First thing to know, because the name is misleading: this node does not apply IP-Adapter to anything. It doesn't touch your model. All it does is build a per-block weight string that you then feed into an actual IP-Adapter node. It's a helper - a little string generator - for the advanced trick of weighting IP-Adapter differently across the model's layers instead of applying it at one flat strength. The pack's own note is terse: "IPAdapter weight - use the same syntax as the merge."

    If you just want IP-Adapter at a single strength, you don't need this at all - set the strength on the IP-Adapter node and move on. This is for the case where you want fine control over which layers the reference influences.

    How it works

    Quick background: IP-Adapter does image prompting by injecting a reference image's features through its own cross-attention path across multiple blocks of the model. Weighting those blocks differently lets you bias the effect - roughly, some blocks lean toward composition and others toward style, so per-block weights let you take (say) the style of a reference without dragging its whole layout along.

    Writing that full per-layer weight list by hand is tedious. This node uses the pack's compact merge-block syntax - things like 0:1, 1:1, 4-15:1, where you can name individual blocks, give ranges, or a bare list, and any block you don't mention inherits the last value you set. It expands that shorthand into the complete weight string the IP-Adapter node wants. The SDXL toggle switches the block count/layout between SD 1.5 and SDXL, since they don't have the same number of blocks.

    The inputs and outputs that matter

    • Weight (STRING, default 0:1,1:1,1,1,4-15:1) - your block weights in the compact syntax.
    • SDXL (BOOLEAN, default false) - flip to true for SDXL's block layout; leave false for SD 1.5.

    The single output is STRING - wire it into the weight/embeds field of an IP-Adapter node from cubiq's ComfyUI_IPAdapter_plus, which the pack lists as a required companion.

    How to install it

    Comes with the SDVN pack. ComfyUI Manager, search SDVN_Comfy_node; or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/StableDiffusionVN/SDVN_Comfy_node
    pip install -r custom_nodes/SDVN_Comfy_node/requirements.txt
    

    from the ComfyUI root, then restart. To actually use the output you also need cubiq's IPAdapter_plus installed - this node only produces a string for it.

    Common issues & troubleshooting

    It doesn't do anything on its own. Worth repeating: this makes a string, it doesn't apply IP-Adapter. If nothing's happening to your image, that's because you still need an IP-Adapter node consuming this output, with a reference image and the adapter model loaded.

    You need IPAdapter_plus installed. IP-Adapter itself lives in cubiq's node pack (SD 1.5, SDXL, and Kolors - note it does not cover Flux or newer bases, and the pack is in maintenance-only mode upstream). Install it, or there's nothing to feed this string to.

    Wrong block count. If the weights don't line up with your model, check the SDXL toggle - SD 1.5 and SDXL have different numbers of blocks, and a string built for one won't map cleanly onto the other.

    Syntax gotcha. In the merge-style syntax, any block you leave out takes the last value you specified - so a short string can silently set every remaining block. If the effect is bleeding into layers you didn't intend, spell out the ranges explicitly.

    CategoryπŸ“‚ SDVN/πŸ’‘ Creative

    Inputs (2)

    NameTypeDefaultDescription
    SDXLBOOLEANfalseβ€”
    WeightSTRING0:1,1:1,1,1,4-15:1β€”

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGEx: 0-4:1,6:1,1,1 or 0-15:1 or 1,1,1,1,1 or 1:1,5:1,7:1