ComfyUI Node

chx_IPA_XL

Split style from composition with two reference images

By cardenluo·Created 2 years ago·Updated 18 days ago· 309
chx_IPA_XL
  • model
  • image_style
  • image_composition
  • attn_mask
  • image_negative
  • model
  • image
  • mask
preset
weight_style1.00
weight_composition1.00
expand_stylefalse
combine_embedsaverage
start_at0.000
end_at1.000
embeds_scaling

Every other IP-Adapter node in this pack takes one reference image and applies it as one signal. chx_IPA_XL takes two, and - this is the actually useful part - treats them differently: one image drives style (color, texture, mood), the other drives composition (layout, pose, arrangement), each with its own weight. It's built for SDXL specifically, which is why it's the "XL" node in the family rather than a variant folded into the basic one.

Why you'd want style and composition split apart

Plain IP-Adapter conditions on "what does this image look like" as one blended signal, which is fine until you want, say, the color palette and brushwork of painting A applied to the pose and framing of photo B. Cramming both into a single reference forces a compromise between the two. Splitting them into image_style and image_composition - each with its own preset-driven weight - lets you dial them independently: crank style up for a strong stylistic transfer while keeping composition low so it barely nudges the layout, or the reverse.

Same underlying mechanism as the rest of the chx_IPA_* family (an image encoder plus adapter, patched into the model's attention so your text prompt still works alongside it), and the same architecture ceiling applies: this is an SD1.5/SDXL/Kolors-era tool. Nothing in the IP-Adapter lineage - including this two-image variant - runs on Flux.

The inputs and outputs that matter

  • model - your SDXL (or SDXL-finetune) checkpoint.
  • image_style / image_composition - the two references, doing the two different jobs described above.
  • preset - the same six-option IP-Adapter preset list as chx_IPA_basic (STANDARD, LIGHT, VIT-G, PLUS, PLUS FACE, FULL FACE), applied to both images.
  • weight_style / weight_composition (each default 1, -1 to 5) - independent strength dials for the two signals. This is the pair you'll actually spend time tuning; everything else is closer to defaults-are-fine.
  • expand_style (boolean, default off) - a toggle for whether the style signal's influence expands beyond its usual scope; leave off unless you have a specific reason to widen it.
  • combine_embeds (default average here, unlike the other IPA nodes which default elsewhere) - how the two embeddings get combined internally.
  • start_at / end_at - step range to apply both signals over.
  • embeds_scaling - the same V-only/K+V attention scaling choice as the rest of the family.
  • Optional attn_mask, image_negative.

Outputs: model, image, mask.

Installing it

Through ComfyUI Manager: search ComfyUI-Apt_Preset, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git

then install.bat on Windows for dependencies, restart. Needs the same IP-Adapter model files and CLIP vision encoder as the other IPA nodes, specifically SDXL-tier ones (ViT-bigG-14-based) - this node isn't the place to point at SD1.5-only files.

Common issues

Composition doesn't follow the composition image at all. Check weight_composition first - it's a fully independent dial from weight_style, so it's easy to tune one and forget the other is sitting near zero or getting drowned out by a much stronger style weight.

The two signals fight each other. This is somewhat inherent to asking one model to honor two different image references at once - if style and composition images are very different in subject matter, expect some compromise regardless of weight tuning. Push start_at/end_at narrower (apply both only during early steps, where composition forms) if late-stage style bleed is overriding structure you wanted from the composition image.

You only have one reference image. If you don't actually need the style/composition split, use chx_IPA_basic instead - it's the simpler node for the common single-reference case, and there's no benefit to running the two-image node with a duplicate image in both slots.

CategoryApt_Preset/chx_tool/chx_IPA

Inputs (13)

NameTypeDefaultDescription
modelMODEL
image_styleIMAGE
image_compositionIMAGE
presetCOMBO6 options: STANDARD (medium strength), LIGHT - SD1.5 only (low strength), VIT-G (medium strength), PLUS (high strength), PLUS FACE (portraits), FULL FACE - SD1.5 only (portraits stronger)
weight_styleFLOAT1.00-1–5
weight_compositionFLOAT1.00-1–5
expand_styleBOOLEANfalse
combine_embedsCOMBOaverage5 options: concat, add, subtract, average, norm average
start_atFLOAT0.0000–1
end_atFLOAT1.0000–1
embeds_scalingCOMBO4 options: V only, K+V, K+V w/ C penalty, K+mean(V) w/ C penalty
attn_maskoptMASK
image_negativeoptIMAGE

Outputs (3)

NameTypeDescription
modelMODEL
imageIMAGE
maskMASK