File size: 14,065 Bytes
18b46f4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# MiniMax-H3 ComfyUI API Workflows: Comprehensive Guide & Catalog

_Author: malcolmrey_  
_Last Updated: September 2026_  
_Repository & Models: [huggingface.co/malcolmrey](https://huggingface.co/malcolmrey)_

---

## 1. Overview & Ecosystem Architecture

**MiniMax-H3** is a state-of-the-art multimodal video and audio generation Diffusion Transformer (DiT). This collection provides production-ready, programmatic **ComfyUI API workflows** (`workflow_api_*.json`) covering:

1. **FirstBlockCache (FBC) + SageAttention Fused Acceleration:** Realizing up to **5.24× speedups** with zero quality loss.
2. **Zero-Training RefMod Identity Adapters:** Instant-load persona conditioning without live VAE image encoding overhead or model retraining.
3. **Step Distillation Pipelines:** Native integration with **LightX Turbo v1.0** 8-step and 4-step low-rank adapters.
4. **End-to-End Multimodal Generation:** Simultaneous high-fidelity 35mm cinematic video and lip-synchronized acoustic dialogue / ambient soundscapes.
5. **Clip-to-Video (C2V) Continuous Chaining:** Seamless multi-scene narrative stitching via latent motion context trimming.

---

## 2. Directory Structure & Required Weights

### A. Recommended ComfyUI Model Layout

```text
ComfyUI/
├── models/
│   ├── diffusion_models/
│   │   └── MinimaxH3/
│   │       └── minimax_h3_fl2va_pruned_int8_convrot.safetensors  (or bf16 variant)
│   ├── clip/
│   │   └── qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors
│   ├── vae/
│   │   ├── minimax_h3_video_vae_fp16.safetensors
│   │   └── minimax_h3_audio_vae_fp32.safetensors
│   ├── loras/
│   │   └── MinimaxH3/
│   │       └── special/
│   │           ├── minimax_h3_fl2v_turbo_8step_v1.0_comfyui_bf16.safetensors
│   │           ├── minimax_h3_fl2v_turbo_4step_v1.0_768p_comfyui_bf16.safetensors
│   │           └── minimax_h3_fl2v_turbo_4step_v1.2_768p_comfyui_bf16.safetensors
│   └── refmods/
│       ├── minimaxh3_<name>_v1_refmod.safetensors
│       └── ...
```

---

## 3. Required Custom Nodes

To execute these workflows via API or ComfyUI GUI, install the following custom nodes:

1. **`ComfyUI-MiniMaxH3Mod`** (RefMod Loader & Conditioning Apply):
   ```bash
   cd ComfyUI/custom_nodes
   git clone https://github.com/Luisacaotica/ComfyUI-MiniMaxH3Mod.git
   ```

2. **`ComfyUI-MiniMaxH3-FirstBlockCache`** (Transformer Block Caching):
   ```bash
   cd ComfyUI/custom_nodes
   git clone https://github.com/chengzeyi/ComfyUI-MiniMaxH3-FirstBlockCache.git
   ```

3. **`comfyui-kjnodes`** (SageAttention & Optimization Patches):
   ```bash
   cd ComfyUI/custom_nodes
   git clone https://github.com/kijai/comfyui-kjnodes.git
   ```

4. **`rgthree-comfy`** (Power LoRA Loader Stack):
   ```bash
   cd ComfyUI/custom_nodes
   git clone https://github.com/rgthree/rgthree-comfy.git
   ```

5. **`ComfyUI-VideoHelperSuite`** (Video Loaders & Muxing):
   ```bash
   cd ComfyUI/custom_nodes
   git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite.git
   ```

---

## 4. Complete Workflow Registry

### Category 1: Accelerated Standalone RefMod Pipelines (FBC + SageAttention + LightX)

| Workflow File | Steps | Sampler | Scheduler | FBC Mode | Distillation LoRA | Render Time (5s 124f) | Recommended Use Case |
|---|:---:|---|---|---|---|:---:|---|
| `workflow_api_minimaxh3_fbc_refmod_standard.json` | **20** | `res_multistep` | `simple` | **Safe** (0.08 / max 2) | None | ~110s (1m 50s) | Maximum micro-texture archival quality |
| `workflow_api_minimaxh3_fbc_refmod_turbo_8step.json` | **8** | `euler` | `simple` | **Fast** (0.10 / max 2) | LightX Turbo 8-Step | **~41s (2.68× faster)** | **Primary Production Standard** (98% quality) |
| `workflow_api_minimaxh3_fbc_refmod_turbo_4step.json` | **4** | `euler` | `simple` | **Fast** (0.10 / max 2) | LightX Turbo 4-Step | **~21s (5.24× faster)** | High-speed screening & seed hunting |

---

### Category 2: Accelerated C2V (Clip-to-Video) Continuous Chaining Pipelines

These workflows enable **seamless multi-clip narrative continuation** without camera cuts while maintaining full FBC + SageAttention speed acceleration and RefMod persona likeness:

| Workflow File | Steps | Sampler | Scheduler | FBC Mode | Distillation LoRA | C2V Motion Context | Recommended Use Case |
|---|:---:|---|---|---|---|:---:|---|
| `workflow_api_minimaxh3_fbc_refmod_c2v_standard.json` | **20** | `res_multistep` | `simple` | **Safe** (0.08 / max 2) | None | 22 frames (trimmed) | Master-quality continuous narrative scenes |
| `workflow_api_minimaxh3_fbc_refmod_c2v_turbo_8step.json` | **8** | `euler` | `simple` | **Fast** (0.10 / max 2) | LightX Turbo 8-Step | 22 frames (trimmed) | **Primary Multi-Scene Movie Production** (~41s/scene) |
| `workflow_api_minimaxh3_fbc_refmod_c2v_turbo_4step.json` | **4** | `euler` | `simple` | **Fast** (0.10 / max 2) | LightX Turbo 4-Step | 22 frames (trimmed) | Fast multi-clip storyboarding (~21s/scene) |

#### C2V Pipeline Dataflow:
```
[ UNETLoader ] ──► [ PathchSageAttentionKJ ] ──► [ ApplyMiniMaxH3FirstBlockCache ]
                                                               │
                                                               ▼
                                                  [ Power Lora Loader (rgthree) ]
                                                               │
[ CLIPLoader ] ──► [ MiniMaxH3ImageToVideo ] ◄─────────────────┘
                           │
[ RefModsLoader ] ──► [ MiniMaxH3RefModApply ]
                           │
[ MotionContextLoadLatent ] ──► [ MiniMaxH3MotionContext ]
                                       │
                                       ▼
                         [ BasicGuider + SamplerCustomAdvanced ]
                                       │
                         ┌─────────────┼─────────────┐
                         ▼             ▼             ▼
                 [ VAEDecode ]   [ VAEDecodeAudio ]  [ MotionContextSaveLatent ]
                         │             │
                         └──────┬──────┘
                                ▼
                   [ MotionContextTrim ] ──► [ CreateVideo ] ──► [ SaveVideo ]
```

---

### Category 3: Legacy & Core Multimodal Workflows

#### 1. Text-to-Video (T2V) — `workflow_api_minimaxh3_t2v.json`
- **Purpose:** Generates full cinematic video and synchronized audio directly from multimodal prompts.
- **Key Nodes:** `MiniMaxH3ImageToVideo`, `PathchSageAttentionKJ`, `SpectrumApplyMiniMaxH3`, `SamplerCustomAdvanced`.
- **Inputs:** Prompt text, dimensions (e.g., `768x1344` or `1344x768`), duration/length frames, seed.

#### 2. Image-to-Video (I2V) — `workflow_api_minimaxh3_i2v.json`
- **Purpose:** Animates a starting image anchor into a continuous temporal sequence.
- **Key Nodes:** `LoadImage`, `MiniMaxH3ImageToVideo`, `VAEDecode`, `CreateVideo`.
- **Inputs:** Source image file, motion prompt, duration, resolution.

#### 3. Reference-to-Video (R2V) — `workflow_api_minimaxh3_r2v.json`
- **Purpose:** Full multi-modal conditioning incorporating reference images, reference audio files, and reference video clips simultaneously.
- **Key Nodes:** `MiniMaxH3ReferenceToVideo`, `VHS_LoadAudioUpload`, `VHS_LoadVideo`, `LoadImage`.
- **Inputs:** Reference audio track, reference face/character image, target prompt.

---

### Category 3: Narrative Continuity & Multi-Scene Chaining

#### 1. Clip-to-Video Continuation (C2V) — `workflow_api_minimaxh3_c2v.json`
- **Purpose:** Continues an existing video clip seamlessly into the next scene without cuts, preserving velocity, character positions, and lighting continuity.
- **Key Nodes:** `MiniMaxH3MotionContextLoadLatent`, `MiniMaxH3MotionContextTrim`, `MiniMaxH3MotionContextSaveLatent`.
- **Method:** Loads the previous scene's uncompressed latent cache, trims the tail motion context, and feeds it as the prior boundary for the new generation.

#### 2. Reference + Clip-to-Video (Ref-C2V) — `workflow_api_minimaxh3_ref_c2v.json`
- **Purpose:** Extends C2V continuous chaining while actively enforcing reference image / audio adapters across sequential scene transitions.

---

### Category 4: Interactive GUI Graph

- **`workflow_minimaxh3_refmod.json`:** Comprehensive visual graph for the ComfyUI web UI with interactive sliders for RefMod blend curves (`linear`, `constant`, `smoothstep`), weight retention, and real-time audio playback preview.

---

## 5. Programmatic API Python Client Example

Below is a complete, standalone Python snippet demonstrating how to queue any of these API workflows through the ComfyUI REST endpoint (`http://127.0.0.1:8188/prompt`):

```python
import json
import urllib.request
import os
import uuid
import time

COMFY_HOST = "127.0.0.1"
COMFY_PORT = 8188

def generate_minimax_video(
    workflow_path="workflow_api_minimaxh3_fbc_refmod_turbo_8step.json",
    refmod_name="minimaxh3_aneta_v1_refmod",
    prompt_text=None,
    width=1344,
    height=768,
    duration_sec=5.16,
    fps=24,
    seed=2026090595,
    output_prefix="video/MiniMax_H3_API_Render"
):
    with open(workflow_path, "r", encoding="utf-8") as f:
        wf = json.load(f)

    # Unwrap {"prompt": {...}} wrapper if present
    prompt = wf.get("prompt", wf)

    total_frames = int(duration_sec * fps) + 1

    # Customize node inputs
    for nid, node in prompt.items():
        ctype = node.get("class_type")
        
        # Prompt & Dimensions
        if ctype in ["MiniMaxH3ImageToVideo", "MiniMaxH3ReferenceToVideo"]:
            if prompt_text:
                node["inputs"]["prompt"] = prompt_text
            node["inputs"]["width"] = width
            node["inputs"]["height"] = height
            node["inputs"]["length"] = total_frames
            
        # RefMod Loader
        elif ctype == "MiniMaxH3RefModsLoader":
            if refmod_name:
                node["inputs"]["mod_1"] = refmod_name
                node["inputs"]["strength_1"] = 1.0
                
        # Random Seed
        elif ctype == "RandomNoise":
            node["inputs"]["noise_seed"] = seed
            
        # Output filename prefix
        elif ctype == "SaveVideo":
            node["inputs"]["filename_prefix"] = output_prefix

    # Submit to ComfyUI
    payload = json.dumps({"prompt": prompt, "client_id": str(uuid.uuid4())}).encode("utf-8")
    req = urllib.request.Request(
        f"http://{COMFY_HOST}:{COMFY_PORT}/prompt",
        data=payload,
        headers={"Content-Type": "application/json"}
    )

    with urllib.request.urlopen(req) as resp:
        res = json.loads(resp.read().decode("utf-8"))
        prompt_id = res["prompt_id"]
        print(f"Queued task successfully! Prompt ID: {prompt_id}")

    # Poll execution progress
    while True:
        req = urllib.request.Request(f"http://{COMFY_HOST}:{COMFY_PORT}/history/{prompt_id}")
        with urllib.request.urlopen(req) as resp:
            history = json.loads(resp.read().decode("utf-8"))
            
        if prompt_id in history:
            status = history[prompt_id].get("status", {})
            if status.get("completed") or status.get("status_str") == "success":
                outputs = history[prompt_id].get("outputs", {})
                for nid, nout in outputs.items():
                    for key in ["videos", "gifs", "images"]:
                        if key in nout:
                            for f in nout[key]:
                                print(f"Generation complete! Output file: {f.get('filename')}")
                                return f.get("filename")
            elif status.get("status_str") == "error":
                raise RuntimeError(f"ComfyUI Job Failed: {history[prompt_id]}")
                
        time.sleep(3)

if __name__ == "__main__":
    test_prompt = """subject_definitions:
<Subject 1> Aneta, authentic natural appearance

integrated_multimodal_description:
[Shot 1] Cinematic 35mm photograph, warm golden sunlight. Wide horizontal 16:9 framing showing <Subject 1> Aneta smiling warmly at the camera. Speaking English in Aneta's natural voice, <Subject 1> Aneta says: <d>Welcome to the new accelerated generation pipeline!</d>

overall_soundscape:
Gentle acoustic room ambience and clear vocal presence."""

    generate_minimax_video(
        workflow_path="workflow_api_minimaxh3_fbc_refmod_turbo_8step.json",
        refmod_name="minimaxh3_aneta_v1_refmod",
        prompt_text=test_prompt,
        width=1344,
        height=768
    )
```

---

## 6. Standard Multimodal Prompt Architecture

MiniMax-H3 utilizes a structured prompt format parsed by Qwen3-VL:

```text
subject_definitions:
<Subject 1> CharacterName, key visual attributes, authentic natural appearance

integrated_multimodal_description:
[Shot 1] Live-action, 35mm cinematic photograph, fine film grain, natural lighting. Continuous unbroken take, no cut. Opens as a medium shot framing <Subject 1> CharacterName. The camera moves in a smooth, continuous push-in gliding directly into a sharp close-up on her face and natural expressive smile. Never freeze. Never hold static. Speaking English in CharacterName's natural voice, and only the quoted words are spoken, <Subject 1> CharacterName (S1) says: <d>Your exact synchronized dialogue text here.</d>

overall_soundscape:
Ambient acoustics, room tone, realistic environment foley, and clear vocal presence.

non_diegetic_music:
N/A (or describe background score style)
```

---

## 7. License & Credits

- **MiniMax-H3 RefMods & Workflows:** Created by **malcolmrey** ([huggingface.co/malcolmrey](https://huggingface.co/malcolmrey)).
- **Custom Nodes:** `ComfyUI-MiniMaxH3Mod` (Luisacaotica), `ComfyUI-MiniMaxH3-FirstBlockCache` (chengzeyi), `comfyui-kjnodes` (kijai).
- **LoRA Distillation:** `LightX2V / MiniMax-h3-Turbo`.