← Back to Leaderboard
Sleejet

leejet/stable-diffusion.cpp

ggml-backed C/C++ engine for local image and video diffusion inference

View on GitHub ↗
LLM Inference EngineQuickstart ↓
Engineering Health (Methodology)
A+ · 96/100
Maintenance Activity
● Updated yesterday
Latest Release
master-1173-95bb623
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption21/25
Release Cadence20/20
License Clarity20/20
Local AICLISelf-HostedGPU
Total Stars
★ 8,183
24h Growth
+4
7d Growth
+42
Forks
1,020

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

leejet/stable-diffusion.cpp Star History (2023-08-13 - 2026-12-03) ALL-TIME STAR HISTORY (2023-08 – 2026-12) +8.1k in 1208d · avg +7/day 8.6k 4.3k 0 2023-08-13: ★ 1052023-10-28: ★ 1,6702024-01-13: ★ 2,0042024-03-30: ★ 2,3542024-06-15: ★ 2,7172024-08-31: ★ 3,0462024-11-16: ★ 3,3782025-02-01: ★ 3,6302025-04-19: ★ 3,9072025-07-05: ★ 4,1002025-09-20: ★ 4,3032025-12-06: ★ 4,6292026-02-21: ★ 5,3352026-05-09: ★ 5,8762026-07-25: ★ 6,5232026-10-10: ★ 7,5902026-12-03: ★ 8,183 ★ 8.2k 2023-08 2025-04 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

stable-diffusion.cpp is a native C/C++ diffusion inference engine built on ggml, rather than a Python or PyTorch application. The repository separates engine code in src/ and headers in include/ from the runnable examples under examples/cli/ and examples/server/. Its two user-facing entrypoints are sd-cli for scripted generation and sd-server for an embedded Web UI.

The CLI example passes a checkpoint with -m and a prompt with -p. The server starts with --model-dir; in the UI, the user selects a model recipe and checkpoint, explicitly loads the model, and then generates from a prompt. Model selection and loading are therefore distinct from issuing a generation request in the UI. For device configuration, the engine distinguishes the backend used for runtime execution from where model parameters are placed.

Key Capabilities & Differentiators

Image coverage extends from SD 1.x, SD 2.x, SDXL and SD3/3.5 to FLUX, Qwen Image and Z-Image. Video coverage includes Wan 2.1/2.2 and LTX releases such as LTX-2.5. Model-specific workflows include Qwen-Image-Edit and DGL ControlNet for Z-Image; those are reasons to choose a particular model path, not features to assume across every checkpoint.

The SD 1.5 example loads a single .safetensors checkpoint, while other models may require weights and additional components specified in their individual model guides. Quantization and RAM/VRAM tuning are covered separately from model selection. Evaluate the exact model variant, components and backend together: a working SD 1.5 smoke test verifies the deployment path, not compatibility or performance for a larger image or video workflow.

Trade-offs & Limitations

Compared with a Python/PyTorch diffusion stack, the native executable is useful when the deliverable is a local runner or small self-hosted service rather than a pipeline developers need to modify in Python. Compared with a managed generation API, it keeps inference on infrastructure you control, but shifts model downloads, storage, device configuration and capacity testing to your team.

A lightweight runtime does not make the weights lightweight. RAM, VRAM and generation time still depend on the model, its components, output settings, backend placement and concurrent load. Treat the embedded UI as a practical generation surface, not evidence of multi-tenant serving features. Verify any required API contract against a pinned build. The engine's MIT license is separate from the terms governing model use and redistribution.

Hardware & Deployment Guide

Start with a prebuilt release binary or build from source using the CMake project. The quick start has Windows PowerShell and Linux/macOS examples. From the build directory, the Unix-style paths are ./bin/sd-cli and ./bin/sd-server; the Windows examples use bin/Release. Download the weights separately into the repository's models/ directory. For the UI, start the server with --model-dir ../models; for a CLI smoke test, pass the SD 1.5 checkpoint with -m and a prompt with -p. A Docker getting-started path is also available.

With the executable and required weights in place, inference can run locally without calling a hosted model API. Provision against the intended model, output settings and concurrency rather than the size of the executable. Recent milestones include MiniMax-H3-Image support and the addition of the embedded Web UI; the latest listed build is master-1170-5544c54. Because interfaces can change frequently, pin the binary and keep a loading and generation smoke test for each model recipe you deploy.

Runtime: ggml-backed C/C++ inference without a Python or PyTorch runtime requirement.
Entrypoints: sd-cli runs prompt-driven jobs; sd-server provides an embedded image and video Web UI.
Models: Supports image families including SDXL, FLUX and Qwen Image, plus video families including Wan and LTX.
Backend placement: Runtime execution and model parameter placement are separate configuration considerations.
Model provisioning: The SD 1.5 example uses one .safetensors checkpoint; other models can require additional components.
Release management: CLI options and APIs can change frequently, so pin builds and validate integrations before upgrading.
Best For

Teams that want diffusion inference on their own machines, with a CLI for scripted jobs or an embedded browser UI for interactive generation, and can validate the exact model and backend before rollout.

Skip If

You need to modify pipelines primarily in Python, want a provider to handle serving and capacity, or require a stable API contract without pinning and qualifying releases.

Reviewed on 2026-12-01 · Grounded in GitHub README, root file tree & releases · Newer release master-1173-95bb623 (2026-12-02) shipped after this reviewMethodology

Quick Start & Installation

Local AICLISelf-HostedGPU
mkdir -p ../models/checkpoints
curl -L -o ../models/checkpoints/v1-5-pruned-emaonly.safetensors https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors

Comparison vs. Top Voice, Vision & Video Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
stable-diffusion.cpp ★8.2k+42C++MITggml-backed C/C++ engine for local image and video diffusion inference
whisper.cpp55.8k+292C++MITNative C/C++ Whisper inference for offline speech-to-text on CPUs and accelerato
stable-diffusion-webui165.4k+65PythonAGPL-3.0Gradio WebUI for local Stable Diffusion generation, editing, and parameter sweep
diffusers35k+36PythonApache-2.0A modular PyTorch SDK for running and customizing multimodal diffusion pipelines

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/leejet/stable-diffusion.cpp.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

leejet/stable-diffusion.cpp Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about stable-diffusion.cpp

How should I integrate the engine into a local workflow?

Use sd-cli for command-line jobs: -m selects the checkpoint and -p supplies the prompt in the SD 1.5 example. For interactive use, run sd-server --model-dir ../models from the build directory and use the embedded Web UI. If an integration depends on a server API, verify its contract in the release you pin rather than assuming compatibility with another inference server.

How much RAM or VRAM should I provision?

There is no single hardware budget across the supported models. Start with the exact model, any separately loaded components and a representative output. Evaluate which backends handle execution and parameter storage, then measure RAM, VRAM and generation time. If you intend to run concurrent jobs, test that load as well; single-job measurements do not establish serving capacity.

Does the MIT license cover commercial self-hosting and model redistribution?

The engine is MIT-licensed, but that license does not grant rights to third-party model weights. Check the terms for the checkpoint and any separately distributed components before commercial use or redistribution. Local inference lets you keep the generation path on your own infrastructure, but does not by itself establish compliance with data-handling or model-license requirements.

When is this a better fit than a PyTorch pipeline or a hosted API?

Choose this engine when a native CLI, an embedded UI and control over local execution are more valuable than writing and modifying pipelines in Python. Prefer a PyTorch-based pipeline when developers need to change pipeline internals in Python. Prefer a managed API when the team wants the provider to operate the serving infrastructure and accepts the associated data-handling and service constraints.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining leejet/stable-diffusion.cpp? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature leejet/stable-diffusion.cpp on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare