Shrink Canny Image
Scaling a subject's edge map down, before you move it
- canny_image
- IMAGE
Middle step of the pack's Canny chain. Shrink Canny Image takes the cropped edge map from CannyImageCropper and scales it down by a shrink_factor, so a subject that filled a crop region now occupies less of it. Combined with the crop node before it and Place Canny On Canvas after it, that's the "make the subject smaller and put it somewhere else" workflow, rendered entirely as edge maps for a Canny ControlNet to redraw.
The core idea worth grokking: you never touch the actual image. You manipulate the edges - crop them, shrink them, recenter them - and let the ControlNet rebuild the scene to match. Our controlnet knowledge base notes the classic use of canny is preserving hard outlines; this chain inverts that and uses canny as a transform of the subject, which is a legitimately clever way to relocate or de-emphasize an object without destructive inpainting of the original.
How it works
The mechanism is unapologetically simple: the tensor becomes a PIL image, gets converted to grayscale (L mode - a canny map is lines on black, so there's no color to preserve anyway), then resized with LANCZOS to shrink_factor × its original size, and converted back to a tensor. The default is 0.9 (90%), range 0.1–1.0. There's no paste-back-to-canvas here - the node deliberately returns the shrunken image alone, and the recentering is the next node's job.
Inputs and outputs
- canny_image (
IMAGE) - the cropped edge map from CannyImageCropper (or any edges image). - shrink_factor (
FLOAT, 0.1–1.0, default 0.9) - 0.1 shrinks to 10%, 1.0 is a no-op. Below 0.9, lines start to get mushy on very small subjects. - Output: IMAGE - the shrunk, grayscale edge map.
The catch that will trip you up
The output is grayscale, and it comes out shaped to feed the pack's own Place Canny On Canvas node rather than a stock consumer. If you wire the output straight into a plain SaveImage or Preview, expect a channel-shape complaint - it's a one-channel-ish image, not the standard batch layout most stock nodes want. This is one of those "the author built it for their own chain" moments: the node's output is happy inside this pack's pipeline and grumpy outside it. Route it through Place Canny On Canvas (which converts back to RGB and puts it on a proper 1024×1024 canvas) and the shape issue disappears.
Also note LANCZOS on a binary-ish edge map can soften thin lines at aggressive shrink factors. For most subjects 0.85–0.95 is the sweet spot; if the redrawn subject comes out with ragged edges, your shrink went too far.
Installing it
It's one of 12 nodes in Remade_nodes - install the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/Pheat-AI/Remade_nodes
Restart ComfyUI, or search Remade_nodes in ComfyUI Manager. No models, no README, numpy declared (and the usual OpenCV caveat: the color-blend node imports cv2, so pip install opencv-python if the pack won't load).
A thin node with a single knob, but it's the scale control for the whole relocate-the-subject trick. Keep the shrink gentle, and keep it pointed at the next node in the chain.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| canny_image | IMAGE | — | |
| shrink_factor | FLOAT | 0.900.1–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |