ComfyUI Node
VFileRandom
VFileRandom - load a random image from a folder without repeats. Draws like a shuffled deck: every image in the folder is shown exactly once before any image repeats. The cycle is remembered per folder in a state file, so it survives ComfyUI restarts. Images added to the folder mid-cycle join the current cycle; deleted ones are dropped. Outputs the image, its alpha mask, the filename (relative to the folder, also as a variant without the file extension) and how many images are left before the deck reshuffles.
VFileRandom
- image
- mask
- filename
- remaining_in_cycle
- filename_noext
◄folder►
◄seed0►
◄include_subfoldersfalse►
◄reset_cyclefalse►
CategoryValiTools
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| folder | STRING | Absolute path to the folder to draw images from. | |
| seed | INT | 00–18446744073709550000 | Only triggers a new draw (keep it on 'randomize'); the no-repeat cycle itself is stateful. |
| include_subfolders | BOOLEAN | false | — |
| reset_cycle | BOOLEAN | false | Forget which images were already drawn and start a fresh shuffled cycle on this run. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |
| filename | STRING | — |
| remaining_in_cycle | INT | — |
| filename_noext | STRING | — |