Skip to main content

ComfyUI stuck for hours "installing custom nodes" — the from-source build hang

Also seen as: "ComfyUI stuck installing custom nodes", "llama-cpp-python build hangs", "sam2 install hangs", "pip install never finishes ComfyUI"

Direct answer

How do I fix "a deploy stuck installing custom nodes"?

A ComfyUI startup that hangs at "installing custom nodes" and never reaches model download is usually one custom node triggering a heavy from-source compile. Packages like llama-cpp-python and sam2 build native/CMake code, and with no timeout one doomed compile — or a pip resolver backtrack — blocks the whole install indefinitely.

Key facts

  • iA custom node’s requirements pull a package that compiles from source (llama-cpp-python, sam2, sometimes xformers) with no prebuilt wheel for your environment.
  • ipip’s resolver backtracking through many versions of a hard-to-satisfy dependency.
  • iNo per-step timeout, so a stuck build looks identical to a slow one.

Next step

  1. 1Add --prefer-binary to the pip install so it takes a prebuilt wheel instead of compiling.
  2. 2Wrap each pip call in a timeout (e.g. timeout 600 pip install ...) so a doomed build is killed and the rest proceeds instead of hanging forever.
  3. 3Pin known-source packages to a wheel via a constraints file (e.g. a specific xformers build).
  4. 4On a headless/cloud deploy, prefer an image that bakes the heavy nodes at build time rather than compiling them at boot.

Not a fit when

  • If it is genuinely slow rather than stuck, a big native build can legitimately take 10–20 minutes — check whether the process is actually using CPU before you kill it.

Not sure this workflow will run before you rent a GPU?

Paste your ComfyUI workflow JSON into the free checker — it flags missing nodes, model requirements, and the VRAM/GPU you actually need. No signup.

Other ComfyUI errors

Frequently Asked Questions

What causes "a deploy stuck installing custom nodes" in ComfyUI?

A custom node’s requirements pull a package that compiles from source (llama-cpp-python, sam2, sometimes xformers) with no prebuilt wheel for your environment.

How do I fix "a deploy stuck installing custom nodes"?

Add --prefer-binary to the pip install so it takes a prebuilt wheel instead of compiling. Wrap each pip call in a timeout (e.g. timeout 600 pip install ...) so a doomed build is killed and the rest proceeds instead of hanging forever.