Nodes/MiniMax H3 Audio T8/MiniMax H3 Face Refine Plan / 远景脸修复规划 (Advanced)
ComfyUI Node

MiniMax H3 Face Refine Plan / 远景脸修复规划 (Advanced)

Plan the face-repair crops before you touch the sampler

By T8mars·Created 20 days ago·Updated a day ago· 807
MiniMax H3 Face Refine Plan / 远景脸修复规划 (Advanced)
  • frames
  • face_plan
  • crops
  • preview
  • report_json
  • canvas_width
  • canvas_height
  • frame_count
fps24.00
detector_modelocal_opencv_yunet
detector_model<no local face detector found>
detector_devicecpu
confidence0.35
manual_roi_x0.30
manual_roi_y0.10
manual_roi_width0.40
manual_roi_height0.55
scene_cut_threshold0.28
max_track_jump0.18
max_gap_frames4
smoothing_radius2
crop_context_scale3.0
canvas_sizeauto_512
require_h3_gridtrue
analysis_chunk_frames8

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 stated fps. Feed it the real frames, not a downscaled copy; the plan is source-bound.
  • detector_mode - default local_opencv_yunet: OpenCV's YuNet face detector, MIT-licensed, running on CPU. There's an anime ONNX route (EXP), a manual_static_roi fallback, 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 (default auto_512) and require_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.

CategoryT8/MiniMax H3/Quality/Experimental

Inputs (18)

NameTypeDefaultDescription
framesIMAGEExact source IMAGE batch at the stated fps.
fpsFLOAT24.000.01–240
detector_modeCOMBOlocal_opencv_yunetOpenCV 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_modelCOMBO<no local face detector found>1 options: <no local face detector found>
detector_deviceCOMBOcpu2 options: cpu, cuda_auto
confidenceFLOAT0.350.01–1
manual_roi_xFLOAT0.300–1
manual_roi_yFLOAT0.100–1
manual_roi_widthFLOAT0.400.01–1
manual_roi_heightFLOAT0.550.01–1
scene_cut_thresholdFLOAT0.280.01–1Low-resolution RGB mean absolute difference; smoothing resets at every cut.
max_track_jumpFLOAT0.180.01–1
max_gap_framesINT40–48
smoothing_radiusINT20–24
crop_context_scaleFLOAT3.01.2–8
canvas_sizeCOMBOauto_5125 options: auto_512, 384, 512, 640, 768
require_h3_gridBOOLEANtrue
analysis_chunk_framesINT81–64

Outputs (7)

NameTypeDescription
face_planH3_T8_FACE_REFINE_PLAN
cropsIMAGE
previewIMAGE
report_jsonSTRING
canvas_widthINT
canvas_heightINT
frame_countINT