Upscale Image To Target β‘π ‘π π £π
Resize by matching another image's dimensions
- image
- target_image
- IMAGE
Normal upscale nodes make you type in a width and height. This one skips the typing: you hand it a second image and it resizes the first to match that image's dimensions, exactly. No math, no "wait, was my source 1024Γ576 or 576Γ1024," just "make this look like that, size-wise."
Why you'd reach for it
The obvious use is compositing - you generated something at one resolution and need it to line up pixel-for-pixel with a reference frame, a mask, or your original input video before you can blend, mask, or overlay them. Rather than reading off the reference's width/height and typing those numbers into a generic upscale node (and having to redo it every time the reference changes), you just wire the reference image straight in as target_image and the node keeps itself in sync automatically. That's especially handy inside a batch/video workflow where the "target" dimensions might change between runs and you don't want to babysit two numeric widgets staying in lockstep.
The inputs and output
Four required fields, each with the author's own tooltip:
image- the image you're actually resizing.target_image- supplies the dimensions to match. Its own pixels aren't touched, ComfyUI just reads its width and height off it.upscale_method- one ofnearest-exact,bilinear,area,bicubic,lanczos. For photographic content,lanczosis the usual safe default;nearest-exactis for when you specifically want hard, un-blurred pixel edges (masks, flat-color art).crop-disabledorcenter. Ifimageandtarget_imagedon't share the same aspect ratio,disabledstretches to fit (distorting proportions) whilecentercrops to match aspect ratio first, then scales - better when you need pixel alignment for compositing and can afford to lose some edge content.
Output is a single IMAGE, resized to the target's dimensions, ready to feed into a composite, a mask multiply, or a save node.
How to install it
The pack's README came back empty when I looked for install specifics this round, so here's the standard path that works for the whole suite:
ComfyUI Manager: search "RyanOnTheInside", install, restart.
Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/ryanontheinside/ComfyUI_RyanOnTheInside
Restart ComfyUI. It's a broad pack - audio analysis, mask morphology, and more sit alongside this simple utility node - so if it pulls in extra Python packages on first install, that's expected.
Troubleshooting
The one thing people trip on with any "match dimensions" node: if your image and target_image have different aspect ratios and you leave crop on disabled, the output will look squashed or stretched - that's the honest behavior of stretch-to-fit, not a bug. Switch crop to center if you need proportions preserved. And remember target_image only donates its dimensions; if you actually wanted to blend the two images together (not just match sizes), you still need a separate compositing step downstream - this node's whole job stops at "same width and height," nothing more.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Input image to be scaled (IMAGE type) | |
| target_image | IMAGE | Image whose dimensions will be used as the target size (IMAGE type) | |
| upscale_method | COMBO | Method used for upscaling ('nearest-exact', 'bilinear', 'area', 'bicubic', 'lanczos') | |
| crop | COMBO | Cropping method to use if aspect ratios don't match ('disabled', 'center') |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |