Multishot Advance Prompt Builder
The H3 Prompt Builder
- cartridge_metadata
- script_out
- shot_count_out
- prompt_builder_state
- project_name_out
- global_prompt_out
- reference_subjects_out
- report
- compiled_preview
MiniMax H3's full-reference prompt contract is a beast: six official sections in a fixed order - subject_definitions, summary, retention_analysis, detailed_description, overall_soundscape, non_diegetic_music - with labels that must match the actual runtime references or the sampler rejects the whole prompt. Hand-writing that for every shot of a long sequence is a recipe for undefined_subject_reference errors at 11pm. This node exists so you don't.
The idea: define the character once (identity, retention rules, global scene notes, visual style), then write only the per-clip action beats in shot_script. The builder assembles the official contract, lints it, and hands you a compiled_preview to eyeball before anything renders.
How it works
Think of it as the authoring half of the pipeline. It can connect directly to the sampler for session-only work, or pass through the Project node so its editable fields persist across restarts:
Multishot Advance Prompt Builder.script_out -> Multishot Advance Sampler.script
Multishot Advance Prompt Builder.shot_count_out -> Multishot Advance Sampler.shot_count
Multishot Advance Prompt Builder.reference_subjects_out -> Multishot Advance Sampler.reference_subjects
Multishot Advance Prompt Builder.compiled_preview -> Multishot Advance Markdown Preview.text
Two intent settings matter up top. prompt_contract (auto/base/full_reference) records authoring intent - auto picks full-reference only when you've declared reference items, but the sampler always validates the result against what's actually connected at render time, so the builder's intent is never trusted blindly. task_mode (auto/T2VA/I2VA/FL2VA/L2VA) likewise records intent; the sampler resolves the real task from actual first_frame/last_frame tensors, not from what you clicked.
The inputs a beginner actually sets
There are a lot of fields, but the ones you'll touch every session:
subject_name- short name/role for<Subject 1>("the woman in Picture 1" by default). Keep it short; the detail goes insubject_description.subject_description- the actual identity: face, hair, skin, wardrobe, distinctive details. The builder adds the "is" and wraps it - don't write<Subject 1> isyourself.retention_focus- what the retention_analysis block tells H3 to preserve across clips. Defaults to identity/face/hair/lighting, which is right for most runs.shot_script- the per-clip action beats. One target clip per---block; real camera cuts inside a clip go as[Shot 1],[Shot 2], with official cut timestamps.reference_images+reference_image_groups- how many<Picture N>items the prompt names, and how they group into people."3,3"means pictures 1-3 are Subject 1 and 4-6 are Subject 2. This must match what you actually wire to the sampler, or you'll get the warning below.global_prompt,style_prompt,soundscape_prompt,music_prompt- shared world/continuity notes, cinematography, and the soundscape/music section bodies.
The presets (style_preset, camera_preset, shot_template, speech_policy) are all default-off and genuinely optional. force_silent, for instance, adds positive closed-mouth performance and environmental soundscape wording when you want a deliberately silent clip - it does not append "no dialogue" negative prose, which H3 doesn't want.
Outputs: script_out, shot_count_out, prompt_builder_state (wire to the Project node to persist the builder's fields), project_name_out, reference_subjects_out, report (lint warnings), and compiled_preview - the exact final prompt as markdown.
Installing it
Ships in the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/KursatAs/ComfyUI-H3-Multishot-Advance
Restart ComfyUI. No extra downloads.
Common issues
The classic error is undefined_subject_reference ... <Subject 2>: the script uses Subject 2 but subject_definitions only established Subject 1. Fix by checking reference_images counts, the runtime image batch, reference_image_groups, and that secondary_subjects has one non-empty description line per extra person. A close cousin is a nested section header - if a body field contains something like detailed_description: as text, remove it; the builder generates the wrappers. And the recurring theme across all of it: the builder's declared counts are editable intent, the sampler reads the actual tensors, and when they disagree it falls back to the runtime contract with a warning - recoverable, but align them anyway to avoid surprise label assignments.
Inputs (31)
| Name | Type | Default | Description |
|---|---|---|---|
| project_name | STRING | My_MultiShot_Advance_Project | Project name used by the load button and usually wired to Multishot Advance Project.project_name_override. |
| project_picker | COMBO | (manual / new project_name) | Existing Multishot Advance projects. Select one to set project_name without typing, then use Load project prompts to refill this builder from project.json. |
| subject_name | STRING | the woman in Picture 1 | Short human-readable name/role for <Subject 1>. Keep this short; put the detailed identity text in subject_description. |
| identity_mode | COMBO | subject_definitions + retention_analysis | Structured mode writes MiniMax-H3 subject and retention blocks. Plain mode only prepends the description as text. |
| prompt_contract | COMBO | auto | Builder intent only. auto selects full_reference when declared refs exist, otherwise base. The Sampler validates the final contract from actual runtime tensors and references. |
| task_mode | COMBO | auto | Base task intent stored in builder/project state. The Sampler resolves T2VA/I2VA/FL2VA/L2VA from actual first/last-frame tensors. |
| reference_images | INT | 10–16 | How many <Picture N> references the prompt should name. Match the images wired to the sampler. |
| reference_image_groups | STRING | Optional multi-person picture grouping, same format as sampler reference_subjects. Example: '3,3' means pictures 1-3 are <Subject 1>, 4-6 are <Subject 2>. | |
| reference_image_role | COMBO | off | Global H3 transport role for <Picture N> items. Semantic bindings control contributed facets but do not change tensor transport. Identity-only pictures stay inside their <Subject N> source; concrete first/last frame and storyboard roles get standalone definitions. The Sampler validates the actual runtime role and tensor binding. |
| reference_videos | INT | 00–4 | How many <Video N> references the prompt should name. |
| reference_video_role | COMBO | video_structure_reference | Explicit role for declared <Video N> items. Only video_continuation_source produces the video continuation task type. |
| reference_video_audio_role | COMBO | voice_timbre_reference | Audio role independent from reference_video_role. Voice timbre enters only clips with structured or explicit foreground speech; ambience, rhythm and copy roles can condition silent clips. off ignores the paired reference_video_audio signal. |
| reference_audios | INT | 00–4 | How many <Audio N> references the prompt should name. |
| global_placement | COMBO | every_shot | every_shot is best for separate H3 clips. first_shot_only keeps later prompts shorter but identity may drift. |
| style_preset | COMBO | Off | Optional style preset bank. Off means the builder adds no preset text and you stay fully manual. |
| shot_template | COMBO | Off | Optional shot formatting. Off preserves pure manual shot text only when no builder global/identity/silent/anchor guidance is active; otherwise H3 official description sections are used. |
| camera_preset | COMBO | Off | Optional camera preset applied to each effective shot. Off means camera wording is left entirely to shot_script. |
| shot_count | INT | 00–100 | 0 = use the parsed independent clip count. A higher value repeats the last clip; a lower value renders only the first requested clips. |
| speech_policy | COMBO | auto | auto lets shot text decide speech. force_silent adds positive closed-mouth performance and environmental soundscape wording. allow_dialogue keeps explicit dialogue cues active. |
| subject_description | STRING | defined by her exact facial identity, facial structure, facial features, eyes, nose, mouth, jawline, skin appearance, hair, hairstyle, and overall visual identity. Her face and identity must remain unmistakably identical to <Picture 1> throughout the entire video. | Identity description derived from the reference image/video: face, hair, skin, wardrobe, posture, age range, distinctive details. Do not write '<Subject 1> is' here; the builder adds it. |
| retention_focus | STRING | her exact identity, face, hair, hairstyle, physical proportions, wardrobe identity, lighting continuity and overall visual consistency | What the retention_analysis block tells H3 to preserve across clips. Write a concise subject-specific phrase or statement placed after 'Continuity focus:'; place scene or location continuity in global_prompt. Do not write 'retention_analysis:' here; the builder adds it. |
| secondary_subjects | STRING | Optional: one extra subject description per line. They become <Subject 2>, <Subject 3>, ... | |
| global_prompt | STRING | World, location, character rules or continuity notes shared by all shots. | |
| style_prompt | STRING | Cinematography, lens, lighting, colour and motion style shared by all shots. | |
| soundscape_prompt | STRING | Optional overall_soundscape text used by H3 shot templates. Empty uses a conservative automatic soundscape. | |
| music_prompt | STRING | Optional non_diegetic_music text used by H3 shot templates. Empty becomes N/A. | |
| shot_script | STRING | Write one target video clip per --- block. Inside a clip, keep real camera cuts as [Shot 1], [Shot 2], [Shot 3] with official cut timestamps. | |
| external_prompt_import_hash | STRING | Internal one-shot import marker. The frontend keeps this hidden. | |
| external_prompt_import_payload | STRING | Internal lossless External Importer state. The frontend keeps this field hidden; editing any imported Builder field safely disables its stale override. | |
| external_prompt_inputopt | STRING | Optional STRING socket for AI Scenario Director output or another external prompt. A new connected prompt is imported into editable Prompt Builder fields on the first Run; downstream execution is blocked until the user runs the workflow again. | |
| cartridge_metadataopt | MULTISHOT_ADVANCE_CARTRIDGE_METADATA | Typed metadata from Multishot Advance Cartridge Loader. It supplies label-free identity prose; actual Picture/Audio labels still come from wired runtime references and the central registry. |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| script_out | STRING | — |
| shot_count_out | INT | — |
| prompt_builder_state | MULTISHOT_ADVANCE_PROMPT_BUILDER_STATE | — |
| project_name_out | STRING | — |
| global_prompt_out | STRING | — |
| reference_subjects_out | STRING | — |
| report | STRING | — |
| compiled_preview | STRING | — |