Petty Paint Image Placement
Position one image on a canvas without doing the math yourself
- image
- image_destination
- IMAGE
Compositing in ComfyUI is usually a pile of Composite Masked nodes and a lot of manual x/y fiddling until things line up. PettyPaintImagePlacement gives you the common case in one node: drop an image onto a destination canvas at a named position - top-center, bottom-right, wherever - plus a pixel offset, and get back the composited result. It's not doing anything a handful of core nodes can't, but it turns "where should this go?" into a dropdown instead of an arithmetic session.
It's a genuinely handy helper when you're stacking a subject onto a background, pasting a head onto a generated body, or stamping a watermark-style layer onto a scene - anything where the layout is "some corner or center, plus a nudge."
How it works
The node takes your source image and a destination image_destination, then builds the output canvas from image_destination and pastes the source at a computed position. The position comes from a destination string built from the words top, bottom, left, right and center - so top-center (the default), bottom-right, center, left, top-left and so on all work. x_offset and y_offset then nudge the placement in pixels, and the node clamps everything to the canvas bounds so you can't accidentally write outside the frame. Under the hood it uses the same torch composite() helper that ComfyUI's own Composite Masked node uses, so the blending behavior matches what you already know.
The inputs that matter
image- the thing you're placing.image_destination- the canvas it lands on. This is what determines the actual pixel size of the output, so if your source is bigger than the canvas it gets clipped, not resized.canvas_width/canvas_height- these are forceInput integers, meaning you can't just type values in; you have to wire them from another node. That's the most common "why won't it run" trap. Feed them from a node that outputs dimensions - the pack's own PettyPaintLoadImage emits WIDTH and HEIGHT for exactly this.destination- position keyword, defaulttop-center.x_offset/y_offset- pixel nudges, default 0, range ±99999.- Output: a single
IMAGE, ready for the next compositing or save step.
Installing it
It ships in the petty-paint pack, so install once and all 40+ nodes come with it:
cd ComfyUI/custom_nodes
git clone https://github.com/mephisto83/petty-paint-comfyui-node
Restart ComfyUI afterwards. ComfyUI Manager users can search "petty-paint-comfyui-node" and click install instead. The only declared dependency is Flask==2.1.2, which this node doesn't touch but Manager will install anyway.
Common issues
The forceInput canvas_width/canvas_height is the one that bites beginners - the node validates with a red error until those are wired, not typed. The other thing to know: the destination canvas must come through image_destination, and if that's an image with an alpha channel, downstream nodes may silently drop it (a known ComfyUI behavior when images flow through RGB pipelines). Keep your compositing steps before any save that matters.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| image_destination | IMAGE | — | |
| canvas_width | INT | — | |
| canvas_height | INT | — | |
| destination | STRING | top-center | — |
| x_offset | INT | 0 | — |
| y_offset | INT | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |