Nodes/ComfyUI-northTools/Concatenate and remember string
ComfyUI Node

Concatenate and remember string

A string that remembers everything you throw at it across runs

By northumber·Created about a year ago·Updated about a year ago· 4
Concatenate and remember string
    • concatenated
    value_bool
    value_str
    resetfalse

    Most ComfyUI nodes are stateless: run them a hundred times and each run starts from scratch. This one is the exception. Feed it a string (or a boolean), and it appends that value to a running history and outputs the whole accumulated string, comma-joined, on every run. It's for those "remember what happened earlier in this session" moments - building up a log, a growing list of prompts, or a tally of which steps have fired - without you having to carry state around the graph manually.

    The author's own description calls it "useful to remember a value across the various runs," and that's exactly the use case. Think of it as a tiny notebook for one value that survives from execution to execution until you tell it to forget.

    How it works

    The node keeps a history list at the class level. On each execution it takes whichever of the two value inputs is active - value_str if it's a non-empty string, otherwise value_bool converted to the literal text "True" or "False" - appends it to the history, and returns everything joined with commas.

    The reset boolean is the forgetting mechanism: flip it and the history empties. The current run's value still gets appended after the clear, which is worth knowing - if you want a clean slate plus one fresh value, the output of the reset run gives you exactly that.

    The single output is concatenated - the whole comma-joined history so far.

    Inputs that matter

    Three optional inputs, and you'll mostly touch two:

    • value_str - the string to append this run. Empty strings are ignored, so you can leave it dangling and nothing happens.
    • value_bool - a boolean alternative. Booleans become the text "True" or "False", which is handy when you're recording pass/fail outcomes across a batch and want the result readable as text.
    • reset - clears the remembered history.

    The gotcha

    The history is class-level state, shared across every instance of this node in the whole session, and it survives until you reset it or restart ComfyUI. That's by design - remembering across runs is the feature - but it means two copies of the node in one workflow share the same memory, and a workflow you loaded and abandoned last week can still have its old values lurking. If concatenated ever looks like it contains ghosts from a previous session, hit reset.

    One more thing to file away: the separator is always a comma. If the strings you're accumulating contain commas themselves, the output stops being trivially parseable - a later split on , will slice mid-value.

    Install

    Manager → search "ComfyUI-northTools", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/northumber/ComfyUI-northTools
    

    then restart. No models, and requirements.txt is just pillow, numpy, torch - nothing to download that ComfyUI doesn't already have.

    Is it world-changing? No. But for building automation that needs to remember what happened, it's a genuinely useful little stateful helper, and it's one of the few nodes in this pack you can't trivially reproduce with a built-in.

    CategorynorthTools

    Inputs (3)

    NameTypeDefaultDescription
    value_booloptBOOLEAN
    value_stroptSTRING
    resetoptBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    concatenatedSTRING