Nodes/AntiMatter Nodes/LinePrompt_MasterLoad_JSON
ComfyUI Node

LinePrompt_MasterLoad_JSON

Scene prompts from JSON, with a name to match

By AntiMatterComfy·Created 4 months ago·Updated 28 days ago· 0
LinePrompt_MasterLoad_JSON
  • json_input
  • prompt
  • Scene Name
enabledtrue
json_text
json_file
scene_modesequential
manual_scene1
repeat_each_scene1
after_last_scenestop_empty
nav0
row1

Storyboard work in ComfyUI has an identity problem: every scene is just another prompt, and once you've generated scene 12 for the fifth time you have no clean way to say "this one's scene 12." LinePrompt_MasterLoad_JSON is the node that gives scene-based generation a spine. It reads a JSON file of scene prompts, walks through them one at a time, and - the part nothing else in the pack does - outputs a Scene Name alongside the prompt. Wire that into Antimatter Text File Appender's scene_name input and rework stops creating duplicates: regenerating scene 12 overwrites scene 12's saved entry instead of stacking a sixth copy.

How it works

The node accepts JSON from three places: a connected json_input (which takes priority), a json_file path, or pasted json_text. It's forgiving about the shape - it flattens a list of objects with prompt/image_prompt/positive/text/description keys, a dict of name → prompt, a list of [name, prompt] pairs, or even a plain list of strings. Scene IDs are pulled from scene, scene_id, id, name, or title, and missing ones get auto-numbered as scene-001, scene-002, and so on. You don't have to conform to a rigid schema - this is what makes it practical instead of a spec-compliance exercise.

Selection modes:

  • sequential - walks scenes in order, honoring repeat_each_scene (how many queue runs per scene) and after_last_scene (stop_empty returns empty strings at the end, loop wraps around).
  • manual - jump straight to manual_scene, for "I'm only fixing scene 35 today."
  • row - direct 1-based row selection, when your JSON order is the ground truth.

There are also Previous/Next buttons via the pack's web extension, backed by the hidden nav counter - same navigation pattern as LinePrompt_MasterLoad. The node forces execution every queue run (IS_CHANGED returns NaN) so sequential mode actually advances, and the preview shows the current scene plus a N/total status.

Inputs that matter

scene_mode, manual_scene (for manual mode), repeat_each_scene, and after_last_scene are the ones you'll set. enabled is the master switch - off, and both outputs return empty strings, which downstream nodes generally treat as "skip."

Outputs

  • prompt - the current scene's prompt, straight into CLIPTextEncode.
  • Scene Name - the scene ID (scene-035, or whatever your JSON called it). Use it for output filenames and, as above, feed it to the Text File Appender for scene-aware replacement. The pair is clearly designed to be used together, and it works.

Installing it

Part of AntiMatter Nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/AntiMatterComfy/antimatter-nodes.git

Restart ComfyUI. No extra Python dependencies, no model files - the whole pack is deliberately lightweight, which keeps it out of the dependency-hell that sinks heavier node collections.

Troubleshooting

If the outputs come back empty, the node is telling you via its status preview - check for json_parse_error (paste a snippet into a JSON validator) or file_not_found (path is relative to ComfyUI's working directory). And a reminder on stop_empty: when it hits the end of the list, it returns empty strings rather than looping, so a long batch run will quietly produce blank prompts once the scenes run out. If that surprises you, switch to loop.

CategoryAntiMatter/Text

Inputs (10)

NameTypeDefaultDescription
enabledBOOLEANtrue
json_textSTRING
json_fileSTRING
scene_modeCOMBOsequential3 options: sequential, manual, row
manual_sceneINT11–100000
repeat_each_sceneINT11–100000
after_last_sceneCOMBOstop_empty2 options: stop_empty, loop
navINT0-2147483648–2147483647
rowINT11–100000
json_inputopt*

Outputs (2)

NameTypeDescription
promptSTRING
Scene NameSTRING