Nodes/SDVN_Comfy_node/⛔ Google Colab Disconnect
ComfyUI Node

⛔ Google Colab Disconnect

Stop burning Colab hours after a run

By StableDiffusionVN·Created 2 years ago·Updated about a month ago· 118
⛔ Google Colab Disconnect
    • status
    modedisconnect_now
    delay_minutes2.0

    If you run ComfyUI on Google Colab, this node saves you money and compute units. Colab bills you for the time the runtime is connected, not the time it's actually generating - so the classic waste is queuing a long batch, walking away, and coming back an hour later to find the GPU sat idle and connected the whole time after it finished. Drop this node at the end of your workflow and it disconnects the Colab runtime once the run completes, either immediately or after a grace period you set.

    It's a purpose-built convenience for the SDVN crowd, who ship their own Colab notebooks for running ComfyUI. If you're not on Colab - local box, a serverless host, your own server - this node does nothing useful for you. That's not a knock; it's just scoped to one very specific environment.

    How it works

    Because it's an output node, it fires when the workflow reaches it. In disconnect_now mode it kills the Colab session the moment execution hits the node. In disconnect_after_delay mode it waits delay_minutes first, giving you a window to grab your outputs or cancel the shutdown before the runtime dies. It returns a short status string so you can see what it did.

    The inputs and outputs that matter

    • mode - disconnect_now (cut the session immediately) or disconnect_after_delay (wait, then cut). Use the delay when you might still be downloading results; use now when it's a fully unattended batch.
    • delay_minutes - how long to wait in delay mode (default 2, up to 10080, which is a full week). A couple of minutes is usually the right amount: enough to save files, short enough to actually free the GPU.

    Output is status (STRING) - a message reporting the action, handy to route into a text/preview node so you have a record.

    The intended placement is at the very end of the graph - after Save Image - so the runtime only shuts down once everything you care about has been produced and written.

    How to install it

    ComfyUI Manager: search SDVN_Comfy_node, install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/StableDiffusionVN/SDVN_Comfy_node
    

    then pip install -r custom_nodes/SDVN_Comfy_node/requirements.txt from your ComfyUI root, and restart. It's under SDVN → Dev.

    Common issues & troubleshooting

    It disconnected before my images saved. Ordering. If the disconnect node runs before your Save Image finishes, you lose the output. Put it last, and use disconnect_after_delay with a couple of minutes of buffer so writes complete first.

    Nothing happens when it runs. You're almost certainly not on Colab. This node talks to the Colab runtime specifically; on a local or non-Colab host there's no session to disconnect, so it's effectively a no-op.

    I wanted to keep working but it killed the session. That's the delay window's whole job - set delay_minutes high enough to react, or don't wire the node into runs you're actively babysitting. It's meant for fire-and-forget batches.

    Does it save compute on comfy.icu or other serverless hosts? No - those already spin the GPU down when your run ends, so there's nothing for this node to do. It's a Colab-only tool.

    Category📂 SDVN/👨🏻‍💻 Dev

    Inputs (2)

    NameTypeDefaultDescription
    modeCOMBOdisconnect_nowNgắt Colab ngay hoặc hẹn giờ ngắt.
    delay_minutesFLOAT2.00–10080Số phút chờ trước khi ngắt khi dùng chế độ hẹn giờ.

    Outputs (1)

    NameTypeDescription
    statusSTRINGTrạng thái thực thi node.