ComfyUI  >  Nodes  >  ComfyUI-Miaoshouai-Tagger >  🐾MiaoshouAI Tagger

ComfyUI Node: 🐾MiaoshouAI Tagger

Class Name

Miaoshouai_Tagger

Category
MiaoshouAI Tagger
Author
MiaoshouAI (Account age: 497 days)
Extension
ComfyUI-Miaoshouai-Tagger
Latest Updated
7/19/2024
Github Stars
0.1K

How to Install ComfyUI-Miaoshouai-Tagger

Install this extension via the ComfyUI Manager by searching for  ComfyUI-Miaoshouai-Tagger
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Miaoshouai-Tagger in the search bar
After installation, click the  Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

🐾MiaoshouAI Tagger Description

Generate descriptive tags and captions for images using advanced AI models.

🐾MiaoshouAI Tagger:

Miaoshouai_Tagger is a powerful node designed to generate descriptive tags and captions for images using advanced AI models. This node leverages the capabilities of the MiaoshouAI Florence-2-base-PromptGen model to analyze images and produce relevant textual descriptions. It supports various captioning methods, allowing you to choose between generating simple tags, detailed captions, or more comprehensive descriptions. The node processes images, applies the selected captioning method, and outputs the generated text, which can be further customized with prefixes, suffixes, and tag replacements. This functionality is particularly useful for AI artists looking to automate the annotation of their image datasets, enhance image searchability, or add descriptive metadata to their artwork.

🐾MiaoshouAI Tagger Input Parameters:

folder_path

The directory path where the images are stored. This parameter is essential as it tells the node where to find the images that need to be tagged. There is no default value, and it must be provided by the user.

caption_method

Specifies the method used for generating captions. Options include tags, simple, and detailed. This parameter determines the complexity and detail level of the generated captions. The default value is not specified, so you need to choose the appropriate method based on your needs.

max_new_tokens

Defines the maximum number of new tokens to generate for the caption. This parameter controls the length of the generated text. There is no default value provided, and it should be set according to the desired caption length.

num_beams

Specifies the number of beams for beam search. Beam search is a technique used in text generation to explore multiple possible outputs and select the best one. A higher number of beams can lead to better quality captions but may increase computation time. There is no default value provided.

images

A list of images to be processed. If not provided, the node will look for images in the specified folder_path. This parameter is optional and can be used to directly pass images to the node.

filenames

A list of filenames corresponding to the images. If not provided, filenames will be generated automatically. This parameter is optional and helps in organizing the output files.

captions

Existing captions to be appended or overwritten. This parameter is optional and can be used to modify or enhance existing captions.

prefix_caption

A string to be added as a prefix to the generated captions. This parameter is optional and can be used to add a consistent starting phrase to all captions.

suffix_caption

A string to be added as a suffix to the generated captions. This parameter is optional and can be used to add a consistent ending phrase to all captions.

replace_tags

A string specifying tags to be replaced in the format search:replace. Multiple pairs can be separated by semicolons. This parameter is optional and allows for customization of the generated tags.

🐾MiaoshouAI Tagger Output Parameters:

captions

The generated captions for the images. This output contains the descriptive text generated by the node based on the selected captioning method and any additional customizations applied through the input parameters. The captions can be used for various purposes, such as metadata annotation, enhancing image searchability, or providing descriptive information for AI-generated artwork.

🐾MiaoshouAI Tagger Usage Tips:

  • To generate simple tags for your images, set the caption_method to tags.
  • For more detailed descriptions, use the simple or detailed options for the caption_method.
  • Customize the generated captions by using the prefix_caption and suffix_caption parameters to add consistent phrases to the beginning or end of each caption.
  • Use the replace_tags parameter to replace specific tags in the generated captions, allowing for further customization and refinement of the output.
  • Ensure that the max_new_tokens and num_beams parameters are set appropriately to balance the quality and length of the generated captions with the computation time.

🐾MiaoshouAI Tagger Common Errors and Solutions:

"FileNotFoundError: [Errno 2] No such file or directory: '<folder_path>'"

  • Explanation: This error occurs when the specified folder_path does not exist or is incorrect.
  • Solution: Verify that the folder_path is correct and that the directory exists. Ensure that the path is properly formatted and accessible.

"ValueError: Invalid caption method '<caption_method>'"

  • Explanation: This error occurs when an invalid value is provided for the caption_method parameter.
  • Solution: Ensure that the caption_method is set to one of the valid options: tags, simple, or detailed.

"RuntimeError: CUDA out of memory"

  • Explanation: This error occurs when the GPU runs out of memory during the processing of images.
  • Solution: Reduce the max_new_tokens or num_beams values to lower the memory usage. Alternatively, process a smaller batch of images at a time or use a device with more GPU memory.

"TypeError: 'NoneType' object is not iterable"

  • Explanation: This error occurs when the images parameter is not provided and the folder_path does not contain any valid image files.
  • Solution: Ensure that the images parameter is provided or that the folder_path contains valid image files in supported formats (e.g., PNG, JPG, JPEG).

🐾MiaoshouAI Tagger Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Miaoshouai-Tagger
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.