Nodes/ComfyUI-MiniMaxH3-PrefixStream/🎬 MiniMax Video Chunk Slicer (长视频智能切片器)
ComfyUI Node

🎬 MiniMax Video Chunk Slicer (长视频智能切片器)

Redraw one 5-second bite, not the whole film

By knoic·Created 9 days ago·Updated a day ago· 5
🎬 MiniMax Video Chunk Slicer (长视频智能切片器)
  • images
  • audio
  • optional_first_frame_ref
  • chunk_images
  • chunk_audio
  • slice_context
  • video_info
  • timeline_preview
  • fps
  • frame_count
  • slice_info
  • prev_last_frame
  • prev_ref_frames
video_file
project_nameVideo_Edit_Project
chunk_length124
chunk_index0
target_width0
target_height0
force_fps24.00
slice_mode
custom_start_frame0
custom_end_frame124
auto_advanceNone (手动控制)
prev_ref_frames_count16
first_chunk_ref_modeCurrent Chunk First Frame (当前片段首帧)
fps

MiniMax H3 generates 4–15 second clips. Your footage is four minutes long. That gap is what this node exists to close - and the naive way to close it, one IMAGE batch of 6,000 frames from VHS_LoadVideo, is why people abandon long-video work before finishing the first shot.

MiniMax Video Chunk Slicer (长视频智能切片器) is the front half of this pack's long-video pipeline. It pulls one chunk of frames plus the matching audio slice out of a video file, so you can hand that chunk to an H3 redraw chain without loading the rest of the movie. The back half, putting the edited chunk back, is MiniMax Video Patch Reassembler.

Why you'd reach for it

Long video used to mean last-frame-to-first-frame chaining: generate clip one, feed its final frame into clip two. It works, and it drifts, because every hop re-encodes. H3 makes generation continuity much better - masked-AV prefix continuation is this pack's headline - but the slicer solves the other job, where you already have footage and want it re-rendered or repaired in H3-sized pieces.

It also closes the loop from the editing side: besides the chunk, it emits the previous chunk's last frame and its final N frames, and once an earlier chunk has been patched back in, those come from the edited result. Wire them into an image-to-video first-frame or prefix-context port and chunk 8 starts from what chunk 7 actually looks like now.

Worth knowing first: H3's open weights are licence-geofenced out of the US, EU, UK and Korea, so local use isn't licensed there. That's a fact about the model, not this node.

How it works

No secret decoder. The node shells out to FFmpeg with a seek position, an fps filter, an optional bicubic scale and -vframes <chunk_length>, pipes raw RGB24 back, and reshapes it into a float tensor. Audio is sliced on the same time window, so picture and sound stay sample-aligned.

That's why the low-memory claim holds: only the chunk you asked for is decoded. Wire images and audio in and it chunks a tensor instead.

The inputs that matter

  • video_file - a dropdown of files found by walking ComfyUI's input/ directory (absolute paths work too). Empty install, empty list: it says none.
  • project_name - the state key. Use the same string here and in the Reassembler, or you've built two timelines that never meet.
  • chunk_length / chunk_index - frames per chunk, and which one. Default 124 (~5.16s at 24fps); the preset capsules offer 39, 90, 124 and 141, the H3-friendly lengths. Resolution presets: 1344x768 (the author's default), 720p, 1080p, or 0/0 for source resolution.
  • force_fps - 24 unless you wire something into the optional fps input, which wins when connected.
  • slice_mode - Auto Chunk Grid (chunk_index × chunk_length), Custom Range (uses custom_start_frame/custom_end_frame), or Next Unedited, which jumps to the first unpatched chunk. That last one earns its keep halfway through a project.
  • auto_advance - set Next Chunk and the frontend widget bumps chunk_index after each run. Queue the workflow N times for an unattended slicing loop.

Then prev_ref_frames_count (default 16) sets how many frames prev_ref_frames carries, first_chunk_ref_mode decides what it holds on chunk 0 (current chunk's first frame, or black), and optional_first_frame_ref supplies your own starting image for that first chunk.

Outputs

chunk_images and chunk_audio go to your edit chain. slice_context goes to the Reassembler and nowhere else - it's a private type, so don't route it into a VHS node. video_info is a VHS-compatible specs dict for VHS_VideoInfo; timeline_preview is a 768x128 progress card for PreviewImage; slice_info is that status as text, edited-vs-original included. Continuity comes out as prev_last_frame (one frame, for an I2V-style port) and prev_ref_frames (N frames, for a video or prefix-context port).

Install

ComfyUI Manager → search ComfyUI-MiniMaxH3-PrefixStream, or:

cd ComfyUI/custom_nodes
git clone https://github.com/knoic/ComfyUI-MiniMaxH3-PrefixStream.git
cd ComfyUI-MiniMaxH3-PrefixStream
pip install -r requirements.txt

That file is just torch, safetensors and pillow - all present already. Restart, then Ctrl+F5: the pack ships frontend widgets, and a stale cache shows a bare node with none of its timeline UI.

Where people get burned

FFmpeg isn't in requirements.txt but it is required. The node calls ffmpeg and ffprobe as system binaries, checking PATH plus a couple of hardcoded Windows paths, so a missing install gives ffmpeg executable not found in PATH or environment from a pack whose dependency list looks trivial. Install it (sudo apt install ffmpeg, brew install ffmpeg, winget install Gyan.FFmpeg) and restart ComfyUI so it inherits the new PATH. Same story for none in the dropdown: the file isn't in ComfyUI/input/, so copy it there or paste an absolute path.

slice_context isn't a general socket. People wire it into a sampler LATENT input and get a type error.

Keep project_name stable. Change it mid-project and the slicer starts a fresh timeline while the reassembler reports on the old one. Session files live under output/minimax_h3_bins/<project>/ - also where you delete a project and start clean.

CategoryMiniMaxH3/VideoEdit

Inputs (17)

NameTypeDefaultDescription
video_fileCOMBO1 options: none
project_nameSTRINGVideo_Edit_Project
chunk_lengthINT12416–2048
chunk_indexINT00–9999
target_widthINT00–7680
target_heightINT00–4320
force_fpsFLOAT24.001–120
slice_modeCOMBO3 options: Auto Chunk Grid (网格切分), Custom Range (自由区间), Next Unedited (自动下一未编辑段)
custom_start_frameINT00–999999
custom_end_frameINT1241–999999
auto_advanceCOMBONone (手动控制)3 options: None (手动控制), Next Chunk (顺序下一段), Next Unedited (跳至下一未编辑)
prev_ref_frames_countINT161–128
first_chunk_ref_modeCOMBOCurrent Chunk First Frame (当前片段首帧)2 options: Current Chunk First Frame (当前片段首帧), Black / Zero Frame (全黑空帧)
imagesoptIMAGE
audiooptAUDIO
fpsoptFLOAT
optional_first_frame_refoptIMAGE

Outputs (10)

NameTypeDescription
chunk_imagesIMAGE
chunk_audioAUDIO
slice_contextSLICE_CONTEXT
video_infoVHS_VIDEOINFO
timeline_previewIMAGE
fpsFLOAT
frame_countINT
slice_infoSTRING
prev_last_frameIMAGE
prev_ref_framesIMAGE