Image Filter
Make ComfyUI Wait for a Human Decision
- images
- latents
- masks
- images
- latents
- masks
- extra1
- extra2
- extra3
- indexes
ComfyUI will happily generate a batch of sixteen images, upscale every single one, and save them all - even when fifteen are garbage. The Image Filter node is the fix: it pauses the whole workflow, pops up a window over your batch, and waits while you click the keepers. Then the graph resumes with only those images flowing onward. It's the closest thing to a human checkpoint in an otherwise fully automated pipeline, and it's the centerpiece of the chrisgoringe/cg-image-filter pack.
The obvious win is cost: pick before you spend VRAM and minutes upscaling the losers. Pick before you save, so your output folder doesn't become a landfill. But the smarter version of the trick is wiring the same latent batch you generated into the optional latents input - then only the latents for your chosen images come out, and the next stage runs on latents directly instead of a decode-recode round trip. That's real quality you keep, not just time you save.
How it actually works
Mechanically it's a clean little server dance. The node saves your batch through ComfyUI's preview system to get URLs, ships them to the frontend over a websocket message, then polls the server every half-second until timeout (default 600s) expires. The floating window is plain JavaScript from the pack's js/ folder. Click Send and it posts your selection back; click Cancel (or hit Escape) and it raises ComfyUI's InterruptProcessingException, killing the run. If you ignore it, the ontimeout option decides: send none, all, first, or last.
The inputs that matter are few:
images- the batch. Required, and the whole reason the node exists.timeout- seconds before the node gives up and appliesontimeout.pick_list- a comma-separated string of indices that selects automatically, no clicking. Zero-indexed, and values wrap modulo the batch size, so-1is the last image. Handy for scripts, and you can repeat an index to duplicate an image in the output.
Then there's video_frames: set it to n and the node groups each block of n images as a video clip you can preview and pick between. The author announced it on r/comfyui as experimental - treat it that way. tip shows a reminder under the extras fields, and extra1–extra3 are short text fields that pass straight through to the outputs so you can jot "denoise this one harder" next to a selection.
Outputs
You get images, latents, and masks (each reflecting only your picks), the three extra strings, and indexes - a comma-separated string of the selected indices. That indexes string is the gift that keeps giving: feed it into the pack's Pick from List node along with your prompt list, and you get back exactly the prompts that produced your keepers. No more hunting through sixteen candidates to find which seed did it.
Installing it
Search "cg-image-filter" (or "Image Filter") in ComfyUI Manager and hit install, or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/chrisgoringe/cg-image-filter
Then restart ComfyUI. There's no requirements.txt and nothing to download - the UI is the pack's own JavaScript. It does use ComfyUI's newer extension API (comfy_api.latest), so if the nodes don't show up, update ComfyUI first.
Gotchas
The pack's README has one rule worth tattooing somewhere: after an update, if a filter node misbehaves, delete it and add it back before reporting a bug. And remember that clicking Cancel isn't an error - it's the workflow stopping on purpose.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| timeout | INT | 6001–1000000 | timeout in seconds |
| ontimeout | COMBO | 4 options: send none, send all, send first, send last | |
| graph_id | STRING | — | |
| latentsopt | LATENT | optional | |
| masksopt | MASK | optional | |
| tipopt | STRING | — | |
| extra1opt | STRING | — | |
| extra2opt | STRING | — | |
| extra3opt | STRING | — | |
| pick_list_startopt | INT | 0 | The index of the first image (normally 0 or 1) |
| pick_listopt | STRING | If a comma separated list of integers is provided, the images with these indices will be selected automatically. | |
| video_framesopt | INT | 1 | Treat each block of n images as a video |
| audiofileopt | STRING | Path or URL for the audiofile to use, or name of the file in the default audio folder |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| latents | LATENT | — |
| masks | MASK | — |
| extra1 | STRING | — |
| extra2 | STRING | — |
| extra3 | STRING | — |
| indexes | STRING | — |