ComfyUI Node

PD:String

A plain text source node with a socket on the output

By 7BEII·Created 2 years ago·Updated 15 days ago· 53
PD:String
    • string
    value

    Every text pipeline needs a place to type the text. ComfyUI lets you type directly into most nodes' widgets, but when you want one string defined in one place and fanned out to five consumers - a prompt used by an encoder, a filename builder, a display node - you want a dedicated text source. That's PD:String: a multi-line text box with a string output socket. It's the PDuse pack's primitive string node, and it does exactly one thing with no surprises.

    If you've met core ComfyUI's PrimitiveString or the "convert widget to input" mechanic, this is the same idea wearing a different hat: the value lives in one node, and every wire downstream reads the same source. Change it once, the whole graph follows.

    How it works

    It's a single value widget (multi-line, so you can paste a full paragraph or a multi-line prompt) that returns itself as the string output. The class docstring calls it "文本输入节点,支持多行字符串输入" - a text input node supporting multi-line input. There's no processing, no trimming, no encoding: what you type is what comes out. The value passes through unchanged, which is precisely why it's trustworthy for anything you need verbatim.

    One thing to note for graph hygiene: the output is a single STRING, not a list. So if you're feeding something that expects a list (like the batch-oriented text nodes in this same pack), PD:String isn't the right source - the pack's list-output text nodes are. For everything else, this is the cleanest way to get a typed string onto a wire.

    The input and output

    • value (STRING, multi-line, default empty) - the text you type.
    • Output: string - the same text.

    Installing it

    Part of Comfyui_PDuse by 7BEII. ComfyUI Manager (search "PDuse") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/7BEII/Comfyui_PDuse.git
    cd Comfyui_PDuse
    pip install -r requirements.txt
    

    Restart. Pure utility - no models, and the pack's only real deps are numpy, Pillow, scipy, opencv-python, torchvision (plus the Excel readers used by other nodes). Docs are Chinese-first.

    Where people get burned

    There's barely a failure mode here, which is the charm. The only friction: if you wire PD:String into a node whose input is list-typed, you'll get a type error and need a list-capable source instead. And remember this node does not randomize, count lines, or do anything clever - when you find yourself wanting behavior, this isn't the node to add it to; that's what the pack's other text nodes are for.

    CategoryPDuse/Text

    Inputs (1)

    NameTypeDefaultDescription
    valueSTRING

    Outputs (1)

    NameTypeDescription
    stringSTRING