ComfyUI Node

Save Text & Image

Save text and image in one node, auto-numbered the way core ComfyUI does it

By creativeself-kim·Created 10 months ago·Updated 6 months ago· 1
Save Text & Image
  • image
    subfolder
    filename_prefixfile
    text

    ComfyUI gives you Save Image and (via a hundred community packs) Save Text, but if your workflow produces a picture and a caption for it - storyboard frame plus its description, for instance - you end up with two nodes fighting over filenames. UtilSaveFile does both in one node and keeps them in lockstep with a single auto-incrementing counter. It's a small win, but in a batch pipeline it saves you from a whole class of "the .txt is named different from the .png" bugs.

    How it works

    It's an output node (no outputs, nothing to wire onward). You give it a subfolder and a filename_prefix; it writes into ComfyUI's output/ directory, scanning existing files to find the highest prefix_NNNN so numbering keeps climbing across runs rather than overwriting. Each saved item becomes prefix_0001.png and/or prefix_0001.txt, sharing the same counter.

    The nice part is the pairing logic. Feed it a batch of images and a single text, and it broadcasts that text to every image. Feed it N texts with N images, and it maps them one-to-one. It's INPUT_IS_LIST-aware, so it plays fine with list-output nodes. There's also a path-traversal guard on subfolder - if you hand it something that escapes the output directory, it silently falls back to the output root instead of writing somewhere weird.

    The inputs

    • subfolder (STRING, default empty) - subdirectory under output/, created if missing.
    • filename_prefix (STRING, default file) - base name before the _0001 counter.
    • text (STRING, optional) - written as a .txt next to the image.
    • image (IMAGE, optional) - written as a .png. You can pass one or both.

    Since both are optional, it doubles as a plain "save text with numbering" node when you leave image disconnected, or a plain SaveImage clone when you leave text out.

    Where it earns its keep

    This is the natural partner for this pack's VideoDescribe or storyboard nodes. Wire the description output into text, pipe the corresponding frame into image, and every run drops a cleanly-numbered image-plus-caption pair into one folder. If you're building a dataset or a shot-log from a video, that pairing alone is worth the install.

    Install

    It ships in the IXIWORKS pack: ComfyUI Manager → search ComfyUI-VideoDescription → Install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/IXIWORKS-KIMJUNGHO/ComfyUI-VideoDescription
    

    No extra dependencies - it uses PIL, numpy, and ComfyUI's own folder_paths, all of which ship with ComfyUI. One small thing to know: it doesn't write into input/ or preview in the UI like core SaveImage; files land in output/ and you'll find them in your OS file browser. That's the standard behavior for this style of node, just don't go looking for them in ComfyUI's image preview.

    CategoryIXIWORKS/Utils

    Inputs (4)

    NameTypeDefaultDescription
    subfolderSTRING
    filename_prefixSTRINGfile
    textoptSTRING
    imageoptIMAGE

    Outputs (0)

    No outputs