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

Painter MiniMax Ref To Video 6

Upload the reference photos inside the node, then @ them in the prompt

By princepainter·Created 8 months ago·Updated 2 days ago· 193
Painter MiniMax Ref To Video 6
  • clip
  • vae
  • audio_vae
  • ref_videos
  • ref_video_audios
  • ref_audios
  • positive
  • LATENT
  • 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 is the 33B omni-modal model where picture and sound come out of the same pass - dialogue, effects and room tone generated together rather than glued on in a later audio stage. Great, and also means the workflow has a lot more wire-ends than a normal video graph: an image encoder, a video VAE, an audio VAE, reference frames, reference audio, and a text encoder that wants to see your photos.

Painter MiniMax Ref To Video 6 collapses the reference side of that into one node. Reference photos get uploaded straight into the node's own area (drag files in, multi-select, drop onto a slot to replace it). Reference video frames and audio still arrive on wires, because in practice those come out of other nodes - a loader, a frame extractor, a TTS pass.

The tags are the interface

The prompt is where you tell H3 what the references are for, using literal tags: <Picture 1>, <Video 1>, <Audio 1>. Reference material is registered as a token sequence before the text is encoded, so a prompt that never names <Picture 1> leaves that photo sitting in the context unused. The editor shows the same markup you typed, colour-highlighted, rather than rewriting it - which means you can box-select the finished prompt out of the node and reuse it elsewhere.

There's a rewriter built in. enable_prompt_optimize only shows/hides the opt_model, opt_api_url, opt_max_length and opt_template fields - the ✦ button in the editor corner triggers the rewrite either way. It talks to a local Ollama server (default http://127.0.0.1:11434, model qwen3.8-27b:latest, which you must pull, and needs vision). No cloud key, no API bill. The default opt_template rewrites your scribble into H3's six-section Ref2VA format: subject definitions, retention analysis, shot-by-shot description, soundscape.

Inputs that actually matter

Three encoders, and they're not interchangeable: clip (prompt + reference item list), vae (reference images and video frames into latents), audio_vae (reference audio, resampled with torchaudio if your clip isn't already at the audio VAE's rate). Then the shape of what you're about to generate:

  • width / height - default 1376×768. The empty latent is built from these immediately: video is a 24-channel latent at 1/16 the resolution, with the audio latent running at 40 frames per second alongside it.
  • length - frames at 24 fps, default 124 (≈5 s). The tooltip gives the trained range as roughly 124–362, i.e. 5 to 15 seconds. H3 only likes counts on the 17k + 5 grid and the node snaps you onto it internally, so 120 frames quietly becomes 124 - the step: 17 on the widget is a nudge, not the rule. Let Painter H3 Size Settings do the arithmetic.
  • ref_max_size - default 1536. The long edge cap for every reference image and video: scaled down to fit, never up, then snapped to 32 px.
  • ref_image_files - a JSON array of ComfyUI upload records. The frontend owns it; don't type in it. It's {filename, subfolder, type} pointing at real files in ComfyUI/input, which is why a workflow shared to another machine keeps the slots and loses the pictures.

The optional autogrow inputs take up to 3 each: ref_videos (frame batches at 24 fps, 2–15 s), ref_video_audios (matched by number - ref_video_audio_1 rides along with ref_video_1), and ref_audios for standalone clips you want cloned or lip-synced to. Reference videos under 5 frames raise an error, anything past your length gets truncated, the frame count is nudged down onto the 17k + 5 grid, and photos are loaded as RGB (EXIF rotation applied, alpha dropped), first frame only.

Outputs

positive → the sampler's positive. LATENT → the sampler's latent, already shaped for H3 audio-video, so don't bolt an EmptyLatent on behind it. prompt → a STRING pass-through of your text, handy for a save-text node.

v6 deliberately has no width/height/length outputs (v3 had them), so if something else needs those numbers, branch them off a size node rather than daisy-chaining this one.

Installing it

ComfyUI Manager → search PainterNodes, or clone the pack:

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

That pulls soundfile>=0.12.1 and numpy>=1.21.0 - trivial. The node also imports torchaudio and PIL, which a normal ComfyUI environment already has. The real download is elsewhere: H3's DiT, video VAE, audio VAE and text encoder. And read the licence before you spend the disk - the MiniMax H3 Community License's Applicable Territory excludes the EU, UK, Republic of Korea and the United States, so in those regions you aren't licensed to run the local weights at all. That's a legal wall, not a technical one.

Where people get burned

The 33B checkpoint plus an audio branch plus multiple references is a lot of resident memory; no verified consumer VRAM floor was published at release and the weights land around 42.5 GB, so check your headroom before downloading. If you want ComfyUI to leave some of the card free while this runs, the pack ships Painter VRAM.

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 (3)

NameTypeDescription
positiveCONDITIONING
LATENTLATENT
promptSTRING