APNext H3 Claude Code Continue Writer
Make the next clip actually continue the last one
- frames
- llm
- h3_prompt
- integrated_multimodal_description
- overall_soundscape
- non_diegetic_music
- session_id
- info
- first_frame
- context_frames
MiniMax-H3 renders clips, not movies. Every video node takes a prompt and produces one chunk - 5 to 15 seconds, give or take - and if you want a longer piece you have to keep the story going across clips. APNext H3 Claude Code Continue Writer is the node that does the hand-off: it looks at the frames of the clip you just rendered, shows them to Claude Code, and writes the H3 prompt for the next clip - with the last frame already designated as the new clip's first frame.
That last bit is the whole trick. Video models are allergic to continuity you don't spell out, so this node writes an I2VA prompt (image-to-video: the first frame is a given image) where the last frame of the old clip is <Picture 1> at 0.00s of the new clip. It hands that frame back out as first_frame so you can wire it straight into the video node. Continuation becomes a matter of "start here, go there" instead of "hopefully start near here."
How it samples what Claude sees
You feed the rendered clip's frames into frames (a decoded video batch). The node doesn't dump the whole thing at the model - it takes frame_count frames every frame_stride frames, counting back from the end. Defaults are 4 frames, one every 6 (a quarter second at 24fps), and the final frame is always included. The earlier frames are context only: they tell the model which way the camera and the action were moving, so the continuation doesn't reverse a pan or freeze mid-swing. Those sampled frames come back out as context_frames so you can preview exactly what it saw - worth doing once, because if the sampling strip looks wrong, the continuation will too.
Switch continuation_mode to T2VA and it instead writes a cut to a fresh scene of the same story; the frames only inform look and mood.
Inputs that matter
frames- the rendered clip (decode it first).frame_count/frame_stride- how many frames Claude sees and how far apart.idea- what happens next. Leave empty and Claude decides how the scene naturally carries on; that's often the better first pass.previous_prompt- the H3 prompt that made the clip you're continuing. For a long chain, paste every prompt so far, oldest first. Not needed if you useresume_session_id.resume_session_id- the killer feature. Feed it the writer'ssession_id(or the previous Continue Writer's) and Claude Code still has the guide, the earlier frames and every prompt in context, so characters, speaker IDs and the soundscape stay consistent across many clips.duration_seconds,visual_style(Auto keeps the previous clip's look - almost always what you want),wildness, the camera block, dialogue toggles - same controls as the base writer.llm(optional) - connect an H3 LLM Backend to write with Ollama instead of the CLI.
Outputs: h3_prompt plus the split-out section fields (integrated_multimodal_description, overall_soundscape, non_diegetic_music), session_id, info, first_frame and context_frames.
Installing
Part of dagthomas/comfyui_dagthomas. ComfyUI Manager → search comfyui_dagthomas, or clone into custom_nodes + pip install -r requirements.txt, restart. Under APNext → H3.
The one real prerequisite: Claude Code must be installed and logged in (claude on PATH, or CLAUDE_CODE_PATH set). If claude isn't found, the node can't run - there's no API-key fallback for the default engine. Calls are slower than an API hit (tens of seconds; 25–60s is normal for an H3 prompt, longer with research on), and each call carries Claude Code's ~35k-token tool preamble, so a long chain burns your subscription window - that's the trade for a session that remembers everything. Keep timeout_seconds above the default 900 for research runs, and don't forget use_subscription is on by default, which is what makes it bill your seat rather than an API key.
Inputs (38)
| Name | Type | Default | Description |
|---|---|---|---|
| frames | IMAGE | The frames of the clip to continue - wire a decoded video batch in here. Only the last frames are sent to Claude Code; the very last one is the next clip's first frame. | |
| frame_count | INT | 41–20 | How many of the last frames to show Claude Code. The final frame is always included; the ones before it only show which way things were moving. |
| frame_stride | INT | 61–120 | Gap between the sampled frames. 1 = strictly consecutive frames (nearly identical at 24 fps); 6 = one every quarter second. Counting back from the last frame. |
| idea | STRING | What should happen next. Leave empty and Claude Code decides how the scene naturally carries on. | |
| continuation_mode | COMBO | I2VA (last frame becomes the first frame) | I2VA: the last frame is <Picture 1> at 0.00s of the new clip - wire first_frame into the video node. T2VA: cut to a fresh scene that follows on; the frames only inform look and story. |
| duration_seconds | FLOAT | 6.01–60 | Length of the NEW clip. |
| shot_plan | COMBO | Auto | 5 options: Auto, Single shot, Two shots, Three shots, Four shots |
| visual_style | COMBO | Auto | Auto keeps the style of the previous clip, which is almost always what you want. 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). 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 Claude Code 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 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 | 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. |
| previous_promptopt | STRING | The H3 prompt that generated the clip you are continuing - wire the writer's h3_prompt output in here. For a longer chain, paste every prompt so far, oldest first. Not needed when resume_session_id is set. | |
| 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 | The session_id of the writer (or the previous Continue Writer). Claude Code then still has the guide, the earlier frames and every prompt so far in context, so the story stays consistent across many clips. | |
| 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. | |
| 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 | — |
| context_frames | IMAGE | — |