Nodes/ComfyUI Layer Style/LayerUtility: Image Tagger Save V2
ComfyUI Node Runs on cloud

LayerUtility: Image Tagger Save V2

Image Tagger Save V2 — save an image with its caption as a matching text file

By chflame163·Created 3 years ago·Updated 5 days ago· 3,113
LayerUtility: Image Tagger Save V2
  • image
    â—„tag_textâ–º
    â—„custom_pathâ–º
    â—„custom_filenameâ–º
    â—„remove_custom_filename_exttrueâ–º
    â—„filename_prefixcomfyuiâ–º
    ◄timestamp▾►
    ◄format▾►
    â—„quality80â–º
    â—„previewtrueâ–º

    A Save Image node with a specific job in mind: dataset building. Every time you save an image with this node, it can also write a matching text file alongside it containing whatever tag or caption text you feed it - the exact image.png / image.txt pairing that LoRA and fine-tuning trainers expect. If your workflow generates a caption automatically (a captioning model upstream) or you're hand-typing tags as you go, this saves the pairing step you'd otherwise do manually in a file browser.

    How it works

    It's an output node - nothing flows out of it, it just writes files to disk, which is why it's the terminal node in whatever branch it sits on. Alongside the image, it writes tag_text to a same-named .txt file next to the image, following whatever filename logic you've configured, so the pair stays matched.

    The inputs that matter

    • image - what gets saved.
    • tag_text - the caption/tag string written to the matching text file. Wire this from a captioning node upstream, or a text box you're hand-editing between runs.
    • custom_path / custom_filename - override the default output location and filename; leave blank to use ComfyUI's normal output folder and auto-naming.
    • remove_custom_filename_ext (default true) - strips any extension you accidentally typed into custom_filename, so you don't end up with a file literally named photo.png.png.
    • filename_prefix (default comfyui) - prepended to auto-generated filenames.
    • timestamp - None, second, or millisecond precision appended to the filename, useful for avoiding collisions across a batch run.
    • format (png or jpg) and quality (10–100, jpg only) - output format and compression.
    • preview (default true) - whether the saved image also shows up in the ComfyUI preview panel.

    No outputs - this is a terminal, save-only node.

    How to install it

    Search ComfyUI Layer Style in ComfyUI Manager, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/chflame163/ComfyUI_LayerStyle
    pip install -r ComfyUI_LayerStyle/requirements.txt
    

    Restart; find it under 😺dzNodes → LayerUtility → SystemIO.

    Common issues

    If you're building a dataset for training and the text files aren't showing up where you expect, check custom_path first - an empty value falls back to the standard ComfyUI output directory, which might not be the folder your trainer is actually pointed at. Worth remembering: a lot of trainers, and the community consensus in general, treat auto-captioning models like BLIP as genuinely weak for this purpose compared to hand-written captions or a stronger captioner (Florence 2, JoyCaption) - this node just saves whatever text you hand it, it doesn't judge the quality of the caption, so garbage in the tag_text input is garbage in your training set. And if you're running a batch and filenames keep colliding or overwriting each other, that's timestamp set to None - bump it to second or millisecond so each run in the batch gets a unique name instead of stomping the last one.

    Category😺dzNodes/LayerUtility/SystemIO

    Inputs (10)

    NameTypeDefaultDescription
    imageIMAGE—
    tag_textSTRING—
    custom_pathSTRING—
    custom_filenameSTRING—
    remove_custom_filename_extBOOLEANtrue—
    filename_prefixSTRINGcomfyui—
    timestampCOMBO3 options: None, second, millisecond
    formatCOMBO2 options: png, jpg
    qualityINT8010–100—
    previewBOOLEANtrue—

    Outputs (0)

    No outputs