ImageScale_motorway_edition
Resize a piped image to an exact resolution
- MOTORWAY 🚌💨
- MOTORWAY 🚌💨
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 sourceupscale_method-nearest-exact,bilinear,area,bicubic,lanczoswidthandheight(INT, 0 to 16384, default 512) - the target size, exactlycrop-disabledorcenterOUTPUT_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.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| MOTORWAY 🚌💨 | MOTORWAY 🚌💨 | — | |
| INPUT_image_key | STRING | image | — |
| upscale_method | COMBO | 5 options: nearest-exact, bilinear, area, bicubic, lanczos | |
| width | INT | 5120–16384 | — |
| height | INT | 5120–16384 | — |
| crop | COMBO | 2 options: disabled, center | |
| OUTPUT_IMAGE_key | STRING | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MOTORWAY 🚌💨 | MOTORWAY 🚌💨 | — |