ComfyUI-H3-Edit
All-in-one MiniMax-H3 video editing custom node for ComfyUI with filmstrip trimming, real-time native SAM 3.1 masking, built-in Edit LoRA, native Context Windows, Pass 2 Latent Upscale, VideoDeflicker, and full-video splice-back.
ComfyUI-H3-Edit
An all-in-one MiniMax-H3 video editing custom node for ComfyUI. Load and trim videos on a filmstrip timeline, preview and track native SAM 3.1 masks in real time, apply the built-in vfx_edit LoRA with MiniMaxH3AddGuide, run native Context Windows (STATIC_STANDARD), upscale drafts back to original resolution via MiniMaxH3LatentUpscaleWithModel, deflicker with VideoDeflicker, and splice the edited range seamlessly back into the full source video — all inside a single compact 2-column UI compatible with both Nodes 1.0 and Nodes 2.0.
This custom node was created with Gemini.
Features
- Interactive Video Loader & Filmstrip Trim Bar
- Load videos via Load Video or drag-and-drop directly onto the preview stage.
- Dedicated filmstrip timeline with zoom (
-/1.0x/+), thumbnail toggle (ON/OFF),Allreset,Shift+Clickedge snap, playback controls (▶ / ⏸), seek bar, mute, and volume slider. - Automatic alignment to MiniMax-H3's
17k + 5frame grid during generation (Snap 17k+5), trimmed cleanly back to the exact selected range after decode.
- Real-Time Native SAM 3.1 Masking
- Uses ComfyUI's native SAM 3.1 pipeline (
CheckpointLoaderSimple→CLIPTextEncode→SAM3_VideoTrack→SAM3_TrackToMask). - 🎯 Preview segments the current frame instantly; 🎬 Track tracks across the trimmed range and caches masks for zero-recompute execution; ✕ clears both the mask and SAM prompt.
- SAM Threshold (
0.05–0.99, default0.50), plus real-time preview for Mask Grow, Mask Blur, Mask Invert, and overlay opacity. - Mask application modes:
post_composite(recommended for natural lighting/shadows),latent_mask,both, oroff.
- Uses ComfyUI's native SAM 3.1 pipeline (
- 3 Editing Pipelines & Built-In Edit LoRA
addguide_edit(default): Injects source video viaMiniMaxH3AddGuide(frame_idx=0) with built-in Edit LoRA selection (e.g., Alissonerdx/Minimax-H3-ComfyUIvfx_editLoRA) and automaticvfx_edit:prefixing. Also supports optionalref_imagefor First-Frame-Propagate (FFP) workflows.refvideo_no_lora: Reference-video editing viaMiniMaxH3ReferenceToVideowithout LoRA.latent_inpaint: Mask-guided latent inpainting without LoRA.- External
prompt_inputsocket automatically overrides and grays out the in-node Edit Prompt box when connected.
- Native Context Windows + Draft-to-Full Latent Upscale + Deflicker
- Applies ComfyUI's native
IndexListContextHandler(STATIC_STANDARD,pyramid/overlap-linear/flat,FreeNoise) with MiniMax-H3 native defaults (length = 124,overlap = 39) — not CCW. - Draft generation (
auto_960,0.5,0.67,0.75,1.0) followed by Pass 2MiniMaxH3LatentUpscaleWithModelback to original video resolution using clean pre-AddGuide conditioning (defaultupscale_denoise = 0.30). - Built-in
VideoDeflicker(default1.00, auto-skipped whenoptical_flow_modelis unconnected). splice_full_videoseamlessly splices the edited range back into the original full-length video and audio, or selectedited_segment_only.
- Applies ComfyUI's native
- Compact 2-Column Smart UI
- Collapsible I/O slots (
▾ I/O/▸ I/O) with live connection counts. - Folder-style settings tabs (
Edit / Mask,Sampler / Ctx,Up / Out), horizontal drag numeric inputs, native-style 32-bit seed shuffle toggle, and full English tooltips.
- Collapsible I/O slots (
Installation
Via ComfyUI Registry / ComfyUI-Manager
Search for ComfyUI-H3-Edit in ComfyUI-Manager or install via comfy-cli:
comfy node registry-install comfyui-h3-edit
Manual Installation
cd ComfyUI/custom_nodes
git clone https://github.com/javawock7618/ComfyUI-H3-Edit.git
cd ComfyUI-H3-Edit
pip install -r requirements.txt
Restart ComfyUI and hard-reload your browser (Ctrl + F5).
Quick Usage
- Add
ComfyUI-H3-Edit(ComfyUI-H3-Editcategory) and connect your MiniMax-H3model,clip,vae_video, andvae_audio(plus optionallatent_upscale_model,optical_flow_model,ref_image, orprompt_input). - Drop a video onto the preview stage (or click Load Video) and drag the blue trim handles on the filmstrip to select the range to edit.
- In the
Edit / Masktab:- Select your
vfx_editLoRA under Edit LoRA (inaddguide_editmode). - (Optional) Select a native SAM 3.1 Ckpt, enter a target in the SAM prompt box (e.g.
person,jacket), click 🎯 Preview to check a frame or 🎬 Track to track the trimmed range, and fine-tune SAM Threshold, Mask Grow, and Mask Blur.
- Select your
- Enter your edit instruction in Edit Prompt (or connect
prompt_input), then queue the prompt.
Inputs & Outputs
- Required Inputs:
model,clip,vae_video,vae_audio - Optional Inputs:
prompt_input,ref_image,latent_upscale_model,optical_flow_model - Outputs:
images(IMAGE): Full spliced video (or edited segment only, depending onOutput Scope)audio(AUDIO): Original audio (keep_original), H3 generated audio (generated_h3), orNone(mute)mask(MASK): Processed SAM 3.1 mask aligned toimagesedited_segment(IMAGE): Edited range frames onlyfps(FLOAT): Source video frame rate
Included Workflow
workflows/ComfyUI-H3-Edit.json: Example workflow wired with MiniMax-H3 loaders (Model / CLIP / Video & Audio VAE / Latent Upscale Model / Optical Flow), optionalllama.cppprompt enhancer (prompt_input),ComfyUI-H3-Edit, andjvX_PreviewVideo.
License
GNU General Public License v3.0 — see LICENSE.