APNext H3 Claude Code Refiner
Revise an H3 prompt in plain English — 'make shot 2 wilder, cut the dialogue'
- image
- h3_prompt
- subject_definitions
- summary
- retention_analysis
- detailed_description
- integrated_multimodal_description
- overall_soundscape
- non_diegetic_music
- session_id
- info
Every video prompting tool eventually hits the same wall: the first prompt isn't the shot. You look at the output, you know exactly what's wrong - "shot 2 should be wilder," "cut the dialogue," "move the market to dawn" - and rewriting the whole structured H3 prompt by hand is brutal. This node lets you say exactly that, in plain English, and it does the surgical edit for you.
The trick is the session. H3 Claude Code Refiner is designed to sit downstream of an H3 Claude Code Writer: wire the writer's session_id into this node's optional session_id input, and the model resumes that conversation with the official guide, your reference images and its own reasoning still in context. You send only the instruction, so it edits rather than rewrites from scratch - cheaper, more consistent, and it won't forget the reference image you attached two nodes ago. Leave session_id empty and it still works: it re-sends the prompt with the matching guide and auto-detects which format it's looking at.
The inputs that matter
h3_prompt- the prompt to revise. Wire theh3_promptoutput of any H3 writer into here.instruction- what to change, in plain language. "Same scene at night." "Shorten it to one shot." The whole point of the node.session_id(optional) - the writer's session, for true surgical refinement.model-sonnet,opus,haiku,fable,default; Claude Code aliases, so it uses your CLI login.research- lets the CLI search the web before revising (slower, reaches the internet).image(optional) - extra reference frames to introduce with this revision.
It returns ten outputs because it has to cover both H3 formats: h3_prompt, subject_definitions, summary, retention_analysis, detailed_description, integrated_multimodal_description, overall_soundscape, non_diegetic_music, plus session_id (grab it if you want to keep refining) and info. Fields the format doesn't use come back empty - a base-format prompt simply won't populate retention_analysis or subject_definitions.
The rest of the controls (use_subscription, timeout_seconds at a 900s default, seed for caching only, working_dir) behave exactly as on the other Claude Code nodes. The one thing you can't do here is pick a temperature or a max-token cap - the CLI owns sampling, which is the trade for the agentic approach.
Install
Shared pack install - 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, and have the Claude Code CLI installed and logged in (it's a separate install from this pack). No API key in ComfyUI; usage bills your Claude subscription seat.
Common issues
- It's rewriting, not editing - you probably left
session_idempty. Feed it the writer'ssession_idand the model keeps context instead of re-deriving everything from the prompt alone. - Slow revisions - a fresh run without a session has to re-send the whole prompt plus guide; that's the 25–60s you're seeing. Sessions make the common "tweak and regenerate" loop dramatically cheaper.
- Rate limits - heavy iterate-and-refine sessions will eventually brush your plan's rolling window. The node prints a warning when it does.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| h3_prompt | STRING | The prompt to revise. Wire the h3_prompt output of an H3 writer in here. | |
| instruction | STRING | What to change, in plain language: 'make shot 2 wilder', 'cut the dialogue', 'same scene at night', 'shorten it to one shot'. | |
| 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 | Controls ComfyUI caching only. -1 re-runs every queue. |
| session_idopt | STRING | The writer's session_id. With it, the model still has the guide, the images and its own reasoning in context - far cheaper and more consistent. Without it the prompt is re-sent with the matching guide. | |
| imageopt | IMAGE | Extra reference frame(s) to introduce with this revision. | |
| working_diropt | STRING | — |
Outputs (10)
| Name | Type | Description |
|---|---|---|
| h3_prompt | STRING | — |
| subject_definitions | STRING | — |
| summary | STRING | — |
| retention_analysis | STRING | — |
| detailed_description | STRING | — |
| integrated_multimodal_description | STRING | — |
| overall_soundscape | STRING | — |
| non_diegetic_music | STRING | — |
| session_id | STRING | — |
| info | STRING | — |