Nodes/comfyui-ig1-tools/Image Selector
ComfyUI Node

Image Selector

Pick the upscaled branch — without paying for both

By iguanesolutions·Created 12 months ago·Updated 9 months ago· 4
Image Selector
  • original
  • upscaled
  • IMAGE
use_upscaledfalse

Here's the workflow problem this solves: a two-pass pipeline - generate at a modest resolution, then HiRes-fix or upscale. Fine when the second pass is always needed. But an automated workflow doesn't always need it. Run the upscale branch anyway and you've doubled your render time for nothing; skip it and you're stuck at 720p.

IG1ImageSelector is the escape hatch. It's a lazy selector: it takes original and upscaled images plus a use_upscaled boolean, and hands back whichever one you asked for - while making sure the branch you didn't pick never runs at all.

The lazy trick

That last part is the whole point, and it's worth understanding because it's the thing people miss. ComfyUI supports lazy inputs, where a node tells the scheduler which inputs it actually needs before anything executes. The ImageSelector's check_lazy_status does exactly this: when use_upscaled is false, it declares that only original is required, and the entire upstream chain feeding upscaled - the latent upscale, the second sampler pass, all of it - gets pruned from execution. Flip the boolean and the reverse happens.

So you're not just choosing between two images; you're choosing between two graphs, and the loser never touches your GPU. That's real VRAM and wall-clock time saved on every run where the extra pass wasn't needed.

Why it exists

The author built it to pair with the pack's Resolution Advisor. Feed the advisor a desired resolution and it outputs NEED_HIRES and NEED_UPSCALE booleans, telling you whether a second HiRes pass and a third pure upscale are required to hit your target. Wire one of those booleans into use_upscaled and you get a fully automatic multi-pass pipeline that only renders the passes it needs. The README even ships an example Flux workflow doing exactly this, automating the HiRes pass and a final downscale based on whatever resolution you type in.

The inputs

  • use_upscaled (boolean, default false) - which branch wins. The source sets force_input, so it wants a real connection: drive it from the advisor or a boolean node rather than expecting a widget to carry the day.
  • original (IMAGE) - the first-pass generation.
  • upscaled (IMAGE) - the HiRes/upscale result.

One output, IMAGE - the winner. Feed it to a Save node, a final downscale (the README's example leans on ComfyUI Essentials for that), or anything else that consumes the finished image.

Installing it

Same as the rest of the pack: ComfyUI Manager → Install via Git URL → https://github.com/iguanesolutions/comfyui-flux-resolution.git, or:

cd ComfyUI/custom_nodes
git clone https://github.com/iguanesolutions/comfyui-flux-resolution

then restart. No model downloads, no extra weights - this pack is all math and plumbing.

The trap

The selector picks, it doesn't blend. If you wire both branches expecting the boolean to act like a mix amount, you'll get one or the other, never a combination. And note the default is false - leave use_upscaled unwired and you'll always get the original, which is a quiet way to discover your "upscaled" branch has become dead weight.

CategoryIG1 Tools

Inputs (3)

NameTypeDefaultDescription
use_upscaledBOOLEANfalseSelect the upscaled image
originalIMAGEThe original image
upscaledIMAGEThe upscaled image

Outputs (1)

NameTypeDescription
IMAGEIMAGEThe selected image