Nodes/ComfyUI-HMT-Suite/Update ComfyUI
ComfyUI Node

Update ComfyUI

Update ComfyUI core from inside the graph — and watch it bounce itself

By tuyenhm68·Created 8 months ago·Updated 28 days ago· 1
Update ComfyUI
    • status
    • message
    confirm_updatefalse
    stable_versiontrue
    auto_restarttrue
    restart_delay3

    Normally updating ComfyUI means git pull in a terminal, or clicking through Manager's update flow, then restarting and hoping nothing broke. HMT_UpdateComfyUI does the whole job as a node: it pulls the latest code, checks out the stable release if you want it, reinstalls requirements, and optionally restarts the server itself. Queue it, walk away, come back to a fresh ComfyUI.

    The interesting bit is how it updates. Instead of shelling out to git, it uses pygit2 - the same library ComfyUI's own update.py uses. That matters because it's what makes the node work in portable installs where the git binary situation is a mess. It's from the HMT Suite pack, sitting alongside the pack's other utils.

    How it works

    The update sequence is borrowed from ComfyUI's official updater, and it's defensive on purpose:

    1. Stash any local changes in the ComfyUI repo so the pull doesn't collide with them.
    2. Create a backup branch named backup_YYYYMMDD_HHMMSS - your escape hatch.
    3. Check out the default branch and pull latest.
    4. If stable_version is on (the default), check out the newest vX.Y.Z tag instead of riding the bleeding edge.
    5. Reinstall requirements.txt from core.

    It reports back the new commit hash (first 8 chars) and whether anything actually changed.

    Inputs and outputs

    • confirm_update - default false, and everything is gated on flipping it to true. Same safety-latch pattern as the pack's Restart node.
    • stable_version - true = latest tagged release (recommended), false = the tip of the development branch. If you're not living on the dev edge on purpose, leave this on.
    • auto_restart - bounce the server when the update lands.
    • restart_delay (optional) - how long to wait before that bounce, default 3 seconds.

    Two outputs: status (success/cancelled/error) and message with the result. That's it - read it, don't wire it.

    Install - read the gotcha first

    Standard HMT Suite install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/tuyenhm68/ComfyUI-HMT-Suite.git
    cd ComfyUI-HMT-Suite
    pip install -r requirements.txt
    

    Here's the trap: the pack's requirements.txt only lists requests. pygit2 is not in it. The first time you run this node you'll get "pygit2 is not installed" and a hint to install it. Do that manually:

    pip install pygit2
    

    On Windows portable, make sure it's installed into the embedded Python (ComfyUI_windows_portable\python_embeded\python.exe -m pip install pygit2), not your system Python - otherwise the node imports the wrong environment and still fails. This is genuinely the most common reason people hit an error with the two HMT updater nodes.

    Common issues

    • "Merge conflicts detected" - you had local edits to core files that couldn't be merged. The node cleans up state and reports the conflicting paths; that's your cue to check whether you actually need those edits.
    • Auto-restart kills your session - same caveats as the Restart node: save your workflow, in-progress jobs get cancelled, and if the restart fails check the terminal you launched from.
    • Nothing updates - the backup branch is created but if the repo is already at the target, the message tells you so. That's a feature: re-running the node is cheap.

    One more honest word: a backup branch is a safety net, not a snapshot. If you want to actually revert an update cleanly, Manager's snapshot feature is the better tool. But for "update core without opening a terminal," this node does exactly what it says.

    CategoryHMT Suite/Utils

    Inputs (4)

    NameTypeDefaultDescription
    confirm_updateBOOLEANfalse
    stable_versionBOOLEANtrue
    auto_restartBOOLEANtrue
    restart_delayoptINT30–10

    Outputs (2)

    NameTypeDescription
    statusSTRING
    messageSTRING