ComfyUI Node

String Save

Save text with a ComfyUI counter — String Save

By CapybaraCrowporation·Created 10 months ago·Updated 3 months ago· 110
String Save
    • rel_path
    text
    name_prefix

    Every generation writes a prompt somewhere, and when the thing generating is Houdini, it wants that prompt back in a file it can read. HouStringToFile (display name "String Save") does exactly that: it takes a string and writes it to a .txt file in ComfyUI's output/ directory, then tells you the path. No hidden magic - it's the bridge's text-export node, the counterpart to all its image-export helpers, and it works the same way for prompts, seeds, JSON payloads, or whatever else your workflow needs to hand back across the Houdini boundary.

    How it works

    Two required string inputs:

    • text - the content to write (tooltip: "text to save").
    • name_prefix - the filename prefix (tooltip: "prefix for filename").

    And one output, rel_path, which is the saved file's path relative to the output directory.

    The interesting bit is how it picks the filename: it calls the same folder_paths.get_save_image_path() helper that SaveImage uses. That means you get the full SaveImage filename convention for free - your prefix becomes something like name_prefix_00001_.txt, with a zero-padded counter, and a slash in the prefix creates subfolders, so portraits/prompt saves to output/portraits/prompt_00001_.txt. The output is a relative path precisely so the Houdini side can join it against the output directory it already knows about.

    The gotchas

    Because it shares the SaveImage counter machinery, it also shares its bookkeeping. Reuse the same prefix across a text save and an image save and they're incrementing from the same counter - fine in practice, mildly surprising when your prompt_00001_.txt sits next to a prompt_00002_.png. And as with any file writer, there's no dedup: every execution with a new counter writes a fresh file, so long sessions can pile up text files. If you don't want to nuke an output folder, treat the prefix as a run identifier.

    Where it fits

    This is a helper in houdini-comfyui-bridge (CapybaraCrowporation/houdini-comfyui-bridge), the community project by Rafael Drelich Valentim and Anatolii Iudanov that plugs ComfyUI into Houdini - not a SideFX project, GPL-3.0, open-sourced late 2025 and demoed at SIGGRAPH Asia 2025. The bridge's design is a directory handoff: Houdini writes inputs into ComfyUI's input/ folder, ComfyUI produces results in output/, and HouStringToFile is how a non-image result - the text that rode along with a render - makes the same trip.

    Install

    The ComfyUI side is the standard install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/CapybaraCrowporation/houdini-comfyui-bridge
    

    Restart ComfyUI after cloning, or install "houdini-comfyui-bridge" via ComfyUI Manager. No Python dependencies, no model downloads - the custom-node half of the pack is intentionally lean; the install weight lives in the Houdini plugin (OTLs into your Houdini userdir or HOUDINI_PATH), which needs Houdini 20.5.613+ or 21.0.465+ and ComfyUI 0.3.33+. The recurring setup trap applies here too: ComfyUI Desktop's default port is 8000 while the Houdini nodes expect 8188, so a silent connection failure usually traces back to that.

    Bottom line

    Simple node, honest job: string in, .txt out, path back. If you're building Houdini-side automation that needs to consume text from a ComfyUI run, this is the write-half of that loop - and the SaveImage-style counter means your exports land in a predictable, sortable sequence rather than a single clobbered file.

    Categorysd

    Inputs (2)

    NameTypeDefaultDescription
    textSTRINGtext to save
    name_prefixSTRINGprefix for filename

    Outputs (1)

    NameTypeDescription
    rel_pathSTRING