Sleep
Make ComfyUI wait, politely, with a progress bar
- flow
- dependency
- flow
Sometimes the most useful thing a node can do is nothing, for a while. JN_Sleep pauses the whole graph for seconds, shows a countdown progress bar so it doesn't look frozen, then hands execution back to whatever you've wired after it. It sounds trivial, but it's one of those nodes that quietly solves a real class of problem - mostly "the other system needs a beat."
How it works
Under the hood it's just ComfyUI's own func_sleep wrapped with a ProgressBar, so the pause ticks down visibly in the UI instead of hanging silently. The interesting part is the throttle logic: it only sleeps when count % every == 0.
- seconds - how long to pause each time it triggers. Whole seconds (it's an INT), default 0.
- every - trigger only every Nth execution. Default 1 = sleep every time.
- count - the execution count you feed it, usually from a counter or math node.
With the defaults (count 0, every 1) it sleeps every run - 0 % 1 == 0 is always true. Feed it a counter and bump every to, say, 10, and it sleeps only on the 10th, 20th, 30th… execution. That's the setup you want for a long batch where you don't need a pause after every single item.
The flow input/output is the pass-through: wire anything in, get the same thing back, so you can drop a Sleep into the middle of a chain without a dedicated type. And dependency (multiple inputs) forces the node to wait until other nodes have finished - which is also how you give it the count in the right order.
When you'd reach for it
- Pacing API calls. If your workflow phones an external service with a rate limit, a Sleep before each call keeps you under the cap.
- Waiting on an external file or service to be ready before the next step runs.
- Thermal management. JNComfy also ships
JN_CoolDownand a whole temperature-throttling patch (configured inComfyUI/jncomfy.yaml) - but those auto-pause based on temperature. Sleep is the manual, "I know the card needs a breather after this" version. - Deliberate staging. Generate, pause, let something settle, continue.
Install
Sleep rides along in JNComfy. ComfyUI Manager → search "JNComfy" → Install, then restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/jn-jairo/jn_comfyui
restart, and if you're installing manually run pip install -r requirements.txt from inside the folder. Don't be put off by that requirements list (torchaudio, librosa, transformers…) - this node is plain Python time.sleep with a progress bar; the heavy deps are for the pack's audio sections.
Gotchas
- It's a blocking pause: the entire graph waits, GPU and all. Don't drop it into a per-frame loop with
every=1unless you enjoy watching paint dry. secondsis whole seconds only. If you need sub-second delays, this isn't the node.- An abort mid-sleep leaves the queue in an odd state sometimes - you'll see the "Sleeping N seconds" line in the console. That's normal; let it finish or hit cancel.
- Remember the pack patches ComfyUI on startup. If other patch-heavy custom nodes are fighting it, check the console for "Failed to import module" before blaming this node.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| seconds | INT | 00–18446744073709550000 | — |
| every | INT | 11–18446744073709550000 | — |
| count | INT | 00–18446744073709550000 | — |
| flowopt | * | — | |
| dependencyopt | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| flow | * | — |