Nodes/ComfyUI-Apt_Preset/Stack_Kontext_MulImg
ComfyUI Node

Stack_Kontext_MulImg

Feeding a Kontext-Style Editor Up to Three Reference Images

By cardenluoĀ·Created 2 years agoĀ·Updated 21 days agoĀ· 309
Stack_Kontext_MulImg
  • image1
  • image2
  • image3
  • kontext_Mul_img
ā—„reference_latents_method▾►
ā—„guidance3.5ā–ŗ
ā—„posā–ŗ

Where Stack_Kontext_MulCondi splits one image into several masked regions with their own instructions, Stack_Kontext_MulImg goes the other direction: it takes up to three separate reference images plus one instruction, for edits like "put the subject from image1 into the pose from image2, styled like image3." Multi-image reference compositing like that is the current frontier for Kontext-style editors - doing it in a single pass instead of chaining sequential single-image edits together.

Inputs

  • reference_latents_method (required, three choices: offset, index, uxo/uno) - controls how the multiple reference images' latents get combined before being handed to the model. offset and index read as two different ways of stacking or addressing multiple reference latents; uxo/uno points at named multi-subject reference techniques circulating in the Flux community rather than a plain built-in stacking mode. This is genuinely the least-documented field on this node - if you're not sure which to pick, try offset first and compare against index if the composited result looks off.
  • guidance (required, default 3.5, range 0–100) - the standard Flux/Kontext guidance value. 3.5 is what BFL ships as the default across essentially every Kontext workflow; leave it unless you have a specific reason to move it.
  • pos (required, multiline text) - your single edit instruction, applied across however many reference images you've plugged in.
  • image1 / image2 / image3 (optional) - your reference images. Leave any unused slots empty.

Output: kontext_Mul_img, a KONTEXT_MUL_IMAGE object for the pack's own Kontext sampler node.

What it's for

Kontext-family models work by concatenating reference images directly into the model's context rather than injecting an embedding - that in-context design is what lets them hold identity and structure across an edit better than adapter-based tools. Feeding several reference images at once, each contributing something different (subject, pose, style, background), is a natural extension of that mechanism, and it's exactly the direction the Kontext/Qwen-Image-Edit ecosystem has been pushing toward: compositing several sources in one shot instead of doing it as a sequence of single-reference edits, each of which risks drifting from the last.

Setting it up

Keep pos specific about what each image is contributing - "combine the outfit from image1 with the pose of image2" gives the model something concrete to work with; a vague instruction across three references multiplies ambiguity rather than resolving it. Start with two reference images before adding a third; every additional image is another thing the model has to correctly attribute in the output.

Install

ComfyUI Manager: search "ComfyUI-Apt_Preset," install, restart. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git, then restart ComfyUI. Its install.bat dependency installer is Windows-only - on Linux or a cloud instance, open it to see what it lists and pip-install those packages, or let ComfyUI Manager's "install missing nodes" catch it on first load.

Troubleshooting

If your result looks like it's ignoring one of the reference images entirely, try switching reference_latents_method - the schema doesn't document what each option optimizes for, so this is genuinely trial and error rather than a settled recommendation.

This pack has real, reported import failures - a comfyui subreddit thread shows (IMPORT FAILED): ...ComfyUI-Apt_Preset in someone's console. ComfyUI Manager's "install missing custom nodes" fixed it there, as did manually re-cloning the repo and restarting.

Gap worth flagging: the exact mechanics behind offset / index / uxo/uno aren't documented anywhere we could verify - if you figure out the practical difference between them, that's genuinely useful information nobody's written down yet.

CategoryApt_Preset/stack/😺backup

Inputs (6)

NameTypeDefaultDescription
reference_latents_methodCOMBO3 options: offset, index, uxo/uno
guidanceFLOAT3.50–100—
posSTRING—
image1optIMAGE—
image2optIMAGE—
image3optIMAGE—

Outputs (1)

NameTypeDescription
kontext_Mul_imgKONTEXT_MUL_IMAGE—