ComfyUI Node

GU Text Edit

Edit machine-generated text before it hits your sampler — GU Text Edit

By alexguryev·Created 4 months ago·Updated 23 days ago· 2
GU Text Edit
    • text_out
    only dynamic text edit !
    text
    protectfalse

    Every auto-captioning workflow ends the same way: a vision model hands you a prompt that's 90% right and 10% garbage, and you'd like to fix that one word without building a whole editing stage. GU Text Edit is that stage. You feed it an incoming string - the tooltip's own example is text produced by image-to-text - and a text box appears at the bottom of the node with that text in it. Edit it, and the edited version is what flows out the other side.

    That's a genuinely useful trick, because normally a ComfyUI string widget is the source of truth: the node's widget is the value. Here it's flipped. The text input is forced to be a wire (the front-end disables the pointless "only" label widget and injects a fresh editable field), and the node reads the edited field back out of the workflow state on each run. The author's description is precise: "Works only with dynamic text!" - the text is not preserved across workflow or ComfyUI restarts; it's a per-run interactive flow.

    How it works

    The mechanics are the interesting part, and they explain the quirks. The node is an output node (it returns UI output) with IS_CHANGED returning NaN, which in ComfyUI-speak means "never cache me" - it must execute on every queue run so it can pick up whatever you typed. Each run it pulls the current contents of the injected text_ed widget out of the workflow/prompt data and forwards it as text_out. The first run populates the editable field; the second run forwards its contents downstream. So the first run after wiring it up feels like a no-op.

    The protect toggle is the one input you'll actually touch. It's off by default, meaning on every queue run the field resets to whatever the incoming text wire says. Flip protect on and updates from the incoming text are blocked - your hand-edited version survives subsequent runs. That's the whole point of the node per its description: "protect edited text from refreshing on next Queue run."

    The inputs and output

    • text - the incoming string to edit (wire this; it's forced to be a connection).
    • protect - block the incoming text from overwriting your edits on the next run.
    • only - a label the front-end disables; ignore it.
    • text_out - the string that leaves, which is your edited text (or the incoming text if you never touched it).

    Wire text_out into your CLIP text encoder, a filename builder, or a concat node and you've got a human-in-the-loop editing step in the middle of an automated pipeline.

    Installing it

    Part of GU_Nodepack, install the pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/alexguryev/ComfyUI-GU_Nodepack
    

    Restart ComfyUI, or use ComfyUI Manager → search "GU_Nodepack". The pip deps are psutil, requests, and gu-funclib; no models needed.

    Gotchas

    Biggest one, straight from the README, in the author's own all-caps: currently only one Text Edit node per graph can be reliably used. Two of them step on each other's widget-reading. And the two-run behavior catches everyone - wire it up, hit Queue, and the output looks like your original text; that's the populate run. Hit Queue again and you get your edits. Also remember the edits live in the widget state, so saving the workflow saves them, but they won't regenerate on their own - if the workflow is reopened fresh, expect the first run to repopulate from the wire again. Windows is the tested platform; single-user installs are the intended audience.

    CategoryGU_Nodepack

    Inputs (3)

    NameTypeDefaultDescription
    onlySTRING dynamic text edit !
    textSTRING
    protectBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    text_outSTRING