ComfyUI Node

TextEncode

TextEncode takes your text and hands it back

By AIFSH·Created 2 years ago·Updated 2 years ago· 0
TextEncode
    • TEXT
    text

    TextEncode is a one-line trick dressed as a node: it takes the text you type, and returns the exact same text. No tokenizer, no GPU, no model loading - the "encode" in the name is a polite fiction, because all the actual encoding happens later inside CogVideoNode's pipeline. If you're used to ComfyUI's CLIP text encoders, lower your expectations: this is not that. It's a pass-through box, and that's fine.

    So why does it exist? Three reasons. It gives CogVideoNode a TEXT input to wire into instead of a widget buried on the node itself, so you can keep your prompt visible and shared. It's multiline, which the CogVideoNode prompt widget isn't. And its widget is marked dynamicPrompts: true in the source, meaning ComfyUI's dynamic-prompts handling - wildcards like __outfit__ and {blue|red|green} - applies, so a single TextEncode can fan out into multiple prompt variants across queue runs. For a video pipeline that's actually useful, because you want to batch-roll prompts without rebuilding the graph.

    Inputs and outputs

    There's one input and one output, both of type TEXT:

    • text (STRING, multiline) - the prompt. The tooltip is the author's own, and it's accurate: "The text to be encoded."
    • TEXT output - tooltip: "the text used to guide the diffusion model." Wire it straight into CogVideoNode's prompt input and you're done.

    The author's description in the pack says the output is "a text prompt that can be used to guide the diffusion model towards generating specific images" - which is a generous way to describe returning a string, but it does capture the one job this node has.

    Installation

    It ships in the same pack as everything else, so there's no separate install - ComfyUI Manager, search DiffSynth-ComfyUI, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/AIFSH/DiffSynth-ComfyUI
    

    then restart ComfyUI. Since the node does no compute, it has zero extra hardware requirements beyond the pack's NVIDIA-only reality (cupy-cuda12x in the requirements is about the other nodes, not this one).

    Common issues

    Honestly? There's not much to go wrong. The failure modes are the boring kind:

    • It's not "encoding" anything. Correct - it isn't supposed to. If you expected a real text encoder that produces conditioning, you've grabbed the wrong node; CogVideoNode does that internally from this text.
    • Prompt seems ignored / weak. That's CogVideoX's prompt sensitivity, not this node - CogVideoX responds better to descriptive motion captions than to SD-style tag soup. And remember the wildcard syntax only works if you're running ComfyUI's dynamic prompts support.
    • Forgetting the wire. It's easy to queue with a TextEncode sitting disconnected and wonder why the run used an empty prompt. The node doesn't hold state; it only forwards what you connect.

    If you have a real ComfyUI text-encoding workflow in mind, reach for a proper CLIP/Flux text encode node instead. If you want a clean, shareable prompt box that feeds CogVideoNode and plays nice with wildcards, this is exactly as much node as the job needs - no more.

    CategoryAIFSH_DiffSynth

    Inputs (1)

    NameTypeDefaultDescription
    textSTRINGThe text to be encoded.

    Outputs (1)

    NameTypeDescription
    TEXTTEXTthe text used to guide the diffusion model.