Skip to content

[Feature request] For... in / Map... loop #5

@rnbwdsh

Description

@rnbwdsh

Would be great if we could have a loop where you pass in a batch and it just iterates over it.

Here is the rough logic that I'd imagine:

  • Batch gets converted to an (internal) accumulation
  • Remaining gets set to the length of this accumulation
  • Output "each" gives 1 item
  • Optional 1: Each gives nr_batch items - so you can rebatch and run N items through a sampler at a time - this way we could even save the "Map End" construct, by emitting a arbitrarily large (nr_batch = 0) batch
  • Optional 2: Map end node starts with 1 acc_add input, if connected it spawns more inputs and outputs (would generally be cool for Loop start/end)
  • Optional 3: If input is an INT, it gets expanded to list(range(int)). In addition to the "remaining" node, a float progress from 0..1 output would be nice - as well as a progress bar on the loop for the sampler
  • Optional 4: CONDITIONINGs are correctly packed/unpacked/appended by this node (or acc generally) - see unpack / pack

Here is an overly complicated workflow on how i archive something like that with 6 nodes (constant number, for loop start, simplemath, accumulate, for loop close, for loop to list)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions