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

APNext H3 Claude Code Writer

H3 prompts written by your Claude Code subscription — with real web research

By dagthomas·Created 3 years ago·Updated 7 days ago· 290
APNext H3 Claude Code Writer
  • 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
idea
task_typeT2VA (text only)
duration_seconds8.0
shot_planAuto
visual_styleAuto
wildness25
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
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

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

  • research feels slow - it's doing a full agent loop plus web fetches; that's the feature. Raise timeout_seconds rather than cursing it.
  • Rate-limited mid-batch - your plan's rolling window (five_hour limit) 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.
Categorycomfyui_dagthomas/H3

Inputs (44)

NameTypeDefaultDescription
ideaSTRINGYour short prompt or image description. This is what gets expanded into a full H3 prompt.
task_typeCOMBOT2VA (text only)Which H3 task the prompt targets. Anything other than T2VA emits the matching reference-alignment instruction line.
duration_secondsFLOAT8.01–60Effective 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_planCOMBOAuto5 options: Auto, Single shot, Two shots, Three shots, Four shots
visual_styleCOMBOAutoStyle 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.
wildnessINT250–1000 = literal and conservative, 100 = fully unhinged. Above 40 the node also injects concrete surreal elements picked from the seed.
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.
imageoptIMAGEKeyframe(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_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.
subject_1optIMAGESubject 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_2optIMAGESubject 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_3optIMAGESubject 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_1optIMAGEScenery 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_2optIMAGEScenery 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_3optIMAGEScenery 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_1optIMAGEObject 1: a prop, product, vehicle or costume piece to depict faithfully - shape, colour, material, markings. Where it is in the photo is ignored.
object_2optIMAGEObject 2: a prop, product, vehicle or costume piece to depict faithfully - shape, colour, material, markings. Where it is in the photo is ignored.
object_3optIMAGEObject 3: a prop, product, vehicle or costume piece to depict faithfully - shape, colour, material, markings. Where it is in the photo is ignored.
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.

Outputs (8)

NameTypeDescription
h3_promptSTRING
integrated_multimodal_descriptionSTRING
overall_soundscapeSTRING
non_diegetic_musicSTRING
session_idSTRING
infoSTRING
first_frameIMAGE
last_frameIMAGE