Nodes/ComfyUI_RH_APICall/RH Batch Images From ImageList
ComfyUI Node

RH Batch Images From ImageList

Pick and reorder frames with an index string

By HM-RunningHub·Created 2 years ago·Updated 3 months ago· 288
RH Batch Images From ImageList
  • images
  • image
image_indices0-3,4,5-7

When a RunningHub job hands you back a stack of images or a run of video frames, you rarely want all of them. RH_BatchImages lets you carve out the ones you care about with a plain text string - "give me frames 0 through 3, then 4, then 5 through 7" - and returns them as a single image batch. It's the selection-and-reorder utility for the pack, and it's pure local plumbing: no API key, no network, nothing leaves your machine.

It lives in ComfyUI_RH_APICall, the plugin that runs workflows on the RunningHub cloud and pulls results back. The heavy nodes there - the execute node especially - can return a whole list of images or the frames of a video. This one is the tidy-up step after that: shape the pile into exactly the subset and order you want before you save it, upscale it, or feed it onward.

How it works

You give it a list of images and a string describing which indices to keep. The string is a comma-separated mix of single numbers and ranges, and the default 0-3,4,5-7 shows the whole grammar at once: 0-3 grabs a contiguous run, 4 grabs a lone image, 5-7 grabs another run, and the commas stitch them together. Indices are zero-based, so 0 is the first image. The order you write them in is the order you get out, which means this doubles as a cheap reordering tool - put 3,2,1,0 and you've reversed the first four.

The inputs and output that matter

  • images (IMAGE) - the batch or frame list to pick from. Wire in whatever produced the stack: the execute node's images or video_frames output, a folder loader, an earlier batch.
  • image_indices (STRING, default 0-3,4,5-7) - your selection. Singles and ranges, comma-separated, zero-based.

The output is image (IMAGE) - the assembled batch, in the order your string specified. It behaves like any ComfyUI image batch downstream.

Installing it

The node comes with the pack, and the pack is light - no models, no big dependencies, because the actual generation runs on RunningHub, not locally:

  • ComfyUI Manager: search ComfyUI_RH_APICall, install, restart.
  • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/HM-RunningHub/ComfyUI_RH_APICall, then restart ComfyUI.

This particular node needs no account or key - it's just working on images already in your graph. The API key only matters for the nodes that talk to RunningHub.

Where people get stuck

The one real gotcha is off-by-one: indices start at 0, so 1-4 skips the very first image. If your selection looks shifted by one, that's why. The other is out-of-range - asking for index 9 when the list only has 8 images (indices 0–7). Keep your top index below the count. If you're not sure how many images you actually got back, drop a preview node on the source first and count. When you only want a single frame rather than a range, its sibling RH_ExtractImage takes one integer and is simpler for that job; reach for RH_BatchImages when you want several, or want to reorder them.

CategoryRunningHub

Inputs (2)

NameTypeDefaultDescription
imagesIMAGEThe images list
image_indicesSTRING0-3,4,5-7Some like 0-2, 3, 4-5. Leaving it empty means selecting all.

Outputs (1)

NameTypeDescription
imageIMAGE