凤希AI - 影视剧场流场景管理 - 学习交流Q群:775649071
Turning a screenplay list into scene data a loop can actually eat
- 总行数
- 场景数据
- 分段时长
FxAiScreenManager ("凤希AI - 影视剧场流场景管理") is the entry point for the pack's "影视剧场流" - the cinema/short-drama flow. You paste a JSON list of scenes - each with a duration, a line of dialogue, and an asset reference - and it normalizes that into structured scene data plus a per-scene durations list. That's the payload every downstream node in the storyboard loop consumes.
What it's for
The pack is aimed hard at short-drama and AI narrative video: multi-scene, dialogue-driven, asset-heavy. Before you can generate anything, you need the story broken into rows the graph can iterate over - one row per scene, each with its own length and prompt material. This node is where your raw scene list becomes that structure. Think of it as the "parser" half of a scene pipeline, with the storyboard loaders as the "reader" half.
How it works
You feed it lines_data - a JSON string that defaults to []. Each row can be a list or a dict:
- As a list:
[duration, dialogue, asset]- e.g.[15.0, "他推开门", "door.jpg"]. - As a dict: keys like
时长/音频时长,台词/提示词文本,素材/图片地址/图片文件. It tolerates several aliases so you can feed it data from different sources. - As a bare string: treated as dialogue, with a 15-second default duration.
Every row gets normalized into a dict with 序号 (1-based), 时长, 台词, and 素材 (asset paths joined into a comma string if you passed a list). The outputs:
- 总行数 - INT. How many scenes you have.
- 场景数据 - LIST of those normalized dicts. Inspect it with FxAiTextPreview if you want to see exactly what you're working with.
- 分段时长 - LIST of floats, one per scene. This is the list you wire into FxAiSegmentTotalFrames and FxAiSingleAudioProc so audio and video agree on segment lengths.
The gotcha that will cost you an hour
If lines_data fails to parse - bad JSON, a stray comma, a single-quoted string (JSON demands double quotes) - the node does not error. It silently falls back to a single 15-second blank scene. Your loop then "successfully" runs one mystery scene and you spend the afternoon wondering why the storyboard is empty. Always validate your JSON with a preview node after this one, and remember: [15.0, "", ""] is the exact shape it expects per row.
Also note the IS_CHANGED behavior - it returns NaN, which forces the node to re-run every execution. That's deliberate (it's a parser, and parsing is cheap) but it means this node keeps everything downstream "dirty," so don't be surprised if ComfyUI re-executes your scene branch every run.
Install
Part of fxai-toolkit - install once, get 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". No models, no extra deps beyond the pack's auto-installed soundfile/psutil. This node itself is pure Python json - the only thing it can fail on is your input.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| lines_data | STRING | [] | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| 总行数 | INT | — |
| 场景数据 | LIST | — |
| 分段时长 | LIST | — |