Spark-comfyui, a self-healing ComfyUI setup for DGX Spark

Hi all!
So, I got tired of my ComfyUI install on the Spark silently breaking every time a custom node pulled in the wrong torch, so I ended up writing a script around the whole lifecycle: install, run, update, plus a doctor command that checks everything.

So what does it contain currently?

One script for the whole lifecycle: install, run, stop, update, doctor, status, tune, service

  • PyTorch cu130 for aarch64, verified and auto-repaired before every launch if a custom node swapped in a CPU build
  • SageAttention compiled natively for sm_121
  • GPU onnxruntime so DWPose/ControlNet preprocessors don’t silently run on CPU
  • Patches ComfyUI’s get_free_memory to read the unified pool - fixes the 5-15x offload slowdown when vLLM or another CUDA process shares the GPU
  • Live check that NVFP4/FP8 quantization actually runs on comfy-kitchen’s fast CUDA backend
  • Optional patch list to ride unmerged ComfyUI PRs or fork branches, rebuilt cleanly on every update
  • Everything installs next to the script, safe to re-run, ComfyUI-Manager configured automatically
  • Lot’s more - check the repo…

I’ve only got one unit to test on, so I’d really appreciate people trying it out and giving some feedback!

It’s now at 1.4.

Most of the work went into doctor, on the theory that everything on this machine fails silently. It now detects per-call SageAttention fallbacks…

  • ComfyUI catches kernel errors per attention call and quietly uses PyTorch attention instead, so a working build can still fall back at runtime; this includes the missing python3.x-dev case discussed here recently, and the dev headers are checked directly too.
  • It detects the stuck-clock state some units get after an OOM or power event (SM pinned at 513-721 MHz, no throttle reason; clocks idle low by design, so the check runs a short matmul and samples under load β€” only a power cycle clears it).
  • And it verifies NVFP4 with a forced kernel run rather than trusting the backend listing, because ComfyUI falls back to a much slower pure-PyTorch path with nothing surfaced.

Also fixed along the way a bug where the patch-revert path could restore stale upstream code after several updates, and run now sets TRITON_PTXAS_PATH so triton.jit() custom nodes don’t hit β€œno kernel image” on sm_121 (triton-lang/triton#10331).

Lastly β€œstatus --watch” went from bare log lines to a live dashboard, redrawn in place:

temp          44Β°C   β–β–β–β–β–ƒβ–ƒβ–…β–‡β–‡β–†β–ˆβ–ˆβ–ƒβ–ƒβ–ƒβ–ƒβ–ƒβ–ƒβ–ƒβ–ƒ  39–59
power       10.72W   β–β–β–β–‚β–ƒβ–„β–…β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–β–β–β–β–β–β–β–  10.27–73.88
sm clk     2411MHz   β–β–β–β–ƒβ–‡β–‡β–ˆβ–‡β–‡β–‡β–†β–†β–‚β–‚β–‚β–‚β–‚β–‚β–‚β–‚  2398–2463
gpu             0%   β–β–β–β–β–†β–†β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–β–β–β–β–β–β–β–  0–96
unified      23.7G   β–β–β–‚β–ƒβ–…β–‡β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  4.9–24.3  of 122G
cpu             0%    β–‚β–ˆβ–†β–†β–ˆβ–ˆβ–†β–†β–†β–†β–†β–ƒβ–β–‚β–β–‚β–‚β–‚β–  0–9

/Cheers

For those running ComfyUI on the DGX Spark with spark-comfyui: the status --watch command got a slight upgrade.. If you already have spark-comfyui installed, you get all of this with one command:

./spark-comfyui.sh update

The tool updates itself first, then ComfyUI and its dependencies, and self-heals anything a custom
node broke along the way.

What the watch does now:

  • Live sparkline timeseries for GPU temp, power, SM clock, util, unified memory, CPU and disk I/O, heat-colored by value.

  • Quiet when healthy: rows for throttle flags, swap and generation telemetry only appear when they have something to say. Idle is seven rows.

  • Generation telemetry straight from ComfyUI’s stock API: gen duration, live it/s, queue-to-saved latency, queue depth, node-cache hit rate.

  • A session: summary line made for A/B testing. It aggregates every gen that finishes while the watch runs: first gen (includes model load), steady average with min/max, mean it/s. Start one watch per condition (a flag, a clock cap, a co-resident LLM) and compare the lines.

        ─ GENERATION Β· SageAttention ─────────────────────────────────
        gen         12.6s            β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–β–β–β–β–β–β–β–β–β–  12.5–15.6 ~13.4 at 07:52:43
        it/s         0.79        ▁▃▃▄   β–ˆβ–ƒβ–ƒβ–„    β–ˆβ–ƒβ–ƒ     0.4–1.36 ~0.79
        latency       10s            β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–…β–…β–…β–…β–…β–…β–…β–β–β–  10–16 ~12.3
        queue           0    β–β–β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–β–β–β–ˆβ–ˆβ–ˆβ–ˆβ–β–β–β–β–ˆβ–ˆβ–ˆβ–β–β–  0–1 ~0.34
        hit rate      67%            β–β–β–β–β–β–β–β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  0–67 ~49.6
        session: 3 gens Β· first 15.6s Β· steady ~12.6s (12.5–12.6) Β· ~0.79 it/s
    

Every sample also lands in thermal_monitor.log, including per-process GPU memory.

New here? Clone the repo and run

./spark-comfyui.sh install

Feedback more than welcome!

spark-comfyui update: backup, restore and reset

For those running ComfyUI on the DGX Spark with spark-comfyui: v2026.07.16 - You can now rebuild a broken install without losing anything, and move your whole setup to a fresh Spark with one small file plus an rsync of your models.

If you already have spark-comfyui installed, you get all of this with one command:

./spark-comfyui.sh update

The tool updates itself first, then ComfyUI and its dependencies.

What’s new:

  • reset: your install rotted (a custom node wrecked the venv, things stopped making sense). This deletes ComfyUI, the venv and SageAttention and reinstalls from scratch, while your models, workflows, settings, inputs, outputs and custom nodes are held aside and put back afterward.
  • backup: archives workflows, settings, inputs, config files, your custom-node set and a manifest of every model file. Models themselves are never archived:
./spark-comfyui.sh backup
  • restore FILE: rebuilds from an archive. Installs first if ComfyUI is missing, merges your state back, re-clones custom nodes at their exact pinned commits, reruns the self-healing mod pass, then prints exactly which model files are missing and their sizes so you know what to re-download or rsync.
  • doctor now shows your newest backup and its age in every health check.

Moving to a new Spark: clone spark-comfyui on the new machine, copy the backup archive, rsync your models directory, run restore. Done…!

/Cheers!

spark-comfyui 2026.07.18: hardening release

This release contains no new features. It consolidates thirteen robustness and security
fixes identified during a systematic review of the codebase. Existing installations upgrade:

./spark-comfyui.sh update

The updater now handles the case where an upstream ComfyUI commit modifies a file that a Spark mod has patched. Patched files are returned to their stock state immediately before syncing and the patches are re-applied afterwards, so updates proceed cleanly regardless of which files upstream changes. User modifications to ComfyUI files are not affected. In addition, update --rollback now re-applies the GB10 patches after rolling back…

The community GPU onnxruntime wheel is now pinned by its sha256 checksum. pip verifies the archive before installation, so any change to the hosted file results in a clear failure rather than a silent install.

tune --persist now retains a previously persisted clock cap when invoked without --clock-cap. Systems that rely on the cap to prevent overcurrent restarts keep that protection across reconfiguration. tune also validates the --clock-cap value up front.

status --watch rotates thermal_monitor.log once it exceeds 50 MB.

/Cheers

I’m getting an error when installing:
Successfully installed MarkupSafe-3.0.3 cuda-bindings-13.0.3 cuda-pathfinder-1.2.2 cuda-toolkit-13.0.3.0 filelock-3.29.0 fsspec-2026.4.0 jinja2-3.1.6 mpmath-1.3.0 networkx-3.6.1 numpy-2.4.4 nvidia-cublas-13.1.1.3 nvidia-cuda-cupti-13.0.85 nvidia-cuda-nvrtc-13.0.88 nvidia-cuda-runtime-13.0.96 nvidia-cudnn-cu13-9.20.0.48 nvidia-cufft-12.0.0.61 nvidia-cufile-1.15.1.6 nvidia-curand-10.4.0.35 nvidia-cusolver-12.0.4.66 nvidia-cusparse-12.6.3.3 nvidia-cusparselt-cu13-0.8.1 nvidia-nccl-cu13-2.29.7 nvidia-nvjitlink-13.2.78 nvidia-nvshmem-cu13-3.4.5 nvidia-nvtx-13.0.85 pillow-12.2.0 setuptools-78.1.0 sympy-1.14.0 torch-2.13.0+cu130 torchaudio-2.11.0+cu130 torchvision-0.28.0+cu130 triton-3.7.1 typing-extensions-4.15.0
[error] mod β€˜20-torch-repair’ failed (critical) β€” see the output above for
details. This step is required; fix the underlying issue and re-run: ./spark-comfyui.sh update

I run ./spark-comfyui.sh doctor and get this:user1@gx10:~/projects/comfyui/spark-comfyui$ ./spark-comfyui.sh doctor
__ __ _
_________ _
_ / / ________ ____ __ / _/ __ __()
/ / __ / __ / ___/ //_/_____/ ___/ __ \/ __ / // / / / / / / /
( ) // / // / / / ,< /___/ // // / / / / / / / // / // / /
// .
/_,// //|| _/_// // /// _, /_,//
/
/ /_
_/
v2026.07.18 β€” ComfyUI on the NVIDIA DGX Spark (GB10 Grace Blackwell)

== spark-comfyui (self) ==
[info] git revision 606848a
[info] Backup: none in backups/ (run: ./spark-comfyui.sh backup)
[info] up to date with the published repo

== PyTorch / GPU (CPU-shadow check) ==
torch 2.13.0+cu130 | compiled CUDA 13.0
Traceback (most recent call last):
File β€œβ€, line 4, in
AssertionError
[FAIL] torch is CPU-only or wrong CUDA β€” a custom node likely re-pinned it.
Fix: ./spark-comfyui.sh update (repairs torch automatically)
[PASS] pip dependency graph is consistent
[info] (ignored benign aarch64 platform-metadata notice for nvidia-*-cu13)

== SageAttention (pip-shadow + kernel-image check) ==
[FAIL] marker missing β€” β€˜run’ will NOT pass --use-sage-attention. Fix: ./spark-comfyui.sh update
[FAIL] sageattention not importable β€” Fix: ./spark-comfyui.sh update

This is a new machine. Only thing I installed was Ollama and some attempts to install ComfUI using the instructions in the playbook.

Hey!
Thanks for helping me test this! So, the install itself worked and the correct CUDA 13 torch wheel is in place. The failing check means torch cannot initialize the GPU at the driver level. That is a host problem, not something in the venv, which is why the tool stops rather than continuing with a CPU-only install. The SageAttention lines in doctor are just fallout: that step never ran because the install stopped early, which I need to look in to.

I’ve made a a small release - as of v2026.07.19 the tool prints the actual CUDA error instead of the bare AssertionError you saw. Please update and run doctor again:

./spark-comfyui.sh update
./spark-comfyui.sh doctor

The update will stop at the same torch step, but this time the doctor output will include diag lines
naming the real cause - hopefully!. Post that output here, along with the output of:

nvidia-smi

I suspect the cu130 torch wheels require an NVIDIA driver from the 580 series or newer. The
top line of nvidia-smi should say CUDA Version 13.0. Since you’re on a new machine, the factory image might not have had its first system update, and thus shipped with an older driver. If nvidia-smi reports a CUDA version below 13.0, run the system update (sudo apt update && sudo apt full-upgrade, then reboot) and re-run ./spark-comfyui.sh update.

Let’s see!
/Cheers

spark-comfyui is now fully containerized

This is the roadmap I’ve been targeting and the previous script with (cu130 torch, native sm_121 SageAttention, GPU onnxruntime, the Spark mods) is now part of one hardened docker image, for ease of maintenance and reproducibility… And your own content stays in a plain data/ directory next to the script, bind-mounted in.

Fresh installs:

git clone https://github.com/bjarkebolding/spark-comfyui.git
cd spark-comfyui
./spark-comfyui.sh install
./spark-comfyui.sh run

/Cheers

Alright! Here goes a few updates to spark-comfyui since I last posted.

You can now point the tool at a specific mounts file, so using various configurations are kept tidy…


./spark-comfyui.sh --mounts ./nas-profile.conf run

./spark-comfyui.sh --mounts ./local-profile.conf status   # see what it resolves

Apart from that, startups have been made faster as the entrypoint now installs all custom-node requirements in one pip pass and skips the step entirely when nothing changed since the container last started.

The doctor now flags a stale image as it compares the current image against upstream ComfyUI master and tells you if a rebuild would pick up new commits.

Edit - forgot to mention that the defaults mounts conf can be found as:
spark-mounts.conf

# spark-mounts.conf β€” where the container finds your content.
# Uncommented lines are KEY = PATH. Relative paths resolve against this
# file's directory. Without overrides everything lives under data/ next to
# the script. 'container status' always shows the resolved table.
#
# Per-entry overrides (keys match the content set exactly):
# models = /mnt/fast-ssd/models
# output = /mnt/nas/comfyui-output
# user = data/user
# input = data/input
# custom_nodes = data/custom_nodes
# extra_model_paths.yaml = data/extra_model_paths.yaml
#
# Additional bind mounts, repeatable: HOST:CONTAINER[:ro]. The container
# path must be under /opt/ComfyUI and the host path must already exist.
# Pair extra model locations with entries in extra_model_paths.yaml, which
# sees the CONTAINER paths:
# mount = /mnt/nas/sdxl-models:/opt/ComfyUI/models/nas:ro

/Happy friday!

Thank you for great work.

MiniMax H3 runs optimized on Spark-ComfyUI

A few updates..
The new MiniMax H3 workflows run on spark-comfyui exactly as they ship, no porting and no flag changes. Here is a test from this afternoon:

That graph holds four models resident at once, a 32B NVFP4 AWQ text encoder next to an int8 video UNET and two VAEs, a NVFP4 rides along for free, since comfy-kitchen is a stock ComfyUI dependency and its fast native cuda backend only needs torch built against CUDA 13 or newer, and the box barely notices:

Above was captured by running:

./spark-comfyui.sh status --watch 1

This release also moves custom node requirement installs to uv with pip as fallback, raises the /dev/shm default to 16g for the bus errors the unified fabric makes routine, and repairs the sm_121 onnxruntime wheel automatically.

Two follow-ups for anyone who read my earlier ACE-Step thread. What actually creates the lip sync there is encoding the song window to audio latents and pinning them with SetLatentNoiseMask and a SolidMask of value zero, so the sampler never denoises them and LTX-2.3 has to generate video that matches the audio rather than inventing its own. - And the --bf16-vae breakage is still live on current master, so keep --no-bf16-vae for LTX-2.3 audio, and only for that, since MiniMax’s audio VAE casts properly on decode and needs nothing.
See the full test video here, from a single simple workflow:

/Cheers

Just ran this on my asus ascent gx10. It works beautifully! Thanks!

The only issue I had was that the .sh files in the container folder were missing the execute flag for me, which caused an permission error on my first run attempt. But after a quick chmod and a spark-comfyui update all was fine :)

I can confirm that MiniMax-H3 just works out of the box (with the downloaded models files of course).

Hey, and thanks!

I looked into to bug you reported and those files have been mode 100755 in git since they were committed, so a plain git clone gives you the execute flag and this will not happen. However, it gets lost if the tree arrives some other way, for example a downloaded ZIP or tarball unpacked by a tool that drops modes, or a copy from another machine that did not preserve permissions… can you confirm not using git clone to download the tree?

That said, I can work around that challenge and made a small fix :) In fact the container/entrypoint.sh is the only file in the build whose mode is essential, as you discovered, because it is the container’s entry point and gets exec’d directly. The other two scripts run through bash and would work at any mode.

As of 2026.08.05 the image now sets the bit itself at build time, so it no longer inherits anything from your disk, and doctor now checks the entry point explicitly.

Good to have MiniMax-H3 confirmed working on the Ascent GX10, that is the first report I have from that box. :)

/Cheers!

That was it. I did the git clone on another machine (windows) and copied the files over so that explains the missing execute flag. Pretty much just user error :), but it’s good to have the fix just in case. Thanks!

spark-comfyui: recipes

New in v2026.08.05.2

Frankly, this is still beta - but sharing a workflow usually means also listing which models it needs, where each one goes, and where to get them. A recipe puts that in one JSON file together with the workflow, so the tool can do it… wouldn’t that be great?

$ ./spark-comfyui.sh recipe show image_krea2_turbo_t2i

== image_krea2_turbo_t2i ==
  name:        Krea-2 Turbo text-to-image
  description: Stock ComfyUI Krea-2 Turbo template. A fast distilled text-to-image
               model, organised as a subgraph, with the krea2_darkbrush style LoRA.
  workflow:    6 nodes
  model:       loras/krea2_darkbrush.safetensors (448M)
  model:       diffusion_models/krea2_turbo_fp8_scaled.safetensors (13G)
  model:       text_encoders/qwen3vl_4b_fp8_scaled.safetensors (4.9G)
  model:       vae/qwen_image_vae.safetensors (243M)

  4 model(s), 18G total
./spark-comfyui.sh recipe check NAME       what is missing, downloads nothing
./spark-comfyui.sh recipe install NAME     fetch models, add nodes, load the workflow
./spark-comfyui.sh recipe capture "NAME"   author one from a workflow you already run

capture reads the workflow, finds each model on your disk relevant for it, and fills in the destination, size and sha256. You add the URLs and a description. The sha256 should be published by the hosting site already: HuggingFace has lfs.sha256 at /api/models/<repo>?blobs=true, CivitAI has files[].hashes.SHA256.

Looking for testers

I’ve created a test recipe for the stock ComfyUI Krea-2 Turbo template, so nothing exciting - but as a proof of concept. Going forward, these recipes should contain relevant information like run flags and custom-nodes; making a recipe reproducible.

Recipes live in recipes/ next to the script and are tracked in the repo, so update brings any new ones with it. To try someone else’s, save their JSON into that directory and it turns up in recipe list - or share your JSON here.

/Cheers

Excellent repo, highly recommend for anyone working with ComfyUI.

Can tell lots of love and sweat put into the scripts, which makes our life easier…

I am very grateful for the work you have done. This has make using ComfyUI on my ASUS Ascent GX10 so easy. Thank you.

Hey! -Thanks for checking out the repo and taking the time to share your feedback! I’m happy to hear it’s making your ComfyUI workflows easier to manage and maintain!

I haven pushed much lately - primarely because it seems we’re currently sitting on a very stable build… it’s super efficient, and haven’t hit any bugs so far. That said, if you run into any edge cases or have suggestions as you keep using it, feel free to drop them here or open an issue!

I tried to set this up on my GX10 and ran into an issue:

The default first UID is 1000, so this repo ends up working right out of the box for most users since the UID used within the docker container is 1000.

In my case, I was setting up 2x DGX spark and didn’t know that the username was supposed to be the same across all the sparks in a cluster, so I ended up having to create a second user across both of my sparks, which caused my main host UID to be 1001 instead

The causes ./spark-comfyui.sh run to fail because of permission errors in the docker container

I got it to work by adding --build-arg UID="$(id -u)" \ to the docker build command here: spark-comfyui/spark-comfyui.sh at main Β· bjarkebolding/spark-comfyui Β· GitHub

Also it seems like the UID 1000 appears to be hardcoded in the Dockerfile itself: spark-comfyui/container/Dockerfile at main Β· bjarkebolding/spark-comfyui Β· GitHub which leads to the build-cache mount not being owned by the current host user as well, which could be fixed by manually clearing the cache after each rebuild

Other than that it worked flawlessly after fixing these up, appreciate your efforts!

P.S. On a side note, I tried to create an issue but it seems to be blocked in the GH repo

You rock - and thanks for testing!

Fixed in v2026.08.23, though not with the build arg. The image bakes no uid at all now. It runs as whoever launched it (--user "$(id -u):$(id -g)" --group-add 0) and the image trees are group-0 writable. That also stops the cache volume needing a clear, and keeps :previous and keep-* images usable across users.

./spark-comfyui.sh update
sudo chown -R "$(id -u):$(id -g)" data/   # once, for files the old image wrote as uid 1000

…I could not test on a real non-1000 account, so a confirmation from your GX10 would help.

/Cheers!