Nodes/SDXL Auto Prompter/APNext H3 Claude Code Reference Writer
ComfyUI Node

APNext H3 Claude Code Reference Writer

MiniMax-H3 full-reference prompts, researched and written by Claude Code

By dagthomas·Created 3 years ago·Updated 7 days ago· 290
APNext H3 Claude Code Reference Writer
  • llm
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • image_9
  • h3_prompt
  • subject_definitions
  • summary
  • retention_analysis
  • detailed_description
  • overall_soundscape
  • non_diegetic_music
  • session_id
  • info
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • image_9
idea
task_typeAuto (decide from the references)
reference_roleAuto (decide per image)
duration_seconds8.0
shot_planAuto
visual_styleAuto
wildness25
word_target425
camera_motionAuto
camera_amplitudeAuto
camera_speedAuto
include_dialoguetrue
dialogue_languageEnglish
include_on_screen_textfalse
include_soundscapetrue
include_non_diegetic_musictrue
modelsonnet
researchfalse
directortrue
use_subscriptiontrue
timeout_seconds1200
seed-1
reference_notes
extra_instructions
custom_dialogue_language
custom_visual_style
resume_session_id
working_dir
context_1
context_2
context_3
context_4
context_5
context_6
context_7
context_8

This is the Claude Code version of the H3 Reference Prompt Writer: same six-section full-reference format, same <Subject N>/<Picture N> label rules, same retention_analysis - but the model writing it is your locally installed Claude Code CLI, billing your subscription seat instead of an API key. If you've read the plain H3 Ref Prompt Writer article, you know the format; this one just answers the "who writes it and what can it look up" question differently.

It inherits every option from the reference writer - idea, task_type (the bracketed summary prefix: keyframe completion, reference generation, video editing, video continuation, audio reuse, audio reference), reference_role, word_target, shot_plan, visual_style, wildness, the camera vocabulary, include_dialogue and dialogue_language, plus four reference image inputs (image_1image_4) and reference_notes for describing what must survive or for video/audio references you can't attach.

Why this variant

Two reasons, same as its base-format sibling. The research toggle sends the CLI to the web before writing - the real location, the wardrobe, the light, the physics - and folds what it finds into the prompt as concrete visual detail, with no citations and no commentary in the output. For full-reference work that's genuinely useful: reference images give you the subject, research gives you the world it moves through, and both end up in the same structured prompt.

And it returns a session_id instead of model_used. That's the hook for refinement - wire it into the H3 Claude Code Refiner and describe the change in plain language ("keep the cardigan, move the market to dawn") with the guide, your reference images and the model's reasoning still in context. It also accepts a resume_session_id of its own and an optional working_dir for a script or lookbook the CLI may read.

Model aliases (sonnet, opus, haiku, fable, default), use_subscription, timeout_seconds (default 900 - reference rewrites are long) and seed all behave as on the other Claude Code nodes.

Install

Pack install is the shared routine - ComfyUI Manager (search "comfyui_dagthomas") or:

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

Restart, then make sure the Claude Code CLI is installed and logged in once (claude on PATH, or CLAUDE_CODE_PATH set). No ComfyUI-side API key needed. The reference images and guide files live in the pack already - nothing extra to download.

Common issues

  • References not sticking - the model can only track what it can see; verify your images are actually connected to image_1image_4, and lean on reference_notes to say plainly what must be preserved.
  • Slow with research on - a full-reference rewrite plus web fetches is a long agent loop. Bump timeout_seconds rather than killing the queue mid-run.
  • Subscription window - heavy batches can exhaust your plan's rolling limit; the node prints a warning when it hits it. That's the price of the seat.
Categorycomfyui_dagthomas/H3

Inputs (46)

NameTypeDefaultDescription
ideaSTRINGYour short prompt: what should happen in the target video.
task_typeCOMBOAuto (decide from the references)Square-bracketed prefix of the summary section. Auto lets the model combine types with ' + '.
reference_roleCOMBOAuto (decide per image)How the attached images should be labelled in subject_definitions.
duration_secondsFLOAT8.01–60
shot_planCOMBOAuto5 options: Auto, Single shot, Two shots, Three shots, Four shots
visual_styleCOMBOAutoIn full-reference mode the style is stated in one or two sentences BEFORE [Shot 1]. The list is the guide's styles plus the APNext Cinematic vocabulary (film stock, grading, aesthetics); pick Custom and fill in custom_visual_style to write your own.
wildnessINT250–1000 = literal and conservative, 100 = fully unhinged. Above 40 the node also injects concrete surreal elements picked from the seed.
word_targetINT425150–1200Target length of detailed_description. The guide recommends 350-500 words for generation tasks.
camera_motionCOMBOAuto21 options: Auto, Static Shot, Zoom In, Zoom Out, Push In, Pull Out, +15
camera_amplitudeCOMBOAuto4 options: Auto, with small amplitude, medium (omit), with large amplitude
camera_speedCOMBOAuto4 options: Auto, at slow speed, normal (omit), at fast speed
include_dialogueBOOLEANtrue
dialogue_languageCOMBOEnglishThe language the characters actually speak, and the tag written inside <d>[...]</d>. Auto lets the model pick one that fits the setting. Pick Custom (or just fill in custom_dialogue_language) for anything not listed.
include_on_screen_textBOOLEANfalse
include_soundscapeBOOLEANtrue
include_non_diegetic_musicBOOLEANtrue
modelCOMBOsonnetWho writes the prompt. sonnet / opus / haiku / fable / default are Claude Code aliases (`default` = whatever the CLI is configured for). `codex` is the OpenAI Codex CLI with its configured model (shown when installed; `codex:<model-id>` in an H3 LLM Backend picks a specific one). ollama: / lmstudio: / local: entries are whatever your local servers were serving when the page loaded; pick one to run fully offline. Anything not listed goes in model_override.
researchBOOLEANfalseLet the agent CLI (Claude Code or Codex) search the web for real references before writing - the actual location, wardrobe, lighting and physics. Slower, and it reaches the internet.
directorBOOLEANtrueLoad the H3 director skills (data/h3/skills): the core writing rules, the format this node emits, and style/motion craft, each with a reference library of gold examples and style anchors that Claude Code reads on demand. Costs a few extra seconds and tokens per run.
use_subscriptionBOOLEANtrueHide the API key from the CLI so it uses your login and subscription seat (ANTHROPIC_API_KEY for Claude Code, OPENAI_API_KEY for Codex). Turn off to bill the API key instead.
timeout_secondsINT120060–7200How long to wait PER CALL before the node gives up on the CLI (this is the node's own watchdog, not a Claude limit). Single H3 prompts take 25-60s; a multi-scene chunk with director/research on can take 10-20 minutes. The multi-scene writers retry a timed-out chunk at half size automatically.
seedINT-1-1–18446744073709550000Picks the surreal elements at high wildness, and controls ComfyUI caching. -1 re-rolls and re-runs every queue.
reference_notesoptSTRINGOptional per-reference notes, one per line, e.g. 'Image 1: the woman, keep her cardigan'. Also use this to describe video or audio references you cannot attach.
extra_instructionsoptSTRING
custom_dialogue_languageoptSTRINGAny language or dialect not in the dropdown, e.g. 'Norwegian (Bergen dialect)' or 'Latin'. Overrides the dropdown when filled in.
custom_visual_styleoptSTRINGAny visual style not in the dropdown, e.g. 'hand-painted cel animation' or 'Kodak Vision3 500T, anamorphic'. Overrides the dropdown when filled in.
resume_session_idoptSTRINGContinue an earlier run by feeding it that node's session_id. The whole conversation, images included, is still in context. A session sticks to its backend: Claude Code ids resume with Claude Code, `codex-` ids with Codex, `local-` ids with the same local model.
working_diroptSTRINGA folder Claude Code may read while writing - a script, a shot list, lookbook notes. Empty uses a throwaway scratch folder, which is the safe default.
llmoptAPNEXT_LLMOptional. Connect an APNext H3 LLM Backend node to write with Ollama, LM Studio, another OpenAI-compatible server or an API model instead of Claude Code. Overrides the model dropdown while connected.
context_1optSTRINGSteering input from another APNext node (Time, Scene, Poses, Plots, Feelings, Cinematic, Science, Geography, Architecture, Fashion, ...). The node detects which kind it is and tells Claude how to use it. Sockets grow as you connect them.
context_2optSTRINGSteering input from another APNext node (Time, Scene, Poses, Plots, Feelings, Cinematic, Science, Geography, Architecture, Fashion, ...). The node detects which kind it is and tells Claude how to use it. Sockets grow as you connect them.
context_3optSTRINGSteering input from another APNext node (Time, Scene, Poses, Plots, Feelings, Cinematic, Science, Geography, Architecture, Fashion, ...). The node detects which kind it is and tells Claude how to use it. Sockets grow as you connect them.
context_4optSTRINGSteering input from another APNext node (Time, Scene, Poses, Plots, Feelings, Cinematic, Science, Geography, Architecture, Fashion, ...). The node detects which kind it is and tells Claude how to use it. Sockets grow as you connect them.
context_5optSTRINGSteering input from another APNext node (Time, Scene, Poses, Plots, Feelings, Cinematic, Science, Geography, Architecture, Fashion, ...). The node detects which kind it is and tells Claude how to use it. Sockets grow as you connect them.
context_6optSTRINGSteering input from another APNext node (Time, Scene, Poses, Plots, Feelings, Cinematic, Science, Geography, Architecture, Fashion, ...). The node detects which kind it is and tells Claude how to use it. Sockets grow as you connect them.
context_7optSTRINGSteering input from another APNext node (Time, Scene, Poses, Plots, Feelings, Cinematic, Science, Geography, Architecture, Fashion, ...). The node detects which kind it is and tells Claude how to use it. Sockets grow as you connect them.
context_8optSTRINGSteering input from another APNext node (Time, Scene, Poses, Plots, Feelings, Cinematic, Science, Geography, Architecture, Fashion, ...). The node detects which kind it is and tells Claude how to use it. Sockets grow as you connect them.
image_1optIMAGEReference image 1: <Picture 1> in the prompt. Connect the same image to image_1 on the MiniMax H3 Reference to Video node, or use this node's image_1 output.
image_2optIMAGEReference image 2: <Picture 2> in the prompt. Connect the same image to image_2 on the MiniMax H3 Reference to Video node, or use this node's image_2 output.
image_3optIMAGEReference image 3: <Picture 3> in the prompt. Connect the same image to image_3 on the MiniMax H3 Reference to Video node, or use this node's image_3 output.
image_4optIMAGEReference image 4: <Picture 4> in the prompt. Connect the same image to image_4 on the MiniMax H3 Reference to Video node, or use this node's image_4 output.
image_5optIMAGEReference image 5: <Picture 5> in the prompt. Connect the same image to image_5 on the MiniMax H3 Reference to Video node, or use this node's image_5 output.
image_6optIMAGEReference image 6: <Picture 6> in the prompt. Connect the same image to image_6 on the MiniMax H3 Reference to Video node, or use this node's image_6 output.
image_7optIMAGEReference image 7: <Picture 7> in the prompt. Connect the same image to image_7 on the MiniMax H3 Reference to Video node, or use this node's image_7 output.
image_8optIMAGEReference image 8: <Picture 8> in the prompt. Connect the same image to image_8 on the MiniMax H3 Reference to Video node, or use this node's image_8 output.
image_9optIMAGEReference image 9: <Picture 9> in the prompt. Connect the same image to image_9 on the MiniMax H3 Reference to Video node, or use this node's image_9 output.

Outputs (18)

NameTypeDescription
h3_promptSTRING
subject_definitionsSTRING
summarySTRING
retention_analysisSTRING
detailed_descriptionSTRING
overall_soundscapeSTRING
non_diegetic_musicSTRING
session_idSTRING
infoSTRING
image_1IMAGE
image_2IMAGE
image_3IMAGE
image_4IMAGE
image_5IMAGE
image_6IMAGE
image_7IMAGE
image_8IMAGE
image_9IMAGE