MiniMax H3 ComfyUI Workflow: Video Inpainting & Object Replacement @ComfyUIworkflows
MiniMax H3 ComfyUI Workflow: Video Inpainting & Object Replacement  @ComfyUIworkflows
Uploaded August 2026 | Updated November 2026, 1 day ago
MiniMax H3 in ComfyUI can now edit an existing video instead of generating a new one. In this workflow I track an object with SAM3, control the mask, and replace it using MiniMax H3 Ref2VA.

The result depends almost entirely on the mask, so most of this video is about getting that part right. I replace a car first, then a much harder shot where a dragon enters the scene. My first attempts failed, and I show the exact settings I changed to fix them.

What the workflow does

NKD Timeline prepares the source clip: resolution in megapixels, output size aligned to a multiple of 32, frame count using the 17n+5 structure H3 needs, plus aspect ratio, frame rate and audio. You can also trim the working section here instead of editing the source somewhere else first.

SAM3 finds and tracks the object you want to edit. The SAM3 prompt is only the object name, such as "car". Keep it separate from your generation prompt.

Mask Cleanup makes the tracked mask more stable and removes short mask noise.

MVEx Subject Crop builds a stable working area around the object. Three modes: Tracked, Combined and Zoomed.

NKD Mask Ops prepares the latent mask H3 actually uses, because H3 works in compressed latent space. A second mask with feather 8 blends the generated crop back into the original video.

Gemma 4 writes the H3 generation prompt from a short, rough description. Your English does not need to be perfect.

Settings from my tests

Car: detection threshold 0.35, crop mode Tracked. The first result broke where the working area was too tight, so I raised the crop scale to 4.

Dragon: detection threshold 0.7, crop mode Combined, mask expand 10, crop scale 2.25, working section shortened to 14.38 seconds. Larger was not automatically better.

One thing worth knowing: my reference car was grey, but the output was black, because my prompt asked for a black sports car. The prompt still influences appearance even when Picture 1 is the visual reference.

Models used

MiniMax H3 Ref2VA INT8
Qwen3-VL 32B AWQ text encoder
Video VAE and audio VAE
SAM3.1 for tracking
Gemma 4 for the auto prompt

Custom node packs

MaskVidExperiments
ComfyUI-NKD-Basic-Tools
ComfyUI-NKD-Preview-Tools


Resources

Workflow file: aistudynow.com/minimax-h3-video-inpainting-in-comfyui-replace-moving-objects-with-masks

MiniMax H3 Ref2VA INT8: huggingface.co/Comfy-Org/MiniMax-H3/resolve/main/diffusion_models/minimax_h3_ref2va_pruned_int8_convrot.safetensors?download=true

Qwen3-VL 32B AWQ: huggingface.co/Comfy-Org/MiniMax-H3/resolve/main/text_encoders/qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors?download=true

SAM3.1: huggingface.co/Comfy-Org/sam3.1/resolve/main/checkpoints/sam3.1_multiplex_fp16.safetensors?download=true

Gemma 4: huggingface.co/Comfy-Org/gemma-4
MaskVidExperiments: github.com/drozbay/MaskVidExperiments
ComfyUI-NKD-Basic-Tools: github.com/Nekodificador/ComfyUI-NKD-Basic-Tools
ComfyUI-NKD-Preview-Tools: github.com/Nekodificador/ComfyUI-NKD-Preview-Tools

## Workflow Credit

The JSON below is a modified derivative of the MiniMax H3 Ref2VA inpainting
workflow built by Tensor Alchemist. His original video:
youtube.com/watch?v=58ydJUg5aR8

If this video is useful, subscribe for more MiniMax H3 and ComfyUI videos.

#MiniMaxH3 #ComfyUI #AIVideoEditing
MiniMax H3 ComfyUI Workflow: Video Inpainting & Object ReplacementComfyUI Pyramid flow Workflow | Beat Gen 3 Alpha in Image to Video | how to install | TutorialApply ANY Style to ANY Video in ComfyUI WAN 2.1 Depth Lora Workflow Tile 4K Upscale (No AnimateDiff)Wan 2.2 S2V-14B in ComfyUI Workflow: Speech-to-Video (GGUF, Low VRAM)ComfyUI Flux Upscale:- Using Flux ControlNet Tile & 4x Upscale Simple WorkflowComfyUI Krea 2 Edit: New VAE Trick (+ Free Workflow)Lynx ComfyUI Workflow: Realistic, Consistent Characters, No LoRA Needed💥 Don’t Miss Out! Download ComfyUI Desktop in Minutes | Learn How to Download and Install NowCogVideo X Advanced WorkFlow ComfyUI: Lora | ControlNet | Text to Video | Image to Video | TutorialWan 2.1 FusionX GGUF ComfyUI Advanced Text-to-Video & Image-to-Video Workflow - Runs on low VRAM😲 Can Shuttle Beat Flux in Just 4 Steps? Comfyui Shuttle Workflow in 3 Seconds! with 8x Tile UpscaleZ Image Turbo ComfyUI AIO: Low VRAM, Hard Prompts Test
ComfyUI Workflow Blog |

MiniMax H3 ComfyUI Workflow: Video Inpainting & Object Replacement

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER