Add collected for-loop nodes

This commit is contained in:
2026-06-24 19:05:28 +02:00
parent 6a5e71719e
commit a469e6cef2
4 changed files with 603 additions and 0 deletions
+32
View File
@@ -10,6 +10,9 @@ The node is registered as:
- `prompt_builder / SxCP Seed Locker`
- `prompt_builder / SxCP Camera Control`
- `prompt_builder / SxCP Camera Orbit Control`
- `prompt_builder / SxCP For Loop Start`
- `prompt_builder / SxCP For Loop End`
- `prompt_builder / SxCP Loop Append`
- `prompt_builder / SxCP Category Preset`
- `prompt_builder / SxCP Cast Control`
- `prompt_builder / SxCP Generation Profile`
@@ -71,6 +74,35 @@ as one long chain:
manually into either generation lane, but they are not part of the default
main path.
## Loop Nodes
`SxCP For Loop Start` and `SxCP For Loop End` provide a lightweight replacement
for the easy-use for-loop dependency. They use the same recursive ComfyUI loop
pattern, but add a dedicated collector output for building a result sequence.
Basic loop wiring:
1. Connect `For Loop Start.flow` to `For Loop End.flow`.
2. Use `For Loop Start.index` inside the loop for seed/index changes.
3. Connect the per-iteration output you want to keep, such as an image, latent,
prompt, or metadata string, to `For Loop End.collect_value`.
4. Optionally connect `For Loop Start.collected` to `For Loop End.collected`.
If omitted, the end node uses the start collector internally.
5. After the loop finishes, use `For Loop End.collected` as the combined output.
`collection_mode` controls how values are stored:
- `auto_batch`: concatenates image tensors or latent samples when possible,
otherwise falls back to a Python list.
- `image_batch`: prefers image tensor batching.
- `latent_batch`: prefers latent `samples` batching.
- `list`: always appends each iteration result to a list.
- `string_lines`: joins each collected value with newlines.
`value1`, `value2`, and later slots are normal carry-through channels for state
you want to update each iteration. They are separate from the collector and grow
dynamically in the UI as you connect them.
## Character Profiles
`SxCP Woman Slot` and `SxCP Man Slot` are the scalable per-participant control