ComfyUI Node

LoadPrompt

Keep your positive/negative pairs on a dropdown

By mittimi·Created 2 years ago·Updated 2 years ago· 2
LoadPrompt
    • positive_prompt_text
    • negative_prompt_text
    preset
    PositivePrompt
    NegativePrompt

    If LoadText is the snippet picker for a single string, LoadPrompt is the two-for-one version: one preset fills both a positive and a negative prompt box, and you get both out as separate strings. Reach for it when you're juggling a few prompt setups and want to swap between them without retyping - or when your negative prompt library is a set of chunks you'd rather not paste from memory every time.

    How it actually works

    Same trick as its sibling in this pack, worth spelling out because it changes how you think about the node. The preset dropdown isn't doing the loading at generation time. When you pick a preset, the frontend pings a custom backend route, which reads the matching .toml from the pack's presets/ folder and sends the contents back to fill the two text widgets. The node's actual function then just returns whatever's in those widgets. So the output is the editable text, not the file - the README leans on this, and it means you can load a saved pair and still tweak the positive prompt for the one image you're chasing.

    The preset file is TOML with up to three keys: text, PositivePrompt, NegativePrompt. LoadPrompt looks for PositivePrompt first, falls back to text if it's missing, and if there's no NegativePrompt key the negative box just clears to empty. Missing keys are silently ignored, so you can keep minimal preset files and the node won't complain.

    The inputs and outputs that matter

    • preset - the dropdown of saved .toml files, built by scanning the presets/ folder at startup. Subfolders work.
    • PositivePrompt / NegativePrompt - the two multiline boxes, both editable.
    • positive_prompt_text and negative_prompt_text - the two STRING outputs. Wire these to your CLIP Text Encode nodes (right-click their text widgets and "convert widget to input" first). That's the whole point: one node now holds both halves of your prompt pair, so the graph reads clean and you swap setups in one click instead of editing two encoders.

    Installing it

    ComfyUI Manager: search "mittimiLoadText" and install. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/mittimi/ComfyUI_mittimiLoadText
    

    Restart after either one. The only dependency is toml, a small pure-Python library that Manager installs for you. No models, no weights, no downloads - this pack is about as light as a custom node gets.

    Where people get tripped up

    The preset list is scanned once at startup, so a new .toml you drop into presets/ needs a ComfyUI restart before it appears in the dropdown. And the pair only syncs when you actually change the dropdown - load an old workflow and it shows whatever text was saved in the graph, not whatever's in the file now. Edited a preset on disk and nothing happened? Re-pick it in the dropdown.

    Two honest caveats. The preset dropdown is a UI widget, not a wire input - you can't drive preset switching from another node, so it's manual, not automatable. And if you need more than text - seeds, settings, whole sampler configs - this is the trimmed-down string version of mittimi's LoadPreset2, which is where the fuller preset idea lives. For the common case of "I keep forgetting my negative prompt," LoadPrompt quietly solves it.

    CategorymittimiTools

    Inputs (3)

    NameTypeDefaultDescription
    presetCOMBO1 options: sample.toml
    PositivePromptSTRING
    NegativePromptSTRING

    Outputs (2)

    NameTypeDescription
    positive_prompt_textSTRING
    negative_prompt_textSTRING