MiniMax H3 Face Refine Plan / 远景脸修复规划 (Advanced)
Plan the face-repair crops before you touch the sampler
- frames
- face_plan
- crops
- preview
- report_json
- canvas_width
- canvas_height
- frame_count
Every H3 user eventually hits it: the wide shot where your character's face is 60 pixels of mush. H3 is a joint AV transformer, so you can't just inpaint a face like it's SDXL - but you can run a second, low-denoise H3 pass on just the face region. That's the whole face-refine pipeline this pack builds, and MiniMaxH3FaceRefinePlanT8Advanced is where it starts. It's the planning node: it looks at your source video, finds and tracks faces, spots scene cuts, and produces the cropped face strips plus a plan that every downstream face-refine node consumes.
It's shot-aware, which matters more than it sounds. Real video cuts - a new camera angle, a hard cut - mean the face tracking should reset, not try to keep one wobbly track alive through a cut. The node detects cuts via a low-resolution RGB mean absolute difference (scene_cut_threshold, default 0.28) and resets its smoothing at every one. max_track_jump (0.18) and max_gap_frames (4) govern when a face is the same face across frames versus a new detection.
The inputs you'll actually touch:
frames- the exact source IMAGE batch at the statedfps. Feed it the real frames, not a downscaled copy; the plan is source-bound.detector_mode- defaultlocal_opencv_yunet: OpenCV's YuNet face detector, MIT-licensed, running on CPU. There's an anime ONNX route (EXP), amanual_static_roifallback, and a local Ultralytics option. Nothing downloads a model at execution time.confidence(0.35) - detection threshold; raise it if you're catching false faces, lower it if real faces are missed.crop_context_scale(3) - how much context around the face each crop keeps. More context = more stable, but bigger latents.canvas_size(defaultauto_512) andrequire_h3_grid(true) - crops get padded to H3's grid constraints, which is non-negotiable for the model to accept them.
The manual ROI fields (manual_roi_x/y/width/height) are there if detection is hopeless - a fixed rectangle beats a detector that keeps locking onto the wrong face. Outputs: face_plan (the H3_T8_FACE_REFINE_PLAN everything downstream consumes), crops, preview, report_json, plus canvas_width, canvas_height and frame_count for building your layout.
Two things to know before you build around it. First, it's deliberately conservative: it never downloads models and it never auto-accepts a candidate - the plan is a proposal you wire into the rest of the pipeline. Second, there's a real-world quirk in the description: the node destroys its detector object after planning, but OpenCV may retain process-global CPU allocator pages. That's not a leak in your workflow, it's a documented behavior - if your RAM usage looks sticky after a plan run, that's why.
Install: ComfyUI Manager → "MiniMax H3 Audio T8", or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/T8mars/comfyui-minimax-h3-audio-T8
Restart after. No forced pip deps, no model downloads - you'll need the H3 model, CLIP, VAE and LoRAs yourself for the actual refine pass, and YuNet comes from your local OpenCV. The plan node is CPU-only and cheap; the expensive part is the second H3 pass you're planning for.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| frames | IMAGE | Exact source IMAGE batch at the stated fps. | |
| fps | FLOAT | 24.000.01–240 | — |
| detector_mode | COMBO | local_opencv_yunet | OpenCV YuNet is the recommended real-person CPU route. The isolated anime ONNX route is EXP; manual ROI remains the fallback. No route downloads a model during execution. |
| detector_model | COMBO | <no local face detector found> | 1 options: <no local face detector found> |
| detector_device | COMBO | cpu | 2 options: cpu, cuda_auto |
| confidence | FLOAT | 0.350.01–1 | — |
| manual_roi_x | FLOAT | 0.300–1 | — |
| manual_roi_y | FLOAT | 0.100–1 | — |
| manual_roi_width | FLOAT | 0.400.01–1 | — |
| manual_roi_height | FLOAT | 0.550.01–1 | — |
| scene_cut_threshold | FLOAT | 0.280.01–1 | Low-resolution RGB mean absolute difference; smoothing resets at every cut. |
| max_track_jump | FLOAT | 0.180.01–1 | — |
| max_gap_frames | INT | 40–48 | — |
| smoothing_radius | INT | 20–24 | — |
| crop_context_scale | FLOAT | 3.01.2–8 | — |
| canvas_size | COMBO | auto_512 | 5 options: auto_512, 384, 512, 640, 768 |
| require_h3_grid | BOOLEAN | true | — |
| analysis_chunk_frames | INT | 81–64 | — |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| face_plan | H3_T8_FACE_REFINE_PLAN | — |
| crops | IMAGE | — |
| preview | IMAGE | — |
| report_json | STRING | — |
| canvas_width | INT | — |
| canvas_height | INT | — |
| frame_count | INT | — |