LayerStyle

2167
By chflame
Updated 15 days ago
View on GitHub →See Common Issues →

A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.

Available Nodes

LayerUtility: ImageTaggerSave

Documentation for LayerUtility: ImageTaggerSave Node

This document provides detailed information about the LayerUtility: ImageTaggerSave node, which is part of the ComfyUI_LayerStyle repository.

Overview

The LayerUtility: ImageTaggerSave node is designed to save images along with associated metadata tags in a specified format and location. It provides flexibility by allowing users to specify custom paths, filenames, and image formats, while also offering options for timestamps and image quality settings. This node is particularly useful in workflows where images need to be stored systematically with accompanying tags for later retrieval or processing.

Features

  • Image Saving: Saves images in the specified format (PNG or JPG) with options for quality and compression.
  • Tag Management: Stores associated text tags with the image in a separate text file.
  • Custom Paths and Names: Allows customization of save paths and filenames, using placeholders for date and time.
  • Timestamps: Options to append timestamps (in seconds or milliseconds) to filenames for versioning or organization.
  • Preview Generation: Supports generating a temporary preview image for quick viewing.
  • Directory Management: Ensures that the specified directory structure exists before saving files.

Inputs

The LayerUtility: ImageTaggerSave node accepts several inputs:

  • Image: The image to be saved (required).
  • Tag Text: A string of text tags associated with the image. This is saved in a separate text file alongside the image.
  • Custom Path: An optional custom directory path where the image and tags will be saved. Placeholder tokens like %date and %time can be used here.
  • Filename Prefix: A prefix to be added to the image filename. It can include placeholder tokens for date and time.
  • Timestamp: Options to append a timestamp to the filename. Choices are "None", "second", or "millisecond".
  • Format: The format in which to save the image, either "PNG" or "JPG".
  • Quality: An integer value specifying image quality (for JPG) or compression level (for PNG), ranging from 10 to 100.
  • Preview: A boolean indicating whether to generate and store a temporary preview of the image.

Outputs

The LayerUtility: ImageTaggerSave node produces outputs in the form of saved files:

  • Image File: The primary output is the saved image file in the specified format and location.
  • Tag File: A text file containing the tag text, stored alongside the image.
  • Preview Image: If the preview option is enabled, a temporary preview image is also created.
  • UI Feedback: Information about the saved image and its location is returned in a format that can be used by ComfyUI's interface for immediate user feedback.

Usage in ComfyUI Workflows

In ComfyUI workflows, this node can be used where image generation and saving is part of the processing pipeline. It allows developers to set up systematic storage solutions, manage metadata efficiently, and integrate image saving with other processing steps like transformations, filtering, or tagging. The flexibility in choosing file paths and formats makes it adaptable to a wide range of projects, from automated tagging systems to archival of generated media.

Special Features and Considerations

  • Error Handling: Attempts to create necessary directories and handle potential errors like path creation failures.
  • Filename Collisions: Prevents overwriting of existing files through systematic counter or timestamp additions.
  • Temporary Storage: Utilizes a temporary directory for previews to avoid cluttering permanent storage spaces.
  • Customization: High degree of customization using prefixes and timestamps to organize and retrieve files efficiently.

This node does not require additional configuration beyond the inputs but relies on correct integration into larger ComfyUI workflows for its full functionality. It is a utility node, primarily focusing on output management within a node-processing environment.