ComfyUI-Custom-Scripts

2347

Repeater|pysssss

Repeater Node Documentation

Overview

The Repeater node is part of the ComfyUI Custom Scripts repository, specifically designed to facilitate repetitive operations within ComfyUI workflows. This node allows users to either create a list of repeated instances of an input node or generate multiple outputs based on the input node. It is particularly useful when repetitive tasks need to be automated or when multiple instances of a node are required with specific variations.

Functionality

The Repeater node enables users to:

  • Create a list of repeated instances of the source node.
  • Generate multiple outputs from a single source node.
  • Choose between reusing the same input node or creating new instances for each repetition.

Inputs

The Repeater node accepts the following inputs:

  1. Source: The input node that will be repeated. This can be any node in the workflow that you wish to duplicate or generate multiple outputs from.
  2. Repeats: An integer value indicating the number of times the input node should be repeated. This can range from 0 to 5000, with a default value of 2.
  3. Output Mode:
    • Single: Outputs a single list containing repeated instances.
    • Multi: Generates individual outputs for each instance. These are split into individual nodes when the graph is processed.
  4. Node Mode:
    • Reuse: Reuses the existing input node for each repetition.
    • Create: Creates new instances for each repetition, which are dynamically added to the graph.

Outputs

The Repeater node produces outputs based on the selected mode:

  • Single Output Mode: Provides a single list containing the specified number of repeated instances of the source node.
  • Multi Output Mode: Generates separate outputs for each instance of the repeated source node.

Usage in ComfyUI Workflows

The Repeater node can be integrated into ComfyUI workflows in several ways:

  • Automating Repeated Tasks: Ideal for scenarios where a particular node operation needs to be applied multiple times, such as batch processing tasks.
  • Generating Varied Outputs: Useful for creating variations from a single source by adjusting parameters, resulting in different outputs.
  • Streamlining Workflow Design: Enhances workflow efficiency by reducing manual duplication of nodes, especially beneficial when dealing with complex graphs.

Special Features and Considerations

  • Wildcard String Handling: The node is designed to accept any type of source input, provided as a wildcard string, allowing flexibility in choosing the input node.
  • Dynamic Node Creation: In "Create" node mode, new node instances are dynamically added, which can be useful for generating unique outputs based on varying input conditions.
  • Output Type Safety: Although not currently implemented, future updates may include type safety for wildcard outputs to ensure they match the input type.

The Repeater node offers a versatile tool for users looking to enhance their ComfyUI workflows by automating repetitive tasks and efficiently managing node duplication. Note that this node is still a work-in-progress, and improvements such as type safety might be added in future updates.