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

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

Black bands, a hard edge, and the clip comes back widescreen

By ausbossΒ·Created 2 months agoΒ·Updated about 22 hours agoΒ· 2
Video Crop + Rotate + Pad β†’ Clip πŸ†Ž
    • frames
    • mask
    • audio
    • frame_count
    • fps
    • width
    • height
    • duration
    • stitcher
    β—„videoβ–Ύβ–Ί
    β—„source_modeinput folderβ–Ί
    β—„local_pathβ–Ί
    β—„start_seconds0.00β–Ί
    β—„end_seconds0.00β–Ί
    β—„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β–Ί
    β—„feather0β–Ί
    β—„canvas_multiple1β–Ί
    β—„fill_color#000000β–Ί
    β—„resize_to_megapixelsfalseβ–Ί
    β—„megapixels1.00β–Ί
    β—„resize_methodlanczosβ–Ί
    β—„resolution_steps1β–Ί
    β—„every_nth1β–Ί
    β—„max_frames0β–Ί
    β—„frame_snapfreeβ–Ί
    β—„stitch_blend32β–Ί
    β—„stitch_grow0β–Ί

    This is the node that goes immediately before a video outpaint. It applies one rotate β†’ crop β†’ pad transform to every frame of a clip and hands the video model a canvas with bands it's meant to paint - plus a stitcher so the frames you didn't ask it to touch come back bit-for-bit.

    Two jobs, really: cut something off (a border, a watermark corner, a tilt), or grow something on. The outpaint case is the one with strict rules - the LTX outpaint IC-LoRA keys on a pure black fill with a hard edge (feather 0) at sizes rounded to 32, and getting that wrong burns a ten-minute render to teach you nothing. So fill and feather sit on the node face here instead of in an editor.

    Inputs you'll actually set

    video picks a file from ComfyUI's input folder or you upload one, or set source_mode to local path and put an absolute path in local_path to read a file in place instead of copying it - worth it for a 4 GB clip.

    Then the window. start_seconds and end_seconds trim; end_seconds 0 means "to the end of the video". The on-node timeline is the friendlier way in: drag the IN/OUT handles and the playhead rides the handle, so the frame you're looking at is the first or last frame the run keeps. every_nth keeps one frame in N and divides the reported fps to match, so the clip keeps real-time speed; max_frames caps the count. frame_index / frame_time are preview position only - scrubbing them never changes the output.

    Then the transform, same trio as the pack's image nodes: rotation_degrees (βˆ’180 to 180, clockwise, applied first), the crop block (crop_aspect_ratio, crop_x, crop_y, crop_width, crop_height), and the pad block (pad_left/pad_top/pad_right/pad_bottom). fill_color lands in the rotated-in corners and the padding, feather softens the mask into kept pixels, and canvas_multiple plus resolution_steps round the output to a multiple. For an outpaint: black fill, feather 0, rounded to 32.

    The resize trio is optional and off by default - resize_to_megapixels, megapixels, resize_method (lanczos is the sharp default). frame_snap (free, 8n+1 for LTX - 49, 97, 121 - or 4n+1 for Wan) drops trailing frames so the count is one the model keeps, and stitch_blend / stitch_grow shape how the paste ramps in afterwards.

    Outputs

    Nine of them. frames is the transformed BHWC batch - that's what goes to the video model. mask is the per-frame generated-area mask: padding plus rotation corners, feathered. audio covers the same trimmed window. frame_count, fps, width, height and duration instrument the clip; wire frame_count into the video latent's length so you never ask the sampler for more frames than you're stitching back. stitcher goes straight into Stitch Inpaint πŸ†Ž, which pastes the source frames over the generated ones and blends only across the padded region - no intermediate Crop For Inpaint node.

    That's why you'd use this rather than a generic resize node: a masked setup owns one thing no instruction-editing model offers - pixels outside the blend region come back identical to the source. On video that's the difference between extending a shot's canvas and re-rendering the shot.

    Installing it

    ComfyUI Manager β†’ search AusBoss, or:

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

    Restart, then hard-refresh with Ctrl+Shift+R after updates. The pack declares no pip dependencies - it uses the Pillow, NumPy, Torch and PyAV that ComfyUI already ships - so there's nothing to install for this node. ComfyUI 0.27.1 minimum.

    Where people get burned

    Feather is not blend. Feather shapes the mask the model sees; stitch_blend is the ramp in output pixels where generated pixels fade over the source. A black-band outpaint wants feather 0 and a blend of a few dozen pixels. Softening the feather "to be safe" is the classic mistake, and it's exactly the grey fuzzy band the IC-LoRA can't work with.

    Frame counts. LTX wants a count divisible by 8 plus 1, and off-grid values fail rather than round. Turn frame_snap on - with it off, the node hands back more source frames than the model returns.

    Local path mode is deliberately restricted. As of 2.0.1 it reaches only ComfyUI's input, output and temp folders. Start ComfyUI with AUSBOSS_TRANSFORM_LOCAL_PREVIEW=1 if you genuinely need the rest of the disk - and understand that you're opening that up on a server whose /prompt route has no auth by default, so don't do it on a box anyone else can reach.

    Swapping the clip keeps your canvas. Fill, feather, the resize budget, snap and the frame limit survive a source change; only rotation, crop and the trim window reset. A fresh Clip node starts black with feather 0 for the same reason - an outpaint shouldn't be quietly ruined by a source swap.

    Long clips are processed a few frames at a time to keep memory sane, and the progress bar and cancel work throughout.

    CategoryπŸ†Ž AusBoss/Video

    Inputs (30)

    NameTypeDefaultDescription
    videoCOMBOChoose a video in ComfyUI's input folder or use the upload button.
    source_modeCOMBOinput folderLocal path mode reads a file in place instead of copying it into the input folder.
    local_pathSTRINGAbsolute video path used only in local path mode. By default only ComfyUI's input, output and temp folders are readable; start ComfyUI with AUSBOSS_TRANSFORM_LOCAL_PREVIEW=1 to allow any path.
    start_secondsFLOAT0.000–86400Skip everything before this time.
    end_secondsFLOAT0.000–86400Stop at this time; 0 runs to the end of the video.
    seek_modeCOMBOframe indexPlayhead position only: frame_index or frame_time picks the frame the node and editor show. The output covers the whole trim window.
    frame_indexINT00–100000000Zero-based playhead frame shown on the node and in the editor; does not affect the output.
    frame_timeFLOAT0.0000–86400Playhead position in seconds for time mode; does not affect the output.
    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.
    featherINT00–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#000000Color 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.
    every_nthoptINT11–512Keep one frame in this many; 2 halves the frame count and the fps output divides to match, so the clip still plays at real speed.
    max_framesoptINT00–100000Stop after this many kept frames; 0 processes the whole trim window. Video models want 8n+1 counts: 49, 97, 121.
    frame_snapoptCOMBOfreeDrop trailing frames so the count is one a video model keeps: 8n+1 for LTX (49, 97, 121), 4n+1 for Wan. Free keeps every frame in the window.
    stitch_blendoptINT320–512Ramp of the stitcher's paste, in pixels, into the kept frames: where generated pixels fade over the source. Separate from feather, which shapes the mask itself.
    stitch_growoptINT0-256–256Moves the paste boundary before the ramp: positive lets the generation replace a strip of the source next to the seam, negative keeps more of the source.

    Outputs (9)

    NameTypeDescription
    framesIMAGEEvery frame of the trim window, transformed, as a BHWC batch.
    maskMASKBHW generated-area mask per frame: rotation corners and padding, feathered.
    audioAUDIOAudio for the same window; silent when the video has no audio track.
    frame_countINTNumber of frames returned.
    fpsFLOATFrames per second of the returned batch: the source rate divided by every_nth.
    widthINTFrame width after the transform and any resize.
    heightINTFrame height after the transform and any resize.
    durationFLOATDuration in seconds of the returned frames.
    stitcherAUSBOSS_STITCHERFor Stitch Inpaint: pastes the source frames back over a generated clip of this size, blending only across the padded and rotated-in area.