Nodes/ComfyUI-ZML-Image/ZML_文本输入
ComfyUI Node

ZML_文本输入

ZML_文本输入

By zml-w·Created about a year ago·Updated 2 months ago· 218
ZML_文本输入
    • 文本
    文本
    文本输入

    This is the smallest node in the pack, and honestly one of the handiest. ZML_文本输入 is a multiline text box that outputs what you type - with one twist: it also accepts an optional wired input that silently overrides the box. That second part is what makes it worth reaching for instead of just typing straight into a prompt encoder.

    Here's the mechanic, straight from the source. The required 文本 field is the usual big text widget. The optional 文本输入 socket is a STRING input with forceInput, meaning it only exists as a wire. At run time the node checks the socket first: if something is connected, whatever it delivers wins and the widget text is ignored; if nothing is connected, your typed text goes through. No merging, no concatenation - it's an either/or switch in ten lines of code.

    Why would you want that? Think of the classic plumbing problem the KB calls "one source, many consumers": you've got a prompt that needs to feed a CLIP text encode, a ZML_文本列表 loop, and a save node's metadata block. You don't want to type it three times. Run it into this node once, then fan the output. Or the reverse: you want to keep a fallback prompt baked into the workflow that some other node can override on demand - a router, a random line picker, an A/B switch. When the upstream is disconnected, the box holds the default; the moment you plug it in, the box becomes documentation.

    The output 文本 is a plain STRING, so it plugs into anything that takes text: CLIP text encoders, the pack's own formatter and filter nodes, filename builders, LLM prompts. There's no list output and no magic here, which is the point. It's the un-glitzy version of ComfyUI's built-in multiline string primitive, and some people will prefer the core one for that reason - this node's edge is the override behavior and the fact that it sits in the same menu as the rest of the ZML text family.

    Installing it

    This node ships inside ComfyUI-ZML-Image, a large Chinese-language pack (160+ nodes). Easiest route is ComfyUI Manager: install ComfyUI-ZML-Image, or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/zml-w/ComfyUI-ZML-Image
    

    Then restart ComfyUI. The pack's requirements.txt lists the usual suspects - numpy, torch, Pillow, and a few heavier extras like ultralytics and opencv-python that Manager installs for you. English speakers: the UI is Chinese by default; grab the translation patch at https://github.com/zml-w/ZZZ_ZML_English_Patch. All ZML nodes land under the 图像 (image) menu in the ZML_图像 submenu.

    Common issues

    Not much to trip on with a pass-through node. The one thing people hit: if you connect something to 文本输入 and the output doesn't change, check whether the upstream is actually executing - a disconnected-in-spirit lazy input can make the override look broken when it's really the source. And remember it overrides rather than merges; if you wanted both, you want ZML_文本列表 or the formatter instead.

    The pack's author is upfront that he builds for his own workflows and some nodes are rougher than others. This one is about as simple as they get, so it's safe. There's no heavy model, no API key, nothing to download - just a text box that got a second life.

    Categoryimage/ZML_图像/文本

    Inputs (2)

    NameTypeDefaultDescription
    文本STRING
    文本输入optSTRING

    Outputs (1)

    NameTypeDescription
    文本STRING