arkennemasis Shot Selector (run N of M)
Run only 5 of your 24 API calls — the node that never bills a skipped branch
- image
- image
If your workflow has 24 generator branches - say, 24 API image calls - and you're iterating on prompts, running all 24 every time is how you watch a Replicate balance evaporate. ArkShotSelector is the valve: drop one after each generator, and it decides per-branch whether that generator actually runs. Unselected branches never execute, so the paid API node upstream is never called and never billed. It's the "run N of M" pattern done properly, with laziness instead of muting.
The mechanism that makes it honest
The key is that image is a lazy input. When the node's check_lazy_status decides this shot isn't selected, it simply doesn't request the image - and because a lazy input not being requested means the whole upstream subtree is skipped, the generator above never fires at all. No half-executed API call, no "well, it already started" surprise. Selected shots pass the image straight through; unselected ones return ExecutionBlocker(None), which silently skips saves, previews and collectors downstream without raising.
Every copy of the node independently derives the same selected set from (seed, how_many, total_shots). That's why there's no shared state or extra wiring: give every copy the same how_many, seed, total_shots and selection, and a unique shot_index, and they all agree on which branches run.
The inputs you set
shot_index- this branch's slot, 0-based, unique per copy.how_many- how many of the branches to run. Wire one value into every copy.total_shots- how many branches exist in total.seed- only used in random mode. Same seed = same set, which is what lets you reproduce a partial run.selection-first N in order(default) runs slots 0..N-1, perfect while you're actively working on the first few branches.random from seedtakes an unbiased sample of the whole set, for a representative spread without paying for all of it.
One sharp edge worth knowing: because ComfyUI blocks any node with a blocked input, a partial run also skips any node that gathers every branch - a collect/unpack pair, for instance. The author's answer is blunt: a partial run is a test pass, so give each branch its own save if you want partial runs to produce files. It's a feature, not a bug - the full set is only assembled when every branch runs.
Install and context
ArkShotSelector is one of the 61 nodes in the comfyui-arkennemasis pack, under arkennemasis/Utility. Install the pack once:
cd ComfyUI/custom_nodes
git clone https://github.com/Hishamahmer/comfyui-arkennemasis
pip install -r comfyui-arkennemasis/requirements.txt # then restart ComfyUI
Or ComfyUI Manager → Install via Git URL with the repo URL. No models, no key - this is pure graph plumbing.
The same lazy-input trick runs through the whole pack - ArkVideoModel uses it to render with one video model and not even stage the other's weights, and the variation pipeline's job gates use it to skip finished cells. If you've ever muted a branch and watched its upstream still chew through a render, this is the cleaner version of the same idea.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Lazy: only pulled when this shot is selected, so the upstream generator does not run otherwise. | |
| shot_index | INT | 00–9999 | This branch's slot number. Must be unique, 0-based. |
| how_many | INT | 240–9999 | How many of the branches to actually run. Wire one value into every copy. |
| total_shots | INT | 241–9999 | How many branches exist in total. |
| seed | INT | 00–18446744073709550000 | Only used by 'random from seed'. Same seed = same set. |
| selection | COMBO | first N in order | 'first N in order' runs slots 1..N - use it when the first slots are the ones you are working on. 'random from seed' takes an unbiased sample of the whole set. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |