Nodes/ComfyUI-MoonNodes/πŸ«™ Clearable Text Input
ComfyUI Node

πŸ«™ Clearable Text Input

The text box that erases itself

By m0rtus59Β·Created 3 months agoΒ·Updated 9 days agoΒ· 8
πŸ«™ Clearable Text Input
    • STRING
    β—„textβ–Ί

    This is the smallest node in the MoonNodes pack and the one that saves you from the most specific annoyance: typing into a text box and then having to manually select, delete, and retype the whole thing for your next message.

    ClearableTextInput is a plain multi-line string box that wipes itself the moment it runs. You type something, the graph executes, your text travels downstream, and the box goes back to empty. That's the entire trick, and it exists for a very practical reason: it's designed to feed the Gemini Persistent Chat node. Chat in a node graph is awkward because a normal prompt widget keeps your last message sitting there, so your next turn starts by cleaning up the previous one. This node removes the cleanup step.

    What it actually does

    Behind the scenes it's two things. The Python side is an output node that passes your text straight through and reports it to the UI. The browser side (a small JavaScript extension in the pack) hooks the "node finished" event and resets the widget value to "" after the run. So you get a genuinely blank slate every time, without touching the graph.

    The interface couldn't be simpler - one input, one output:

    • text (multiline STRING) - what you type
    • STRING output - the same text, wired downstream into whatever expects it

    Install

    It ships in ComfyUI-MoonNodes, so the standard two-step applies:

    cd ComfyUI/custom_nodes
    git clone https://github.com/m0rtus59/ComfyUI-MoonNodes.git
    cd ComfyUI-MoonNodes
    pip install -r requirements.txt
    

    Then restart ComfyUI. Or skip all that and find ComfyUI-MoonNodes in the ComfyUI Manager and hit install. The only real dependency in the whole pack is google-genai, and that's for the Gemini nodes - this one needs nothing extra.

    Where people get tripped up

    The one thing to keep in mind is that it clears every time, no exceptions. It's not a switch - there's no "keep my text" toggle here. If you're using it as the prompt source for a normal text-to-image run you'll be retyping your prompt on every generation, which is not the point. Use it exactly where its design makes sense: as the message input for a chat-style workflow where each run is a fresh question to an LLM.

    Also worth knowing: since it's marked as an output node, ComfyUI will treat it as a terminal result. That's fine for this use - the Gemini workflow treats "send this prompt" as the end goal of that branch of the graph. If you want a text widget that does not self-destruct, use ComfyUI's built-in text node or one of the many never-clearing alternatives; MoonNodes also ships LLMSubmitInput, which is this same idea but with a submit button and a pause behavior instead.

    CategoryMoonNodes

    Inputs (1)

    NameTypeDefaultDescription
    textSTRINGβ€”

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGβ€”