Image_CnMap_Resize
Match one image's resolution to another before you blend them
- image
- get_resize_image
- mask
- image
- mask
A one-job node, and the pack's own description spells the job out plainly: if get_resize_image has something wired into it, image gets resized to match its dimensions; otherwise image passes through unchanged. That's the entire behavior.
How it works and why it exists
You could do this with a generic resize node by reading off two numbers and typing them in - but that's exactly the friction this node removes. It's built for the case its name suggests: prepping control maps ("Cn Map") where you've got, say, a canny edge map at one resolution and a depth map generated separately at another, and you need them lined up before something like Image_CnMapMix can blend them meaningfully. Instead of noting down width and height, you just point this node at the reference image directly and it copies its size.
The inputs and outputs that matter
image(required) - what actually gets resized (or passed through).get_resize_image(optional) - the size reference. Its own pixel content isn't used for anything, only its dimensions.mask(optional) - resized in step withimage.- Output:
image,mask.
How to install it
Via ComfyUI Manager: search ComfyUI-Apt_Preset, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git
Windows: install.bat. Linux/Mac: pip install -r ComfyUI-Apt_Preset/requirements.txt in your venv - no bundled script for non-Windows. Restart ComfyUI. Nothing to download for a plain resize node; the pack's broader dependency list belongs to other parts of this fairly large, actively maintained pack (~300 GitHub stars, MIT license).
Common issues & troubleshooting
Expecting a default target size. There isn't one. Leave get_resize_image disconnected and the node explicitly falls back to image's own size - nothing happens, by design, unless you wire a reference.
Mask comes out a different size than the image. Only wired inputs get resized together. If your mask was pulled in downstream rather than fed directly into this node's mask slot, it won't have gone through the same resize - route it through this node alongside image if you need both aligned.
Pairing with Image_CnMapMix. This node is the natural upstream step whenever your two blend sources don't match resolution - resize one of them to the other with Image_CnMap_Resize first, then feed both into the mix node. Skipping this step is the most common reason a two-image blend looks wrong or throws a shape error downstream.
Why not just use a generic resize node. You could - but a generic resize node wants you to type width and height, which means reading them off the reference image first (open it, check its dimensions, come back and type two numbers). This node collapses that into one wire: point get_resize_image at whatever you're matching against, and the dimensions travel with the connection instead of living in your head for the thirty seconds between checking and typing them.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| get_resize_imageopt | IMAGE | — | |
| maskopt | MASK | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |