ImageCrop_motorway_edition
Crop a piped image to exact width and height
- MOTORWAY 🚌💨
- MOTORWAY 🚌💨
Cropping is one of those steps you do constantly without thinking: cut the face out to detail it, cut a region to re-render at higher resolution, cut the edges off a misframed generation. ImageCrop_motorway_edition is ComfyUI's stock ImageCrop, wrapped for the MOTORWAY 🚌💨 pipe in agilly1989/ComfyUI_agilly1989_motorway.
It reads the image out of the pipe under INPUT_image_key (default "image"), chops out a rectangle, and stores the crop back under OUTPUT_IMAGE_key (default "IMAGE"). Its only visible output is the Motorway - the cropped image is parked in the pipe for whatever reads that key next.
Inputs that matter
INPUT_image_key(default"image") - pipe key of the sourcewidthandheight(INT, 1 to 16384, default 512) - the size of the cropxandy(INT, 0 to 16384, default 0) - the top-left corner of the crop in the sourceOUTPUT_IMAGE_key(default"IMAGE") - where the crop lands
The pair to get right is x/y: it's the top-left corner, so x counts in from the left edge and y down from the top. If you're coming from image editors that crop from the center, that mental model will bite you. A crop that goes past the image edge will error, so keep x + width and y + height inside the source.
How it works
Standard *_motorway_edition mechanics: pop the Motorway, look up the image by the input key, run stock ImageCrop with your widget values, store the result under the output key, and return a clone of the pipe so the input pipe isn't mutated. This is the node that slots into the classic detailer pattern inside a pipe workflow: crop the face, upscale and re-render the crop, then ImageCompositeMasked pastes it back.
Installing
cd ComfyUI/custom_nodes
git clone https://github.com/agilly1989/ComfyUI_agilly1989_motorway
Restart ComfyUI, or grab it via ComfyUI Manager by searching "motorway". No requirements.txt, no model files - pure Python.
Gotchas
The usual pipe-node rules: keys are exact and case-sensitive, and a 'MotorwayClass' object has no attribute 'hash_' error means your key string matches nothing in the pipe. Mind the case trap - read "image" (lowercase), write "IMAGE" (uppercase) - so chained clones need keys you set yourself. And the pack-wide caveat: it's BETA, and the motorway_edition clone family is currently disabled in the 1.1.7 hotfix, so if the node isn't in your menu, stock ImageCrop does the identical job with wires.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| MOTORWAY 🚌💨 | MOTORWAY 🚌💨 | — | |
| INPUT_image_key | STRING | image | — |
| width | INT | 5121–16384 | — |
| height | INT | 5121–16384 | — |
| x | INT | 00–16384 | — |
| y | INT | 00–16384 | — |
| OUTPUT_IMAGE_key | STRING | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MOTORWAY 🚌💨 | MOTORWAY 🚌💨 | — |