← See All Custom Node Packs

Inspire Pack

791
By Dr.Lt.Data
Updated 7 months ago
View on GitHub →See Common Issues →

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

This extension provides various nodes to support Lora Block Weight, Regional Nodes, Backend Cache, Prompt Utils, List Utils and the Impact Pack.

Available Nodes

ChangeImageBatchSize //Inspire

ChangeImageBatchSize //Inspire Node Documentation

Overview

The ChangeImageBatchSize //Inspire node is a utility within the ComfyUI-Inspire-Pack that enables users to modify the batch size of images within a workflow. This node is particularly useful when the processing needs to be adapted to different batch requirements, like when ensuring that workflows generate the desired number of images or to efficiently process images in batches.

Functionality

This node adjusts the size of the image batch according to the specified batch size and mode. When the desired batch size is larger than the current batch size, the node duplicates the last image to fill the batch. Conversely, if the desired batch size is smaller, the node crops the batch to fit.

Inputs

  • Image: The primary input to this node is the IMAGE. The input should consist of a batch of images that you want to resize.

  • Batch Size: This is an INT input, where you specify the desired size of the batch. The default value is 1, with a range from 1 to 4096.

  • Mode: A dropdown selection with only one option, "simple", which dictates how the resizing is handled:

    • simple: If the desired batch size is larger, the last frame in the batch is duplicated to fill the required batch size. If it's smaller, the batch is simply cropped.

Outputs

  • Image: The node outputs the resized image batch, ensuring that the output batch matches the specified batch size.

Usage in ComfyUI Workflows

This node is essential for workflows requiring consistent image batch sizes either for subsequent processing nodes that have specific batch size requirements or for ensuring that an intended number of output images are generated regardless of the initial batch size.

Example Use Case

  1. Image Augmentation: When processing a series of images for augmentation, it might be necessary to ensure a specific number of outputs, such as creating synthetic data for machine learning models that demand a fixed batch size.

  2. Consistent Output: In a workflow where the output batch size needs to match a specific value for downstream processing (like batch normalization or batching during model inference), this node provides that functionality.

Special Features and Considerations

  • Batch Size Adjustment: The node's primary function is a straightforward adjustment of the batch size, with dynamic image duplication of the last image to fill gaps when increasing the batch size.

  • Mode Limitation: Currently, it supports a single operation mode, "simple", limiting the scope of resizing operations to straightforward duplication and cropping actions.

  • Efficient Processing: This node is designed for efficiency in workflows that need consistent batch sizes without manual duplication or cropping.

  • Boundary Conditions: The node will handle images efficiently by leveraging PyTorch operations for batch resizing, provided the images are in the expected format.

This node offers a focused but powerful utility that aids in the automation and flexibility of image processing workflows within ComfyUI, particularly when consistent batch sizes are a requirement.