ComfyUI Node

AICG3D 分段提示词解析

The node that types your script into every segment

By JGRFW·Created about a month ago·Updated about 16 hours ago· 309
AICG3D 分段提示词解析
    • 段1提示词
    ◄text第1段(5秒) 竖屏9:16电影感情绪短片,冷调低饱和,阴天柔光。人物:女主,二十多岁女性,齐肩微卷短发,米白色针织毛衣。 镜头缓慢推近,她抬头看向远处的高楼,霓虹灯在湿润路面上拉出长长的光带。 第2段(5秒) 镜头跟着她走进狭窄的小巷,巷口挂着一盏昏黄的灯泡,墙面斑驳;她停下脚步回头看了一眼来路。 第3段(5秒) 她推开巷子尽头的铁门,天光一下子亮起来,来到开阔的江边;镜头缓缓拉远,画面停在她的背影上。 ►
    ◄mode自动识别►
    ◄custom_regex►
    ◄keep_headerfalse►
    ◄seconds_mode跟随文本标注►
    ◄default_seconds5.0►
    ◄auto_filltrue►
    ◄randomize_seedtrue►
    ◄max_segments64►
    ◄seed_start0►

    MiniMax H3 gives you 4–15 seconds per generation. So any "long video" workflow on H3 is really a chain: shot one, shot two, shot three, each with its own prompt, its own seconds value, its own seed, stitched at the end. That's fine for three shots. By shot nine you're copy-pasting from a notes file, and somewhere around shot eleven you paste the same paragraph twice and only notice after a 40-minute render.

    This node is the fix. It's a parser, not a generator: paste the whole screenplay once, hit one button, and every 「视频段落」 node on your canvas gets its own slice. The name on the node is 「AICG3D 分段提示词解析」 - the pack is Chinese, and yes, you will be reading Chinese labels. Translation tab open.

    How it splits a script

    The node runs a set of regexes over your text and cuts on whatever marker it finds. In the default mode of 自动识别 the priority order is: segment headers first, then a --- divider, then blank lines, and if there's nothing to split on the whole thing becomes one segment.

    The header patterns are broader than you'd expect, which is the good part. It recognises 第1段, 第 1 段(5秒), 第一段, 镜头2, 分镜3, 场景4, Shot 3, and bare numbering like 6. or 7、, plus the bracket form 【第1段|5秒】 - and a bracket only counts as a header if it contains a real segment marker, so a 【人物说明】 line won't swallow your first shot. It also strips the BOM and zero-width junk that comes along with copy-pasted text.

    The other five modes are manual overrides: 第N段标记, 空行分段, 分隔线 ---, 每行一段, and 自定义正则 with your own pattern in custom_regex. keep_header decides whether 「第1段(5秒)」 stays in the prompt text or gets stripped with the leading duration.

    What actually gets written, and where

    Here's the part people miss. The node has exactly one output, 段1提示词 (STRING). The rest happens through a button that writes directly into the prompt widgets of the 视频段落 nodes on your canvas, in canvas order. That's a front-end write, not a graph connection - which is why the pack can do this without twelve messy wires, and also why the behaviour splits depending on how you run.

    Wire the output into segment one and a queued or API-driven run gets segment one right. Segments two onward still come from the button. The author is upfront about this in the node's own docstring, and it's the most important thing to know before you build a batch pipeline around it.

    The knobs worth setting: seconds_mode (跟随文本标注 pulls the 5秒 out of each header, 固定值 uses default_seconds, 不改动 leaves values alone), auto_fill to re-push everything whenever you edit text, and randomize_seed with seed_start for sequential seeds - segment one gets the start value, then +1 each, and every segment's post-generation control gets pinned to fixed so your run isn't overwritten on the next queue. That last detail matters more than it sounds; control_after_generate rolling a fresh seed after the run is the most reliable beginner injury in ComfyUI, and this node quietly works around it. max_segments caps the whole thing at 64.

    Installing it

    You want the whole pack, not a splitter. In ComfyUI Manager search AICG3D, 短剧工作台, or MiniMax H3, or clone it:

    cd ComfyUI/custom_nodes
    git clone https://github.com/JGRFW/comfyui-AICG3D
    cd comfyui-AICG3D && pip install -r requirements.txt
    

    Dependencies are light - imageio-ffmpeg, psutil, requests, aiohttp, no torch pinning. FFmpeg itself only matters for the pack's final-combine node, not this one. Restart and the nodes live under the AICG3D category, this one in 提示词与 Skill.

    One warning from the README, repeated across two release notes: do not install the standalone ComfyUI-AICG3D-PromptSplit alongside this pack - two nodes with the same identity fight over the front-end logic and one silently wins. As of v1.1.14 the official ID is AICG3D_H3PromptSegmentSplit precisely so it stops competing for the generic name, with the old ID kept as an alias only when nothing else claims it.

    Where it goes sideways

    If the script doesn't split, don't fight 自动识别 - switch mode to 空行分段 or write a regex. Auto mode's header detection is deliberately conservative (a header must be followed by punctuation or a duration, not prose), so a script written as one giant paragraph with no separators genuinely won't split.

    The button acts on canvas order, so node layout is your index. Scatter your segment nodes and the prompts land in a different order than you read them. And with auto_fill on, editing text re-fills every segment - including the one you hand-tuned. Turn it off the moment you start polishing individual shots.

    One bit of context: this is a new, single-author Chinese pack with essentially no English-language discussion around it - I found zero community chatter about AICG3D at all. That doesn't make it bad (the code is careful and the README is unusually detailed), but you're early. Test on three shots before committing a twelve-shot script.

    CategoryAICG3D/提示词与 Skill

    Inputs (10)

    NameTypeDefaultDescription
    textSTRING第1段(5秒) 竖屏9:16电影感情绪短片,冷调低饱和,阴天柔光。人物:女主,二十多岁女性,齐肩微卷短发,米白色针织毛衣。 镜头缓慢推近,她抬头看向远处的高楼,霓虹灯在湿润路面上拉出长长的光带。 第2段(5秒) 镜头跟着她走进狭窄的小巷,巷口挂着一盏昏黄的灯泡,墙面斑驳;她停下脚步回头看了一眼来路。 第3段(5秒) 她推开巷子尽头的铁门,天光一下子亮起来,来到开阔的江边;镜头缓缓拉远,画面停在她的背影上。 整篇分段剧本。段标题支持 第1段 / 第一段 / 镜头2 / Shot 3 / 4. 等写法。
    modeCOMBO自动识别自动识别:先找段标题,其次 --- 分隔线,其次空行,都没有就整段当一段。
    custom_regexSTRING解析方式选「自定义正则」时才生效。
    keep_headerBOOLEANfalse开 = 「第1段(5秒)」这种标题也留在提示词里;关 = 自动删掉标题和段首时长。
    seconds_modeCOMBO跟随文本标注一键填入时秒数怎么写:跟随文本标注 / 全部用固定值 / 完全不碰秒数。
    default_secondsFLOAT5.01–60—
    auto_fillBOOLEANtrue开 = 改动上面的文本后,自动重填画布上的每个「视频段落」节点。
    randomize_seedBOOLEANtrue一键填入时按段落顺序写入连续种子:第1段使用起点种子,第2段+1,依次递增,并把每段的生成后控制固定为 fixed。关闭则不修改原有种子。
    max_segmentsINT641–64—
    seed_startINT00–4294967294顺序写入种子的起点:开启后第1段用这个数,第2段+1,依次递增;填0 = 每次一键填入随机选一个起点。

    Outputs (1)

    NameTypeDescription
    段1提示词STRING—