Nodes/AusBoss/Video Crop + Rotate + Pad β†’ Frame πŸ†Ž
ComfyUI Node

Video Crop + Rotate + Pad β†’ Frame πŸ†Ž

Find one frame in a video and transform it, in one node

By ausbossΒ·Created 2 months agoΒ·Updated 3 days agoΒ· 2
Video Crop + Rotate + Pad β†’ Frame πŸ†Ž
    • image
    • mask
    β—„videoβ–Ύβ–Ί
    β—„source_modeinput folderβ–Ί
    β—„local_pathβ–Ί
    β—„seek_modeframe indexβ–Ί
    β—„frame_index0β–Ί
    β—„frame_time0.000β–Ί
    β—„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β–Ί

    The image transform node in this pack - Image Crop + Rotate + Pad πŸ†Ž - is one thing people reach for constantly. Video Crop + Rotate + Pad β†’ Frame πŸ†Ž is the same transform with a video player bolted on front, and the critical thing to understand up front is what it is not: it is not a video trimmer. It picks one frame out of a video and applies the rotate/crop/pad transform to that frame. The output is a single image. The full-screen editor's long timeline, playback, and exact frame stepping exist to find the frame, not to cut a range.

    That's the honest use case, and it's a good one: you want a poster frame, a reference still, or a clean single frame from a specific moment - pre-cropped, pre-rotated, pre-padded - without loading the whole clip into your workflow.

    Finding the frame

    Two seek_modes cover how you think about time: frame index (zero-based target frame) or time seconds (target time). The editor gives you first/last, Β±1, Β±25, Β±50, Β±100 steps, playback, and timeline scrubbing, so you can land exactly where you want and let the widgets record it.

    There's also source_mode: input folder (pick from ComfyUI's input folder) or local path for an absolute path - the mode to use for very large videos you don't want to copy. One gotcha lives here: queued runs always read local paths, but the editor's live preview of paths outside ComfyUI's own folders is opt-in. Start ComfyUI with AUSBOSS_TRANSFORM_LOCAL_PREVIEW=1 to enable it. The env var exists on purpose - it keeps the preview routes from exposing arbitrary files to anything that can reach your server, which matters if you run on --listen.

    The transform

    Exactly the image node's controls: rotation_degrees (clockwise, applied before crop and padding), crop_aspect_ratio (free or locked ratios from 1:1 to 21:9), crop_x/y/width/height, pad_left/top/right/bottom, feather, canvas_multiple, and fill_color (rotation voids and padding). Operation order is always rotate β†’ crop β†’ pad, and the outputs are image (the transformed frame) plus mask - a BHW generated-area mask covering rotation corners and padding. That mask is the key to feeding the result into an inpainter or outpaint rig and telling it what's "new."

    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; PyAV (bundled with ComfyUI) handles the video decode. Minimum ComfyUI 0.27.1; if a frontend update changes custom-widget behavior, the README asks for your ComfyUI and frontend versions in the issue. Hard-refresh the browser with Ctrl+Shift+R after updating frontend files.

    Troubleshooting

    Forget AUSBOSS_TRANSFORM_LOCAL_PREVIEW=1 and the local-path preview will be blank even though queued runs work - that's expected, not a bug. If the frame you find in the editor doesn't match the output, check whether you're in time seconds mode (frame-accurate stepping is the frame-index mode's job). And remember it's one frame out: if you need a clip back, this is the wrong node - Load Video πŸ†Ž is the loader that keeps the whole batch.

    CategoryπŸ†Ž AusBoss/Video

    Inputs (19)

    NameTypeDefaultDescription
    videoCOMBOChoose a video in ComfyUI's input folder or use the upload button.
    source_modeCOMBOinput folderLocal path mode reads a video already inside ComfyUI's input, output or temp folder in place, without an upload copy.
    local_pathSTRINGAbsolute path to a video inside ComfyUI's input, output or temp folder, used only in local path mode and read in place without a copy. Paths anywhere else are refused.
    seek_modeCOMBOframe indexPicks the frame by frame_index or by frame_time seconds; the other widget is ignored.
    frame_indexINT00–100000000Zero-based target frame.
    frame_timeFLOAT0.0000–86400Target seconds in time mode.
    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.

    Outputs (2)

    NameTypeDescription
    imageIMAGEThe selected and transformed frame as a one-image BHWC batch.
    maskMASKBHW generated-area mask: rotation corners and padding.