Nodes/fxai-toolkit/凤希AI - 分镜生成器 - 进Q群与更多的群友学习:775649071
ComfyUI Node

凤希AI - 分镜生成器 - 进Q群与更多的群友学习:775649071

Your shot list, turned into a loop the graph can walk

By fxai666·Created 4 months ago·Updated 3 days ago· 35
凤希AI - 分镜生成器 - 进Q群与更多的群友学习:775649071
    • 分镜数据
    • 循环次数
    • 开始索引
    lines_data[]
    开始序号0
    结束序号0
    刷新标记

    FxaiStoryBoard ("凤希AI - 分镜生成器") takes a JSON list of shots - your storyboard - and hands back three things: the shot data itself, the number of loop iterations to walk it, and the index where the walk starts. It's the "storyboard as a program" node: you declare the shots once, and it computes the loop bounds so the graph can generate one shot per iteration without you hand-wiring indexes.

    What it's for

    In the pack's narrative workflow, a storyboard is just a list of prompts/asset rows you want to generate in order, one per segment. This node converts that list into loop-driving numbers. The 分镜数据 output is the list your loaders index into; 循环次数 tells the loop how many times to run; 开始索引 tells it where to begin. That trio is the whole "iterate my shots" pattern compressed into three sockets.

    How it works

    You paste the shot list into lines_data (a multiline JSON string, default []). Each element is a dict - typically with a 提示词 field, plus extras like 场景道具 or 角色资源 depending on which loader you pair it with. The node:

    1. Parses the JSON into a Python list.
    2. Computes 开始索引 from 开始序号 - which is 1-based, so 开始序号 = 3 means "start at shot 3" → index 2.
    3. Computes 循环次数 from the range: from the start index to the end of the list, or to 结束序号 if you set it. Setting both 开始序号 and 结束序号 to the same non-zero value means "just this one shot."

    Outputs:

    • 分镜数据 - LIST. Wire this into a storyboard loader.
    • 循环次数 - INT. The number of loop iterations.
    • 开始索引 - INT. The starting row.

    There's also a 刷新标记 input - a forced INT socket you can tick to force re-parsing (handy when you're editing the JSON live).

    The honest take

    This node is genuinely useful, and also slightly redundant: json.loads on a text widget is a Python one-liner. What you're paying for is the loop math - the 1-based→0-based conversion and the range clamping are exactly the off-by-one traps that eat beginners. If you've ever written a loop that runs one shot too many, this node exists for you.

    The gotcha is the same as FxAiScreenManager: invalid JSON parses to an empty list instead of erroring, and then 循环次数 clamps to a minimum of 1 - so you get one mystery iteration of an empty storyboard rather than a helpful crash. Validate with FxAiTextPreview before you hit run.

    Install

    Part of fxai-toolkit - one install, the whole pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/fxai666/fxai-toolkit
    

    Restart ComfyUI, or use ComfyUI Manager and search "fxai-toolkit". Pure Python json under the hood; no models, no downloads.

    Category凤希AI/分镜

    Inputs (4)

    NameTypeDefaultDescription
    lines_dataSTRING[]
    开始序号optINT0
    结束序号optINT0
    刷新标记optINT

    Outputs (3)

    NameTypeDescription
    分镜数据LIST
    循环次数INT
    开始索引INT