Paste Cropped Image
Paste Cropped Image — the other half of the crop pipeline
- cropped_image
- image
- mask
- rgba_image
Crop a subject out of a photo and you're only halfway there. The other half is putting it back down somewhere useful - on a clean canvas, at a chosen position, with a usable alpha. That's exactly what Paste Cropped Image does, and it's built to be the partner node for Interactive Crop from the same pack. The classic flow is Load Image → Interactive Crop → Paste Cropped Image, and the two talk to each other without any math on your side.
How it works
Mechanically it's a paste-with-alpha-composite: the node builds a blank canvas of canvas_width × canvas_height, optionally fills it with a hex color, then composites your cropped image on top at x/y. If the incoming image has an alpha channel, that alpha is used for the composite and handed back as the output mask; if it's a plain RGB crop, the pasted region is treated as fully opaque. The output rgba_image is that same composite with the alpha baked into the fourth channel - ready to feed anything that consumes RGBA.
One thing it does well is not explode. Paste coordinates are clamped to the canvas, and the pasted region is clipped if it would run off the edge. Drop a crop 50px past the right border and you get a partially visible paste, not an error. The paste math also clamps values to 0–1, which quietly saves you from the occasional NaN-colored corruption that sloppy compositing code produces.
The inputs that matter
cropped_image- required, the IMAGE to place (typically from Interactive Crop'scropped_imageoutput).canvas_width,canvas_height- the new canvas size. Defaults to 1024×1024.x,y- top-left placement in canvas pixels. These are where Interactive Crop'soutput_x/output_y(orcrop_width/crop_heightif you're sizing things up) slot in.background_type-transparent(default) orhex_color. Transparent is what you want when you're building a cutout for further compositing;hex_colorflattens the result onto a solid color so you get a viewable RGB image in one go.hex_color- the solid fill used whenbackground_typeishex_color. Defaults to black; it's a plain#RRGGBBstring.
Outputs
Three of them, all the same paste in different packaging: image is the RGB result (transparent areas render as the background color or black), mask is the alpha - white where the crop landed, black elsewhere - and rgba_image is the true transparency-carrying version. Which one you grab depends on the next node: a mask consumer wants mask, anything that can read RGBA wants rgba_image, and a Save Image wants image.
Install
No model files, no extra Python deps - the pack runs on NumPy, Pillow and PyTorch, all present in a standard ComfyUI install:
cd ComfyUI/custom_nodes
git clone https://github.com/orion4d/Orion4D_layer_manager
Restart ComfyUI after cloning. ComfyUI Manager users can skip the terminal entirely: search Orion4D_layer_manager under "Install Custom Nodes."
Common issues
- Paste landed in the wrong place. Check whether your crop node's coordinates are scaled. Interactive Crop's
scale_multiplierscales both the image and the coordinates, which is what keeps this pair in sync - but if you feed it coordinates from a different crop tool that doesn't scale, positions drift. Prefer the two-pack. - Cutout pasted as a solid rectangle. That means your input has no alpha channel. If you cropped from a node that only outputs RGB, run it through an alpha/mask extraction first, or use Interactive Crop's mask-aware flow.
- It's on a black background and you wanted transparent. Switch
background_typetotransparent; theimageoutput can't show transparency, so black there is expected - grabrgba_imageinstead.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| cropped_image | IMAGE | — | |
| canvas_width | INT | 10241–16384 | — |
| canvas_height | INT | 10241–16384 | — |
| x | INT | 00–16384 | — |
| y | INT | 00–16384 | — |
| background_type | COMBO | transparent | 2 options: transparent, hex_color |
| hex_color | STRING | #000000 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |
| rgba_image | IMAGE | — |