Files
DumiFlex 26c2068671 feat(docs): one field list per node for the docs pages and the Node Info help (#256)
Each WP node's fields live once in src/manager/docs/node-fields.ts. The docs pages draw them with DocFields, and pnpm docs:help writes them into docs/help/WP_*.md. Tests fail when a node socket has no field or a field names a socket that is gone (tests/fixtures/node-sockets.json, written by scripts/dump_node_sockets.py).
2026-11-03 21:24:30 +01:00

3.8 KiB
Raw Permalink Blame History

WP Context Loop

Runs the whole chain N times from one Generate. Put it in front of your WP Context: each pass (a frame) rolls your wildcards again, so one click gives N different prompts.

On the node

  • seed INT: The loop's own seed. Only used when Override Context seed is on.
  • count INT: How many frames one Generate makes (1–999). 1 switches looping off without unwiring the node.
  • values STRING: Optional text from another node: one frame per line (or per list entry), each writing its line to $iteration_value. The values set the frame count and count follows the last run; with a sweep on, every value runs every combination. Its dot sits beside the iteration variable (beside the values note once wired) and shows when you hover it.
  • Strategy: hash, sequential or stride: how the frame seeds are worked out when Override Context seed is on. See Seeds & loops.
  • Per-iteration seeds: The seed each frame will use. Lock single frames, Lock all, Copy / Paste, or Prev to keep the seed a frame used last run. Locks need Override Context seed on.
  • Sweep combinations: Run every combination of the options you pick instead of random rolls. See below.
  • Edit frame: The base / #1 #2 … chips. Pick a frame to change just that frame (see Per-iteration overrides). Ctrl-click skips a frame, Alt-click locks its seed.
  • Override Context seed: On: the loop sets every frame's seed from its own seed, so the batch can be repeated. Off (default): each WP Context keeps its own seed and the loop changes it a little per frame.
  • Iteration var: The name of the frame-number variable ($iteration). The globe and Σ buttons hide or show $iteration and $iteration_total in the prompt.
  • Bypass loop: Runs a single frame while the node stays wired.
  • context (out) context: One Context per frame. ComfyUI runs the nodes after it once per frame.
  • loop_config (out) WP_CONTEXT_LOOP_CONFIG: Wire it into a WP Seed List so each frame also gets its own sampler seed.

Frame variables

Each frame sets $iteration (1, 2, 3 … up to the count) and $iteration_total (the count). They are hidden from the prompt by default; switch their internal flag off in the loop to print them, for example frame $iteration of $iteration_total.

The values dot sits beside the iteration variable (beside the values note once wired) and shows when you hover it. With values wired, each frame also sets $iteration_value to its line. It prints by default, so a picture of $iteration_value works straight away.

Sweep combinations

Open Sweep combinations, switch it on, pick wildcards from the WP Context nodes after the loop and tick the options to include. Sweeping $hair (3 options) against $mood (3 options) makes 9 frames, one per pair. The first wildcard changes slowest and the last fastest, so it reads like a grid.

  • Limit (default 64, up to 999) caps the frames.
  • Hold other picks (default on) keeps everything you didn't sweep the same on every frame.
  • The menu lists every frame before you run, and count follows it.

Per-frame control

  • Per-iteration seeds opens the list of each frame's seed: lock single frames, Lock all / Unlock all, Copy / Paste, and Prev to lock the seed a frame used on the last run.
  • Edit frame (the base / #1 #2 … chips) lets you give one frame its own settings in the module editors. Ctrl-click a frame chip to skip that frame, Alt-click to lock its seed.

Tips

  • A module with Lock pick ignores the loop. Hold across run in a module's settings keeps its pick for every frame of one run, then rolls again next run.
  • A plain KSampler gets the same seed on every frame. Add a WP Seed List if two frames could roll the same prompt.
  • More in the manager's docs: WP Context Loop, Seeds & loops, and Per-iteration overrides.