Nodes/ComfyUI-LightQueueCounter/Light Queue Counter Any Passthrough
ComfyUI Node

Light Queue Counter Any Passthrough

A queue counter you can drop on any wire

By ruminar·Created 4 months ago·Updated 3 months ago· 1
Light Queue Counter Any Passthrough
  • value
  • value
  • status
  • title
  • running
  • pending
  • total
labelqueue
title_formattotal
print_to_consoletrue

You queue two hundred batch jobs, walk away, come back, and have no idea how many are left without staring at the browser. ComfyUI shows a queue count in the UI, sure - but that's the whole-app number, and it tells you nothing about what the queue looked like at the moment a specific job actually ran. LightQueueCounterAnyPassthrough is a tiny node that samples the backend queue at execution time and hands you the numbers as real outputs, without touching the data flowing through it.

What it is

A passthrough with an ANY input and an ANY output. Image, latent, conditioning, model, string, whatever - slice it into any wire and it returns the same value unchanged, while additionally emitting status, title, running, pending, and total. The name is not a lie: the thing you pass through is never altered.

How it works

This is where the "light" comes from, and it's the one genuinely smart bit of the pack. Instead of polling ComfyUI's /queue endpoint, the node reads PromptServer.instance.prompt_queue directly on the backend, under the queue's own mutex: len(queue) is pending, len(currently_running) is running, and total is the sum. No JSON serialization of a big queue array per run, the way the API route would do it. That's why the author can claim ~0.004s per execution - it's a couple of length checks, not a snapshot of the world.

There's no timer and no polling loop. The count is sampled at the moment the node executes, so what you get is a snapshot, not a live ticker.

The inputs and outputs that matter

  • value - required, ANY. Whatever you're passing through.
  • label - optional, default "queue". The name prefix in the text outputs.
  • title_format - total, short, or full.
  • print_to_console - default true. Prints [LightQueueCounter] ... to the server log.

The five extras are the payload: value (unchanged), status (queue: running=1, pending=49, total=50), title (the short display form, queue: 1/49/50), and the running, pending, total INTs.

For a beginner, honestly, you only touch label and title_format. Then wire the INT outputs into a text node or Display Any to see them, or feed status/title into this pack's SetTitle node to render them into a node title that survives collapsing.

Installing it

It's a two-line install with zero dependencies - no requirements.txt, no model files, nothing that can fight your environment:

cd ComfyUI/custom_nodes
git clone https://github.com/ruminar/ComfyUI-LightQueueCounter.git

Then restart ComfyUI. Or, easier: open ComfyUI Manager, search "LightQueueCounter" under Custom Nodes, and install from there. The whole pack is one Python file plus a small web extension, GPL-3.0, single release so far.

Common issues

  • It's a snapshot, not a feed. If nothing is executing, whatever number is sitting on an output is from the last run. That's by design - it updates on execution, not on a timer.
  • It counts down through a queue. With ten jobs queued, the first execution sees ~9 pending; the last sees 0. If that surprises you, you were expecting a live widget.
  • Console spam. print_to_console defaults to true, so you'll see a line per run in the server log. Flip it off if it bugs you.
  • The status output shows the moment-in-time count, so don't use it as a "total jobs ever" counter - it's "jobs right now," by construction.

If you just want a folded badge on your canvas instead of outputs to wire around, skip this one and grab LightQueueCounterTitleTap from the same pack - that's the one the author actually recommends.

Categoryutils/queue

Inputs (4)

NameTypeDefaultDescription
value*
labeloptSTRINGqueue
title_formatoptCOMBOtotal3 options: total, short, full
print_to_consoleoptBOOLEANtrue

Outputs (6)

NameTypeDescription
value*
statusSTRING
titleSTRING
runningINT
pendingINT
totalINT