Nodes/ComfyUI Ino Nodes/Ino List Get Last
ComfyUI Node

Ino List Get Last

Pull the last item off any list

By nobandegani·Created about a year ago·Updated 2 months ago· 6
Ino List Get Last
  • items
  • item
  • success
  • length

Somewhere in every batch workflow there's a moment where you don't care about the batch at all - you just want the newest thing that came out of it. InoListGetLast exists for that exact moment. Give it any list and it returns the final item, with a success flag and the list length so your graph can behave sensibly when the list turns out to be empty.

It's the sibling of Ino List Get Item (which is the same thing with an index you pick), and it fills the niche where the answer is always "the end." A common shape: load a folder of reference images, run them through a batch processor, and then take the last output for a final upscale or preview while the rest get filed away. Or grab the last item a list-building node appended, without having to know how many there are.

How it works

One required input: items (any type, list). The node returns:

  • item - the last element of the list, whatever its type (IMAGE, MASK, string, model).
  • success - True if the list had at least one item, False if it was empty.
  • length - the total number of items, in case you want to log or branch on it.

Under the hood it's just Python's items[-1] with a guard: an empty list returns success: False and a null item instead of crashing the whole workflow. That's the part worth knowing - this pack's philosophy is that a failed read should be a signal you can route on, not a wall of red.

Installing it

InoListGetLast is one node in the ComfyUI-InoNodes pack by nobandegani, alongside 125+ others covering file handling, S3, model loading, and workflow utilities. Install the pack and you get it:

cd ComfyUI/custom_nodes
git clone https://github.com/nobandegani/comfyui_ino_nodes
cd comfyui_ino_nodes
pip install -r requirements.txt

ComfyUI Manager users can search "ComfyUI Ino Nodes" instead - same result, less typing. Restart ComfyUI after installing, and note the pack targets the newer V3 node schema, so keep ComfyUI itself reasonably up to date.

Common issues

Same trap as its sibling: items must genuinely be a list on the wire. If you connect an upstream node that emits a single value, indexing "last" still works in a trivial sense, but you lose the length signal and the empty-list guard has nothing to guard. List outputs from the Ino pack's own nodes (like the images output of Ino Load Images From Folder, which is explicitly a list) are the natural inputs.

Also worth remembering: success is the output to check before you trust item. If your folder was empty or an upstream node produced nothing, item will be a placeholder and success will be False - gate your downstream nodes on it and the workflow degrades gracefully instead of silently processing nothing.

CategoryInoListHelper

Inputs (1)

NameTypeDefaultDescription
items*

Outputs (3)

NameTypeDescription
item*
successBOOLEAN
lengthINT