ComfyPilotComfyPilot
工作流 / 视频工具 / 角色替换:MiniMax H3 Max
角色替换:MiniMax H3 Max

角色替换:MiniMax H3 Max

Cast Swap: MiniMax H3 Max

使用 MiniMax H3 Max Recast 替换已完成 CLIP 中的人物:连接最多四张参考照片,模型会在保留动作、构图、剪辑和原始音频的同时重写演员阵容。CLIP 时长为 5 到 30 秒,单个镜头不超过 15 秒,分辨率从 480P 到 1080P,并可选择更自然的皮肤和融合效果。非常适合无需重拍即可替换镜头中的演员、为主持人进行本地化,或用不同的面孔测试造型。

视频工具 5 个节点 2 个输入 230 次使用 ComfyUI ≥ 0.44.0 ComfyUI 10 KB

下载工作流 JSON 查看官方来源

下载后把文件拖进 ComfyUI 窗口即可打开。

节点构成

LoadVideo × 1
LoadImage × 1
MinimaxHailuo03MaxRecastNode × 1
SaveVideo × 1
MarkdownNote × 1

官方标注的模型

MiniMax H3

工作流 JSON

和上面「下载工作流 JSON」是同一份文件。

1{
2 "id": "a1166011-68a6-490d-9040-dcd56a4c3680",
3 "revision": 0,
4 "last_node_id": 5,
5 "last_link_id": 3,
6 "nodes": [
7 {
8 "id": 1,
9 "type": "LoadVideo",
10 "pos": [
11 100,
12 130
13 ],
14 "size": [
15 282.798828125,
16 82
17 ],
18 "flags": [],
19 "order": 0,
20 "mode": 0,
21 "inputs": [],
22 "outputs": [
23 {
24 "name": "VIDEO",
25 "type": "VIDEO",
26 "links": [
27 1
28 ]
29 }
30 ],
31 "properties": {
32 "Node name for S&R": "LoadVideo"
33 },
34 "widgets_values": [
35 "ad_video_demo.mp4",
36 "image"
37 ],
38 "widgets_values_named": {
39 "file": "ad_video_demo.mp4",
40 "upload": "image"
41 }
42 },
43 {
44 "id": 2,
45 "type": "LoadImage",
46 "pos": [
47 100,
48 300
49 ],
50 "size": [
51 282.798828125,
52 102
53 ],
54 "flags": [],
55 "order": 1,
56 "mode": 0,
57 "inputs": [],
58 "outputs": [
59 {
60 "name": "IMAGE",
61 "type": "IMAGE",
62 "links": [
63 2
64 ]
65 },
66 {
67 "name": "MASK",
68 "type": "MASK",
69 "links": null
70 }
71 ],
72 "properties": {
73 "Node name for S&R": "LoadImage"
74 },
75 "widgets_values": [
76 "woman_in_red.png",
77 "image"
78 ],
79 "widgets_values_named": {
80 "image": "woman_in_red.png",
81 "upload": "image"
82 }
83 },
84 {
85 "id": 3,
86 "type": "MinimaxHailuo03MaxRecastNode",
87 "pos": [
88 520,
89 170
90 ],
91 "size": [
92 400,
93 272
94 ],
95 "flags": [],
96 "order": 3,
97 "mode": 0,
98 "inputs": [
99 {
100 "name": "model.video",
101 "type": "VIDEO",
102 "link": 1
103 },
104 {
105 "name": "model.reference_images.image_1",
106 "type": "IMAGE",
107 "link": 2
108 },
109 {
110 "name": "model.reference_images.image_2",
111 "shape": 7,
112 "type": "IMAGE",
113 "link": null
114 }
115 ],
116 "outputs": [
117 {
118 "name": "VIDEO",
119 "type": "VIDEO",
120 "links": [
121 3
122 ]
123 }
124 ],
125 "properties": {
126 "Node name for S&R": "MinimaxHailuo03MaxRecastNode"
127 },
128 "widgets_values": [
129 "MiniMax H3 Max",
130 "@Image1 is now the woman in the video: keep her speaking to camera, holding the lipstick up the same way, same bright room with white flowers, same framing and timing.",
131 "768P",
132 true,
133 42,
134 "randomize",
135 "randomize"
136 ],
137 "widgets_values_named": {
138 "model": "MiniMax H3 Max",
139 "model.prompt": "@Image1 is now the woman in the video: keep her speaking to camera, holding the lipstick up the same way, same bright room with white flowers, same framing and timing.",
140 "model.resolution": "768P",
141 "model.enhance_realism": true,
142 "model.seed": 42,
143 "control_after_generate#1": "randomize",
144 "control_after_generate": "randomize"
145 },
146 "color": "#432",
147 "bgcolor": "#653"
148 },
149 {
150 "id": 4,
151 "type": "SaveVideo",
152 "pos": [
153 1000,
154 170
155 ],
156 "size": [
157 453.80198751024386,
158 296.70120974169953
159 ],
160 "flags": [],
161 "order": 4,
162 "mode": 0,
163 "inputs": [
164 {
165 "name": "video",
166 "type": "VIDEO",
167 "link": 3
168 }
169 ],
170 "outputs": [
171 {
172 "name": "video",
173 "type": "VIDEO",
174 "links": null
175 }
176 ],
177 "properties": [],
178 "widgets_values": [
179 "api_minimax_h3_max_recast",
180 "auto",
181 "auto",
182 "auto"
183 ],
184 "widgets_values_named": {
185 "filename_prefix": "api_minimax_h3_max_recast",
186 "format": "auto",
187 "format.codec": "auto",
188 "codec": "auto"
189 }
190 },
191 {
192 "id": 5,
193 "type": "MarkdownNote",
194 "pos": [
195 -286,
196 700
197 ],
198 "size": [
199 1100,
200 900
201 ],
202 "flags": [],
203 "order": 2,
204 "mode": 0,
205 "inputs": [],
206 "outputs": [],
207 "properties": [],
208 "widgets_values": [
209 "## Cast Swap: MiniMax H3 Max\n\n**Replace the people in a finished shot.** Recast keeps the motion, the framing, the cuts and the original sound, and swaps the people for the ones in your reference photos.\n\n---\n\n### What this graph does\n\n1. **Load Video**: the source clip. It must be 5 to 30 seconds long and no single shot inside it may run longer than 15 seconds.\n2. **Load Image**: the replacement person, at least 256 x 256. Connect up to four photos for up to four people: they become `@Image1` to `@Image4` in socket order.\n3. **MiniMax H3 Max Recast**: rewrites the people in the clip to match the photos.\n4. **Save Video**: writes the MP4.\n\n**Input Assets:** [ad_video_demo.mp4](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/refs/heads/main/input/ad_video_demo.mp4) · [woman_in_red.png](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/refs/heads/main/input/woman_in_red.png)\n\n---\n\n### Writing the prompt\n\nThe prompt says who becomes whom and what has to stay in place. Name the photos by their slot, `@Image1` for the first photo connected to the node, then say what the person is doing and what must not change:\n\n- `@Image1 is now the woman in the video: keep her speaking to camera, holding the lipstick up the same way, same bright room with white flowers, same framing and timing.`\n- Two people: `@Image1 replaces the presenter and @Image2 replaces the guest, keep the handshake and the pan.`\n- Do not describe the look of the new person: costume, hair and accessories follow the reference photo, so a photo of someone in a red suit comes back in a red suit. Spend the prompt on behaviour, blocking and what has to stay.\n\nThe prompt is optional, but the swap is much more predictable when it is there.\n\n---\n\n### Controls\n\n| Control | What it does |\n|---|---|\n| `model` | `MiniMax H3 Max` is the only option on this node |\n| `resolution` | `480P`, `768P` or `1080P`, default `768P` |\n| `enhance_realism` | More natural skin texture and better blending of the new person into the scene. The demo below was rendered with it on |\n| `seed` | Same prompt and seed give similar, not identical, results |\n\n### What the demo run produced\n\n`ad_video_demo.mp4` (1280 x 720, 5.04 seconds) kept its timing and its audio and came back at 1344 x 768 with the presenter replaced by the person in `woman_in_red.png`. The wardrobe followed the reference photo as well, red suit and beret instead of the original green top, and the face stayed stable across all 121 frames with no flicker on the product or the flowers.\n\n### Gotchas\n\n- One photo per person, assigned in socket order. Five photos is over the limit of four.\n- Clips shorter than 5 seconds, or with a shot longer than 15 seconds, are rejected before generation.\n- The source audio is kept, Recast does not regenerate speech.\n"
210 ],
211 "widgets_values_named": {
212 "text": "## Cast Swap: MiniMax H3 Max\n\n**Replace the people in a finished shot.** Recast keeps the motion, the framing, the cuts and the original sound, and swaps the people for the ones in your reference photos.\n\n---\n\n### What this graph does\n\n1. **Load Video**: the source clip. It must be 5 to 30 seconds long and no single shot inside it may run longer than 15 seconds.\n2. **Load Image**: the replacement person, at least 256 x 256. Connect up to four photos for up to four people: they become `@Image1` to `@Image4` in socket order.\n3. **MiniMax H3 Max Recast**: rewrites the people in the clip to match the photos.\n4. **Save Video**: writes the MP4.\n\n**Input Assets:** [ad_video_demo.mp4](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/refs/heads/main/input/ad_video_demo.mp4) · [woman_in_red.png](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/refs/heads/main/input/woman_in_red.png)\n\n---\n\n### Writing the prompt\n\nThe prompt says who becomes whom and what has to stay in place. Name the photos by their slot, `@Image1` for the first photo connected to the node, then say what the person is doing and what must not change:\n\n- `@Image1 is now the woman in the video: keep her speaking to camera, holding the lipstick up the same way, same bright room with white flowers, same framing and timing.`\n- Two people: `@Image1 replaces the presenter and @Image2 replaces the guest, keep the handshake and the pan.`\n- Do not describe the look of the new person: costume, hair and accessories follow the reference photo, so a photo of someone in a red suit comes back in a red suit. Spend the prompt on behaviour, blocking and what has to stay.\n\nThe prompt is optional, but the swap is much more predictable when it is there.\n\n---\n\n### Controls\n\n| Control | What it does |\n|---|---|\n| `model` | `MiniMax H3 Max` is the only option on this node |\n| `resolution` | `480P`, `768P` or `1080P`, default `768P` |\n| `enhance_realism` | More natural skin texture and better blending of the new person into the scene. The demo below was rendered with it on |\n| `seed` | Same prompt and seed give similar, not identical, results |\n\n### What the demo run produced\n\n`ad_video_demo.mp4` (1280 x 720, 5.04 seconds) kept its timing and its audio and came back at 1344 x 768 with the presenter replaced by the person in `woman_in_red.png`. The wardrobe followed the reference photo as well, red suit and beret instead of the original green top, and the face stayed stable across all 121 frames with no flicker on the product or the flowers.\n\n### Gotchas\n\n- One photo per person, assigned in socket order. Five photos is over the limit of four.\n- Clips shorter than 5 seconds, or with a shot longer than 15 seconds, are rejected before generation.\n- The source audio is kept, Recast does not regenerate speech.\n"
213 },
214 "color": "#222",
215 "bgcolor": "#000"
216 }
217 ],
218 "links": [
219 [
220 1,
221 1,
222 0,
223 3,
224 0,
225 "VIDEO"
226 ],
227 [
228 2,
229 2,
230 0,
231 3,
232 1,
233 "IMAGE"
234 ],
235 [
236 3,
237 3,
238 0,
239 4,
240 0,
241 "VIDEO"
242 ]
243 ],
244 "groups": [],
245 "config": [],
246 "extra": {
247 "ds": {
248 "scale": 0.5,
249 "offset": [
250 120,
251 -50
252 ]
253 },
254 "frontendVersion": "1.57.6"
255 },
256 "version": 0.4
257}