ComfyUI Node

Mpi String

A single-line string you can wire, instead of retype

By MadPonyInteractive·Created 11 months ago·Updated 5 days ago· 3
Mpi String
    • string
    string

    MpiString is a text box in, the same text out, nothing in between. One input, string (single-line), one output, string. It's the most literal "pass-through value" node the pack ships, and like all of these tiny typed primitives, its value is entirely about wiring, not processing.

    Here's the scenario that makes it earn its place: your positive prompt includes a style token, and that same token needs to reach a CLIP Text Encode and a filename builder and a tag checker. Type it into each widget and you've got three copies to keep in sync - change it in one place, forget the other two, and now your filename says "cinematic" while the image was made without it. Wire one MpiString into all three consumers and the value has exactly one authoritative source. The KB's node-plumbing essay calls this the single-source-of-truth pattern, the same mechanic as "one seed, five samplers" - break the value out of the widget, make it a socket, fan it out.

    The twist: why MpiText exists next to it

    The pack ships both MpiString and MpiText, and they look like duplicates until you read the schemas: MpiString's input is multiline: false, MpiText's is multiline: true. That's the whole difference. Single-line for short values - filenames, tokens, style names, a seed as text. Multiline for the thing you actually want a big box for, like a draft prompt or a list. Grab the one whose shape matches the value; the socket type is STRING either way, so they're interchangeable downstream, but the UI behavior isn't.

    Install

    It ships with ComfyUi-MpiNodes. ComfyUI Manager (search "MpiNodes" or publisher "mad-pony-interactive"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MadPonyInteractive/ComfyUi-MpiNodes
    

    Restart ComfyUI. No dependencies - this node has one text field and a return (string,).

    Anything to watch?

    Nothing that breaks. One mild tip: because the output type is plain STRING, any node that accepts a string socket can consume it - including this pack's MpiTextContains, which is a natural pairing if you're building a whitelist gate off a wired value. And if you find yourself wanting the value to flow into a node that only accepts a list of strings, that's MpiTextListJoin / MpiTextListReplace territory, not this node. It stays boring on purpose.

    CategoryMpiNodes/Logic

    Inputs (1)

    NameTypeDefaultDescription
    stringSTRING

    Outputs (1)

    NameTypeDescription
    stringSTRING