Minimax_H3_Face_Resample
Crop-level img2img that can also fix someone else's video
- crop_images
- face_pack
- parameter
- sigmas
- info
- audio
- model
- vae
- audio_vae
- clip
- sampler
- ref_images
- ref_videos
- ref_video_audios
- images
- bbox
- identity_refs
This is the middle node of the pack's face-fix trio and the only one that actually generates anything. Minimax_H3_Face_Cut hands it uniform res × res crop rows; this node runs a block-level img2img pass over those crops with the same MiniMax H3 model, VAE and text encoder your main sampler used; Minimax_H3_Face_Blend pastes the result back.
Mechanically it's an ADetailer-style detected-crop re-render - the loop the detailing doc describes as zoom in on a mask, upscale, diffuse, composite. What's specific here is that the "crop" is a video with chunk seams in it, so the crop rows are split into blocks that mirror your main sampler's segmentation, each block gets inter-block continuation anchoring, and each block's encoding is padded to the 17n+5 frame grid and trimmed after decode. The refinement inherits the same temporal structure as the thing it's repairing instead of fighting it.
The two wiring modes are the part people trip over. In integrated mode you connect info from the main H3 sampler; the node then pulls model/VAE/CLIP out of that info and ignores its own model/vae/clip ports entirely. In standalone mode you leave info empty and wire the local model/VAE/CLIP yourself - which is how you use this on ordinary video that H3 never touched, and it's a genuinely useful escape hatch for repairing faces in anything. The parameter port is required in both modes. It's not the main sampler's info; don't cross the wires, and specifically don't connect Face_Cut's shot_info here - that node explicitly says it doesn't consume it.
Inputs that matter
Two required inputs are just plumbing: crop_images and face_pack, both straight off Face_Cut. Beyond those and the two wiring-mode inputs (info, or model/vae/clip):
sigmas- required, both modes. A decreasing σ schedule ending at 0, normally from a scheduler node. This is your denoise: the starting σ is how much noise gets added to the crop, so a lower start is a gentler fix.SplitSigmas' low output works (it ends at 0), and raising its step softens the repair - just keep the step under your total step count, or the low side shrinks to a bare 0 and refinement degenerates into a pass-through. Newer ComfyUI builds haveSplitSigmasDenoise, which splits by denoise value directly and is less fiddly.face_prompt- a face-specific prompt, with a real job. Your scene prompts were written for whole-shot generation and often say nothing about faces; at high σ they actively mislead the redraw. Use this to state what you actually want.prompt_mode- how that combines with the original per-segment prompt.prependkeeps the scene context and your reference declarations.replace_textkeeps only the reference tags.replace_alldrops the segment prompt entirely. For high-σ structural repair,replace_textis the author's first choice.identity_ref(default true) - the main anti-jitter lever. It picks the sharpest crop row per identity and injects it as a<Picture N>reference for that identity's redraw, so the face doesn't reinvent itself between blocks. Making things worse? Just turn it off.seed- keepcontrol_after_generateon fixed. Randomise it and the row cache will never hit.color_match(default true) - Reinhard-style per-subtrack colour match back to the source crops so the repaired face sits in its surroundings. Applied after the cache loads, so toggling it is free.sampler_name/schedulerand the optionalsamplerport are standalone-mode only - integrated mode gets the sampler frominfo, and plugging asamplerin overrides both dropdowns.- Optional autogrow
ref_images/ref_videos/ref_video_audios- only passed when declared in the segment prompt with a Picture tag. Index subtlety: the auto identity anchor is<Picture 1>with no refs connected, and shifts to "connected refs + 1" when you have some - two ref images in means your auto anchor is<Picture 3>. - Optional
audiomatters only in images mode, where the pack has no audio ledger: connect the source audio and it's encoded withaudio_vaefor lipsync. With neither, you get a silent placeholder and a warning.
Outputs: images (the refined canvas, row-for-row matching crop_images) → Face_Blend's canvas. bbox (the repackaged geometry pack) → Face_Blend's bbox. identity_refs previews the anchors actually used this run - check it, because a wrong anchor means the wrong identity gets repaired and you'll only find out three nodes later.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/supElement/ComfyUI_MinimaxH3_AutoContext.git
cd ComfyUI_MinimaxH3_AutoContext
pip install -r requirements.txt
Or search ComfyUI_MinimaxH3_AutoContext in Manager, then restart. Either way you need the H3 model, video VAE, audio VAE and CLIP - integrated mode pulls them out of info, standalone mode makes you wire them yourself. "Standalone" means the video wasn't made by this sampler; the repair still runs on H3.
Common issues
"Resample reports missing inputs." Two causes, one per mode: integrated mode without info connected, or standalone mode without model + vae + clip. The parameter port being connected doesn't count - it's required in both modes but is not the wiring-mode switch.
The face stays stubbornly identical to the original. Your σ start is too low, usually from a too-aggressive SplitSigmas step. Same if you went looking for a denoise slider: there isn't one, σ is it.
An obvious hard seam at a chunk boundary. Try prompt_mode: replace_text for high σ, and keep color_match on. If it persists, the repair is too aggressive for that window - lower the σ start.
Identity drifts across blocks. This is what identity_ref exists for. Confirm with its identity_refs output that the anchor is the right person and not a blurry frame.
Nothing changes when you re-run with different settings. Cache. Changing the σ schedule invalidates automatically; changing prompts, seeds or reference declarations does too. When in doubt, tick clear_cache or delete ComfyUI/output/cache/node_<node id>/. The pack caps that directory at 32 GB and evicts oldest-first (H3_CACHE_MAX_GB tunes it, 0 disables).
Inputs (23)
| Name | Type | Default | Description |
|---|---|---|---|
| crop_images | IMAGE | crop_images from H3FaceCut (uniform res^2, row order = subtrack order, ALL frames kept) 来自 H3FaceCut 的 crop_images (统一 res², 行序=子轨序, 全帧保留) | |
| face_pack | DICT | face_pack from H3FaceCut 来自 H3FaceCut 的 face_pack | |
| parameter | DICT | Output of Minimax_H3_AutoContext_parameter (REQUIRED in both wiring modes). Ignored keys: width/height/total_frames/video_guide. Minimax_H3_AutoContext_parameter 节点的输出 (两种接线模式均必选)。忽略键: width/height/total_frames/video_guide。 | |
| sigmas | SIGMAS | Refinement sigma schedule (decreasing, last=0) 精修 σ 阶梯 (单调递减, 末值0) | |
| seed | INT | 00–18446744073709550000 | Block sampling seed. In standalone mode also the conditioning seed 块采样种子。独立模式下同时作为 conditioning 种子 |
| sampler_name | COMBO | euler | STANDALONE mode only 仅独立模式使用 |
| scheduler | COMBO | simple | STANDALONE mode only 仅独立模式使用 |
| face_prompt | STRING | clear and well-defined facial structure: sharp but natural eye contours, distinct iris and pupil, defined eyelid crease, clear lip shape, natural eyebrow structure; skin retains visible pores and natural highlight rolloff; no blur, no smearing, no distortion, no melting or twisted features; not smoothed into a plastic or mask-like appearance | Face-repair prompt, composed with the original per-segment prompt according to prompt_mode. Scene prompts from the parameter node are written for whole-shot generation and often say nothing useful about faces — at high sigma they actively mislead the redraw. Ref declarations (<Picture N> etc.) are always preserved per prompt_mode 修脸专用提示词, 按 prompt_mode 与原分段提示词组合。parameter 的场景提示词是为整镜头生成写的, 往往没有面部描述 — 高 σ 重绘时甚至会误导结果。参考声明 (<Picture N> 等) 按 prompt_mode 规则保留 |
| prompt_mode | COMBO | prepend | How face_prompt combines with the original block prompt: - prepend: face_prompt + original (keeps environment context & refs) - replace_text: face_prompt + ONLY the ref tags of the original (drops scene text; best for high-sigma structural repair) - replace_all: face_prompt alone (refs dropped unless you declare them) face_prompt 与原分段提示词的组合方式: - prepend: 修脸词 + 原提示词 (保留环境上下文与参考声明) - replace_text: 修脸词 + 仅保留原提示词中的参考声明 (丢弃场景文本, 高 σ 结构修复首选) - replace_all: 仅修脸词 (参考素材不再传递, 除非自行声明) |
| identity_ref | BOOLEAN | true | Auto identity anchor: picks the sharpest crop row of each identity and passes it as a <Picture N> reference for that identity's redraw — keeps identity and appearance consistent across frames/blocks at high sigma (the main anti-jitter lever, together with face_prompt and the fixed per-identity noise seed) 自动身份锚: 为每条身份挑选最清晰的一帧裁剪, 以 <Picture N> 参考图形式注入该身份的重采样 — 高 σ 下保持跨帧/跨块的身份与外观一致 (与修脸提示词、身份固定噪声种子共同构成抗抖三件套) |
| color_match | BOOLEAN | true | Reinhard-style color match of each resampled subtrack to its source crop rows so the blended face matches its surroundings. Applied AFTER cache load — toggling does NOT invalidate cache 将每条重采样子轨与对应裁剪行做 Reinhard 式色彩匹配 (逐通道均值/方差, 按子轨统计)。在缓存加载之后执行 — 切换开关不会使缓存失效 |
| enable_cache | BOOLEAN | true | Cache per-subtrack canvas rows (keyed by crop-rows hash + block seeds + sigmas + prompts + refs + sampler + fps + lock_audio + model/VAE/CLIP fingerprints). Identical reruns skip sampling 按子轨缓存画布行 (键: 裁剪行指纹+块种子+σ+提示词+参考素材+采样器+fps+lock_audio+模型/VAE/CLIP 指纹)。一致的重复运行将跳过采样 |
| clear_cache | BOOLEAN | false | Delete this node's cache directory before running 运行前删除本节点的缓存目录 |
| infoopt | DICT | INTEGRATED mode: connect the main sampler's info (h3_runtime + seg_sizes/boundaries/segment_prompts). STANDALONE mode: leave EMPTY. Do NOT wire Face_Cut's shot_info here — it is not consumed; shot_info belongs to the parameter node. 集成模式: 接主采样节点的 info。独立模式: 留空。不要把 Face_Cut 的 shot_info 接到这里 — 本节点不消费它, shot_info 应接 parameter 节点的 shot_info 端口 | |
| audioopt | AUDIO | Audio ledger for images mode (pack.a_lat is empty there): connect the source video's audio; encoded internally with audio_vae (lip sync). pack.a_lat (latent mode) wins when present; silent placeholder + warning if neither exists images 模式的音频账本 (此时 pack 内无 a_lat): 接源视频音频, 内部用 audio_vae 编码 (口型同步)。latent 模式的 pack.a_lat 优先; 两者皆无时用静音占位并警告 | |
| modelopt | MODEL | STANDALONE mode only: diffusion model for resampling. Ignored when info carries h3_runtime 仅独立模式: 重采样用的扩散模型。info 携带 h3_runtime 时被忽略 | |
| vaeopt | VAE | STANDALONE mode only: video VAE for canvas encode/decode 仅独立模式: 画布编码/解码的视频 VAE | |
| audio_vaeopt | VAE | STANDALONE mode only: audio VAE, encodes the audio port (lip sync) 仅独立模式: 音频 VAE, 编码 audio 端口 (口型同步) | |
| clipopt | CLIP | STANDALONE mode only: text encoder for block prompts 仅独立模式: 块提示词的文本编码器 | |
| sampleropt | SAMPLER | STANDALONE mode only: external SAMPLER, overrides sampler_name/scheduler 仅独立模式: 外部采样器, 接入后覆盖 sampler_name/scheduler | |
| ref_imagesopt | COMFY_AUTOGROW_V3 | — | |
| ref_videosopt | COMFY_AUTOGROW_V3 | — | |
| ref_video_audiosopt | COMFY_AUTOGROW_V3 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| bbox | DICT | — |
| identity_refs | IMAGE | — |