APNext H3 Claude Code Writer
H3 prompts written by your Claude Code subscription — with real web research
- image
- llm
- subject_1
- subject_2
- subject_3
- scenery_1
- scenery_2
- scenery_3
- object_1
- object_2
- object_3
- h3_prompt
- integrated_multimodal_description
- overall_soundscape
- non_diegetic_music
- session_id
- info
- first_frame
- last_frame
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 (44)
| 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 | 8.01–60 | Effective video duration. Drives the cut times and the S.SS value in the alignment instruction. The render snaps frames UP to the 17n+5 grid, so prefer grid durations - 8.00s (192f) is the only common integer one. |
| 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. 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. |
| 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 | Who 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. |
| research | BOOLEAN | false | Let 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. |
| director | BOOLEAN | true | Load 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_subscription | BOOLEAN | true | Hide 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_seconds | INT | 120060–7200 | How 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. |
| 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 | Keyframe(s) the video model will actually get. I2VA: the first frame. L2VA: the last frame. FL2VA: batch both (frame 0 = first, last = last). In T2VA it is context only. For a picture that should merely be DESCRIBED - a character, a place, a prop - use the subject/scenery/object sockets. | |
| 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. | |
| custom_visual_styleopt | STRING | Any 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_idopt | STRING | Continue 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_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. | |
| llmopt | APNEXT_LLM | Optional. 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. | |
| subject_1opt | IMAGE | Subject 1: a person, creature or character. Only WHO they are carries over - face, hair, build, wardrobe, distinctive marks. The photo's backdrop, light and framing are ignored; the scene comes from your idea. The video model never sees this image. | |
| subject_2opt | IMAGE | Subject 2: a person, creature or character. Only WHO they are carries over - face, hair, build, wardrobe, distinctive marks. The photo's backdrop, light and framing are ignored; the scene comes from your idea. The video model never sees this image. | |
| subject_3opt | IMAGE | Subject 3: a person, creature or character. Only WHO they are carries over - face, hair, build, wardrobe, distinctive marks. The photo's backdrop, light and framing are ignored; the scene comes from your idea. The video model never sees this image. | |
| scenery_1opt | IMAGE | Scenery 1: a location or environment. Its architecture, terrain, light, weather, palette and mood become the setting, described in words. People in it are ignored. | |
| scenery_2opt | IMAGE | Scenery 2: a location or environment. Its architecture, terrain, light, weather, palette and mood become the setting, described in words. People in it are ignored. | |
| scenery_3opt | IMAGE | Scenery 3: a location or environment. Its architecture, terrain, light, weather, palette and mood become the setting, described in words. People in it are ignored. | |
| object_1opt | IMAGE | Object 1: a prop, product, vehicle or costume piece to depict faithfully - shape, colour, material, markings. Where it is in the photo is ignored. | |
| object_2opt | IMAGE | Object 2: a prop, product, vehicle or costume piece to depict faithfully - shape, colour, material, markings. Where it is in the photo is ignored. | |
| object_3opt | IMAGE | Object 3: a prop, product, vehicle or costume piece to depict faithfully - shape, colour, material, markings. Where it is in the photo is ignored. | |
| context_1opt | STRING | Steering 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_2opt | STRING | Steering 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_3opt | STRING | Steering 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_4opt | STRING | Steering 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_5opt | STRING | Steering 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_6opt | STRING | Steering 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_7opt | STRING | Steering 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_8opt | STRING | Steering 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. |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| h3_prompt | STRING | — |
| integrated_multimodal_description | STRING | — |
| overall_soundscape | STRING | — |
| non_diegetic_music | STRING | — |
| session_id | STRING | — |
| info | STRING | — |
| first_frame | IMAGE | — |
| last_frame | IMAGE | — |