MiniMax H3 Aicg 已选视频上下文
What Selected Video Context is really for
- h3_bundle
- media
- media_1
- media_2
- media_3
- media_4
- media_5
- media_6
- media_7
- media_8
- media_9
- media_10
- media_11
- media_12
- media_13
- media_14
- media_15
- model
- h3_context
MiniMax H3's V2V motion transfer was the thing people noticed on launch day - the community's own words were "can do motion control like Kling". AICG3D_H3SelectedVideoContext (MiniMax H3 Aicg 已选视频上下文) is the pack's take on that: take an existing video, slice it into segments on H3's frame grid, and regenerate it with your own references. Replace the person, replace the background, or just re-render the whole thing at a different style and resolution.
It's the entry point of the pack's video-replacement workflow, and it differs from the text-to-video context node in one way that matters: the source video is the timeline master. Segment count, segment lengths and the audio all come from that video, not from a seconds widget.
The one setting that decides everything
video_reference is the fork in the road, and the tooltip is unusually blunt about it:
- On - the original clip goes in as a
<Video 1>reference and sampling starts from an empty latent. You can change person and background thoroughly, but the motion is only inferred from the reference, so it may not match the original. - Off - no reference video; sampling starts from the original clip's own latent. Motion is locked; the person and background get repainted, and how much is decided by the denoise in your schedule. 0.4–0.6 keeps the motion, 0.8 is close to a redraw, 1.0 throws the motion away.
A companion control, source_reference_scale (0–1, default 0.34), only applies when video_reference is on: how far the source is scaled down before being fed as a reference. At 1.0 the model happily copies the original actor's face and clothes. Changed the reference image and the output still looks like the original person? Drop this toward 0.15.
And face_anchor is the identity lock: it crops a face out of your reference image, pastes it onto each segment's source first frame, and feeds that as a keyframe. On, with video_reference on, gives the strongest identity but drags the original silhouette along. Off is the "keep the motion, swap the face" combination - motion anchored by the source latent, identity anchored by the face, denoise 0.45–0.55. (It needs ultralytics and a face_yolov8m.pt in models/ultralytics/bbox/, otherwise it silently falls back to no anchoring and just logs a warning.)
Splitting and shaping
segment_mode is whole_video, time_cuts or frame_cuts, and segment_cuts takes the cut points - the sibling 自动分段切点 node will compute them for you from "every N seconds". context_length (5–141, step 17) is how many frames of the previous segment condition the next one. continuity_mode picks latent_guide / guide / soft_av / hard_av - latent is the lossless cheap one.
There's also a shortcut worth using: replacement_target with replace_people, replace_background or multi_reference generates the prompt for you and switches the plan to per-second slicing with reassembly. replacement_total_seconds limits the replacement to the first N seconds (0 = the whole thing), and replacement_description appends your own constraints to the auto-prompt.
output_resolution and output_aspect_ratio both default to 跟随原片 (follow the source). Pick 720P and 16:9 and you're changing the canvas deliberately instead of inheriting a phone video's 9:16. cleanup_after_run is the finishing move - 卸载模型 unloads and reclaims after 分段解码 finishes, 释放缓存 just hands the cache back (faster next run).
Inputs and outputs
Source media arrives through the pack's resource-library inputs (media, media_1…media_15) - the first video in that library is the timeline master. Required is h3_bundle, then mode (Ref2VA / T2VA / I2VA / FL2VA / L2VA / image / digital_human) and prompt.
Outputs are model and h3_context. The context goes into 分段采样, which auto-detects a selected-video plan and VAE-encodes your source ranges into the same segment intermediate the normal path uses - no denoising happens at this stage. Then 分段二采 if you want a second pass, then 分段解码.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/JGRFW/comfyui-AICG3D
Restart and hard-refresh. Face anchoring additionally wants pip install ultralytics plus the YOLO face model; everything else is in the pack. And the usual caveat for anything H3: the local weights are licence-locked out of the US, EU, UK and Korea.
Common issues
Denoise is doing nothing because it's the wrong denoise. With video_reference off, the refine pass prints a hint when your schedule starts above 0.75 that you're about to lose the motion. It's right. Lower it.
"Selected-video segment N has an invalid frame range." Cut points that don't fit the snapped timeline - H3 rounds to a 17k+5 frame grid. Let 自动分段切点 emit the cuts rather than hand-writing them.
Face swap ignored. No detector, no anchor. Check the console line about face_yolov8m.pt.
Beginners tend to reach for video_reference on because "more reference is better". It isn't. If you want the original performance, turn it off and start from the source latent - the whole point of this node is that you get both routes.
Inputs (62)
| Name | Type | Default | Description |
|---|---|---|---|
| h3_bundle | MINIMAX_H3_BUNDLE | — | |
| mode | COMBO | reference | Ref2VA 综合参考;T2VA 纯文本;I2VA 单张首帧;FL2VA 首尾两帧;L2VA 单张尾帧;数字人锁定素材音频。 |
| prompt | STRING | — | |
| segment_mode | COMBO | whole_video | 3 options: whole_video, time_cuts, frame_cuts |
| segment_cuts | STRING | — | |
| context_length | INT | 55–141 | — |
| continuity_mode | COMBO | latent_guide | 4 options: latent_guide, guide, soft_av, hard_av |
| advanced | BOOLEAN | false | — |
| keyframe_role | COMBO | first | 2 options: first, last |
| ref_image_size | COMBO | 1k | 5 options: match, 1k, 1.5k, 2k, original |
| reference_mention_mode | COMBO | index | 2 options: filename, index |
| prompt_optimizer_settings | BOOLEAN | false | — |
| prompt_optimizer_scene_guide | COMBO | none | 19 options: none, 3d_animation_short, brand_promo, coop_game_intro, handdrawn_live, minimalist_product_ad, +13 |
| context_prompt_optimizer_mode | COMBO | whole_sequence | 2 options: whole_sequence, per_segment |
| context_prompt_optimizer_concurrency | INT | 31–20 | — |
| auto_cuts | BOOLEAN | true | — |
| segment_seconds | FLOAT | 5.00.5–60 | — |
| snap_to_latent_grid | BOOLEAN | true | — |
| max_segments | INT | 1201–600 | — |
| video_reference | BOOLEAN | true | 决定走哪条通路(直接影响动作一致性): 开 = 原片当 <Video 1> 参考,从空潜变量重画:换人换景更彻底,但动作只是从参考里推出来的,容易和原片不一致; 关 = 不给原片参考,直接从原片潜变量起步:动作最稳,人物/背景按参考图重绘,重绘幅度由「步数 / 调度」里的 denoise 决定——0.4~0.6 = 动作基本保持;0.8 以上接近重画;1.0 = 动作基本丢。 |
| output_resolution | COMBO | 跟随原片 | 输出分辨率。默认「跟随原片」= 按源视频自己的像素出片(老行为);选 480P / 720P / 1080P 等档位,就按该档位的像素量 + 右边选的宽高比重算画布。 |
| output_aspect_ratio | COMBO | 跟随原片 | 输出宽高比。默认「跟随原片」;改成 16:9 / 9:16 等就把画幅换掉——在「跟随原片」档下像素总量按原片规模保留,只换形状。 |
| cleanup_after_run | COMBO | 卸载模型 | 整条线跑完(⑥ 分段解码之后)怎么收尾:卸载模型 = 连模型一起卸出显存并回收内存,占用最低,代价是下次运行要重新加载;释放缓存 = 只把缓存还给驱动,模型留在显存里,下次运行更快;不处理 = 保持 ComfyUI 默认行为。 |
| source_reference_scale | FLOAT | 0.340–1 | 原片参考强度(换人模式专用):原片作为 <Video 1> 参考时缩小到原来的几倍。1.0 = 原样喂给模型,最容易把原片的人物/服装/背景一起照抄下来;0.34 = 默认(约 1/9 像素),只留下构图、动作、景别;调到 0.15 以下基本只剩动作轮廓,人物长相就只能靠参考图重新生成——如果换了参考图但成片还是原片那个人,就把这一格往小调。 |
| face_anchor | BOOLEAN | true | 锁脸(人脸锚定):从参考图里抠出人脸,贴到每段原片首帧的人脸位置,再把这一帧当关键帧送进采样,逼模型用参考图的长相。 · 换人模式=开:每段首帧 = 原片画面 + 参考脸,身份最重,但容易被原片轮廓带回原人; · 换人模式=关(保动作):动作先由原片潜变量锚死,首帧再用参考脸锚一次身份——想要「动作不变 + 换成参考图那个人」就用这个组合,配上 denoise 0.45~0.55。 |
| replacement_target | COMBO | custom | 简化模式:只替换人物,或只替换背景。选择后,节点自动生成对应提示词,并自动使用按每段秒数切分、逐段替换、最后拼回完整视频。 |
| replacement_total_seconds | FLOAT | 0.00–600 | 替换总时长(秒)。0 = 使用整条原视频;例如原片 20 秒填 10 就只替换前 10 秒。 |
| replacement_description | STRING | 补充说明要替换的人物、服装、场景或必须保持的内容,会附加到自动提示词。 | |
| mediaopt | * | — | |
| prompt_optimizer_resourcesopt | STRING | — | |
| prompt_optimizer_markeropt | STRING | — | |
| prompt_optimizer_prompt_connectedopt | BOOLEAN | false | — |
| media_1opt | * | — | |
| media_type_1opt | STRING | — | |
| media_2opt | * | — | |
| media_type_2opt | STRING | — | |
| media_3opt | * | — | |
| media_type_3opt | STRING | — | |
| media_4opt | * | — | |
| media_type_4opt | STRING | — | |
| media_5opt | * | — | |
| media_type_5opt | STRING | — | |
| media_6opt | * | — | |
| media_type_6opt | STRING | — | |
| media_7opt | * | — | |
| media_type_7opt | STRING | — | |
| media_8opt | * | — | |
| media_type_8opt | STRING | — | |
| media_9opt | * | — | |
| media_type_9opt | STRING | — | |
| media_10opt | * | — | |
| media_type_10opt | STRING | — | |
| media_11opt | * | — | |
| media_type_11opt | STRING | — | |
| media_12opt | * | — | |
| media_type_12opt | STRING | — | |
| media_13opt | * | — | |
| media_type_13opt | STRING | — | |
| media_14opt | * | — | |
| media_type_14opt | STRING | — | |
| media_15opt | * | — | |
| media_type_15opt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| h3_context | MINIMAX_H3_CONTEXT | — |