Nodes/comfyui-rb-bridge/RB String Bridge
ComfyUI Node

RB String Bridge

Rewrite the prompt between two halves of a run

By itribs·Created 2 days ago·Updated a day ago· 0
RB String Bridge
    • text
    text_edit
    timeout-1
    text

    Ever queued a two-stage workflow, seen the first pass land, and thought "I should really change the prompt before it spends the next two minutes refining this"? Normally your options are: let it run wrong, or hit Stop, edit, and re-run from scratch - which throws away the first stage's work too.

    RB String Bridge is the third option. Execution reaches it, the run parks, and a text box opens up on the node. Type whatever you want, click Continue, and the run resumes with your new text feeding everything downstream. The first half of the graph is untouched - its result was already computed and doesn't re-run.

    That's the core trick of this whole pack, and it's more useful than it sounds. Pausing to edit a value mid-run - not just pausing to approve or reject - is exactly what makes a two-pass workflow feel interactive instead of fire-and-forget. The string flavor is the one you'll want when the thing you're judging is text: a refinement-stage prompt, a hires-fix prompt, a caption or watermark string saved at the very end of the graph.

    How it works

    Two inputs matter, plus the shared timeout:

    • text_edit (STRING, multiline) - the box you edit while the run is parked. If nothing is wired in, whatever's in here is simply what comes out.
    • text (STRING, optional) - wire a value in and it becomes the starting point: when the pause fires, the incoming text is loaded into the edit box for you to rewrite. Leave it unconnected and the widget value is the default.
    • timeout (FLOAT) - -1 waits forever (default), 0 skips the pause entirely, >0 auto-continues after N seconds.

    The single output, also named text (STRING), carries your edited value onward. It's meant to plug into anything that consumes a string - most commonly a CLIP Text Encode, a filename-prefix node, or a metadata writer downstream.

    The mechanism is the same for every node in the pack: the node sends a session event to the frontend, your Continue and Cancel buttons enable, and a server-side wait loop blocks until you click. Continue posts the edited box contents back over an HTTP route and the node returns it; Cancel fires a full workflow interrupt. The loop polls for interrupts every tenth of a second, so Stop still works while it's parked.

    A practical sketch

    Stage one renders your base image. The bridge sits before the second sampler, feeding its own CLIP Text Encode. First run pauses after stage one - you see the base, and then write the refine prompt to steer the second pass. Continue, and only the tail executes with your new text. Change your mind? Touch the text_edit widget or anything upstream and queue again.

    Installation

    One repo installs all five nodes - no dependencies, no model files. Via ComfyUI Manager, search comfyui-rb-bridge, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/itribs/comfyui-rb-bridge
    

    Restart and hard-refresh the browser tab - the edit box and buttons are frontend elements, and a stale tab is the usual reason they don't appear. Find it by searching "RB" and looking in the bridge category.

    Common issues

    • It doesn't pause when you re-queue. ComfyUI caches hard: if nothing upstream of the node changed, it reuses the previous run and skips the bridge entirely. Nudge it - change the text_edit widget or an upstream input - and it'll stop again.
    • It hangs forever. With timeout at -1 it waits for a human. That's the feature; just don't queue a pile of jobs behind an unanswered pause.
    • Cancel nukes the run, not just the tail. Resume-only if you want the workflow to keep going.
    • Buttons broken or missing? This pack renders its own DOM widgets on the classic canvas; if ComfyUI's newer Nodes 2.0 rendering is on and widgets misbehave (a failure mode seen across custom nodes, rgthree's included), switch back to the classic canvas.
    Categorybridge

    Inputs (3)

    NameTypeDefaultDescription
    text_editSTRING
    timeoutFLOAT-1Seconds to wait. -1 = infinite, 0 = skip pause
    textoptSTRING

    Outputs (1)

    NameTypeDescription
    textSTRING