ComfyUI-WD14-Tagger

840

Available Nodes

Documentation

ComfyUI WD14 Tagger

Overview

The ComfyUI WD14 Tagger repository is an extension for ComfyUI, which allows for the interrogation and extraction of booru-style tags from images. This tool integrates the functionality of the SmilingWolf/wd-v1-4-tags model to provide users with a streamlined method to tag images easily. The models for this functionality are created by SmilingWolf.

Installation

To install the ComfyUI WD14 Tagger, follow these steps:

  1. Clone the repository into the custom_nodes folder of your ComfyUI installation:

    git clone https://github.com/pythongosssss/ComfyUI-WD14-Tagger
    

    Example directory path: custom_nodes\ComfyUI-WD14-Tagger

  2. Open a Command Prompt, Terminal, or your preferred command line interface.

  3. Navigate to the newly created folder custom_nodes\ComfyUI-WD14-Tagger:

    cd path\to\your\ComfyUI\custom_nodes\ComfyUI-WD14-Tagger
    

    Replace path\to\your with your actual installation path.

  4. Install the required Python packages:

    • For Windows Standalone installation (embedded python):

      ../../../python_embeded/python.exe -s -m pip install -r requirements.txt
      
    • For Manual/non-Windows installation:

      pip install -r requirements.txt
      

Repository Purpose

The primary purpose of this repository is to provide a ComfyUI-compatible node that can automatically extract and display booru-style tags from images. It supports multiple batched image inputs and automatically downloads required models at runtime if they are not already available.

Provided Nodes

This repository provides the following node:

  • WD14Tagger|pysssss - Implemented in wd14tagger.py, this node is fundamental to the interrogation and tagging functionality provided by the repository.

Features and Capabilities

  • Automatic Model Downloading: If the required models are not present in the designated directory, they will be downloaded and cached automatically during runtime.

  • Multiple Image Tagging: The WD14Tagger|pysssss supports processing and tagging multiple images simultaneously.

  • Customizable Tagging Parameters:

    • model: Choose from different interrogation models, like MOAT or ConvNextV2.
    • threshold: Set a score threshold for general tags to consider them valid.
    • character_threshold: Set a score threshold specifically for character-related tags.
    • exclude_tags: Provide a comma-separated list of any tags that should be excluded from the results.
  • Quick Image Tagging: Users can right-click on any node displaying an image, such as LoadImage, SaveImage, or PreviewImage, and select WD14 Tagger from the menu for rapid tagging.

  • Offline Use: Allows for manual downloading of models for offline usage. This requires creating a models folder in the same directory as wd14tagger.py and downloading the specified model files.

Utility in ComfyUI Workflows

The ComfyUI WD14 Tagger is particularly useful for users who work with image datasets that require detailed metadata annotations. By integrating this node into ComfyUI workflows, users can automate the process of tagging images, thereby saving significant time and improving consistency in tag application. This tool is invaluable for managing large datasets and ensuring images are correctly annotated for further analysis or publication on platforms that use booru-style tagging.