text_MinimaxH3
One long H3 script, many scene prompts — without the copy-paste
- array
If you've ever written a multi-scene video script in one text box and then manually chopped it into per-scene prompts for a staged generation workflow, this node exists to retire that chore. text_MinimaxH3 takes one big block of text - the whole scene list for your MiniMax H3 project - and splits it into an array of segment prompts, one per scene, on the markers you choose. That array output is exactly what the pack's per-stage/segment prompt plumbing expects to fan out across the stages of a long video run.
The one rule
The whole design reduces to one rule, and it's where people get burned, so read it twice: your delimiter marker must occupy a line all by itself. The node walks your text line by line, and only a line that exactly matches the marker pattern acts as a segment boundary. Text before the first marker, after the last marker, and between two markers each become one segment (blank space around them is trimmed). The author's own tooltip spells out the supported shapes: 【Segment {n}】, #segment{n}---------, or even a plain ---.
Two details make the marker format worth understanding:
- The
{n}is a wildcard that matches any number. It doesn't have to be sequential and it isn't used as an index - it just marks "this line is a scene boundary regardless of which number is on it." So【Segment 1】,【Segment 2】,【Segment 7】all work, in any order, and the output array follows the order they appear in the text, not their numbers. - The marker can't contain a newline and can't be empty - sensible, since it has to sit alone on one line. If you leave
textblank or use a marker that never matches anything, the node raises "批量文本为空" rather than silently handing you an empty array. That's a feature: it catches "I forgot to add markers" before it becomes a silent empty generation downstream.
That's the entire node, honestly - there are no hidden options, no strength dial, no secondary output. Text in, array out. It is the dictionary-definition utility node, and it's better for being boring.
Why you'd reach for it
In the pack's staged MiniMax H3 world, each scene of a longer video gets its own stage, and each stage wants its own focused prompt (character doing X in location Y) rather than the whole script stuffed into every stage. Keeping the full script in one multiline text box with 【Segment {n}】 markers means the master text lives in exactly one place - you edit scene 3's line in the source block and the split updates everywhere - instead of maintaining N separate prompt widgets that drift out of sync. If you've felt the pain of "I changed the prompt in one place and not the other," you already know why this pattern wins.
Useful when it interacts with the rest of the pack: the ARRAY output is a first-class type here, so it plugs into the same list/segment tooling the pack uses for feeding stages - you'll usually see it feeding a text-list node or being indexed per stage rather than consumed directly by a sampler. If you're not running staged H3 and just want a text splitter, ComfyUI's core and every generic text-tool pack can do the same job without installing a MiniMax-heavy dependency set - this node's value is being wired for this pack's conventions.
Installing it
Install is the pack-wide one:
git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git
drop it in custom_nodes, double-click install.bat (this pack pulls a genuinely large dependency list even though this particular node needs almost nothing at runtime), and restart ComfyUI. ComfyUI Manager finds it under "ComfyUI-Apt_Preset" if you'd rather click.
Default is 【Segment {n}】 which is exactly right for the pack's own workflows. If you're writing markers by hand in an English prompt, #segment{n}--------- reads a little more naturally on a line by itself, but the choice is cosmetic - what matters is that the line contains nothing else.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | — | |
| delimiter | STRING | 【分段{n}】 | 分隔标识必须独占一行;{n} 匹配数字。例如 【分段{n}】、#segment{n}--------- 或 ---。 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| array | ARRAY | — |