Visit ComfyUI Online for ready-to-use ComfyUI environment
Generate descriptive tags and captions for images using advanced AI models.
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.
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.
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.
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.
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.
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.
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.
Existing captions to be appended or overwritten. This parameter is optional and can be used to modify or enhance existing captions.
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.
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.
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.
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.
caption_method
to tags
.simple
or detailed
options for the caption_method
.prefix_caption
and suffix_caption
parameters to add consistent phrases to the beginning or end of each caption.replace_tags
parameter to replace specific tags in the generated captions, allowing for further customization and refinement of the output.max_new_tokens
and num_beams
parameters are set appropriately to balance the quality and length of the generated captions with the computation time.<folder_path>
'"folder_path
does not exist or is incorrect.folder_path
is correct and that the directory exists. Ensure that the path is properly formatted and accessible.<caption_method>
'"caption_method
parameter.caption_method
is set to one of the valid options: tags
, simple
, or detailed
.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.images
parameter is not provided and the folder_path
does not contain any valid image files.images
parameter is provided or that the folder_path
contains valid image files in supported formats (e.g., PNG, JPG, JPEG).© Copyright 2024 RunComfy. All Rights Reserved.