Nodes/tri3d-comfyui-nodes/Stack images for cat vton with flux v5.1.0
ComfyUI Node

Stack images for cat vton with flux v5.1.0

Two images, one canvas

By TRI3D-LC·Created 3 years ago·Updated about a year ago· 27
Stack images for cat vton with flux v5.1.0
  • image_L
  • image_R
  • IMAGE

If you've seen the CAT-VTON trick for virtual try-on, you know the setup: instead of giving Flux a person and a garment separately, you concatenate them - the model/mannequin image on the left, the garment on the right - into one square canvas, and feed that to a Flux LoRA that's been trained to understand the two-halves layout. H Stack Images is that prep step, packaged as a node. It takes image_L and image_R, builds a square white canvas sized to fit both, centers each vertically, and lays them side by side. What comes out is exactly the conditioning input the cat-vton-with-flux workflows expect.

The mechanism is unglamorous and correct. It computes a canvas dimension large enough for the taller of the two images and the combined widths, pads with white, vertically centers each half, and pastes. If your images are wildly different sizes, it still produces a valid square - which is more than some competing stitch nodes can claim. It's the node named for its output format, and the format is the whole point.

Inputs

  • image_L - the left half. In the try-on layout this is the person or mannequin.
  • image_R - the right half. The garment on a hanger or flat lay.

Output

One IMAGE: the square, side-by-side composite. From here it feeds the Flux LoRA / inpainting stage, and after generation you'd slice it back into halves (this pack has a composite splitter for exactly that).

Why this layout exists

The reason CAT-VTON-style pipelines concatenate instead of conditioning separately is that it lets the model see the garment and the body in one spatial context - the model learns "the left half is the person, the right half is what they should be wearing." It's a genuinely effective hack, and it's why a whole family of flux try-on LoRAs refuse to work unless you hand them the stitched square. If you've loaded such a workflow and the result looked like a hallucinated mess, this node (or its equivalent) is the missing input-side piece.

Install

Same as every node in this pack:

cd ComfyUI/custom_nodes
git clone https://github.com/TRI3D-LC/tri3d-comfyui-nodes
# restart ComfyUI

Or ComfyUI Manager, search "tri3d." Folder name must stay tri3d-comfyui-nodes. Torch tensor operations only - no models, no extra deps, runs instantly even on CPU.

Gotchas

  • It stacks, it does not resize to a fixed grid. Each half keeps its native aspect ratio within the canvas, so if your two inputs are very different in height, the composite gets a lot of empty white - and that white is real pixels the LoRA sees. For best results, feed images of roughly matching proportions.
  • It only takes single images (image_L[0], image_R[0]); a batch comes through as just its first frame. Slice batches yourself if you need per-sample stacking.
  • White is hardcoded as the canvas color. Dark-background garments will read as floating shapes on white, which can confuse a LoRA trained on studio-style shots.

For the one job it exists for - producing a valid CAT-VTON conditioning canvas - it's dead simple and does it right. If your try-on workflow is built around this pack, this node is the door you have to walk through to get anywhere.

CategoryTRI3D

Inputs (2)

NameTypeDefaultDescription
image_LIMAGE
image_RIMAGE

Outputs (1)

NameTypeDescription
IMAGEIMAGE