> ## Documentation Index
> Fetch the complete documentation index at: https://comfyuiwiki.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MiniMax H3：ComfyUI 工作流示例

> 了解如何在 ComfyUI 中使用开放权重的 MiniMax H3，借助原生工作流实现文生视频、图生视频和参考生视频，并支持原生立体声音频。

[MiniMax H3](https://www.minimax.io/blog/minimax-h3) 是 MiniMax 推出的通用全模态生成模型，现已以开放权重形式提供。它能在单一上下文中联合理解文本、图像、视频和音频，并生成带**原生立体声音频**的视频：语音、音效和音乐在单次前向传播中一并建模，而非事后叠加。输出最高支持 2K 分辨率、24fps，时长约 15 秒。

ComfyUI 原生支持 MiniMax H3。模板库目前提供三个示例工作流，每种覆盖一种生成模式：

* **文生视频**（T2V）：根据文本提示生成视频
* **图生视频**（I2V）：根据输入图像生成视频，可选择首帧/末帧控制
* **参考生视频**（R2V）：根据参考图像、视频和音频生成视频，锁定角色、风格、动作、相机运动或声音

这三个是示例模板，并非模型能力的完整清单。通过原生 MiniMax H3 节点可以覆盖更多生成模式：`MiniMaxH3ImageToVideo` 节点支持首帧/末帧图生视频（fl2va），`MiniMaxH3ReferenceToVideo` 节点支持图像、视频和音频参考驱动的生成（ref2va）。你也可以用这些节点搭建其他工作流。

<UpdateReminder />

## 主要功能

* **原生立体声音频**：对话、音效和音乐可与视频一同生成，并在同一个 MP4 文件中同步
* **多模态上下文**：文本、图像、视频和音频参考可在单次生成中组合使用
* **参考驱动生成**：从参考素材中锁定角色身份、风格、动作、相机运镜或声音
* **指令遵循**：使用自然语言描述参考素材与目标镜头之间的关系
* **准确的文本渲染**：拼写文本和品牌元素渲染清晰
* **开放权重**：在 ComfyUI 中本地运行，可完全控制每个参数

## 入门

ComfyUI 支持开放权重的 MiniMax H3。开始使用：

1. 将 ComfyUI 更新到 0.30.0 或更高版本
2. 前往**模板库** > **视频**，选择任意一个 MiniMax H3 工作流
3. 按照弹出窗口的提示下载模型并运行工作流

模型文件托管在 Hugging Face 的 [Comfy-Org/MiniMax-H3](https://huggingface.co/Comfy-Org/MiniMax-H3) 仓库中。

## 设置输出分辨率

每个工作流都使用一个 **Resolution Selector（分辨率选择器）** 节点来控制总体输出尺寸。该节点根据三个设置计算 `width` 和 `height`，其输出直接连接到 MiniMax H3 节点的 `width` 和 `height` 输入：

* **宽高比**：选择一个预设，例如 `16:9 (Widescreen)`、`9:16 (Portrait Widescreen)` 或 `1:1 (Square)`
* **百万像素**：输出的目标总像素数。数值越大画面越大，数值越小生成越快
* **取整倍数**：计算结果会取整到该数值的最近倍数。保持为 `32`，与 H3 的分辨率网格一致

模板默认使用一个较快的预览尺寸。要获得全质量输出，请在 16:9 下将百万像素提高到约 `1.0`，大约得到 1344x768：即 H3 的原生画布（短边 768px，上限 768x1344 像素）。

## ComfyUI 原生工作流

### MiniMax H3 文生视频（T2V）

根据文本提示词生成带有原生立体声音频的视频。

<video controls className="w-full aspect-video" src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/output/video_minimax_h3_t2v.mp4" />

<CardGroup cols={2}>
  <Card title="在 Comfy Cloud 中运行" icon="cloud" href="https://cloud.comfy.org/?template=video_minimax_h3_t2v&utm_source=docs&utm_medium=referral&utm_campaign=minimax-h3">
    在 Comfy Cloud 中打开
  </Card>

  <Card title="下载工作流" icon="download" href="https://github.com/Comfy-Org/workflow_templates/blob/main/templates/video_minimax_h3_t2v.json">
    下载 JSON，或在模板库中搜索“MiniMax H3 T2V”
  </Card>
</CardGroup>

#### 模型下载

<CardGroup cols={2}>
  <Card title="Diffusion Model：minimax_h3_fl2va_pruned_int8_convrot" icon="download" href="https://huggingface.co/Comfy-Org/MiniMax-H3/blob/main/diffusion_models/minimax_h3_fl2va_pruned_int8_convrot.safetensors">
    放入 <code>ComfyUI/models/diffusion\_models/</code>
  </Card>

  <Card title="文本编码器：qwen3vl_32b_minimax_h3_nvfp4_awq" icon="download" href="https://huggingface.co/Comfy-Org/MiniMax-H3/blob/main/text_encoders/qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors">
    放入 <code>ComfyUI/models/text\_encoders/</code>
  </Card>

  <Card title="VAE：minimax_h3_video_vae_fp16" icon="download" href="https://huggingface.co/Comfy-Org/MiniMax-H3/blob/main/vae/minimax_h3_video_vae_fp16.safetensors">
    放入 <code>ComfyUI/models/vae/</code>
  </Card>

  <Card title="VAE：minimax_h3_audio_vae_fp32" icon="download" href="https://huggingface.co/Comfy-Org/MiniMax-H3/blob/main/vae/minimax_h3_audio_vae_fp32.safetensors">
    放入 <code>ComfyUI/models/vae/</code>
  </Card>
</CardGroup>

#### 模型存储

```
ComfyUI/
├── 📂 models/
│   ├── 📂 diffusion_models/
│   │   └── minimax_h3_fl2va_pruned_int8_convrot.safetensors
│   ├── 📂 text_encoders/
│   │   └── qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors
│   └── 📂 vae/
│       ├── minimax_h3_video_vae_fp16.safetensors
│       └── minimax_h3_audio_vae_fp32.safetensors
```

#### 提示词技巧

1. **描述整个场景**：先描述整体场景（地点、人物、正在发生的事情），再按时间将其拆分为多个镜头。
2. **镜头、相机和音频**：在同一个提示词块中描述镜头、相机运动以及伴随的音频（对话、音效、音乐）。
3. **分辨率**：H3 的原生画布短边为 768px，上限为 768x1344 像素，并四舍五入为 32 的倍数。
4. **时长**：时长输入会吸附到模型在 24fps 下每块 17 帧（17k+5）的网格上。
5. **首帧/尾帧**：将图像连接到 `MiniMaxH3ImageToVideo` 节点上的 `first_frame` 和/或 `last_frame`，即可将此工作流转换为首帧/尾帧图生视频。

#### 提示词编写指南

MiniMax 官方发布了针对基础生成模式（T2VA、I2VA、FL2VA 和 L2VA）的[视频提示词编写指南](https://huggingface.co/MiniMaxAI/MiniMax-H3/blob/main/docs/VIDEO_PROMPT_WRITING_GUIDE_base_en.md)。该指南说明了如何将提示词组织为带有镜头运动与音频（对白、音效、音乐）的定时镜头，并为每种模式提供了示例。

\---### MiniMax H3 图像转视频（I2V）

根据输入图像生成视频，可选指定首帧/末帧关键帧。

<video controls className="w-full aspect-video" src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/output/video_minimax_h3_i2v.mp4" />

<CardGroup cols={2}>
  <Card title="在 Comfy Cloud 中运行" icon="cloud" href="https://cloud.comfy.org/?template=video_minimax_h3_i2v&utm_source=docs&utm_medium=referral&utm_campaign=minimax-h3">
    在 Comfy Cloud 中打开
  </Card>

  <Card title="下载工作流" icon="download" href="https://github.com/Comfy-Org/workflow_templates/blob/main/templates/video_minimax_h3_i2v.json">
    下载 JSON 或在模板库中搜索“MiniMax H3 I2V”
  </Card>
</CardGroup>

<CardGroup cols={1}>
  <Card title="输入图像：transparent_rgb_gaming_mouse.png" icon="image" href="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/transparent_rgb_gaming_mouse.png">
    下载默认输入图像，或使用您自己的图像。
  </Card>
</CardGroup>

#### 模型下载

<CardGroup cols={2}>
  <Card title="Diffusion 模型：minimax_h3_fl2va_pruned_int8_convrot" icon="download" href="https://huggingface.co/Comfy-Org/MiniMax-H3/blob/main/diffusion_models/minimax_h3_fl2va_pruned_int8_convrot.safetensors">
    放置到 <code>ComfyUI/models/diffusion\_models/</code>
  </Card>

  <Card title="文本编码器：qwen3vl_32b_minimax_h3_nvfp4_awq" icon="download" href="https://huggingface.co/Comfy-Org/MiniMax-H3/blob/main/text_encoders/qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors">
    放置到 <code>ComfyUI/models/text\_encoders/</code>
  </Card>

  <Card title="VAE：minimax_h3_video_vae_fp16" icon="download" href="https://huggingface.co/Comfy-Org/MiniMax-H3/blob/main/vae/minimax_h3_video_vae_fp16.safetensors">
    放置到 <code>ComfyUI/models/vae/</code>
  </Card>

  <Card title="VAE：minimax_h3_audio_vae_fp32" icon="download" href="https://huggingface.co/Comfy-Org/MiniMax-H3/blob/main/vae/minimax_h3_audio_vae_fp32.safetensors">
    放置到 <code>ComfyUI/models/vae/</code>
  </Card>
</CardGroup>

#### 模型存储

```
ComfyUI/
├── 📂 models/
│   ├── 📂 diffusion_models/
│   │   └── minimax_h3_fl2va_pruned_int8_convrot.safetensors
│   ├── 📂 text_encoders/
│   │   └── qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors
│   └── 📂 vae/
│       ├── minimax_h3_video_vae_fp16.safetensors
│       └── minimax_h3_audio_vae_fp32.safetensors
```

#### 提示词技巧

1. **关键帧**：`first_frame` 和 `last_frame` 输入为可选；模型会生成它们之间的运动
2. **提示词**：在同一个文本块中描述镜头、动作以及伴随的音频（对白、音效、音乐）
3. **分辨率**：H3 的原生画布短边为 768px，上限为 768x1344 像素，并取整到 32 的倍数
4. **时长**：时长输入会对齐到模型在 24fps 下的每块 17 帧（17k+5）网格

#### 提示词编写指南

MiniMax 官方发布了针对基础生成模式（T2VA、I2VA、FL2VA 和 L2VA）的[视频提示词编写指南](https://huggingface.co/MiniMaxAI/MiniMax-H3/blob/main/docs/VIDEO_PROMPT_WRITING_GUIDE_base_en.md)。该指南说明了如何将提示词组织为带有镜头运动与音频（对白、音效、音乐）的定时镜头，并为每种模式提供了示例。

\---### MiniMax H3 参考转视频（R2V）

从参考图像、视频和音频的任意组合中生成视频，锁定角色、风格、动作、相机运镜或声音。

<video controls className="w-full aspect-video" src="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/output/video_minimax_h3_r2v.mp4" />

<CardGroup cols={2}>
  <Card title="在 Comfy Cloud 中运行" icon="cloud" href="https://cloud.comfy.org/?template=video_minimax_h3_r2v&utm_source=docs&utm_medium=referral&utm_campaign=minimax-h3">
    在 Comfy Cloud 中打开
  </Card>

  <Card title="下载工作流" icon="download" href="https://github.com/Comfy-Org/workflow_templates/blob/main/templates/video_minimax_h3_r2v.json">
    下载 JSON，或在模板库中搜索“MiniMax H3 R2V”
  </Card>
</CardGroup>

<CardGroup cols={2}>
  <Card title="参考图像：red_superboy_on_city_roof.png" icon="image" href="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/red_superboy_on_city_roof.png">
    工作流的角色参考，也可使用您自己的图像。
  </Card>

  <Card title="参考图像：mecha_dragon_lightning.png" icon="image" href="https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/input/mecha_dragon_lightning.png">
    工作流的风格与主题参考，也可使用您自己的图像。
  </Card>
</CardGroup>

#### 模型下载

<CardGroup cols={2}>
  <Card title="扩散模型：minimax_h3_ref2va_pruned_int8_convrot" icon="download" href="https://huggingface.co/Comfy-Org/MiniMax-H3/blob/main/diffusion_models/minimax_h3_ref2va_pruned_int8_convrot.safetensors">
    放置于 <code>ComfyUI/models/diffusion\_models/</code>
  </Card>

  <Card title="文本编码器：qwen3vl_32b_minimax_h3_nvfp4_awq" icon="download" href="https://huggingface.co/Comfy-Org/MiniMax-H3/blob/main/text_encoders/qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors">
    放置于 <code>ComfyUI/models/text\_encoders/</code>
  </Card>

  <Card title="VAE：minimax_h3_video_vae_fp16" icon="download" href="https://huggingface.co/Comfy-Org/MiniMax-H3/blob/main/vae/minimax_h3_video_vae_fp16.safetensors">
    放置于 <code>ComfyUI/models/vae/</code>
  </Card>

  <Card title="VAE：minimax_h3_audio_vae_fp32" icon="download" href="https://huggingface.co/Comfy-Org/MiniMax-H3/blob/main/vae/minimax_h3_audio_vae_fp32.safetensors">
    放置于 <code>ComfyUI/models/vae/</code>
  </Card>
</CardGroup>

#### 模型存储

```
ComfyUI/
├── 📂 models/
│   ├── 📂 diffusion_models/
│   │   └── minimax_h3_ref2va_pruned_int8_convrot.safetensors
│   ├── 📂 text_encoders/
│   │   └── qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors
│   └── 📂 vae/
│       ├── minimax_h3_video_vae_fp16.safetensors
│       └── minimax_h3_audio_vae_fp32.safetensors
```

#### 提示技巧

1. **按标签引用**：按标签引用每个输入，顺序须与其连接时完全一致，例如 `<Picture 1>`、`<Video 1>`、`<Audio 1>`
2. **为每个参考分配任务**：说明哪个参考负责画面的哪个部分（身份、风格、动作、相机、声音）。明确的分配往往效果更好
3. **限制**：最多 9 张参考图像、3 个参考视频（每个可携带自己的配乐），以及 3 个独立的参考音频片段
4. **ref\_image\_size**：`match` 会将参考缩小到生成分辨率以提高速度；`max` 则保留短边最长 2048px，以获得更强的身份保真度，但会牺牲速度
5. **注意**：R2V 使用 `ref2va` 扩散模型，这是一组与 T2V 和 I2V 工作流所用 `fl2va` 模型不同的权重

#### 提示词编写指南

MiniMax 官方发布了针对参考驱动生成（R2V）的[全参考模式提示词指南](https://huggingface.co/MiniMaxAI/MiniMax-H3/blob/main/docs/VIDEO_PROMPT_WRITING_GUIDE_ref_en.md)。该指南介绍了改写输出的结构，包括主体定义、参考标签与保留分析，以及如何为每个参考在目标镜头中分配角色。

## 使用 Sage Attention 加速生成

示例工作流默认使用标准注意力实现。使用 [Sage Attention](https://github.com/woct0rdho/SageAttention) 可以将生成速度大约提升一倍，质量损失极小。Sage Attention 是可选依赖，需要你自行安装：

1. 安装 `sageattention` Python 包。从 [SageAttention releases](https://github.com/woct0rdho/SageAttention/releases) 页面下载与你 PyTorch 和 CUDA 版本匹配的 wheel 文件，然后用 `pip install <wheel-file>` 安装。
2. 安装 [KJNodes 自定义节点](https://github.com/kijai/ComfyUI-KJNodes)，它提供了 `Patch Sage Attention KJ` 节点。可以使用 ComfyUI Manager 安装，或将仓库克隆到 `ComfyUI/custom_nodes/` 后重启 ComfyUI。
3. 在工作流中添加 `Patch Sage Attention KJ` 节点，并将其连接在 `UNETLoader` 和 `BasicGuider` 节点之间：它的 `model` 输入接收来自 `UNETLoader` 的模型，`model` 输出连接到 `BasicGuider` 的 `model` 输入。将 `sage_attention` 设置为 `auto`。
4. 照常运行工作流。只需要给 guider 打补丁；scheduler 只负责生成 sigmas，可以保持不变。

注意：

* Sage Attention 要求 float16 或 bfloat16 张量。MiniMax H3 的部分层使用其他数据类型，因此你可能会在控制台看到 "Input tensors must be in dtype of torch.float16 or torch.bfloat16, using pytorch attention instead" 消息。这是正常现象；受影响的层会回退到标准注意力，生成仍然可以正常工作。
* 另一种方式是使用 `--use-sage-attention` 启动参数启动 ComfyUI 来全局启用 Sage Attention，无需添加节点。
