Nodes/MiniMax H3 Planner/H3 Segment Slicer
ComfyUI Node

H3 Segment Slicer

Cut an existing treatment into segments with no model, no key, no network

By AIJigyasa·Created 23 days ago·Updated 20 days ago· 4
H3 Segment Slicer
  • project
  • cast
  • timeline
  • report
◄h3_prompt►
◄total_seconds60.0►
◄shots_per_segment2►
◄min_segment_seconds2.0►
◄audio_roleperformed on camera►
◄carry_sectionstrue►
◄cuts►
◄style_prefix_override►

If you already have a treatment - a prompt with [Shot N] 00:05.500 markers written at the whole video's length - then you don't need a language model to split it up. You need arithmetic. H3 Segment Slicer does the cutting, the renumbering, the clock rebasing and the copying, and it never asks a model anything.

That's not a shortcut, it's the safer path. Ask a model to rewrite a slice of a treatment and it will paraphrase, and a paraphrase can contradict the style prefix it was told to preserve - you end up with "cinematic, literary" written under a prefix that says "2d illustration". This node cannot do that, because it never rewrites anything.

What it isn't: a planner. With no treatment there is nothing to cut, and no amount of string handling invents a shot list. That's what the Story Planner is for.

How the split works

It finds the treatment's [Shot N] markers and packs shots left to right, as many as fit under two ceilings: the longest clip H3 can render (14.375s at 24fps) and your shots_per_segment. A segment never ends inside a shot - it ends on that shot's own timestamp. Then each segment gets the treatment's shared sections (summary, retention_analysis, overall_soundscape, non_diegetic_music) plus its own detailed_description, with every timestamp rebased to that segment's zero and validated against its rendered length, so H3 never gets a cue it can't reach.

The style prefix is lifted off [Shot 1] of the treatment and prepended to each segment's [Shot 1] - once. (An earlier version wrote it twice, which is exactly the kind of thing that happens when you slice prompts programmatically. It's fixed.)

Tags the cast doesn't have get stripped, asset file names get stripped, and definitions get de-duplicated. Locked segments are left alone, so re-running after editing one card doesn't disturb the rest.

Inputs

project, h3_prompt and total_seconds are the wiring. h3_prompt wants the treatment run at the full video duration - the same number you gave the prompt creator.

  • shots_per_segment - 2 by default. Raise it to pack more of the treatment into each clip, as far as the segment cap allows.
  • min_segment_seconds - a tail shorter than this gets folded into the segment before it, which is what stops a 1.4s orphan clip at the end of the piece.
  • carry_sections - copy the treatment's summary, retention, soundscape and music into every segment. Off writes a minimal stand-in instead.
  • audio_role - same three-way choice as the prompter: performed on camera, voice-over, or background only. Ignored when the cast has no audio.

Optional: cast, style_prefix_override (blank means "lift it off the treatment"), and cuts.

That cuts input is the interesting one. Wire H3 Beat Map's cuts output into it and the boundaries come from the music instead: each shot lands in whichever cut its timestamp falls into, and shots_per_segment is ignored. The treatment then only says what happens inside each cut, and the bar grid says where the cuts are. That's the music-video path.

Outputs are timeline and report.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/AIJigyasa/ComfyUI-H3-Planner

Restart, or install MiniMax H3 Planner from ComfyUI Manager. This node has no dependency on the sibling Prompt Creator pack and doesn't need Ollama installed at all - deliberately, so it works on a machine with no model server. The pack as a whole wants ffmpeg on PATH (or pip install imageio-ffmpeg).

Where people get burned

Run your prompt creator at the full duration. The pack's own example workflow keeps the prompt creator whole and changes one thing: target_duration: 60.0 instead of 6.0. Run it for a single clip and you get a treatment with one shot in it, and the slicer has nothing meaningful to cut. Most prompt creators cap around 120s, so anything longer needs several treatments chained or the Segment Prompter's idea mode.

"No [Shot N] markers" means your treatment isn't timestamped the way the slicer expects. It cannot invent a shot list - feed it a real treatment or plan one.

Segments too long or too short for your card? shots_per_segment and H3 Project's max_segment_seconds are the two levers, in that order. The segment cap always wins.

Don't confuse it with the Story Planner. Slicer = you have a treatment, it cuts. Story Planner = you have an idea, a model writes everything. Both emit the same H3_TIMELINE type, so the render and stitch graphs don't care which one produced it.

CategoryH3 Planner

Inputs (10)

NameTypeDefaultDescription
projectH3_PROJECT—
h3_promptSTRINGthe h3_prompt output of your prompt creator, run at the FULL video duration. This node cuts it on its [Shot N] markers; it cannot invent one.
total_secondsFLOAT60.01–600the whole video's length — the same number you gave the prompt creator
shots_per_segmentINT21–12how many of the treatment's shots to pack into one clip, as far as the segment cap allows
min_segment_secondsFLOAT2.00.2–15a tail shorter than this is folded into the segment before it
audio_roleCOMBOperformed on camerawho makes the sound in the connected audio. Ignored when the cast has no audio asset.
carry_sectionsBOOLEANtruecopy the treatment's summary, retention, soundscape and music into every segment. Off writes a minimal stand-in instead.
castoptH3_CAST—
cutsoptSTRINGthe `cuts` output of H3 Beat Map. Wired, the cuts land on the music instead of on the treatment's own shot markers, and shots_per_segment is ignored.
style_prefix_overrideoptSTRINGblank = lift it off [Shot 1] of the treatment

Outputs (2)

NameTypeDescription
timelineH3_TIMELINE—
reportSTRING—