Extensions/ComfyUI-ares_MiniMaxH3_IntelligentPrompt
ComfyUI Extension

ComfyUI-ares_MiniMaxH3_IntelligentPrompt

MiniMax H3 智能参考标签提示词助手,附带 Ares 视频工具节点

By SuperWJ062·Created about a month ago·Updated 23 days ago· 0
SuperWJ062/ComfyUI-ares_MiniMaxH3_IntelligentPrompt
Nodes
On cloudLocal install
Stars0
Updated23 days ago
Readme

ComfyUI-ares_MiniMaxH3_IntelligentPrompt

An intelligent prompt helper for the official MiniMaxH3ReferenceToVideo node. It automatically detects the reference images / videos / audios connected to the node and generates the official H3 reference tags (<Picture N> / <Video N> / <Audio N>). Press Shift + @ to open the reference list and click to insert the tag at the prompt cursor.

Also includes a set of Ares video tool nodes for segmented long-video generation, loop iteration, and seamless continuation.

中文文档见下方,以下为中文完整说明。


简介

面向官方 MiniMaxH3ReferenceToVideo 节点的智能提示词插件:自动识别节点上已接入的参考图片 / 视频 / 音频,按 MiniMax H3 官方规范生成引用标签,Shift + @ 一键调出清单,点击即插入到 prompt 光标处。

同时附带一套 Ares 系列视频工具节点,用于 H3 长视频的分段生成、循环迭代与自动续接。

功能特性

智能参考标签

  • 自动扫描官方节点 ref_image_0 / ref_video_0 / ref_video_audio_0 / ref_audio_0 等输入端口(从 0 起),只列出已连接的素材

  • 按官方 tokenizer 规则编号,标签直接可被模型解析:

    | 顺序 | 端口 | 标签 | 示例 | | --- | --- | --- | --- | | 1 | ref_image_0... | <Picture N> | <Picture 1> | | 2 | 每段视频:ref_video_audio_k 声轨 + ref_video_k | <Audio N> + <Video N> | <Audio 1><Video 1> | | 3 | ref_audio_0... | <Audio N> | <Audio 2> |

  • Shift + @ 弹出参考清单(图片 / 视频 / 音频分组,带类型徽章、来源节点与缩略图)

  • 点击条目即把标签插入到 prompt 光标处(焦点在 prompt 输入框时)或末尾(焦点在画布上时)

  • 键盘操作: / 选择,Enter 插入,Esc 关闭

  • 支持同时使用多个 H3 节点:优先操作当前聚焦的 prompt 输入框对应的节点,其次是选中的节点

Ares 视频工具节点

| 节点 | 显示名 | 说明 | | --- | --- | --- | | AresVideoSave | Ares Save Video | 保存视频到输出目录,支持自动元数据、H.264 重编码与 CRF、预览自适应缩放 | | AresTrimVideo | Ares Trim Video | 按帧截取视频片段,输出裁剪后视频 + 帧序列 + 末帧;帧数自动钳制在 H3 参考视频要求的 48–360 帧(2–15 秒 @24fps),支持 tail 从末尾截取实现自动续接 | | AresLoadLastVideo | Ares Load Last Video | 读取输出目录最近保存的视频作为本轮参考;输出目录为空时回退到 initial_video,用于循环迭代第一轮 | | AresLoopControl | Ares Loop Control | 设置循环迭代轮数,执行完成后前端自动重跑工作流并递减计数,配合 Ares Load Last Video 实现参考视频循环迭代 |

安装

克隆或复制本项目到 ComfyUI/custom_nodes/

cd ComfyUI/custom_nodes
git clone https://github.com/SuperWJ062/ComfyUI-ares_MiniMaxH3_IntelligentPrompt

Windows 上如采用「源码目录 + junction」的方式:

New-Item -ItemType Junction -Path "D:\ComfyUI-ares\ComfyUI\custom_nodes\ComfyUI-ares_MiniMaxH3_IntelligentPrompt" -Target "G:\源目录"

重启 ComfyUI 后即可使用。

使用

智能参考标签

  1. 添加任意官方文本输入节点作为提示词编辑器(如 Text (Multiline) / Text / Input Text (Prompt)),只要它有多行文本输入框和 STRING 输出即可
  2. 把参考图片 / 视频 / 音频接入官方 MiniMax H3 Reference to Video 节点的 ref_image_0ref_video_0ref_video_audio_0ref_audio_0 等输入端口(Autogrow 端口从 0 开始编号)
  3. 把文本节点的输出接到官方节点的 prompt 输入端口(中间可以连接任意文本拼接/处理节点,插件会沿图自动找到 H3 节点)
  4. 点击文本节点输入框,按 Shift + @
  5. 在弹出的清单中点击素材,标签即插入到光标处;/ 选择,Enter 插入,Esc 关闭
  6. 继续编写其余提示词,如:
<Picture 1> 一位穿红色汉服的少女在樱花树下回眸 <Video 1><Audio 1> 参考视频中的动态动作

也支持直接在官方 H3 节点自身的 prompt 输入框上按 Shift + @(无需额外文本节点)。

长视频分段续接(示例流程)

[文本编辑器] → [MiniMax H3 Reference to Video] → [VAE Decode] → [Ares Save Video]
                                              ↑
                          [Ares Load Last Video] ← 上一轮保存的视频
  • 第一轮:Ares Load Last Video 使用 initial_video,生成后由 Ares Save Video 保存
  • 第二轮起:Ares Load Last Video 自动加载最近保存的视频;用 Ares Trim Videotail 截取末尾帧作为 ref_image / ref_video,实现无缝续接
  • Ares Loop Control 设置总轮数,每轮结束前端自动重跑并递减

兼容性

  • 前端:ComfyUI 新版前端(Vue 版,comfyui_frontend_package
  • 后端:ComfyUI 新版 comfy_api.latestio.Schema / io.ComfyNode
  • 图数据结构:同时兼容新版(Map/对象 links)与旧版 litegraph(数组 links)
  • 提示:素材加载后建议先运行一次队列(或让节点输出缓存刷新),清单中的缩略图才能正常显示;若菜单提示"未检测到已连接素材",菜单底部会列出当前 ref 端口状态,便于排查

开发

  • js/main.js:前端逻辑(节点识别、参考收集、上游回溯预览、悬浮菜单、插入、快捷键、视频预览自适应)
  • js/loop.js:循环控制自动重跑逻辑
  • nodes.py:Ares 视频工具节点
  • __init__.py:注册节点与 WEB_DIRECTORY

标签编号规则与官方 tokenizer 保持一致,见 ComfyUI/comfy/text_encoders/minimax.py

许可证

GPL-3.0