ComfyUI Node Runs on cloud

Sleep

Pausing a ComfyUI workflow on purpose

By kijai·Created 3 years ago·Updated about 12 hours ago· 2,930
Sleep
  • input
  • *
minutes0
seconds0.00

Most nodes exist to make something happen faster. Sleep is the opposite: it's a node whose entire job is to make your workflow wait. That sounds useless until you actually need it - usually when something downstream of this node depends on timing rather than data.

What it's for

Sleep takes whatever comes in, holds it for a set amount of time, and then lets it through unchanged. The obvious use is pacing calls to something rate-limited - if a later part of your graph hits an external API (a hosted model, a webhook, anything with a per-second quota), dropping a Sleep in the chain between calls keeps you under the limit without babysitting the queue by hand. It's also handy for staging: if you're chaining several sub-jobs and something upstream needs a moment to actually finish writing to disk before the next step reads it, a short sleep is a blunt but reliable fix. And it shows up in test/demo workflows where you want to see each stage happen instead of watching everything blur past in half a second.

Don't reach for it as a substitute for a real dependency, though - if node B genuinely needs node A's output, that's what the connection between them already guarantees. Sleep is for timing constraints that live outside the graph, not correctness inside it.

How it works

It's a wildcard node - the input slot and the output both take type *, meaning it'll happily hold an image, a latent, a string, a model, anything. Under the hood it's exactly what it sounds like: the node blocks for the duration you set, then forwards its input as its output. Nothing about the data itself changes. Everything wired after Sleep simply doesn't run until the timer expires - that's the entire mechanism, no magic.

The inputs that matter

Two settings, and they add together:

  • minutes - integer, 0 to 1439 (i.e. up to just under 24 hours).
  • seconds - float, 0 to 59.99, in 0.01 steps, for finer control than whole seconds.

Total delay is minutes * 60 + seconds. There's no output setting to configure - the single * output just mirrors whatever you plugged into input.

How to install it

Sleep ships inside kijai's KJNodes for ComfyUI pack, a large, general-purpose grab-bag of utility and QoL nodes that a lot of other workflows quietly depend on (it's common enough that people notice immediately when an update breaks something in it).

  • ComfyUI Manager - search KJNodes for ComfyUI, install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-KJNodes, then pip install -r ComfyUI-KJNodes/requirements.txt (portable installs run that through python_embeded\python.exe -m pip install -r ... instead), then restart ComfyUI.

You don't need any model files or extra setup for this specific node - it's pure Python, no dependencies of its own beyond what the pack already needs.

Common issues & troubleshooting

The whole run looks frozen. That's expected - while Sleep is counting down, nothing wired after it executes. If you set minutes instead of seconds by mistake, a workflow that should take five seconds can quietly sit there for five minutes. Double-check which field you actually typed into; it's an easy typo to make since they sit right next to each other.

It doesn't show a countdown. Sleep doesn't render progress - you'll just see the node stay active in the UI until it's done. If you want visible feedback during a long pause, that's on you to build (a preview node before it, or just trusting the timer).

Using it to "fix" a race condition. If you're using Sleep to wait for a file another process is writing, that's a real but fragile pattern - a slow disk or a busier-than-usual run can outlast whatever delay you picked. It works until it doesn't. If you can make the dependency explicit instead (wire the actual output you need rather than guessing at a duration), that's the more reliable fix.

CategoryKJNodes/misc

Inputs (3)

NameTypeDefaultDescription
input*
minutesINT00–1439
secondsFLOAT0.000–59.99

Outputs (1)

NameTypeDescription
**