Extensions/ComfyUI-H3-Refiner
ComfyUI Extension

ComfyUI-H3-Refiner

All-in-one face and dual-hand video refinement custom node for MiniMax-H3 in ComfyUI.

By javawock7618·Created a day ago·Updated a day ago· 3
javawock7618/ComfyUI-H3-Refiner
Nodes—
On cloudLocal install
Stars3
Updateda day ago
Readme

ComfyUI-H3-Refiner

An all-in-one ComfyUI custom node for refining faces and dual hands in MiniMax-H3 videos.

Note: This custom node was created with Gemini.


Key Features

  • Single-Node All-in-One Pipeline: Built-in video loader (drag-and-drop / Browse), range trimming with optional 17k+5 snapping, face refinement, independent dual-hand refinement, and seamless range merge in one node (ComfyUIH3Refiner).
  • Full-Video Face Scanner & Target Picker: Scans all frames regardless of the selected trim range, clusters distinct faces, and lets you select a specific person (#1, #2, ...).
  • Target-Linked Hand Filtering: When a specific target face is selected, hand refinement automatically links to that subject—skipping other people across shot cuts and prioritizing hands belonging to the chosen person in multi-person frames.
  • Built-in SAM Support: Supports Ultralytics SAM presets (sam2.1_b.pt, sam2.1_s.pt, mobile_sam.pt, auto-downloaded into ComfyUI/models/sams/ on first use) as well as checkpoints placed in ComfyUI/models/sams/ (e.g. sam_vit_b_01ec64.pth). Models are offloaded to CPU after masking to preserve VRAM.
  • Clean, Motion-Aware Stitching: Uses Savitzky-Golay trajectory smoothing, per-frame denoise scaling, short motion-blur dropout bridging for hands, and source-pixel feathering with colour matching.
  • Compact Cropped Compare Output (compare_images): Outputs a compact side-by-side INPUT | RESULT comparison video of refined face and hand crops.
  • Collapsible I/O & 2-Tab UI: Supports collapsible I/O slots (Nodes 1.0 & Nodes 2.0) and a streamlined 2-tab layout (Models & Refine, Prompts & Sampler).

Installation

  1. Clone or place ComfyUI-H3-Refiner into ComfyUI/custom_nodes/:
    cd ComfyUI/custom_nodes
    git clone https://github.com/javawock7618/ComfyUI-H3-Refiner.git
    
  2. Install dependencies:
    pip install -r ComfyUI-H3-Refiner/requirements.txt
    
  3. Place YOLO face and hand detectors in ComfyUI/models/ultralytics/bbox/ (e.g., face_yolov8m.pt, hand_yolov8s.pt).
  4. (Optional) Place a SAM checkpoint in ComfyUI/models/sams/, or leave SAM Model on sam2.1_b.pt to auto-download on first run.
  5. Restart ComfyUI and hard-reload the browser (Ctrl + F5).

Quick Usage Guide

  1. Add ComfyUI-H3-Refiner (MiniMax H3/Refiner) and connect model, clip, vae_video, vae_audio, and optionally face_ref_image.
  2. Drop a video onto the preview stage or click Browse.
  3. (Optional) Drag the blue trim handles (or Shift + Click on the trim bar) to refine only a specific segment. Enable 17k+5 to snap the range to MiniMax-H3's frame grid.
  4. (Multi-person videos) Click Scan Faces in the Models & Refine tab and pick the target face (#1, #2, ...). Both face and hand passes will track that subject.
  5. Adjust Face Denoise (default 0.20), Hand Denoise (default 0.22), Mask Feather (default 6), and Steps (default 4 for turbo setups), then queue the workflow.
  6. Connect images, audio, and fps to your video save/preview nodes, and optionally inspect compare_images and preview.

Included Workflow

  • workflows/ComfyUI-H3-Refiner.json: Example workflow wired with MiniMax-H3 loaders, optional Face Ref Image, ComfyUI-H3-Refiner, comparison preview, and CreateVideo / SaveVideo.

License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See LICENSE and README.ja.md for the Japanese documentation.