Nodes/ComfyUI_Lam/等待图片选择器
ComfyUI Node

等待图片选择器

Make the workflow pause until you pick a winner

By yanlang0123·Created 2 years ago·Updated 11 days ago· 77
等待图片选择器
  • images
  • 是否没选
  • 选择图片

WaitImagSelector (等待图片选择器, "waiting image selector") is the human-in-the-loop node: it renders your candidate images in the ComfyUI UI, then blocks the queue until you actually click one. Generate four variations, pause, keep the one you like, and let it flow into the next stage - upscale, detail pass, whatever. It's the image-chooser idea (the same concept as the well-known image-chooser nodes that other packs ship) reimplemented inside ComfyUI_Lam.

How it works

Under the hood it's a subclass of SaveImage with a twist: it writes the incoming batch to the temp directory, pushes the preview URLs to the frontend over a websocket message, then blocks - polling in a tight loop - until the JavaScript side sends back the list of indexes you clicked. The pack vendored its own copy of the chooser UI in js/image_chooser, so the interaction is a dialog showing each image; click to select, click again to deselect, confirm, and the node wakes up.

The outputs:

  • 是否没选 - a BOOL. True if you cancelled or picked nothing, False if you selected.
  • 选择图片 - the IMAGE you picked. If you multi-selected, they come back as a batch.

Wire the BOOL into a switch or a condition to route "nothing selected" somewhere graceful, and feed the IMAGE into your next node. That's the whole contract.

Why you'd use it

The classic pattern: generate a grid of candidates, keep the winner, continue. It's also handy for interactive cleanup - run a batch, eyeball each result, and only pass the good ones downstream. The UI supports selecting multiple images, so you can build a "pick the keepers" gate into a larger pipeline. It saves to the temp dir rather than output/, so rejects don't clutter your saved work.

The one thing that will bite you

This node blocks. It stops the queue and waits for a human click - that's its job. But it means it's fatal in any headless context: run ComfyUI purely via the API, or queue a workflow with this node in it and walk away, and the queue hangs forever waiting for a click that will never come. There's a cancel path in the code (a __cancel__ message routes through the chooser's message handling), but you have to be there to trigger it. If your pipeline runs unattended, don't put this node in it.

Installing it

Part of the ComfyUI_Lam pack. Install via ComfyUI Manager (search "ComfyUI_Lam") or:

cd ComfyUI/custom_nodes
git clone https://github.com/yanlang0123/ComfyUI_Lam

Restart ComfyUI - the frontend needs the pack's js/ directory loaded, so a proper restart (not just reloading a workflow) matters here. No models required. One pack-wide quirk to expect: this pack can throw a leftover popup reading 请先添加AppParams节点 ("please add the AppParams node first") on startup; it's cosmetic, a full restart plus clearing Manager's cache quiets it, and it has nothing to do with whether this node works.

Troubleshooting

If the dialog never appears, check that the pack's web extensions actually loaded - a half-restart is the usual culprit. If the node sits spinning forever, you've hit the blocking behavior; click something or cancel. And remember: a True 是否没选 output means no selection was made, so your downstream logic should treat that as a first-class case, not an error.

Categoryimage

Inputs (1)

NameTypeDefaultDescription
imagesIMAGE

Outputs (2)

NameTypeDescription
是否没选BOOL
选择图片IMAGE