Nodes/ComfyUI_Fill-Example-Nodes/Fill Example: Progress Bar
ComfyUI Node

Fill Example: Progress Bar

A Node Whose Whole Job Is Showing You a Progress Bar

By filliptm·Created about a year ago·Updated 5 months ago· 6
Fill Example: Progress Bar
    • STRING
    iterations10

    Fill Example: Progress Bar exists to answer one question: how do I make my custom node show progress in ComfyUI? It's not a production tool - you'll never need it in a real image pipeline. It's a working demonstration of ComfyUI's backend progress API, and if you've ever written a node that churns for a while (a batch upscaler, a slow effect, anything with a loop) this tiny example is worth ten minutes of your time.

    Here's the whole trick, and it's embarrassingly small: ComfyUI ships a ProgressBar class in comfy.utils, and your node just has to update it as it works. That little meter at the top of the queue in the ComfyUI UI? That's the thing you're driving.

    How it works

    The node's run method is the entire lesson, in four lines:

    pbar = comfy.utils.ProgressBar(iterations)
    for i in range(iterations):
        time.sleep(0.1)
        pbar.update(1)
    return ("Finished!",)
    

    You create a ProgressBar sized to the number of steps, then call pbar.update(1) once per unit of work. ComfyUI turns those updates into the progress percentage you see in the UI - same mechanism your KSampler uses, minus the actual diffusion. The time.sleep(0.1) is a stand-in for "real work." Swap it for your actual computation and you've built yourself a node with a live progress bar.

    Inputs and outputs

    There's one input and one output, and neither matters much for actual use:

    • iterations (INT, default 10, min 1, max 100) - how many fake work units to run. Each unit sleeps 0.1s, so 10 iterations takes ~1 second and the max of 100 takes ~10 seconds.
    • STRING output - the text "Finished!". It's a sentinel, not a payload. You could wire it into a Show Text node to confirm the run completed, but that's really it.

    Install

    The pack has no dependencies and downloads nothing, so this is painless:

    • ComfyUI Manager → Install Custom Nodes → search "ComfyUI_Fill-Example-Nodes" → install → restart.
    • Or:
    cd ComfyUI/custom_nodes
    git clone https://github.com/filliptm/ComfyUI_Fill-Example-Nodes
    

    Restart ComfyUI and the node appears under "Fill-Example-Nodes".

    Common issues

    The main thing that trips people up is that the node looks hung. It deliberately sleeps 0.1 seconds per iteration, so with the default 10 iterations the whole run takes about a second and with 100 it takes ten. That's not a freeze - that's the demo doing its job. If you want to see the bar actually crawl, crank iterations to 100 and watch the queue status.

    One honest caveat: the progress bar only renders when you run the workflow through the ComfyUI frontend and this node is in the executing path. There's nothing to see if you call the API headlessly or if the node isn't part of the executed branch. And if you expected the STRING output to matter, it doesn't - ignore it.

    The real value of this node is as a template. When you're writing your own long-running node and it feels like ComfyUI is frozen for 40 seconds with no feedback, this is the pattern that fixes it. Copy it, make time.sleep your actual workload, and you've shipped a node that feels professional instead of dead.

    CategoryFill-Example-Nodes

    Inputs (1)

    NameTypeDefaultDescription
    iterationsINT101–100

    Outputs (1)

    NameTypeDescription
    STRINGSTRING