Nodes/ccsun_node/Single Image
ComfyUI Node

Single Image

Grab exactly one image out of a batch by number

By CC-SUN6·Created 2 years ago·Updated about a year ago· 0
Single Image
  • images
  • selected_image
selected_image1

Single Image is the simpler of ccsun_node's two selector nodes. Its sibling, "several images," is built for picking a handful of images out of a batch via a text field. This one is built for the more common case: you generated a batch, you already know which one you want, and you just need it out as a single image so the rest of your (possibly expensive) pipeline - an upscale pass, a face-detail fix, a save - only runs on that one instead of the whole batch.

How it works

Same underlying idea as several images: it's flagged as an output node, so it always runs and renders a preview of what's fed into it in the ComfyUI UI, whether or not you've wired its output anywhere. The difference is the picker. Instead of a text field, selected_image here is a plain integer widget - 1 to 9999, default 1. That range covers batch sizes you'll never actually hit in practice (nobody's running 9999-image batches on a single GPU), it's just a generous ceiling on the widget. The number that matters is that it's 1-indexed: the first image in your batch is index 1, not 0. Worth remembering if you're used to zero-indexed thinking from code - type 1 for "the first one," not 0.

Inputs and outputs

  • images (required) - the batch to pick from, typically straight off a KSampler with batch_size greater than 1, or after decoding a multi-image latent.
  • selected_image (required, integer, 1–9999, default 1) - which one you want.
  • selected_image (output) - the single image at that index, ready to wire into a Save Image, an upscaler, a detailer pass, whatever's next.

A realistic way this shows up in a workflow: you run a batch, eyeball the results (maybe using "several images" upstream to preview the whole set first), figure out that image 3 is the keeper, hardcode 3 here, and only that one flows into your heavier downstream nodes. It's a cheap way to avoid burning an expensive upscale or detailer pass on images you're going to throw away anyway.

Installing it

Search ccsun_node in ComfyUI Manager and install from there, or clone it manually:

cd ComfyUI/custom_nodes
git clone https://github.com/CC-SUN6/ccsun_node

Restart ComfyUI. Nothing else to fetch - no model files, no unusual Python dependencies beyond what ComfyUI itself needs.

Common trip-ups

The one that'll actually bite people: if you type an index higher than the number of images you actually fed it - say your batch was 4 images but you set selected_image to 7 - the pack's README doesn't say what happens, and there's no documented fallback behavior. Treat it as undefined and just don't do it; keep the index inside the size of the batch you generated.

The node's bundled metadata description is generic boilerplate ("saves the input images to your output directory") that doesn't really match what the node does based on its actual inputs and outputs - its job is selecting one image out of a batch, not writing files to disk on its own. If you want a saved copy, put an explicit Save Image node after it.

Beyond that, this is a small, single-author pack with essentially no community footprint - no forum threads, no FAQ. If something behaves oddly, a GitHub issue on the repo is your best (and really only) path to an answer.

Categoryccsun_node

Inputs (2)

NameTypeDefaultDescription
imagesIMAGE
selected_imageINT11–9999

Outputs (1)

NameTypeDescription
selected_imageIMAGE