Nodes/ComfyUI Easy Use/Make Image For ICLora
ComfyUI Node Runs on cloud

Make Image For ICLora

Stitch a reference + target for in-context LoRA repainting

By yolain·Created 3 years ago·Updated 8 days ago· 2,633
Make Image For ICLora
  • image_1
  • image_2
  • mask_1
  • mask_2
  • image
  • mask
  • context_mask
  • width
  • height
  • x
  • y
directionleft-right
pixels0
methodauto

In-context LoRAs (the "IC-LoRA" technique that took off on Flux) work by a slightly weird trick: instead of feeding the model one image, you feed it two glued side by side - a reference on one panel and the region to repaint on the other - and the model fills the second panel in the context of the first. easy makeImageForICLora is the node that builds that stitched canvas and, crucially, the masks and coordinates that go with it, so you don't have to assemble the diptych and hand-compute the paste-back geometry yourself.

If you've been doing IC-LoRA or in-context editing workflows by manually stitching images and eyeballing masks, this collapses that fiddly setup into a single node. It's a genuine time-saver for a technique whose whole difficulty is in the plumbing, not the prompt.

How it works

You give it one or two images (and optionally their masks). It composites them into a single image - placed left/right or top/bottom - and, because it knows exactly where each panel landed, it also emits the mask that marks the repaint region, a context_mask marking the reference region, and the width/height/x/y numbers describing the layout. Those coordinates are what let you crop the generated result back out of the stitched canvas afterward. The method control handles the annoying case where the two images aren't the same size, normalizing them to a uniform height or width so they line up cleanly.

The inputs and outputs that matter

  • image_1 (required) and image_2 (optional) - the two panels. Typically one is your reference and the other the area to repaint.
  • direction - left-right or top-bottom; how the panels are laid out.
  • method - auto, uniform height, or uniform width. When the two images differ in size, this decides how they get matched up. auto picks for you; force one if the automatic choice crops or stretches badly.
  • pixels - spacing/padding used when combining.
  • Optional mask_1 / mask_2 if you're supplying your own masks.

Outputs are the full kit: image (the stitched canvas), mask and context_mask (feed the inpaint/conditioning), and width / height / x / y (the geometry to crop the result back out). Wire the image+mask into your sampler/inpaint stage, and keep the coordinates for the un-stitch afterward.

How to install it

Part of ComfyUI-Easy-Use. ComfyUI Manager: search ComfyUI-Easy-Use, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/yolain/ComfyUI-Easy-Use

then install.bat (Windows) or pip install -r ComfyUI-Easy-Use/requirements.txt, and restart. No models for this node itself - but the technique needs an in-context LoRA loaded on a compatible base model (typically Flux), which you download separately.

Common issues & troubleshooting

Seams where the two images meet. If the panels have very different sizes, the join can look off. This is exactly what method is for - try uniform height or uniform width explicitly instead of auto. (The pack's changelog specifically fixed a stitching bug that hit when both images had the same height, so update Easy-Use if you're on an older build and seeing artifacts.)

Masks in the wrong place. The mask marks the repaint panel and context_mask the reference panel - mixing them up sends the model to repaint the wrong half. Preview both masks before sampling to confirm they cover what you intend.

Forgetting the coordinates. The whole point of the width/height/x/y outputs is cropping the generated panel back out of the stitched result. Skip them and you'll be left with the two-panel image and no clean way to extract just the new part. Route them into a crop node.

Nothing "in-context" happens. This node only builds the canvas. The actual in-context behavior comes from the IC-LoRA on your model - if the output ignores the reference, check that the LoRA is loaded and that you're on a base it was trained for.

CategoryEasyUse/Image

Inputs (7)

NameTypeDefaultDescription
image_1IMAGE
directionCOMBOleft-right2 options: top-bottom, left-right
pixelsINT00–16384The pixel of the output image is not set when it is 0
methodCOMBOauto3 options: uniform height, uniform width, auto
image_2optIMAGE
mask_1optMASK
mask_2optMASK

Outputs (7)

NameTypeDescription
imageIMAGE
maskMASK
context_maskMASK
widthINT
heightINT
xINT
yINT