Nodes/comfyui-huyl2-nodes/πŸ”‹ Colab Keep Alive
ComfyUI Node

πŸ”‹ Colab Keep Alive

Stop Google from killing your session mid-render

By huyl3-cpuΒ·Created 9 months agoΒ·Updated 4 months agoΒ· 1
πŸ”‹ Colab Keep Alive
  • any_input
  • status
  • passthrough
β—„enabledtrueβ–Ί
β—„interval_min30β–Ί
β—„interval_max60β–Ί
β—„methodaggressiveβ–Ί

Anyone who's run ComfyUI on Google Colab has hit this: Colab disconnects idle sessions, and that's a real risk for a long batch render or anything with pauses in it (a slow model download, an extended sampling run). This node tries to simulate activity so Colab doesn't decide the session is idle and pull the plug out from under you mid-run.

Why this exists specifically for Colab

This whole pack reads as a personal Colab toolkit - the README's install instructions are written entirely around /content/ComfyUI/custom_nodes, and this node is the clearest evidence of that context. It's solving a problem that's specific to free/hosted notebook environments with idle-disconnect policies, not a general ComfyUI limitation.

How it works

method picks the approach: aggressive, gpu_ping, colab_heartbeat, memory_touch, or file_touch - each presumably a different way of generating activity Colab's idle detection might notice (a small GPU operation, a filesystem write, touching memory, or whatever its own heartbeat mechanism responds to). Rather than firing on a perfectly fixed schedule, interval_min/interval_max give it a randomized range to work within, which is the more sensible choice - regular, mechanical pinging is a worse imitation of real usage than jittered timing.

Inputs and outputs

  • enabled (BOOLEAN, default true).
  • interval_min / interval_max (INT, defaults 30/60) - the randomized firing range.
  • method (enum, default aggressive).
  • any_input (optional, wildcard) - wire your graph through it so it actually gets invoked as part of a run.
  • Outputs: status (STRING) and passthrough (wildcard - whatever came in on any_input, unchanged).

Installing it

No models or extra dependencies mentioned in the README:

cd ComfyUI/custom_nodes
git clone https://github.com/huyl3-cpu/comfyui-sortlist.git

Restart ComfyUI afterward. Search ComfyUI Manager first if you'd rather not clone manually, but a small personal pack like this may not be indexed there.

Common issues and troubleshooting

It only helps during an active run. This node fires as part of graph execution - it doesn't run in the background between queued jobs. If your real problem is a Colab session sitting idle with nothing queued, this doesn't substitute for keeping the tab active or a separate always-on keep-alive script; it only protects you while something is actually executing.

It's a Colab-specific workaround, full stop. On a local machine, a rented GPU box, or a hosted service like comfy.icu, there's no idle-disconnect behavior for this node to fight - it has nothing to do there and isn't solving a problem you have.

No method is a guarantee. Google has changed Colab's idle-detection behavior before without warning, so treat any of the five methods here as "worth trying for a long unattended render," not a promise your session survives to the end. If a render is genuinely critical, don't rely on this alone - keep an eye on the session yourself too.

CategorySortList/Utils

Inputs (5)

NameTypeDefaultDescription
enabledBOOLEANtrueβ€”
interval_minINT3015–60β€”
interval_maxINT6030–120β€”
methodCOMBOaggressive5 options: aggressive, gpu_ping, colab_heartbeat, memory_touch, file_touch
any_inputopt*β€”

Outputs (2)

NameTypeDescription
statusSTRINGβ€”
passthrough*β€”