File Paths Ensure Execution Node
This commit is contained in:
@@ -52,23 +52,23 @@ Closes the file paths loop and collects iteration results.
|
||||
|
||||
**Inputs:**
|
||||
- `current_index`: Current index from FilePathsForLoop (required, force input)
|
||||
- `passthrough_1` through `passthrough_5`: Optional outputs from nodes in the loop
|
||||
- `iteration_data`: Optional output from FilePathsEnsureExecution or any node in the loop
|
||||
|
||||
**Outputs:**
|
||||
- `total_iterations`: Total number of iterations completed
|
||||
|
||||
**Usage:** This is the termination point of your loop. Connect the `current_index` from FilePathsForLoop (or through other nodes) to ensure the loop completes. You can also connect outputs from processing nodes to the passthrough inputs to collect results.
|
||||
**Usage:** This is the termination point of your loop. Connect the `current_index` from FilePathsForLoop (or through other nodes) to ensure the loop completes. If you need to ensure multiple nodes execute, connect them to FilePathsEnsureExecution first, then connect FilePathsEnsureExecution's output to this node's `iteration_data` input.
|
||||
|
||||
### FilePathsEnsureExecution
|
||||
Ensures connected nodes execute during loop iteration by collecting their outputs.
|
||||
|
||||
**Inputs:**
|
||||
- `input_1` through `input_10`: Optional inputs (supports any type with wildcard `*`)
|
||||
- `input_1` through `input_5`: Optional inputs (supports any type with wildcard `*`)
|
||||
|
||||
**Outputs:**
|
||||
- `passthrough`: The first non-None input value
|
||||
|
||||
**Usage:** Connect outputs from any nodes that need to execute within the loop to this node's inputs. Then connect this node's output downstream (e.g., to FilePathsLoopClose) to ensure all connected nodes complete execution.
|
||||
**Usage:** Connect outputs from any nodes that need to execute within the loop to this node's inputs. Then connect this node's output downstream (e.g., to FilePathsLoopClose) to ensure all connected nodes complete execution. If you need more than 5 inputs, chain multiple FilePathsEnsureExecution nodes together - connect the first node's output to one of the second node's inputs.
|
||||
|
||||
## How ComfyUI List-Based Loops Work
|
||||
|
||||
|
||||
Binary file not shown.
@@ -61,7 +61,7 @@ class FilePathsForLoop:
|
||||
class FilePathsLoopClose:
|
||||
"""
|
||||
Closes the file paths loop.
|
||||
Connect any outputs you want to collect from the loop iterations.
|
||||
Connect FilePathsEnsureExecution output here to ensure all nodes in the loop execute.
|
||||
This ensures all iterations complete before proceeding.
|
||||
"""
|
||||
@classmethod
|
||||
@@ -71,11 +71,7 @@ class FilePathsLoopClose:
|
||||
"current_index": ("INT", {"default": 0, "forceInput": True}),
|
||||
},
|
||||
"optional": {
|
||||
"passthrough_1": ("*",),
|
||||
"passthrough_2": ("*",),
|
||||
"passthrough_3": ("*",),
|
||||
"passthrough_4": ("*",),
|
||||
"passthrough_5": ("*",),
|
||||
"iteration_data": ("*",),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +82,7 @@ class FilePathsLoopClose:
|
||||
CATEGORY = "FilePathsFromFolder/Loop"
|
||||
OUTPUT_NODE = True
|
||||
|
||||
def close_loop(self, current_index, **kwargs):
|
||||
def close_loop(self, current_index, iteration_data=None):
|
||||
# Count total iterations
|
||||
total = len(current_index) if isinstance(current_index, list) else 1
|
||||
return (total,)
|
||||
@@ -96,7 +92,7 @@ class FilePathsEnsureExecution:
|
||||
"""
|
||||
Ensures connected nodes execute by passing through their outputs.
|
||||
Use this to chain multiple nodes that need to execute during each loop iteration.
|
||||
Connect up to 10 node outputs, then connect this node's output to FilePathsLoopClose.
|
||||
If you need more than 5 inputs, you can chain multiple of these nodes together.
|
||||
"""
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
@@ -107,11 +103,6 @@ class FilePathsEnsureExecution:
|
||||
"input_3": ("*",),
|
||||
"input_4": ("*",),
|
||||
"input_5": ("*",),
|
||||
"input_6": ("*",),
|
||||
"input_7": ("*",),
|
||||
"input_8": ("*",),
|
||||
"input_9": ("*",),
|
||||
"input_10": ("*",),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user