APNext H3 Claude Code Writer
H3 prompts written by your Claude Code subscription — with real web research
- image
- h3_prompt
- integrated_multimodal_description
- overall_soundscape
- non_diegetic_music
- session_id
- info
The H3 Prompt Writer on a subscription instead of an API key. Where the regular writer picks whatever provider has a key set, this one hands the job to your locally installed Claude Code CLI, which authenticates with its own login - no ANTHROPIC_API_KEY in ComfyUI, and the work counts against your Claude plan's seat rather than metered API spend. If you're already paying for Claude, that's a real saving on a workflow that's going to write a lot of prompts.
It writes the same base format as the APNext H3 Prompt Writer - integrated_multimodal_description, overall_soundscape, non_diegetic_music, shot blocks, <d> dialogue tags - from the same official MiniMax guide shipped in data/h3/. All the shared knobs carry over: idea, task_type (T2VA / I2VA / FL2VA / L2VA), duration_seconds, shot_plan, visual_style, wildness, the full camera_motion/amplitude/speed vocabulary, include_dialogue and dialogue_language. The differences are where the Claude Code layer pays off.
The two things that make it worth choosing
research. Flipping this on sends Claude Code to the web before it writes - the real location, period-correct wardrobe, how the light actually behaves there, how the physical event unfolds - and folds what it finds in as concrete visual detail. It's instructed never to cite anything or add commentary, so the output stays a clean H3 prompt instead of a Wikipedia dump. Slower, and it reaches the internet, but it's the difference between "a marketplace in old Cairo" and a prompt that knows what old Cairo smells like on screen. The claude: dropdown entry on the regular writer is fine for a plain one-shot; you pick this node when you want the research pass.
Sessions. This node returns session_id in place of model_used, and it's the whole point of the chain. Feed that into an H3 Claude Code Refiner and you can revise the prompt in plain language - "make shot 2 wilder, cut the dialogue" - with the guide, the reference images and the model's own reasoning still in context. The writer also takes an optional resume_session_id to continue an earlier run, and working_dir to let the CLI read a script, shot list or lookbook notes while it writes.
Model aliases are sonnet, opus, haiku, fable or default. use_subscription (on by default) hides the API key so your login is used; flip it off to bill the API key instead. timeout_seconds defaults to 900 because H3 prompts take 25–60s and research runs take longer. seed only picks the surreal elements at high wildness and controls ComfyUI caching.
Install
The pack install is standard - 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
But the real prerequisite is the Claude Code CLI installed and logged in (claude on PATH, or CLAUDE_CODE_PATH set). The claudecode: model entries only appear when the CLI is found, and this node needs it to exist at all. No API key needed in ComfyUI either way.
Common issues
researchfeels slow - it's doing a full agent loop plus web fetches; that's the feature. Raisetimeout_secondsrather than cursing it.- Rate-limited mid-batch - your plan's rolling window (
five_hourlimit) can exhaust on heavy batches. The node prints a clear warning. - Empty local model lists don't matter here - this node is Claude Code-specific; the
ollama:/lmstudio:options live on the regular writer.
Inputs (24)
| Name | Type | Default | Description |
|---|---|---|---|
| idea | STRING | Your short prompt or image description. This is what gets expanded into a full H3 prompt. | |
| task_type | COMBO | T2VA (text only) | Which H3 task the prompt targets. Anything other than T2VA emits the matching reference-alignment instruction line. |
| duration_seconds | FLOAT | 6.01–60 | Effective video duration. Drives the cut times and the S.SS value in the alignment instruction. |
| shot_plan | COMBO | Auto | 5 options: Auto, Single shot, Two shots, Three shots, Four shots |
| visual_style | COMBO | Auto | Style stated at the start of [Shot 1]. Auto derives it from the idea or the attached image. |
| wildness | INT | 250–100 | 0 = literal and conservative, 100 = fully unhinged. Above 40 the node also injects concrete surreal elements picked from the seed. |
| camera_motion | COMBO | Auto | 21 options: Auto, Static Shot, Zoom In, Zoom Out, Push In, Pull Out, +15 |
| camera_amplitude | COMBO | Auto | 4 options: Auto, with small amplitude, medium (omit), with large amplitude |
| camera_speed | COMBO | Auto | 4 options: Auto, at slow speed, normal (omit), at fast speed |
| include_dialogue | BOOLEAN | true | — |
| dialogue_language | COMBO | English | The 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_text | BOOLEAN | false | — |
| include_soundscape | BOOLEAN | true | — |
| include_non_diegetic_music | BOOLEAN | true | — |
| model | COMBO | sonnet | Claude Code model alias. `default` uses whatever the CLI is configured for. |
| research | BOOLEAN | false | Let Claude Code search the web for real references before writing - the actual location, wardrobe, lighting and physics. Slower, and it reaches the internet. |
| use_subscription | BOOLEAN | true | Hide ANTHROPIC_API_KEY from the CLI so it uses your Claude Code login and subscription seat. Turn off to bill the API key instead. |
| timeout_seconds | INT | 90060–3600 | How long to wait. H3 prompts take 25-60s; research runs take longer. |
| seed | INT | -1-1–18446744073709550000 | Picks the surreal elements at high wildness, and controls ComfyUI caching. -1 re-rolls and re-runs every queue. |
| imageopt | IMAGE | Reference frame(s), sent inline to the CLI as vision input. | |
| extra_instructionsopt | STRING | — | |
| custom_dialogue_languageopt | STRING | Any language or dialect not in the dropdown, e.g. 'Norwegian (Bergen dialect)' or 'Latin'. Overrides the dropdown when filled in. | |
| resume_session_idopt | STRING | Continue an earlier Claude Code run by feeding it that node's session_id. The whole conversation, images included, is still in context. | |
| working_diropt | STRING | A 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. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| h3_prompt | STRING | — |
| integrated_multimodal_description | STRING | — |
| overall_soundscape | STRING | — |
| non_diegetic_music | STRING | — |
| session_id | STRING | — |
| info | STRING | — |