JoyLTX Prompts from File
Drive a run from a text file so an episode doesn't live in a node widget
- prompts
- shot_count
- name
- block
Pasting a finished script into the Multishot sampler's prompt box works once. The moment you have several episodes, or prompts that came out of an external tool, or a batch you want to walk through unattended, the text belongs in a file - and JoyLTX PromptFile reads it for you. Point it at a .txt or .json under ComfyUI/input (or an absolute path), and it hands the sampler ready-to-use shot prompts plus a count.
The file formats are the same ones the writer emits. A .txt with --- on its own line between blocks becomes one prompt per block; no --- lines and it splits on blank paragraphs instead. A .json can be {"prompts": [...]} or a plain list - either is fine, and dicts also accept a shots key as an alias. Default path is joyltx_prompts/episode.txt, which tells you where the pack expects you to keep these.
The two outputs you'll actually wire are prompts (a JSON string the sampler parses directly) and shot_count (how many shots you're feeding it - handy for a display or a save node). The other two are batch machinery: name is the file's basename, and block is the single prompt at the current index.
That index is where the node gets interesting. Switch mode from file (path) to folder + index and the path field stops mattering: index now picks the Nth .txt/.json file in the folder (sorted, wrapping at the end). Wire a Primitive set to increment into index, queue the graph once per file, and a whole folder of scripts renders unattended - each run picking the next file. In file mode, index instead picks which block inside the file, so you can step through one script's shots one at a time. Set reload off and the file is cached instead of re-read every run; leave it on (the default) and editing the file on disk changes the next run without touching ComfyUI.
Worth knowing: reload is implemented through the node's changed-detection, so with it on, the node re-reads when the file's mtime changes - that's the "edit and rerun" loop working as intended. If a path doesn't resolve you get a clear "not found: <path>" error naming the exact file it looked for. It ships with the JoyLTX25 pack and needs nothing extra.
If you want the same idea one level up - where the file holds story ideas the writer expands, not finished shot prompts - that's JoyLTX StorySource. PromptFile is the version that assumes the writing is done.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| path | STRING | joyltx_prompts/episode.txt | Relative to ComfyUI/input, or absolute. .txt: prompts separated by --- lines (or one per paragraph if there are no ---). .json: {"prompts": [...]} or a list. |
| reloadopt | BOOLEAN | true | Re-read the file every run (turn off to cache). |
| modeopt | COMBO | file (path) | file = the path above. folder + index = the N-th prompt file (sorted) in `folder`; wire `index` from a Primitive set to increment and queue the graph N times to render a folder of episodes unattended. |
| folderopt | STRING | joyltx_prompts | Folder under ComfyUI/input (or absolute) holding .txt / .json prompt files. |
| indexopt | INT | 00–100000 | In 'folder + index' mode: which FILE (0-based, wraps). For the `block` output it is also which BLOCK inside the chosen file. Wire a Primitive on 'increment' and queue once per item to walk a folder of scripts, or a file of story ideas, unattended. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| prompts | STRING | — |
| shot_count | INT | — |
| name | STRING | — |
| block | STRING | — |