Run ComfyUI Easily with InstaSD

Skip the complex setup. InstaSD helps creative professionals build workflows and deploy them to the world:

  • One-click deployment
  • Any model, any node
  • Powerful GPUs for rapid iteration
Get Started

Ref_Image_Preprocessing

πŸ“· Ref Image Preprocessing Node Documentation

Overview

The Ref Image Preprocessing node is part of the ComfyUI PhotoMaker's set of tools designed to help users integrate reference images into their workflows. This node facilitates the preparation and processing of reference images, which can be used as inputs in image generation tasks with the PhotoMaker toolset.

Functionality

The Ref Image Preprocessing node serves to streamline the process of preparing reference images for further processing in ComfyUI workflows. It offers two main modes of operation: Direct Input and Path Input.

  1. Direct Input Mode: Allows users to directly input one or more images into the node. This is useful when images are already accessible in the workflow and need to be processed without having to specify a file path.

  2. Path Input Mode: Instructs the node to automatically read all images from a specified directory path. This mode is convenient for batch processing of images stored in a particular folder.

Input

The Ref Image Preprocessing node accepts the following inputs:

  • ref_images_path: A string input that specifies the path to the folder containing the reference images. This input is utilized when operating in Path Input mode.

  • mode: This input allows selection between 'direct_Input' and 'path_Input'. It determines the node's operational mode and defaults to 'direct_Input'.

  • ref_image: An optional input for directly providing images. This is used in Direct Input mode and allows users to input images directly into the node for immediate processing.

Output

The node produces the following output:

  • IMAGE: A processed image, or a list of images, ready for use in further image generation tasks. The images are provided in a format compatible with the subsequent nodes in the PhotoMaker toolchain.

Usage in ComfyUI Workflows

In ComfyUI workflows, the Ref Image Preprocessing node can be used to setup reference images before they are passed to image generation nodes such as the PhotoMaker Generation node. It is typically one of the first steps in a pipeline where the goal is to utilize existing images as a foundation or style reference for new image creations. Here’s how it might be used:

  1. Direct Input Workflow: If you have specific images loaded into your ComfyUI interface, use the Direct Input mode to quickly integrate these images into your workflow. This is ideal for scenarios where you frequently update images or work with single images.

  2. Batch Processing Workflow: For workflows dealing with multiple images stored in a directory, use the Path Input mode. This supports batch processing, making it efficient for handling collections of images in projects where a unified style or processing is required.

Special Features and Considerations

  • Flexibility in Input: The node supports both single and multiple images, offering flexibility in how images are incorporated into workflows.

  • Batch Processing: With the Path Input mode, users can efficiently process batches of images without having to individually load or specify each image. This is particularly advantageous for workflows that need to process large datasets or archives of images.

  • Ease of Use: By simplifying image processing inputs, this node helps reduce the complexity involved in preparing images for advanced generation and editing tasks within ComfyUI.

This node is an essential utility within the ComfyUI PhotoMaker suite for users looking to seamlessly integrate and preprocess images in an intuitive and efficient manner.