Nodes/ComfyUI_IPAdapter_plus/IPAdapter Style & Composition SDXL
ComfyUI Node Runs on cloud

IPAdapter Style & Composition SDXL

Style from one image, layout from another

By cubiq·Created 3 years ago·Updated about a year ago· 6,086
IPAdapter Style & Composition SDXL
  • model
  • ipadapter
  • image_style
  • image_composition
  • image_negative
  • attn_mask
  • clip_vision
  • MODEL
weight_style1.00
weight_composition1.00
expand_stylefalse
combine_embedsaverage
start_at0.000
end_at1.000
embeds_scaling

This is the node that does the trick everyone wanted IP-Adapter to do: take the style from one reference image and the composition from a completely different one. Two images in, two independent strength dials, one result that borrows the look of A and the layout of B. When it clicks, it's genuinely the coolest thing in the pack.

The reason it can do this comes from how IP-Adapter injects conditioning. The adapter feeds image features into the model's attention layers, and it turns out different layers carry different kinds of information - some govern overall style and palette, others govern spatial arrangement and structure. This node routes your style reference into the style-carrying layers and your composition reference into the composition-carrying ones, so they don't fight. It's the InstantStyle line of thinking taken to its natural conclusion.

One hard constraint up front: this is SDXL only. There's no SD1.5 version. If you're on an SD1.5 checkpoint, this node isn't for you.

Inputs and outputs

The two references are the point: image_style and image_composition, each with its own weight - weight_style and weight_composition (both default 1.0, range −1 to 5). That independence is the feature. Push style hard while keeping composition gentle, or the reverse, until the balance is right. Alongside those:

  • expand_style - a boolean. Off by default; flip it on to push the style influence into more attention layers for a stronger, more pervasive style transfer. Worth trying when the look isn't coming through strongly enough.
  • combine_embeds - defaults to average here (not concat, unlike most nodes in the pack), which suits blending two distinct references.
  • start_at / end_at / embeds_scaling - the usual sampling-window and attention-scaling controls.

The rest - model, ipadapter, and the optional image_negative, attn_mask, clip_vision - behave as they do across the pack. Output is a single patched MODEL into your KSampler.

Getting a good result

The honest bit: this node rewards experimentation and punishes copy-pasted settings. The interaction between weight_style, weight_composition, and expand_style is where all the quality lives, and the right balance depends heavily on your two references. Start both weights around 1.0, generate, then adjust one at a time. If the composition reference is bleeding its style into the output too, that's your signal to lean on the split harder - that's exactly the failure this node is meant to fix, and it means your weights are off, not that the node is broken.

Because it's an SDXL node, make sure you've got the bigG-based CLIP vision encoder loaded - SD1.5's ViT-H won't work here.

Installing the pack

ComfyUI Manager: search "IPAdapter plus" in the Custom Nodes Manager, install, restart. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/cubiq/ComfyUI_IPAdapter_plus, then restart ComfyUI. Drop the SDXL IP-Adapter model in ComfyUI/models/ipadapter and the CLIP-ViT-bigG-14 encoder in ComfyUI/models/clip_vision. If the node won't load, update ComfyUI first. There's a dedicated cubiq video walking through Style & Composition if you want to see the two-reference workflow in motion - the concept is much easier to grasp watching the two dials move than reading about them.

Categoryipadapter/style_composition

Inputs (14)

NameTypeDefaultDescription
modelMODEL
ipadapterIPADAPTER
image_styleIMAGE
image_compositionIMAGE
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
image_negativeoptIMAGE
attn_maskoptMASK
clip_visionoptCLIP_VISION

Outputs (1)

NameTypeDescription
MODELMODEL