Nodes/Image Filter/Image Filter
ComfyUI Node

Image Filter

Make ComfyUI Wait for a Human Decision

By chrisgoringe·Created 2 years ago·Updated 2 months ago· 132
Image Filter
  • images
  • latents
  • masks
  • images
  • latents
  • masks
  • extra1
  • extra2
  • extra3
  • indexes
timeout600
ontimeout
graph_id
tip
extra1
extra2
extra3
pick_list_start0
pick_list
video_frames1
audiofile

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 applies ontimeout.
  • pick_list - a comma-separated string of indices that selects automatically, no clicking. Zero-indexed, and values wrap modulo the batch size, so -1 is 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 extra1extra3 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.

Categoryimage_filter

Inputs (14)

NameTypeDefaultDescription
imagesIMAGE
timeoutINT6001–1000000timeout in seconds
ontimeoutCOMBO4 options: send none, send all, send first, send last
graph_idSTRING
latentsoptLATENToptional
masksoptMASKoptional
tipoptSTRING
extra1optSTRING
extra2optSTRING
extra3optSTRING
pick_list_startoptINT0The index of the first image (normally 0 or 1)
pick_listoptSTRINGIf a comma separated list of integers is provided, the images with these indices will be selected automatically.
video_framesoptINT1Treat each block of n images as a video
audiofileoptSTRINGPath or URL for the audiofile to use, or name of the file in the default audio folder

Outputs (7)

NameTypeDescription
imagesIMAGE
latentsLATENT
masksMASK
extra1STRING
extra2STRING
extra3STRING
indexesSTRING