Image IC Advanced
The in-context combiner with pixel-level control — overlay, XY placement, and the main image on its own
- first_image
- second_image
- first_mask
- second_mask
- IMAGE
- MASK
- FIRST_MASK
- SECOND_MASK
- MAIN_IMAGE
- first_size
- second_size
ImageICAdvanced is the grown-up version of the pack's ImageIC: same in-context-LoRA / Fill+Redux combining idea, but with the positioning knobs you actually need when "side by side" isn't good enough. It adds an overlay combine mode, precise percentage XY placement, and - the useful one - a separate MAIN_IMAGE output that gives you the reference image alone at the final canvas size, which is exactly what a conditioning stack wants when it needs the reference at full target resolution.
How it works
Like the basic node, it takes two images, anchors the scale on a reference_edge, and builds a shared canvas. The differences are in the placement layer:
- combine_mode: horizontal / vertical - same seam behavior as
ImageIC, but placement along the seam is driven byposition_type(top/center/bottom/left/right) instead of a single position option. - combine_mode: overlay - the new mode. The second image is placed on top of the canvas at
x_position/y_position, given as percentages of the available space (50,50 = center). This is the mode for "put a small subject over a scene," or for in-context work where the reference shouldn't sit flush against an edge.
After compositing, the result is scaled to final_size (long edge) and, in a separate branch, the main image (whichever reference_edge designates) is extracted, re-scaled to fit the same final canvas while keeping its own aspect ratio, and emitted as MAIN_IMAGE on its own. Masks work the same as the basic node: a combined MASK, separate FIRST_MASK / SECOND_MASK region masks, plus first_size / second_size tuples.
The inputs that matter
- first_image / second_image - the two inputs.
- reference_edge -
image1_width,image1_height,image2_width,image2_height; sets the anchor edge and which image becomes MAIN_IMAGE. - combine_mode -
horizontal,vertical, oroverlay. - position_type - top/center/bottom/left/right, used by the seam modes.
- x_position / y_position - 0–100 percentages, used by overlay mode.
- second_image_scale - extra scale on image 2, 0.1–2.0.
- final_size / background_color - target long edge and canvas filler.
- first_mask / second_mask - optional per-image masks.
Outputs: IMAGE, MASK, FIRST_MASK, SECOND_MASK, MAIN_IMAGE, first_size, second_size.
When you'd pick it over ImageIC
Overlay mode is the headline. In-context partial redraws aren't always "left half / right half" - sometimes the reference belongs floating over a scene, or you want a subject composited at an exact spot, and that's percentage XY placement. And the standalone MAIN_IMAGE output saves you a graph branch: when your pipeline needs the reference at final resolution as well as the combined canvas (common in ICLora conditioning), this node hands you both without you re-scaling anything yourself. If you're just doing simple side-by-side outpainting, the basic node is enough - but the moment you need placement control, this is the one.
Installing it
Part of ComfyUI-YCNodes. ComfyUI Manager → search ComfyUI-YCNodes → install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/yichengup/ComfyUI-YCNodes
Restart, then look under YCNode/Image. Uses opencv-python (as cv2) plus numpy/torch - the pack's requirements.txt covers it.
Gotchas
A few sharp edges. The node takes the first frame of each input batch - single-image oriented, so don't feed it frame batches. x_position/y_position only apply in overlay mode; in the seam modes they're ignored in favor of position_type, and mixing them up produces "why didn't my position do anything" moments. The overlay canvas can get large, and the node does a full-res composite plus a separate main-image render, so on big inputs it's heavier than it looks. And like its sibling, the masks are region masks ("which input owns this pixel"), not transparency weights - treat them as selections, not alpha.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| first_image | IMAGE | — | |
| second_image | IMAGE | — | |
| reference_edge | COMBO | image1_width | 4 options: image1_width, image1_height, image2_width, image2_height |
| combine_mode | COMBO | horizontal | 3 options: horizontal, vertical, overlay |
| second_image_scale | FLOAT | 1.00.1–2 | — |
| position_type | COMBO | center | 5 options: top, center, bottom, left, right |
| x_position | FLOAT | 50.00–100 | — |
| y_position | FLOAT | 50.00–100 | — |
| final_size | INT | 102464–8192 | — |
| background_color | STRING | #FFFFFF | — |
| first_maskopt | MASK | — | |
| second_maskopt | MASK | — |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |
| FIRST_MASK | MASK | — |
| SECOND_MASK | MASK | — |
| MAIN_IMAGE | IMAGE | — |
| first_size | TUPLE | — |
| second_size | TUPLE | — |