Nodes/ComfyUI-Workflow-Studio/Gallery Feeder (WFS)
ComfyUI Node

Gallery Feeder (WFS)

Feed your saved gallery back into the graph, one image at a time

By ketle-man·Created 6 months ago·Updated 3 days ago· 10
Gallery Feeder (WFS)
    • image
    group_name__Feeder__
    index0
    sort_mode
    seed0

    You know the itch: you've got a folder of outputs you actually like, and you want to run them back through a pipeline - img2img, upscale, re-light, prompt variations - one by one, without hand-wiring each image into the graph. That's the job of WFS_GalleryFeeder. It pulls one image out of a named Gallery group at a time and hands it to the workflow as a normal IMAGE tensor. It ships inside ComfyUI-Workflow-Studio, the author's alternative frontend for ComfyUI (it's on the community's "alternative UIs for ComfyUI" lists), and it's the built-in version of a trick that usually demands a second plugin.

    No API calls, no model downloads, no key. The whole mechanism is reading a JSON file. WFS_GalleryFeeder looks at the same gallery_metadata.json that Workflow Studio's Gallery tab maintains (under ComfyUI/user/default/Workflow-Studio/), collects every image whose group list includes your group_name, sorts them, and returns the one at index. Sort is either filename ascending/descending or random - and for random, the seed input shuffles the order reproducibly.

    The clever bit is hidden in IS_CHANGED, which always reports a change. ComfyUI re-executes the node on every queue even when nothing else moved, so bumping the index between runs is what drives the loop. And because the code does paths[index % len(paths)], the index wraps - you can't walk off the end, a too-big number just starts over.

    The four inputs, and honestly they're all you'll touch:

    • group_name - which Gallery group to draw from; defaults to __Feeder__
    • index - position in the sorted list
    • sort_mode - filename_asc, filename_desc, or random
    • seed - only matters when sort is random

    Output is a single image (IMAGE), so it plugs into anything that eats an image: an img2img path, a face fixer, an upscaler, whatever.

    Why pair it with a Gallery group instead of a folder path? Curation. In the Gallery tab, the little F button on a thumbnail toggles membership in the __Feeder__ group (FC clears it), so you build an explicit shortlist of exactly the images you want looping - not "everything in this folder." The group is reserved, so you can't delete it by accident. The node also gets ▶ Run / ■ Stop / After Gen (loop, increment, fixed) widgets directly on the canvas via gallery_feeder_extension.js; the same controls live in the Studio's Feeder subtab, which is the intended driving seat.

    Install - it's just the pack: ComfyUI Manager, search Workflow Studio, or

    cd ComfyUI/custom_nodes
    git clone https://github.com/ketle-man/ComfyUI-Workflow-Studio.git
    

    then restart. For this node there are no extra Python packages - numpy, Pillow, and torch are already bundled with ComfyUI. (The repo's requirements.txt covers the Tagger tab only: onnxruntime, piexif. Skip it unless you tag.)

    Where people get burned:

    • Black 64×64 image coming out. That's the placeholder the node returns when the group is empty, missing, or the metadata file doesn't exist yet. Add images to the group with the F button and double-check the exact group_name - it's a reserved word, not a guess.
    • "It never advances." Check the After Gen mode; fixed keeps the same index on purpose.
    • Old seed error. A v0.3.42 bug capped the seed at 0x7FFFFFFF, so the Studio could write a value ComfyUI rejected as too big. Fixed since - if you see value_bigger_than_max, update the pack.

    If you came here from the author's separate comfyui-image-feeder plugin: same idea, no second install. This is the Gallery-group version.

    CategoryWorkflow Studio

    Inputs (4)

    NameTypeDefaultDescription
    group_nameSTRING__Feeder__
    indexINT00–99999
    sort_modeCOMBO3 options: filename_asc, filename_desc, random
    seedINT00–18446744073709550000

    Outputs (1)

    NameTypeDescription
    imageIMAGE