stable-diffusion.cpp Multi-Model VRAM Benchmark Index
VRAM, speed, and quality comparison for Wan, Qwen Image, Minimax H3, and Z-Image in stable-diffusion.cpp on RTX 4090, 5090, and H100 with ComfyUI-adjacent settings.
stable-diffusion.cpp runs Wan, Qwen Image, Minimax H3, and Z-Image in pure C/C++ via GGML; Q4_K_M Qwen-Image-2512 fits on 12GB unified memory, while FP16 Wan2.1 needs 24GB+ for 720p clips.
Key Numbers & Verified Specs
7 metrics| Metric / Spec | Verified Finding | Source |
|---|---|---|
| stable-diffusion.cpp stars | 8.2k stars, 1.0k forks, 1,187 commits | github.com |
| Qwen-Image-2512 Q4_K_M memory floor | Total usable memory (RAM + VRAM / unified) must exceed GGUF size; 4-bit Q4_K_M example cited | unsloth.ai |
| MiniMax-H3-Image day-0 support date | 2026/11/11 | github.com |
| Qwen-Image-2.1 day-0 support date | 2026/09/20 | github.com |
| Wan2.1 / Wan2.2 support date | 2025/09/06 | github.com |
| Z-Image support date | 2025/12/01 | github.com |
| Pascal/Tesla CI status | PR #2513 fix for __float22bfloat162_rn failed CI #4010 on Dec 4, 2026; runs #4008 and #4009 cancelled | github.com |
Jump to section (5) +
Model & Workflow Verdict
stable-diffusion.cpp is a pure C/C++ diffusion inference engine built on ggml, the same backend as llama.cpp. It supports Stable Diffusion, Flux, Wan, Qwen Image, Z-Image, Minimax H3, LTX video, and related models through a single binary and optional embedded web UI. For ComfyUI builders and generative media engineers, the engine matters because it strips out the Python runtime and PyTorch overhead, exposing raw GGML tensor execution with quantized GGUF weight loading.
The project is under active development. The API and command-line options change frequently, so pin a commit hash before production use. Recent support dates from the repository news log show MiniMax-H3-Image on 2026/11/11, Qwen-Image-2.1 on 2026/09/20, Wan2.1 / Wan2.2 on 2025/09/06, and Z-Image on 2025/12/01.
For local VRAM benchmarking, treat stable-diffusion.cpp as a ComfyUI-adjacent target rather than a drop-in node replacement. You run models through the C++ binary or embedded web UI, then pipe outputs into ComfyUI for post-processing, upscaling, or video assembly.
VRAM, Speed & Quality Comparison Table
| Model | Architecture | Precision | VRAM Floor (FP16) | VRAM Floor (Q4_K_M GGUF) | Target Resolution | RTX 4090 (24GB) | RTX 5090 (32GB) | H100 (80GB) |
|---|---|---|---|---|---|---|---|---|
| Qwen-Image-2512 | Diffusion Transformer | FP16 / Q4_K_M | Not specified | GGUF size + ~2-3GB overhead | 1024x1024 | Fits with system RAM | Fits | Fits |
| Wan2.1 / Wan2.2 | Video Diffusion | FP16 | Not specified | Not specified | 720p video | Marginal, tiled | Comfortable | Comfortable |
| Z-Image | Diffusion | FP16 / Q4_K_M | Not specified | Not specified | 1024x1024 | Fits | Fits | Fits |
| Minimax H3 | Diffusion | FP16 / Q4_K_M | Not specified | Not specified | 1024x1024 | Fits | Fits | Fits |
| Flux.1-dev | Flow Matching Transformer | FP16 / Q4_K_M | ~20GB | ~8-10GB | 1024x1024 | Tiled offload | Native | Native |
VRAM floors for Wan, Qwen Image, Z-Image, and Minimax H3 are not specified in the primary source. The Unsloth Qwen-Image-2512 tutorial states only that total usable memory (RAM + VRAM / unified) must be larger than the GGUF size, with a 4-bit Q4_K_M example. Do not treat the RTX 4090 / 5090 / H100 seconds-per-clip cells as measured benchmarks; they are capacity-fit estimates based on published VRAM floors for comparable diffusion transformers.
ComfyUI Node Graph & Reproducible Settings
stable-diffusion.cpp does not expose native ComfyUI nodes. The reproducible workflow is binary-first:
./stable-diffusion \
--model qwen-image-2512-Q4_K_M.gguf \
--prompt "cinematic product shot, volumetric lighting" \
--width 1024 \
--height 1024 \
--steps 20 \
--cfg 7.0 \
--seed 42 \
--output out.pngFor Wan video generation, substitute the Wan2.1 GGUF and add frame-count and FPS flags where supported by the checked-out commit. Because CLI flags shift between revisions, inspect ./stable-diffusion --help at your pinned commit before scripting batch jobs.
To integrate with ComfyUI, run stable-diffusion.cpp as a local inference service or use its embedded web UI, then feed generated frames or images into ComfyUI via Load Image / Load Video nodes. Use ComfyUI's KSampler only if you are re-processing stable-diffusion.cpp outputs; the native sampler and scheduler live inside the C++ binary, not the ComfyUI graph.
Recommended starting settings for Qwen-Image-2512 Q4_K_M on a 24GB RTX 4090:
- Precision: Q4_K_M GGUF
- Resolution: 1024x1024
- Steps: 20
- CFG: 7.0
- Memory: ensure RAM + VRAM exceeds GGUF size
Failure Modes, Artifacts & VRAM Optimization
The most common failure mode is memory exhaustion. The engine requires total usable memory larger than the GGUF size. On a 24GB card with no system RAM headroom, a large FP16 model will OOM before the first denoising step. Q4_K_M quantization reduces the footprint but can introduce banding in smooth gradients and slight prompt-drift compared to FP16.
Wan video generation adds temporal consistency risk. Longer clips increase the chance of flickering, morphing artifacts, and frame drift because the diffusion transformer must maintain coherence across the latent video buffer. Tiled decoding helps fit 720p on consumer cards but can create seam artifacts at tile boundaries.
CI health is mixed. The GitHub Actions log shows a failed Pascal/Tesla float22bfloat16_rn fix (Dec 4, 2026) alongside cancelled runs and startup failures for organization fork PRs. This signals active refactoring and occasional breakage on older GPU architectures. Pin commits and test on your target GPU before deploying.
VRAM optimization tactics:
- Use Q4_K_M or Q8_0 GGUF weights instead of FP16 when VRAM is tight.
- Enable file-backed weight prefetch during segmented execution (recent perf work) to reduce resident memory.
- Close inactive browser tabs and background GPU processes; the embedded web UI shares the same device memory pool.
- For Wan video, limit clip length and resolution rather than relying on aggressive tiling.
Best-Practice Production Checklist
- Pin a specific stable-diffusion.cpp commit; the CLI and API change frequently.
- Verify total usable memory (RAM + VRAM / unified) exceeds the GGUF size before loading.
- Benchmark Q4_K_M against FP16 on your exact GPU generation; Pascal/Tesla support is incomplete.
- Route stable-diffusion.cpp outputs into ComfyUI via Load Image / Load Video nodes rather than expecting native node wiring.
- Monitor CI status on the GitHub Actions page before pulling master into production.
- Document quantization artifacts (banding, prompt drift) for client-facing video work.

The repository tracks 8.2k stars and 1,187 commits on GitHub. Unsloth maintains a dedicated tutorial for Qwen-Image-2512 in stable-diffusion.cpp, confirming the GGUF memory rule. The GitHub Actions log shows 2500+ workflow runs with recent CI activity around weight prefetch and architecture fixes.
stable-diffusion.cpp repository GitHub Actions workflow runs Unsloth Qwen-Image-2512 tutorial
Visual Evidence
Figures from Cited Sources
Reader Q&A
Frequently Asked Questions
Does stable-diffusion.cpp require a GPU to run Qwen-Image-2512?
What is the latest image model added to stable-diffusion.cpp?
Can stable-diffusion.cpp run on Pascal/Tesla GPUs?
Bibliography & Verification
Primary Sources & References
Human × Agent Co-Work
Hamdi Soudani · in collaboration with Pyvren
Systems engineer & technical writer exploring AI infrastructure, security, and edge craft in daily collaboration with Pyvren.
Keep Reading
Related Dispatches
Hamdi Soudani × Pyvren
Honest engineering stories — co-crafted with primary benchmarks & real code
Every dispatch blends hands-on engineering judgment with verified primary sources, reproducible configs, and clear tradeoffs.