Nodes/ComfyUI-GadgetNodes/Edit Train Tags
ComfyUI Node

Edit Train Tags

Clean your training captions without leaving ComfyUI

By 2daadv·Created 6 months ago·Updated 21 days ago· 1
Edit Train Tags
    • folder
    • image_file_path
    • image
    folder
    image_file_name
    keep_tags
    remove_tags

    The single biggest quality lever in LoRA training is the dataset, and the single most tedious part of the dataset is the tags. WD14 taggers dump a wall of comma-separated booru tags per image, and a chunk of them are garbage you'd never want the model to learn - "lowres," "bad anatomy," the half-detected nonsense. Cleaning that up usually means leaving ComfyUI for a tag editor, which breaks your flow exactly when you're iterating. Edit Train Tags is the in-graph answer: a UI for browsing a training folder, editing each image's .txt caption, and saving it back.

    The mechanism is the dataset sidecar convention straight out of image-io-metadata.md: for image001.png there's image001.txt (comma-separated tags), and optionally a image001-masklabel.png mask. The node walks the folder you give it, loads each image's caption, and exposes it in an editor. The behavior is tuned by train_config.yaml in the pack's root - you create this file yourself:

    mask_image_postfix: "-masklabel.png"   # mask filenames, hidden from the list
    black_list_tag:
      - "lowres"
      - "bad anatomy"
      - "worst quality"
    

    That blacklist is the clever bit: the editor treats those tags as junk and helps you strip them in bulk, instead of one by one.

    Inputs: folder (required, a path string) and image_file_name (required, a dropdown populated from the folder). Both are validated - no folder or missing file and the node tells you instead of crashing. Optional keep_tags and remove_tags (multiline strings) let you push a list of tags to keep or strip across the folder. Outputs: folder, image_file_path (the full path of the current image), and image - the image as an IMAGE tensor. That last one matters: the README's example wires it into a WD14 tagger node, so you can re-tag on the spot and compare against what's already saved.

    Where it genuinely helps, and where to be careful:

    • The workflow shape it enables is good: folder → pick image → edit tags → save → feed image to WD14 to check the re-tag. That loop is exactly how you clean a small dataset properly (lora-training.md is blunt that a well-curated twenty images beats a careless two hundred).
    • It's a UI node, so it's interactive - same human-in-the-loop nature as the pack's crop dialog. Not for headless automation; fine for the person doing the curation.
    • ⚠️ It's JS-dependent. The tag editor is an addDOMWidget frontend extension, and per the README it "may not display or operate correctly" under the Nodes 2.0 frontend. On Nodes 2.0, verify it actually works before building a whole dataset pass around it; on the legacy canvas it's fine.
    • The keep_tags/remove_tags are inputs, not the UI. The heavy lifting happens in the editor widget; those two string inputs are the batch-level helpers.

    The pack: 2daadv/ComfyUI-GadgetNodes, MIT, one developer, brand new (no community reputation to report yet - it's a 2026 release with essentially zero footprint). Install via ComfyUI Manager (search "GadgetNodes") or git clone https://github.com/2daadv/ComfyUI-GadgetNodes into custom_nodes/, pip install -r requirements.txt, restart. The node lives in Gadget/train.

    Honest verdict: for anyone training LoRAs on anime-style datasets where tag hygiene is half the battle, this is the kind of small tool that turns a chore into something you can do between generations. Just don't treat the auto-tagger's output as gospel - the blacklist and manual review exist because the tags are a starting point, not the truth.

    CategoryGadget/train

    Inputs (4)

    NameTypeDefaultDescription
    folderSTRING
    image_file_nameCOMBO0 options:
    keep_tagsoptSTRING
    remove_tagsoptSTRING

    Outputs (3)

    NameTypeDescription
    folderSTRING
    image_file_pathSTRING
    imageIMAGE