Script Your ComfyUI Setup So It Rebuilds Itself

Back
Team Aquanode

Team Aquanode

Sarthak Vaish

AUGUST 20, 2026

If your ComfyUI setup process is "open the Manager, search for eight node names, click Install eight times, wait, hope nothing conflicts," that process does not survive a rented GPU. You do it once on your own machine and never again. On a cloud box you do it every time you rent, which means it needs to be a script, not a set of clicks. comfy-cli, the official command-line tool from the ComfyUI team, is built for exactly that: every install, update, and snapshot action Manager's UI exposes has a scriptable equivalent, several with a --json output mode built for wiring into automation rather than being read by a person.

This is what a genuinely scripted ComfyUI setup looks like: the install command, the node list, the model downloads, and the one flag that catches a dependency conflict before it bricks the box instead of after.

TL;DR: comfy install -y installs ComfyUI headlessly, comfy node install <id> <id> ... installs a whole node list in one non-interactive call using each node's lowercase Comfy Registry ID, and comfy model download --url <URL> pulls checkpoints and LoRAs from CivitAI or Hugging Face by URL. Add --uv-compile (needs ComfyUI-Manager v4.1+) and the install cross-checks every node's dependencies against every other node's before anything breaks, instead of after. None of this makes the setup persistent on its own — a script still re-downloads everything on a fresh box. What it does is turn a 40-minute manual process into a repeatable one, so the same script gets you back to a known state on any provider.

Install ComfyUI itself, non-interactively

pip install comfy-cli
comfy install -y

comfy install sets up ComfyUI and ComfyUI-Manager together. The -y flag, exposed on comfy setup's wizard, is what makes this safe to run from a provisioning script instead of an interactive terminal, per the tool's own docs: "Pass -y for non-interactive (CI/scripted) installs." Add --fast-deps to resolve the initial dependency set with uv instead of pip, which matters here specifically because the initial ComfyUI + Manager install is the one dependency resolution you cannot skip, and it is faster to do it once with a real resolver than to wait on pip's.

Install a node list in one call

comfy node install comfyui-manager comfyui_ipadapter_plus \
  comfyui-animatediff-evolved comfyui_controlnet_aux \
  comfyui-videohelpersuite comfyui-impact-pack \
  comfyui-reactor was-node-suite-comfyui

comfy node install takes one or more node IDs and installs them through ComfyUI-Manager's cm-cli backend, which is what resolves dependencies. One documented trap: the argument has to be the node's Comfy Registry ID, which is lowercase, not the GitHub repository's casing. Passing ComfyUI-Impact-Pack instead of comfyui-impact-pack fails with Node 'ComfyUI-Impact-Pack@unknown' not found, per the tool's own docs. It is an easy typo to make copying a repo name straight from GitHub, and the failure mode doesn't say "wrong case," it says "not found," which reads like the node doesn't exist. Find the exact ID on the node's Comfy Registry page or via comfy node show all, and see our node reference guide for the IDs of eight of the most common packs.

There is a second install path, comfy node registry-install <id>, that talks to the Comfy Registry directly instead of going through Manager, and does not require Manager to be present. It only accepts --force-download, none of the flags below, so for anything you want conflict-checked, use comfy node install.

The flag that catches the fight before it happens

Our node reference guide walked through a real conflict: WAS Node Suite pins opencv-python-headless<=4.7.0.72 while VideoHelperSuite asks for plain, unpinned opencv-python, and both provide the same cv2 import. That is precisely what --uv-compile exists to catch. It requires ComfyUI-Manager v4.1+, and instead of installing each node's dependencies one at a time with pip, it delegates to Manager's unified resolver, which batch-resolves every custom node's requirements together via uv pip compile with cross-node conflict detection, per the tool's docs, identifying "which node packs have incompatible dependencies and why."

comfy node install comfyui-impact-pack was-node-suite-comfyui \
  comfyui-videohelpersuite --uv-compile

Run standalone against an already-installed node set with comfy node uv-sync. This does not make conflicting packages compatible, nothing can do that if two packages genuinely require different versions of the same library, but it turns a runtime import error discovered mid-generation into an install-time error with the two offending packages named, which is the difference between debugging a graph and debugging an environment.

Bring the models with you

Node installs are the fast part. The rest of this cluster covers why the model side is the expensive part, and comfy-cli scripts that too:

comfy model download --url https://civitai.com/api/download/models/128713 \
  --relative-path checkpoints --set-civitai-api-token $CIVITAI_API_TOKEN

--url accepts a CivitAI page, a Hugging Face file URL, or a direct link. Tokens can come from --set-civitai-api-token / --set-hf-api-token, from the CIVITAI_API_TOKEN / HF_API_TOKEN environment variables, or from a previously stored config value, in that priority order, and per the docs, env-var tokens "are never stored persistently in your config file" — the right way to hand a provisioning script a credential without baking it into a file that ends up in a snapshot.

What this script still doesn't fix

Put the three pieces together, comfy install -y, a comfy node install call with --uv-compile, and a handful of comfy model download calls, and you have a real provisioning script: one file, checked into version control, that takes a bare cloud GPU to a working ComfyUI in one non-interactive run. That is a genuine improvement over clicking through Manager by hand, and if you're setting up a box today, write this script before you need it a second time.

What it does not do is make the box remember anything. Every run downloads the same node repos and the same tens of gigabytes of models again, because the script describes how to reach the state, it doesn't preserve the state itself, the exact gap our reinstall-every-session piece covers for the manual version of this same problem. A good provisioning script turns a rebuild from 40 minutes of clicking into 10 minutes of waiting on downloads. It does not turn it into zero.

The way to actually get to zero is to stop rebuilding at all: snapshot the box once the script has run, custom_nodes cloned and resolved, models sitting in models/checkpoints, and restore that snapshot on the next box instead of re-running the script. That's what workspace backups do on Aquanode, a point-in-time capture of the directories you name, restorable on a different GPU or a different provider. Keep the script for the first box and for disaster recovery. Use the snapshot for every box after that.

About the author

I'm Sarthak, and I work on the product side at Aquanode. I tested every command in this post against comfy-cli's own documentation and the Comfy Registry API rather than a secondhand tutorial, because a copy-pasted flag that doesn't exist is worse than no flag at all when you're scripting something that runs unattended on a box you're paying for by the hour.

Sources

#comfyui#comfy-cli#custom nodes#cloud gpu#automation#stable diffusion
Ready when you are

Stop paying for
idle GPUs.

Sign up in 60 seconds. Pay only for the GPU minutes you actually use.

© 2026 Aquanode. All rights reserved.

All trademarks, logos and brand names are the property of their respective owners.