Nodes/ComfyUI-ZML-Image/ZML_选择文本V3
ComfyUI Node

ZML_选择文本V3

The prompt-preset node the pack is actually proud of

By zml-w·Created about a year ago·Updated 2 months ago· 218
ZML_选择文本V3
    • text
    separator,

    This is the text node the pack author keeps coming back to - the changelog is basically one long list of V3 improvements across months of updates: dynamic text rows, lock mode, folder dropdowns, random output, one-click presets, custom colors. Where V1 and V2 are fixed five-slot boxes, V3 is a proper prompt-preset manager wearing a node costume. If you store commonly used prompts (the author says he keeps his Wan video prompts in these), this is the one you actually want on the canvas.

    The UI is custom JavaScript, so it behaves differently from a normal node: you get a dynamic list where each row is a text block with its own enable switch and delete button, rows have names (which are not output - only the enabled blocks' text is), and there's a lock mode that stops you from accidentally editing or reordering when you're just flipping prompts on and off.

    How it works

    On the backend it's almost embarrassingly simple: a separator input (default ,\n\n), and all the real state arrives through a hidden selectTextV3_data JSON payload that the frontend sends. The node reads that, picks the enabled entries, joins them with the separator, and emits text. The interesting bit is in the method signature, not the logic: it returns float("nan") from IS_CHANGED, which is the ComfyUI idiom for "run me every single time, never cache me." That's how the random mode works - each run re-rolls the selected entry - and it's also the thing to remember if you ever wonder why a workflow with this node re-executes everything downstream every time. That's by design, but it costs you the cache.

    What you'll actually use

    • The folder dropdown mode: instead of typing rows, you point the node at a folder of saved text files and pick which one is active, like the pure-Python preset-text nodes. Useful when your prompt library lives as files you edit outside ComfyUI.
    • Random output for picking a random enabled prompt per run - good for batch variety.
    • Presets: the node can save its current rows to a local preset and restore them with one click, so your "Wan prompt set" and "SDXL prompt set" live as presets you swap between.

    The downside, honestly, is the same custom-UI trade-off everywhere in this pack: it's a one-person project, and the fancy UI is the part most likely to glitch. The author himself documents a known display quirk where, after a page refresh, the node renders in its initial empty state even though your data is intact - clicking the lock or any control snaps it back to normal. Annoying, harmless.

    Install

    ComfyUI Manager → search "ComfyUI-ZML-Image", or cd ComfyUI/custom_nodes && git clone https://github.com/zml-w/ComfyUI-ZML-Image, restart. The UI is Chinese (ZML_选择文本V3) - get the English patch before poking around. No models or extra dependencies for this node; the heavy requirements in the pack's requirements.txt belong to other nodes.

    Categoryimage/ZML_图像/文本

    Inputs (1)

    NameTypeDefaultDescription
    separatorSTRING,

    Outputs (1)

    NameTypeDescription
    textSTRING