ComfyUI Node

AICG3D 分段提示词解析

Paste a whole script, split it, and fill every segment node in one click

By JGRFW·Created about a month ago·Updated about 10 hours ago· 261
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►

    AICG3DPromptSegmentSplit - AICG3D 分段提示词解析 - is the node that makes a ten-segment workflow bearable. You paste one piece of formatted script into its text box, press one button, and every 视频段落 node on the canvas gets its prompt, its seconds and its seed filled in. No wires, no copy-paste, no retyping.

    It's also the node in this pack most likely to confuse you, because it's a hybrid: it's a real ComfyUI node with a real output, and it's a frontend tool with buttons. Read the next section before you assume it's broken.

    The two ways it works (and which one you're in)

    The button path. The node has a 一键填入全部视频段落 button. Press it and the script is parsed in the browser, then written directly into each 视频段落 node's widgets on the canvas. With auto_fill on (default), editing the text re-fills them automatically. This is the intended workflow and it needs no wires at all.

    The wire path. The node also has exactly one output, 段1提示词 - the first parsed segment as a string. Connect it to the prompt input of the first segment node and you've routed segment one by wire; the remaining segments still get filled by the button. Connecting it to any segment works too; it always resolves to segment 1 of its chain.

    Here's the part nobody expects: the backend only returns that first prompt. auto_fill, randomize_seed, seed_start and seconds_mode are accepted and dropped server-side - they exist for the frontend button. So if you queue the workflow and expect the other nine segment nodes to be populated, they won't be. Press the button.

    Parsing rules

    mode defaults to 自动识别 (auto) and prefers, in order: segment headers, then --- divider lines, then blank lines, then "the whole thing is one segment". If you want to be explicit the options are 第N段标记, 空行分段, 分隔线 ---, 每行一段, and 自定义正则.

    Headers it recognises include 第1段, 第一段, 第 2 段(5秒), 镜头2, 分镜3, 场景4, Shot 5, and 6. at line start. It's careful about it, too - a line starting 第一段正文。 is treated as prose, not a header, so it doesn't eat your text.

    • keep_header - off (default) strips the header and the leading duration; on keeps them in the prompt.
    • default_seconds - used when a segment doesn't state its own duration.
    • max_segments - capped at 64. More segments than that and it warns and truncates.
    • custom_regex - only fires when mode is 自定义正则. A broken pattern raises "自定义正则写错了" rather than silently producing garbage, which is a kindness.

    Seeding, which is the sleeper feature

    randomize_seed + seed_start are what make a multi-segment reroll tractable. With it on, the button writes sequential seeds - segment 1 gets seed_start, segment 2 gets +1, and so on - and flips each segment's post-generate control to fixed. So one press gives you twenty segments with twenty distinct, reproducible seeds, instead of twenty nodes all on randomize. seed_start of 0 means "pick a random start each press", which is your genuine reroll.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/JGRFW/comfyui-AICG3D
    

    Restart and hard-refresh the browser. The fill-in behaviour is frontend JavaScript, so a stale cache is a real failure mode - if the button does nothing after an update, Ctrl+F5 first.

    Gotchas

    Do not install ComfyUI-AICG3D-PromptSplit alongside this. The author's own release notes call this out: the splitter is fully built into the pack now, and two same-named nodes overwrite each other's frontend logic. One of them stops working and it's not obvious which.

    The parse "fails" because your script has no structure. One blob of prose with no headers, no dividers and no blank lines becomes exactly one segment. That's correct behaviour, not a bug.

    Your segment nodes fill in the wrong order. Order is derived from the canvas chain - first segment first, following previous_segment - so a segment that isn't actually chained gets left out or filled oddly. Use 添加下一段 to build the chain and this stops happening.

    Seconds don't match what you typed. seconds_mode is 跟随文本标注 by default, which reads a duration out of the header or the block. If your headers have no duration, default_seconds takes over. Set it to 固定值 if you want uniformity, or 不改动 to leave your manual values alone.

    For the kind of script this node wants, look at the default text in the box - three 5-second segments, one visual beat each. That's the shape. Long literary paragraphs parse fine but sample badly.

    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—