Latent Composite
Paste one latent onto another before the sampler
- samples_to
- samples_from
- LATENT
Latent Composite is the paste tool for latents: it stamps one latent onto another at a position, with an optional feathered edge. This is the node that makes outpainting work. Generate a picture, crop it down to a strip, paste it onto a blank latent that's twice as big, and let the sampler fill the empty rest - the pasted part stays exactly as it was, the new part gets invented around it. Do that in pixel space and you're decoding, compositing, re-encoding, and praying the seams line up. Do it here and it's one operation on tensors.
The inputs:
- samples_to - the base latent you're pasting onto (the big canvas).
- samples_from - the latent being pasted in (the crop).
- x / y - where to place it, in pixels. The node divides by 8 internally, so the paste lands on the latent grid.
- feather - edge blending, also in pixels (÷8). 0 is a hard edge; larger values ramp the boundary so there's no visible cut line. It only feathers edges that are actually inside the canvas - edges flush against the border stay hard.
Output is a LATENT, same size as samples_to, with samples_from written in.
Where people actually use it
Outpainting is the headline, but the same paste-into-canvas trick powers a whole class of workflows: pasting a face you like back into a re-generated scene, holding a fixed region constant while regenerating the rest, or stacking a small high-quality render onto a bigger composition. The crucial detail is when you sample. A hard paste looks like a rectangle if you decode immediately - but run a second sampling pass over the composite at low denoise, and the model treats the whole thing as a canvas to paint on, blending the seam naturally. The feathered edge just gives the sampler a smoother gradient to work with.
The gotchas that bite
Coordinates are pixel values floored to 8-pixel cells, so work in multiples of 8 or your paste lands a few pixels off where you aimed. The feather is a linear ramp built in latent space, and it only applies where the pasted region is inside the destination - feather against the border does nothing, which is fine for outpainting (you want the seam into empty canvas) but surprising if you're feathering an edge-aligned paste. Also remember samples_from isn't resized: if its latent is bigger than the destination, you're clipping, not scaling. Finally, this is not masking - if you want a soft, mask-shaped blend (say, pasting a face onto a scene with a rounded boundary), the Latent Composite Masked sibling is the one with a MASK input; this plain node only does rectangular pastes with edge feathering.
It ships with ComfyUI core - no install, no model files. Pair it with Crop Latent and Empty Latent Image and you've got the skeleton of every outpaint workflow ever posted.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| samples_to | LATENT | — | |
| samples_from | LATENT | — | |
| x | INT | 00–16384 | — |
| y | INT | 00–16384 | — |
| feather | INT | 00–16384 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |