ComfyUI Node: ♻ Loop

Class Name

Bjornulf_LoopBasicBatch

Category
Bjornulf
Author
justUmen (Account age: 3046days)
Extension
Bjornulf_custom_nodes
Latest Updated
2025-02-28
Github Stars
0.2K

How to Install Bjornulf_custom_nodes

Install this extension via the ComfyUI Manager by searching for Bjornulf_custom_nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Bjornulf_custom_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
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

♻ Loop Description

Facilitates repetitive operations by creating loops for batch processing tasks.

♻ Loop:

The Bjornulf_LoopBasicBatch node is designed to facilitate repetitive operations by creating a loop that processes a given input multiple times. This node is particularly useful for scenarios where you need to apply the same operation repeatedly, such as generating multiple instances of a text or number based on a specified count. By leveraging this node, you can efficiently manage batch processing tasks, ensuring consistency and saving time. The node's primary function is to take an input and replicate it a specified number of times, or alternatively, use a default text if no input is provided. This makes it versatile for various applications, from simple text duplication to more complex data handling tasks.

♻ Loop Input Parameters:

nb_loops

The nb_loops parameter specifies the number of times the input should be repeated. It is an integer value with a default of 1, allowing you to control the extent of repetition. The minimum value is 0, which effectively means no repetition, and the maximum is 1000, providing flexibility for extensive batch operations. Adjusting this parameter directly impacts the number of output instances generated by the node.

default_text

The default_text parameter serves as a fallback input when no specific input is provided. It is a string with a default value of "Default input". This parameter is crucial for ensuring that the node can still function and produce output even in the absence of an explicit input. The node intelligently determines the type of the default_text (integer, float, or string) and processes it accordingly.

input

The input parameter is optional and can accept any type of data. If provided, this input will be the basis for the loop operation, repeated according to the nb_loops parameter. The flexibility of this parameter allows you to use a wide range of data types, making the node adaptable to various use cases.

♻ Loop Output Parameters:

output

The output parameter is a list containing the repeated instances of the input or default text. The type of the output is determined by the type of the input or the default_text, which can be an integer, float, or string. This output is crucial for batch processing tasks, as it provides a consistent and predictable set of data based on the specified loop count.

♻ Loop Usage Tips:

  • To ensure optimal performance, set the nb_loops parameter to the exact number of repetitions you need, avoiding unnecessary iterations.
  • Use the default_text parameter to provide a meaningful fallback value, ensuring that the node produces useful output even when no input is specified.

♻ Loop Common Errors and Solutions:

Invalid input type

  • Explanation: The input provided is not compatible with the expected types.
  • Solution: Ensure that the input is of a type that the node can process, such as a string, integer, or float.

nb_loops out of range

  • Explanation: The nb_loops parameter is set to a value outside the allowed range.
  • Solution: Adjust the nb_loops parameter to be within the range of 0 to 1000.

♻ Loop Related Nodes

Go back to the extension to check out more related nodes.
Bjornulf_custom_nodes
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.