ComfyUI Node

LoadText

A prompt-preset dropdown that still lets you edit

By mittimi·Created 2 years ago·Updated 2 years ago· 2
LoadText
    • text
    preset
    text

    You've got half a dozen positive prompts you reuse - the portrait setup, the product-shot one, that one style you keep copy-pasting from your notes. LoadText is the small node for that habit: a dropdown of saved presets that fills a text box, and whatever's in the box flows out as a plain STRING. It's from mittimi's one-purpose pack, and it's explicitly a text-only cut-down of his LoadPreset2 node. No models, no API, no key - it's a snippet picker with an extra step.

    How it actually works

    Here's the part that surprises people: the preset dropdown isn't a strict file loader. When you pick a preset, the node's frontend asks the backend to read the matching .toml out of the pack's presets/ folder and pours it into the multiline text widget. The node's real Python function then just returns whatever text is sitting in that widget. That's why the README says the output "can be rewritten freely" - because the output is the widget. Load the preset, tweak it, and your edit is what goes down the wire. You get preset convenience without being locked to the file.

    Presets are TOML, and one file can hold three keys: text, PositivePrompt, NegativePrompt. LoadText reads text first, and falls back to PositivePrompt if text isn't there. Missing keys aren't an error - they're just skipped. Which means the same preset file can feed both nodes in this pack without you writing anything twice.

    The inputs and output that matter

    Only three things to touch:

    • preset - the dropdown. It's populated at ComfyUI startup by scanning presets/ recursively, so subfolders work and show up as relative paths.
    • text - a multiline string, the thing you actually edit.
    • text (output) - a STRING you wire into any string input. The usual move: right-click a CLIP Text Encode's text field, "convert widget to input," and drop the wire there. This is the plumbing-layer pattern of one source feeding many places - you define the prompt once instead of typing it into five nodes.

    Installing it

    ComfyUI Manager is the easy path - search "mittimiLoadText" and hit install. Or the manual route:

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

    Then restart ComfyUI. The only dependency is the toml library, a tiny pure-Python package that Manager pulls automatically. Nothing heavy, no model downloads, no install.txt-style gotchas.

    Where people get tripped up

    Two things are worth knowing before they bite you. First, because the preset list is built once at startup, a new .toml file you drop into presets/ won't show up in the dropdown until you restart ComfyUI. Second, the preset only loads when you change the dropdown - opening a saved workflow won't re-read the file. If you edit a preset on disk and your open node still shows the old text, just re-pick the preset and it'll sync.

    Keep the TOML valid while you're at it. A parse error means the backend chokes when you select that preset and the text box simply doesn't fill. The author's a self-described hobbyist who asks for bug reports in kind, not stern - but the edge cases here are exactly what you'd expect from a small single-purpose tool.

    If you find yourself wanting to switch whole workflows' worth of settings instead of just strings, look at LoadPreset2, the fuller version this was trimmed from. For "I want my recurring prompts in a dropdown," LoadText does the job.

    CategorymittimiTools

    Inputs (2)

    NameTypeDefaultDescription
    presetCOMBO1 options: sample.toml
    textSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING