Nodes/MiniMax H3 Novel Pipeline/Cinematic Chapter Adapter
ComfyUI Node

Cinematic Chapter Adapter

What the Cinematic Chapter Adapter Does Before Any Video Exists

By yuyuki·Created 2 months ago·Updated 11 days ago· 3
Cinematic Chapter Adapter
  • lmstudio_config
  • chapter_selection
  • cinematic_chapters
  • saved_files
◄out_dircinematic_chapters►
◄chunk_chars4000►
◄temperature0.15►
◄max_tokens8192►
◄correction_attempts2►

Feed a 4,000-word chapter straight into a video model prompt box and you get mush. MiniMax H3 is genuinely good at prompts that name what happens and when - the release-day threads praised it for handling "exact times at which things occur" - but a novel chapter doesn't hand you that. It hands you a paragraph of dialogue, a paragraph of walking, and a paragraph where someone who was fine is now dead.

Cinematic Chapter Adapter is the step that turns that into something with a timeline. It's stage zero of the MiniMax H3 Novel Pipeline: it reads chapters and writes structured sequence data.

And the name oversells it in one way - nothing is rendered, sampled, or sent anywhere. No cloud, no key. The model runs on your own machine, served by LM Studio.

What it produces, and why the shape matters

For each chapter it writes one JSON file, NNN_<chapter>.cinematic.json, under the run's cinematic_chapters/ folder. The object is small: a chapter_name, and a sequences array where each entry has a sequence number, a source excerpt kept as evidence, and an adaptation with exactly three strings - initialState, event and endingState.

That three-part split is the whole point. Later stages extract characters, props and locations per phase, so action can't bleed into appearance. event holds every ordered event, numbered and separated by newlines; endingState gets carried forward and handed to the next passage as the model's previous_final_state, which is how continuity survives a chunk boundary instead of resetting at every 4,000 characters.

The mechanism is a schema-constrained chat request per passage, with the passage length bounded by chunk_chars and split on paragraph boundaries. A single-passage response has to be exactly initial_state, events and final_state, with the source excerpt covered. Get a field wrong or skip part of the source and the error text is appended to the prompt for another attempt, up to correction_attempts times. Still failing on a passage over 1,000 characters? It splits that passage and retries smaller ones, carrying the final state through each. At 1,000 characters or under, a bad response ends the run - no silent fallback.

The inputs you actually touch

Two are wires, and you don't get to improvise them. lmstudio_config comes from LM Studio Configuration; chapter_selection comes from Select Chapters - the adapter won't take a plain path string. Chapters must already be inside ComfyUI's input directory under minimax_h3_novel/ (.txt, .md, .markdown, .pdf).

Then four numbers. out_dir defaults to cinematic_chapters, relative to the run folder. chunk_chars (4000, min 1000) is the input bound. max_tokens (8192) is the output budget - if you're seeing truncation, lower chunk_chars or raise this, in that order. temperature sits at 0.15, which is right for fidelity work; resist the urge to warm it up. correction_attempts (2) is the retry budget above.

Outputs: cinematic_chapters goes to Extract Chapter References' same-named input, and saved_files lists the JSON paths on disk as one newline-joined string. This is also an output node, so it can terminate a queue on its own and previews the adapted JSON - handy for testing one chapter before committing to a book.

Install

ComfyUI Manager, search MiniMax H3 Novel Pipeline, then restart. Or clone it, with the Python interpreter that actually runs ComfyUI:

cd ComfyUI/custom_nodes
git clone https://github.com/yuyuki/ComfyUI-Minimax_H3_Novel_Pipeline
python -m pip install -r ComfyUI-Minimax_H3_Novel_Pipeline/requirements.txt

Don't cherry-pick dependencies - requirements.txt pulls pypdf, openai>=1.0,<3, httpx>=0.27,<1 and jsonschema>=4.18,<5, and the ranges are deliberate. Nothing else in the repo is optional: the root __init__.py, src/ and web/ are all load-bearing.

Then start LM Studio's local server, load either a Qwen or a Mistral model, and set the API key in ComfyUI Settings → MiniMax H3 Novel → LM Studio (lm-studio if you've turned auth off). Add the LM Studio Configuration node with a matching model_family, and wire its output here.

Where people get burned

  • "missing match" / no model found. Each stage picks the first model LM Studio exposes whose identifier contains qwen or mistral, per model_family, with no fallback. Load the model, and keep only one of that family loaded so the pick isn't ambiguous.
  • Text comes back empty or misses detail. Almost always truncation or an oversized passage. Drop chunk_chars to 2500 and retry before changing anything else.
  • The picker or settings won't save, and long runs feel slow. Those routes only accept direct local browser access to ComfyUI, so a reverse proxy or forwarded host gets rejected. And it's one request per passage plus retries - though each finished chapter hits disk as it completes, so a cancelled run leaves usable files behind.

Do a single short chapter first, read the initialState/event/endingState output yourself, and only then point it at twenty chapters. The node checks structure and coverage; it can't tell you the model misread who was holding the knife.

CategoryMiniMax H3 Novel

Inputs (7)

NameTypeDefaultDescription
lmstudio_configMINIMAX_LMSTUDIO_CONFIG—
chapter_selectionMINIMAX_CHAPTER_SELECTION—
out_dirSTRINGcinematic_chapters—
chunk_charsINT40001000–30000—
temperatureFLOAT0.150–2—
max_tokensINT8192256–32768—
correction_attemptsINT20–10Retries for invalid fields or incomplete source coverage.

Outputs (2)

NameTypeDescription
cinematic_chaptersMINIMAX_CINEMATIC_CHAPTERS—
saved_filesSTRING—