Nodes/ComfyUI_agilly1989_motorway/ImageScale_motorway_edition
ComfyUI Node

ImageScale_motorway_edition

Resize a piped image to an exact resolution

By agilly1989·Created 2 years ago·Updated about a year ago· 7
ImageScale_motorway_edition
  • MOTORWAY 🚌💨
  • MOTORWAY 🚌💨
INPUT_image_keyimage
upscale_method
width512
height512
crop
OUTPUT_IMAGE_keyIMAGE

Sometimes you need an image at one very specific resolution - the size a checkpoint was trained on, or the exact dimensions your workflow's downstream math expects. ImageScale is the node for that, and ImageScale_motorway_edition is the same node reading its input from and writing its output to a MOTORWAY 🚌💨 pipe.

It's part of agilly1989/ComfyUI_agilly1989_motorway, the author's key-value pipe pack. It reads the image out of the pipe under INPUT_image_key (default "image"), resizes to your exact width and height, and stores the result back under OUTPUT_IMAGE_key (default "IMAGE"). Only visible output is the Motorway pipe.

Inputs that matter

  • INPUT_image_key (default "image") - pipe key of the source
  • upscale_method - nearest-exact, bilinear, area, bicubic, lanczos
  • width and height (INT, 0 to 16384, default 512) - the target size, exactly
  • crop - disabled or center
  • OUTPUT_IMAGE_key (default "IMAGE") - where the result lands

crop is the subtle one. With disabled, the image is stretched to fit your width/height, which distorts the aspect ratio if they don't match the source. With center, it scales to cover and then crops the overflow from the middle, so you keep the aspect but lose the edges. If you want to hit a target resolution without distortion, center is usually the right call.

How it works

Standard clone mechanics: pop the Motorway, pull the image out via the input key, run stock ImageScale with your widget values, store the result under the output key, and return a cloned pipe so nothing upstream is mutated. It's the exact-fit sibling of the pack's ImageScaleBy (factor-based) and ImageScaleToTotalPixels (megapixel-based) - pick the one that matches the question you're asking.

Installing

cd ComfyUI/custom_nodes
git clone https://github.com/agilly1989/ComfyUI_agilly1989_motorway

Restart ComfyUI, or install via ComfyUI Manager (search "motorway"). No requirements.txt, no model downloads - pure Python.

Gotchas

Keys are exact and case-sensitive; a 'MotorwayClass' object has no attribute 'hash_' error means your key string matches nothing in the pipe. Mind the case default - read "image" (lowercase), write "IMAGE" (uppercase) - so a chain of clones needs keys you set to match. And the family status: BETA, with the motorway_edition clones disabled in the 1.1.7 hotfix - if the node isn't in your menu, stock ImageScale does the identical job with wires.

Categoryagilly1989 Nodes/Motorway-ed/image/upscaling

Inputs (7)

NameTypeDefaultDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨
INPUT_image_keySTRINGimage
upscale_methodCOMBO5 options: nearest-exact, bilinear, area, bicubic, lanczos
widthINT5120–16384
heightINT5120–16384
cropCOMBO2 options: disabled, center
OUTPUT_IMAGE_keySTRINGIMAGE

Outputs (1)

NameTypeDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨