Nodes/ComfyUI-Taylor-Attention/LoadPromptListFromJSON
ComfyUI Node

LoadPromptListFromJSON

Your Prompt Lists, Straight Off the Hard Drive

By ttulttul·Created 7 months ago·Updated 7 months ago· 1
LoadPromptListFromJSON
    • prompts
    json_path

    LoadPromptListFromJSON does one boring thing well: it reads a JSON file that is a plain array of strings and hands it to your workflow as a STRING list. No prompt wizardry, no wildcard expansion - just a file on disk turned into a list you can loop over.

    That's more useful than it sounds once you're doing anything batch-shaped. A prompt list is the natural driver for "run this workflow against twenty prompts and compare" - you keep the prompts in a file instead of buried in workflow JSON, edit them in any text editor, and re-run. It's also exactly how the Taylor-Attention pack's Phase-1 trainer gets its variety: distillation samples real prompts and sampling states, and a list of prompts is the input that keeps it honest.

    The file format

    The file format is the simplest thing that could work:

    ["a red car on a highway at dusk", "a quiet library in the rain", "a glass of water on a wooden table"]
    

    Inputs and output

    One input, one output:

    • json_path - path to the JSON file containing an array of strings.
    • prompts - the resulting STRING list.

    Under the hood it's json.load plus a strict shape check: the payload must be a list, and every element must be a string, or the node raises with the offending index. No silent coercion of numbers to strings - if your file has 42 in it, you'll get an error telling you exactly where.

    Gotchas

    The gotcha worth knowing: there's no ComfyUI path resolution here. The node calls os.path.isfile on whatever string you give it, so a bare filename like prompts.json resolves relative to wherever the ComfyUI process was launched from. Use an absolute path (or one you're sure the process can see) and you'll save yourself a confusing "JSON file not found" later.

    Installing

    It ships in ttulttul/ComfyUI-Taylor-Attention, the same research pack as the Flux2TTR training nodes. Install via ComfyUI Manager (search "Taylor-Attention") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ttulttul/ComfyUI-Taylor-Attention
    

    Restart ComfyUI, then install the pack's dependencies - a genuine list (torch, einops, pyiqa, comet-ml, dreamsim and friends) and it needs a recent ComfyUI with the v3 node API:

    uv pip install -e custom_nodes/ComfyUI-Taylor-Attention
    

    The README's install line still names the old folder (ComfyUI-Approximate-Attention); point uv at the folder you actually cloned. There are no model files to download for this node - like the rest of the pack, it's marked experimental and lean on dependencies. A tiny node, but once your prompt library lives in a JSON file, you'll wonder why you were pasting lists into the graph before.

    Categoryadvanced/scheduling

    Inputs (1)

    NameTypeDefaultDescription
    json_pathSTRINGPath to JSON file containing a simple array of strings.

    Outputs (1)

    NameTypeDescription
    promptsSTRING