Nodes/ComfyUI-JNodes/Synced String Literal
ComfyUI Node

Synced String Literal

A text box that lives on disk, not just in your workflow

By JaredTherriault·Created 3 years ago·Updated about a month ago· 91
Synced String Literal
    • STRING
    input_text
    path_to_synced_txt
    serialize_input_textfalse

    Every ComfyUI text box has the same limitation: it lives inside the workflow JSON. Edit it in a text editor, share the prompt with a friend, version it in git - none of that works cleanly, because the text is buried in a node's widgets_values. Synced String Literal fixes exactly that one problem: it's a multiline text node that's mirrored to a real .txt file on your disk, so the text can be edited from outside ComfyUI and pulled back in, or written out from inside the graph. The README describes it plainly: "a multiline text node synced with external text files. Put the path in the path_to_synced_txt field and save/load from it."

    Why you'd actually use this

    Anywhere you keep a prompt, a system message, or a chunk of boilerplate text that you want to edit in your actual text editor rather than a cramped ComfyUI widget - this is the node. It's also handy for sharing text between workflows without copy-pasting: point two different graphs at the same file path and they read the same source. And because it's a real file on disk, it plays nicely with version control or a script that generates the text programmatically and drops it where this node expects it.

    Inputs and outputs

    Three fields control the behavior, and one output carries the result:

    • path_to_synced_txt - single-line text, empty by default. The file path this node reads from and writes to. This is the field the README calls out as the one to set.
    • input_text - multiline text, the actual content. This is what you type directly in the node if you're not driving it purely from the file.
    • serialize_input_text - a BOOLEAN, off by default. Controls whether the node writes input_text out to the synced file (rather than only reading from it).
    • STRING (output) - the resolved text, ready to wire into a CLIP Text Encode or anywhere else a prompt string is expected.

    Installing it

    No extra dependency for this specific node - it's part of the base JNodes install:

    • ComfyUI Manager - search "JNodes", install, restart.
    • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/JaredTherriault/ComfyUI-JNodes, then pip install -r requirements.txt, then restart.

    Common issues

    The obvious failure mode: the file at path_to_synced_txt doesn't exist, is on a network drive that's momentarily unreachable, or the path is relative and resolves differently depending on where ComfyUI was launched from - always double check with an absolute path if you're getting unexpected empty text. The less obvious one is a sync conflict: if you're editing the .txt file externally while also typing into input_text inside ComfyUI, whichever direction the node syncs last wins, and with serialize_input_text enabled you can overwrite an external edit you just made in your text editor without meaning to. Treat it as one source of truth at a time - either you're editing the file externally and leaving serialize_input_text off, or you're driving it from inside ComfyUI and letting it write out.

    Beyond this node specifically, remember that JNodes as a whole changes your ComfyUI UI on install - a docked image drawer, status indicators in the title bar, and prompt-editing features like comment-out shortcuts. If anything about your editor's behavior looks different after installing this pack (multiline text areas getting a new font, ctrl+shift+/ suddenly commenting text), that's JNodes' web features, not a bug - they're all configurable from ComfyUI Settings > JNodes.

    Categoryprompt

    Inputs (3)

    NameTypeDefaultDescription
    input_textSTRING
    path_to_synced_txtSTRING
    serialize_input_textBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    STRINGSTRING