Nodes/AusBoss/Image Crop + Rotate + Pad πŸ†Ž
ComfyUI Node

Image Crop + Rotate + Pad πŸ†Ž

A crop, rotate, and pad tool that feels like an editor, not a widget farm

By ausbossΒ·Created 2 months agoΒ·Updated 3 days agoΒ· 2
Image Crop + Rotate + Pad πŸ†Ž
    • image
    • mask
    β—„imageβ–Ύβ–Ί
    β—„rotation_degrees0.0β–Ί
    β—„crop_aspect_ratiofreeβ–Ί
    β—„crop_x0β–Ί
    β—„crop_y0β–Ί
    β—„crop_width0β–Ί
    β—„crop_height0β–Ί
    β—„pad_left0β–Ί
    β—„pad_top0β–Ί
    β—„pad_right0β–Ί
    β—„pad_bottom0β–Ί
    β—„feather24β–Ί
    β—„canvas_multiple1β–Ί
    β—„fill_color#808080β–Ί
    β—„resize_to_megapixelsfalseβ–Ί
    β—„megapixels1.00β–Ί
    β—„resize_methodlanczosβ–Ί
    β—„resolution_steps1β–Ί

    The standard ComfyUI way to crop an image is a cascade of nodes: crop, rotate, pad, then a mask if you're going to inpaint the seams. Image Crop + Rotate + Pad πŸ†Ž collapses that whole stack into one Load Image-style node with a live preview - and the preview is actually usable, which is rarer than it should be.

    The node shows the transformed image directly on the canvas. Drag the cyan crop handles, the four orange padding handles, or the green rotation knob, and the preview is the live stage. When you need precision, the Open editor button opens a full-screen editor with zoom, pan, and a numeric sidebar. Eight crop handles with generous hit targets, free or ratio-locked crop, Shift snapping to 15 degrees on rotation, mouse-wheel zoom, middle-mouse or Alt-drag pan. It's the sort of editing surface you'd expect from a standalone tool, not a graph node.

    What it outputs

    Two outputs, and they're the whole point:

    • image - the transformed BHWC batch.
    • mask - a generated-area mask covering source transparency, rotation corners, and padding. That mask is what makes the node useful for outpainting and inpainting: wire it into an inpainter and the model knows exactly which pixels are "new" (rotation voids and padding) versus original. It's the same discipline as the transform pair in this pack - the mask marks what the sampler may touch.

    Operation order is always rotate β†’ crop β†’ pad, and new sources start with zero rotation, full crop, zero padding, and a canvas multiple of 1. Knowing that order explains a lot of the widget behavior: rotation_degrees is applied first, then the crop is taken out of the rotated frame, then padding grows the result.

    The widgets that matter

    crop_aspect_ratio locks the crop handles to a ratio (source, 1:1, 9:16, 16:9, and more) - useful when you're targeting a fixed delivery format. crop_width/crop_height of 0 keep the full available dimension. feather (default 24) feathers the mask into kept pixels and fades the image edge into the fill color, which is how you avoid a hard line when you pad and inpaint. canvas_multiple rounds the output up by adding minimum extra pixels to right and bottom - the sampler-friendly-multiple trick the whole pack is built around. fill_color accepts hex, R,G,B, grayscale, or CSS names, and falls back to mid-gray if it can't parse your input.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/ausboss/ComfyUI-AusBoss.git
    

    Restart ComfyUI and search for AusBoss (Manager: ComfyUI-AusBoss). No extra Python dependencies; minimum ComfyUI 0.27.1. Alt+E (rebindable in Settings β†’ Keybindings) opens the editor for the selected node, and Settings β†’ πŸ†Ž AusBoss lets you recolor every AusBoss node in the graph.

    Troubleshooting

    If the mask looks like it's marking the whole image, you've got a transparency or rotation-void situation you didn't expect - the mask deliberately includes source transparency, rotation corners, and padding, not just your crop. If the editor won't open in API-mode execution, that's fine: the widgets carry the transform, so API runs work without the editor ever being open. And if a transform doesn't stick after you close the editor, check that you didn't reset it - there are Reset view, Reset padding, and Reset all controls for exactly that reason.

    CategoryπŸ†Ž AusBoss/Image

    Inputs (18)

    NameTypeDefaultDescription
    imageCOMBOChoose or upload an image from ComfyUI's input folder.
    rotation_degreesFLOAT0.0-180–180Clockwise rotation applied before crop and padding.
    crop_aspect_ratioCOMBOfreeLocks crop handles to a ratio; free allows any rectangle.
    crop_xINT00–65536Left edge of the crop in pixels, measured on the rotated image.
    crop_yINT00–65536Top edge of the crop in pixels, measured on the rotated image.
    crop_widthINT00–655360 keeps the full available width.
    crop_heightINT00–655360 keeps the full available height.
    pad_leftINT00–32768Fill-color pixels added on the left; padding lands in the output mask.
    pad_topINT00–32768Fill-color pixels added on top; padding lands in the output mask.
    pad_rightINT00–32768Fill-color pixels added on the right; padding lands in the output mask.
    pad_bottomINT00–32768Fill-color pixels added on the bottom; padding lands in the output mask.
    featherINT240–4096Feathers the mask into kept pixels and fades the image edge into the fill color.
    canvas_multipleINT11–4096Rounds output up by adding the minimum extra pixels to right and bottom.
    fill_colorSTRING#808080Color for rotation voids and padding; accepts #RGB/#RRGGBB hex, R, G, B (0-255 or 0..1 floats), one grayscale number, or a CSS color name. Unparseable values fall back to mid-gray.
    resize_to_megapixelsBOOLEANfalseResize the output to the megapixel budget below, aspect preserved.
    megapixelsFLOAT1.000.01–16Output pixel budget in megapixels (x 1024x1024, matching the core Scale Image to Total Pixels node).
    resize_methodCOMBOlanczosSampling filter for the resize; lanczos is the sharp default.
    resolution_stepsINT11–256Rounds each resized dimension to a multiple of this - 8 or 64 keeps VAE-friendly sizes.

    Outputs (2)

    NameTypeDescription
    imageIMAGEThe transformed image batch in BHWC format.
    maskMASKBHW generated-area mask: transparency, rotation corners, and padding.