Nodes/ComfyUI-PainterNodes/Painter MiniMax Ref To Video 3
ComfyUI Node

Painter MiniMax Ref To Video 3

The MiniMax H3 reference node that finally keeps your pictures inside the node

By princepainter·Created 7 months ago·Updated 3 days ago· 192
Painter MiniMax Ref To Video 3
  • clip
  • vae
  • audio_vae
  • ref_videos
  • ref_video_audios
  • ref_audios
  • positive
  • LATENT
  • width
  • height
  • length
  • prompt
prompt
width1376
height768
length124
ref_max_size1536
ref_image_files[]
enable_prompt_optimizetrue
opt_modelqwen3.8-27b:latest
opt_api_urlhttp://127.0.0.1:11434
opt_max_length1024
opt_template你是 MiniMax H3 视频生成模型的专业提示词工程师。请把用户手写的简单提示词,重写为 H3 全参考(Ref2VA)六段标准提示词。 # 严格输出格式(章节标题必须用以下英文单词独占一行,正文用中文撰写,台词用 <d>[语言] ...</d> 保留原语言) subject_definitions: <Subject 1> 是 <Picture 1> 中的[人物/环境/物体描述]。 <Subject 2> 是 <Picture 2> 中的[... ]。 ... (每个可复用主体一行;参考图只在主体定义里引用,不单列 <Picture N> 行) summary: [reference generation] 一段中文概述目标视频的镜头流程、出现的主体,以及参考图/参考视频/参考音频如何被使用。 retention_analysis: <Subject 1> (appears in [Shot 1]): fully_preserved - 保留哪些外观特征。 <Subject 2> (appears in [Shot 2]): partially_preserved - 哪些特征被改动。 ... (每个 <Subject N> 一行,使用 fully_preserved / partially_preserved / attribute_transfer / weak_reference 之一) detailed_description: [Shot 1] 用一两句话给出整体视觉风格(电影写实 / 中国古风 / 3D 等)与首帧构图。 [Shot 1] 中全景建立[环境]。<Subject 1> ...,<Subject 2> ...。镜头/动作/声音/对白... [Shot 2] At 00:02.000, 切到[运镜]。<Subject ...> ...。 ... (按播放顺序逐镜头;每个镜头覆盖:构图、主体外貌与位置、环境光照、动作与状态变化、运镜、声音、对白;生成类约 350-500 中文字) overall_soundscape: 概括全片环境声与物理音效(风声、脚步声、器物碰撞等)。 non_diegetic_music: 描述仅观众可闻的背景音乐(乐器/节奏/起伏)。用户明确说不要音乐/不要 BGM 时,输出 N/A。 # 标签与标记规则 - <Subject N>:可复用主体(人物/环境/服装/道具/风格)。 - <Picture N>:仅当参考图本身作为某个镜头的首帧/关键帧/尾帧时才单列;否则只在主体定义里引用。 - <Video N>:当参考视频作为编辑源或时间结构来源时使用。 - <Audio N>:当参考音频被直接复制或音色被引用时使用。 - 对白/歌词必须用 <d>[原始语言] ...</d> 包裹,例如 <d>[中文] 你好。</d>。 - 镜头格式:[Shot 1] 无时间戳;[Shot 2] At MM:SS.mmm(两位小数)。 - 说话人编号:(S1) (S2) 按目标视频中实际发声顺序编号,同一说话人跨镜头复用同一编号。 # retention_analysis 关系标记(固定英文) - fully_preserved 完全保留 - partially_preserved 部分保留 - attribute_transfer 属性转移到另一主体 - weak_reference 仅保留风格/氛围相似 # 必须遵守 - 严格保留用户原始意图:目标时长、镜头切换、台词内容、无音乐/无字幕要求。 - 节点内有参考图时,仔细观察并在 subject_definitions 与 detailed_description 中描述锁定的外观细节(身份、面容、发型、服装、道具、场景),并在 retention_analysis 中标 fully_preserved。 - 节点外有参考视频/音频时,将它们的角色与内容纳入重写(这些外部媒体的画面/声音会出现在最终视频里)。 - 只输出重写后的提示词正文,不要前言、不要解释、不要 markdown 标题/加粗/列表符号(**、##、###、---、-、* 全部禁用)。所有章节标题就是上面那六个英文单词独占一行。

MiniMax H3 - the 33B omni-modal video model that went open-weights in August 2026 - is genuinely great at the job nobody else could quite do locally: hand it a couple of reference pictures plus a loosely written idea, and it returns video with synced audio, obeying instructions like "cut at 3.5 seconds." The community called its motion transfer "like Kling". Feeding it references from ComfyUI was the fiddly part, though - load every frame yourself, hand-build the conditioning.

Painter MiniMax Ref To Video 3 is one node that swallows the whole job: upload reference images inside the node, type your idea, and out come the CONDITIONING and LATENT that feed H3's sampler. It's the third revision, and the version history is basically the history of what annoyed people - v1/v2 did multi-reference conditioning with external inputs; v3 moves the images to an in-node upload area and adds a prompt optimizer.

How it works

Under the hood it's a conditioning-and-latent factory. It takes the three model pieces H3 splits into - clip, vae (the video VAE) and audio_vae. It builds an empty joint audio+video latent from your width/height/length, snapping the frame count to H3's temporal grid (frames such that n % 17 == 5) and deriving the matching audio-latent length at 40 fps. Reference images get scaled down so their longest edge fits ref_max_size (never upscaled), snapped to 32px and VAE-encoded; reference videos are encoded as frame sequences and sampled down to ~2 fps keyframes so the model's vision can actually read them; reference audio is resampled and encoded with the audio VAE. Then it tokenizes your prompt with all those references attached and stamps the minimax_refs into the conditioning. What leaves the right side feeds the sampler: positive → conditioning, LATENT → latent, then decode with VAEDecode plus VAEDecodeAudio.

This is one Painter node where the work is real and checkable in the source - it genuinely encodes refs and builds an AV latent. That matters: the author (princepainter, a prolific one-person node factory that wraps new video models within days) has drawn occasional "does this node actually do anything?" scrutiny from the community.

What you actually set

  • prompt - the fun part. The custom editor speaks the shorthand that maps onto MiniMax's official H3 prompting skill: type @图片1 / @音频1 / @视频1 (rendering as <Picture 1> / <Audio 1> / <Video 1> tags) to reference an uploaded asset, wrap dialogue as 【台词内容】, write 切镜3.5 for a cut at 3.5 seconds. The UI labels are Chinese-first; the inserted tags are the English ones H3 expects.
  • length (default 124) - frame count at 24 fps. 124 is about 5 seconds; the trained sweet spot is roughly 124–362.
  • width / height (default 1376×768) and ref_max_size (default 1536, the cap for reference long edges) are set-and-forget.

The optimizer block is v3's other headline: a button on the prompt editor calls a local Ollama model to rewrite your rough idea into H3's six-section prompt format - and because the model can see your reference images, the rewrite actually describes the character you locked in. You need Ollama running locally, and opt_model should be the name of a vision-capable model you've actually pulled. Be warned: the default template is a long Chinese system prompt and the rewrite comes back in Chinese until you edit it - the enable_prompt_optimize toggle just shows and hides that block.

Outputs: positive and LATENT for the sampler, plus width / height / length / prompt - handy bookkeeping, and prompt shows you what the optimizer produced.

Installing it

In ComfyUI-Manager, search "PainterNodes" and install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/princepainter/ComfyUI-PainterNodes
cd ComfyUI-PainterNodes
pip install -r requirements.txt

Then restart. The pack's own dependencies are just soundfile and numpy, but this node is written against ComfyUI's new declarative node API (io.ComfyNode with autogrow inputs), so you need a genuinely recent ComfyUI - if the node misbehaves, update ComfyUI before anything else. You also need the H3 weights from MiniMaxAI/MiniMax-H3 (~42.5 GB at full precision) in your workflow's loaders, and Ollama only if you want the optimizer.

Where people get burned

  • The license. H3's Community License excludes the US, EU, UK and Korea from running the open weights locally. In those regions the hosted Hailuo API is the licensed path; no node fixes that.
  • Reference videos need ≥ 5 frames (~0.2 s at 24 fps) or the node raises.
  • Audio VAE unplugged → silent or failing output. It's a required input for a reason.
  • Workflow version drift. This pack iterates weekly (v1 → v2 → v3 in a month). A saved workflow from v1/v2 expects external image inputs; v3 wants them uploaded inside. If links won't attach, that's why - re-wire, don't debug.
Categorymodel/conditioning/minimax

Inputs (17)

NameTypeDefaultDescription
clipCLIP
vaeVAE
audio_vaeVAE
promptSTRING
widthINT137632–16384
heightINT76832–16384
lengthINT1245–3600Frame count at 24 fps, (124 = ~5s, trained range is ~124-362)
ref_max_sizeINT153632–4096Reference max long edge. Reference images and videos are scaled down (never up) so the longest side fits this value, then snapped to 32px.
ref_image_filesSTRING[]Internal: JSON array of uploaded reference image file info (managed by frontend upload area)
enable_prompt_optimizeBOOLEANtrue显示提示词优化选项。开启后下方显示模型/接口/模板等设置;关闭则隐藏下方选项保持节点简洁。提示词优化始终可用——点击提示词编辑器右下角的 ✦ 按钮即可触发 Ollama 优化,无需先打开本开关。
opt_modelSTRINGqwen3.8-27b:latest用于优化提示词的 Ollama 模型名(需已 pull,支持 vision)。
opt_api_urlSTRINGhttp://127.0.0.1:11434Ollama HTTP API 根地址,自动追加 /api/chat。
opt_max_lengthINT102464–8192优化提示词最大生成 token 数(num_predict)。
opt_templateSTRING你是 MiniMax H3 视频生成模型的专业提示词工程师。请把用户手写的简单提示词,重写为 H3 全参考(Ref2VA)六段标准提示词。 # 严格输出格式(章节标题必须用以下英文单词独占一行,正文用中文撰写,台词用 <d>[语言] ...</d> 保留原语言) subject_definitions: <Subject 1> 是 <Picture 1> 中的[人物/环境/物体描述]。 <Subject 2> 是 <Picture 2> 中的[... ]。 ... (每个可复用主体一行;参考图只在主体定义里引用,不单列 <Picture N> 行) summary: [reference generation] 一段中文概述目标视频的镜头流程、出现的主体,以及参考图/参考视频/参考音频如何被使用。 retention_analysis: <Subject 1> (appears in [Shot 1]): fully_preserved - 保留哪些外观特征。 <Subject 2> (appears in [Shot 2]): partially_preserved - 哪些特征被改动。 ... (每个 <Subject N> 一行,使用 fully_preserved / partially_preserved / attribute_transfer / weak_reference 之一) detailed_description: [Shot 1] 用一两句话给出整体视觉风格(电影写实 / 中国古风 / 3D 等)与首帧构图。 [Shot 1] 中全景建立[环境]。<Subject 1> ...,<Subject 2> ...。镜头/动作/声音/对白... [Shot 2] At 00:02.000, 切到[运镜]。<Subject ...> ...。 ... (按播放顺序逐镜头;每个镜头覆盖:构图、主体外貌与位置、环境光照、动作与状态变化、运镜、声音、对白;生成类约 350-500 中文字) overall_soundscape: 概括全片环境声与物理音效(风声、脚步声、器物碰撞等)。 non_diegetic_music: 描述仅观众可闻的背景音乐(乐器/节奏/起伏)。用户明确说不要音乐/不要 BGM 时,输出 N/A。 # 标签与标记规则 - <Subject N>:可复用主体(人物/环境/服装/道具/风格)。 - <Picture N>:仅当参考图本身作为某个镜头的首帧/关键帧/尾帧时才单列;否则只在主体定义里引用。 - <Video N>:当参考视频作为编辑源或时间结构来源时使用。 - <Audio N>:当参考音频被直接复制或音色被引用时使用。 - 对白/歌词必须用 <d>[原始语言] ...</d> 包裹,例如 <d>[中文] 你好。</d>。 - 镜头格式:[Shot 1] 无时间戳;[Shot 2] At MM:SS.mmm(两位小数)。 - 说话人编号:(S1) (S2) 按目标视频中实际发声顺序编号,同一说话人跨镜头复用同一编号。 # retention_analysis 关系标记(固定英文) - fully_preserved 完全保留 - partially_preserved 部分保留 - attribute_transfer 属性转移到另一主体 - weak_reference 仅保留风格/氛围相似 # 必须遵守 - 严格保留用户原始意图:目标时长、镜头切换、台词内容、无音乐/无字幕要求。 - 节点内有参考图时,仔细观察并在 subject_definitions 与 detailed_description 中描述锁定的外观细节(身份、面容、发型、服装、道具、场景),并在 retention_analysis 中标 fully_preserved。 - 节点外有参考视频/音频时,将它们的角色与内容纳入重写(这些外部媒体的画面/声音会出现在最终视频里)。 - 只输出重写后的提示词正文,不要前言、不要解释、不要 markdown 标题/加粗/列表符号(**、##、###、---、-、* 全部禁用)。所有章节标题就是上面那六个英文单词独占一行。 发给 Ollama 的 system 提示词(按 h3 skill 重写为 ref2va 六段格式)。可按需修改。
ref_videosoptCOMFY_AUTOGROW_V3
ref_video_audiosoptCOMFY_AUTOGROW_V3
ref_audiosoptCOMFY_AUTOGROW_V3

Outputs (6)

NameTypeDescription
positiveCONDITIONING
LATENTLATENT
widthINT
heightINT
lengthINT
promptSTRING