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 about 18 hours ago· 285
APNext H3 Claude Code Writer
  • image
  • h3_prompt
  • integrated_multimodal_description
  • overall_soundscape
  • non_diegetic_music
  • session_id
  • info
idea
task_typeT2VA (text only)
duration_seconds6.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
use_subscriptiontrue
timeout_seconds900
seed-1
extra_instructions
custom_dialogue_language
resume_session_id
working_dir

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 (24)

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_secondsFLOAT6.01–60Effective video duration. Drives the cut times and the S.SS value in the alignment instruction.
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.
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
modelCOMBOsonnetClaude Code model alias. `default` uses whatever the CLI is configured for.
researchBOOLEANfalseLet Claude Code search the web for real references before writing - the actual location, wardrobe, lighting and physics. Slower, and it reaches the internet.
use_subscriptionBOOLEANtrueHide 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_secondsINT90060–3600How long to wait. H3 prompts take 25-60s; research runs take longer.
seedINT-1-1–18446744073709550000Picks the surreal elements at high wildness, and controls ComfyUI caching. -1 re-rolls and re-runs every queue.
imageoptIMAGEReference frame(s), sent inline to the CLI as vision input.
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.
resume_session_idoptSTRINGContinue an earlier Claude Code run by feeding it that node's session_id. The whole conversation, images included, is still in context.
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.

Outputs (6)

NameTypeDescription
h3_promptSTRING
integrated_multimodal_descriptionSTRING
overall_soundscapeSTRING
non_diegetic_musicSTRING
session_idSTRING
infoSTRING