ComfyUI > Nodes > Mikey Nodes > Image Caption (Mikey)

ComfyUI Node: Image Caption (Mikey)

Class Name

Image Caption

Category
Mikey/Image
Author
bash-j (Account age: 4196days)
Extension
Mikey Nodes
Latest Updated
2024-06-15
Github Stars
0.08K

How to Install Mikey Nodes

Install this extension via the ComfyUI Manager by searching for Mikey Nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Mikey Nodes 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

Image Caption (Mikey) Description

Add text captions to images with font selection, text wrapping, and positioning for visual enhancement and metadata support.

Image Caption (Mikey):

The Image Caption node is designed to add text captions to images, making it a valuable tool for AI artists who want to annotate or enhance their visual creations with descriptive text. This node allows you to input an image and overlay it with a caption using a specified font. The node handles text wrapping, font selection, and positioning to ensure the caption is visually appealing and fits well within the image dimensions. It also supports additional metadata and prompt-based text modifications, making it versatile for various creative and functional applications.

Image Caption (Mikey) Input Parameters:

image

This parameter takes the input image to which the caption will be added. The image should be in a format supported by the node, such as JPEG or PNG. The image is processed to ensure it is in the correct mode and size for captioning.

font

This parameter specifies the font file to be used for the caption text. The font file must be accessible and valid. If the font file does not exist, an exception will be raised. The font size is set to 32 by default, but this can be adjusted within the node's implementation.

caption

This parameter is the text that will be overlaid on the image. The caption can be modified based on additional metadata or prompts provided. The text is wrapped and positioned to fit within the image dimensions, ensuring readability and aesthetic appeal.

extra_pnginfo

This optional parameter allows you to provide additional metadata that can be used to modify the caption text. If not provided, an empty dictionary is used by default. This metadata can be useful for dynamic text generation based on image content or other contextual information.

prompt

This optional parameter provides a prompt that can influence the caption text. The prompt can be used in conjunction with the extra_pnginfo to dynamically generate or modify the caption, making it more relevant to the image content or desired outcome.

Image Caption (Mikey) Output Parameters:

output_image

The output image is the original input image with the caption text overlaid. The caption is added in a visually appealing manner, ensuring it fits well within the image dimensions and maintains readability.

output_mask

The output mask is a tensor that represents the areas of the image where the caption text has been added. This mask can be useful for further image processing or analysis, allowing you to isolate the captioned areas.

Image Caption (Mikey) Usage Tips:

  • Ensure the font file specified is accessible and valid to avoid exceptions.
  • Use the extra_pnginfo and prompt parameters to dynamically generate or modify captions based on image content or other contextual information.
  • Adjust the font size and text wrapping settings within the node to ensure the caption fits well within the image dimensions and maintains readability.

Image Caption (Mikey) Common Errors and Solutions:

Font file does not exist: <font_file>

  • Explanation: The specified font file could not be found or accessed.
  • Solution: Verify that the font file path is correct and that the file exists. Ensure the file has the appropriate read permissions.

Invalid image file: <image>

  • Explanation: The input image file is not valid or cannot be found.
  • Solution: Check the image file path and ensure the file exists and is in a supported format. Verify that the file has the appropriate read permissions.

Caption text is too long to fit within the image dimensions

  • Explanation: The caption text exceeds the available space within the image, causing it to overflow or be cut off.
  • Solution: Adjust the font size or wrap the text to fit within the image dimensions. Consider shortening the caption text if necessary.

Image Caption (Mikey) Related Nodes

Go back to the extension to check out more related nodes.
Mikey Nodes
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.