← Back to Leaderboard
GStability-AI

Stability-AI/generative-models

A YAML-driven diffusion framework for local SDXL inference and training experiments

View on GitHub ↗
AI FrameworkQuickstart ↓
Engineering Health (Methodology)
B · 60/100
Maintenance Activity
● Updated 11mo ago
Latest Release
0.1.0
Commercial License Check
MIT · Commercial Friendly

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

Maintenance6/35
Fork Adoption23/25
Release Cadence11/20
License Clarity20/20
Local AIGPUCLI
Total Stars
★ 27,353
24h Growth
+3
7d Growth
+13
Forks
3,091

GitHub Star History

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

Stability-AI/generative-models Star History (2023-06-21 - 2026-12-04) ALL-TIME STAR HISTORY (2023-06 – 2026-12) +27.4k in 1262d · avg +22/day 28.9k 14.4k 0 2023-06-21: ★ 12023-09-09: ★ 8,4842023-11-25: ★ 12,9812024-02-10: ★ 18,5682024-04-27: ★ 21,3992024-07-13: ★ 22,4782024-09-28: ★ 23,4402024-12-14: ★ 24,1482025-03-01: ★ 24,7662025-05-17: ★ 25,2932025-08-02: ★ 25,7262025-10-18: ★ 26,0582026-01-03: ★ 26,3842026-03-21: ★ 26,7072026-06-06: ★ 26,9732026-08-22: ★ 27,1442026-12-04: ★ 27,353 ★ 27.4k 2023-06 2025-03 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

Stability AI's sgm is a Python/PyTorch framework that assembles diffusion pipelines from YAML. instantiate_from_config() constructs the configured components: network_config selects the backbone, loss_config defines the training loss and its sigma sampler, and sampler_config selects the numerical solver, step count, discretization, and guidance wrapper independently of the model. That separation lets a team compare sampling strategies without changing the backbone implementation.

GeneralConditioner calls each configured AbstractEmbModel with the batch field named by its input_key, such as txt or cls. Each embedder can specify trainability and classifier-free guidance dropout. The conditioner combines 2D–4D outputs into vector, sequence, and spatial conditioning, with concatenation sensitive to embedder order. Extending the system means implementing or configuring Python components and keeping their batch and tensor interfaces compatible.

Key Capabilities & Differentiators

The Streamlit entry point at scripts/demo/sampling.py supports text-to-image and image-to-image sampling with SDXL base and refiner variants in versions 1.0 and 0.9. The 1.0 checkpoints have both full-file SHA-256 and tensor-data hashes, so users can verify the download and the stored tensors separately. The image output path embeds an invisible watermark; scripts/demo/detect.py checks individual files or batches of files for that watermark, which differs from the one used in Stable Diffusion 1.x/2.x.

Training starts at python main.py --base ...; YAML files merge left to right, with later values taking precedence. Example configs range from class-conditional pixel diffusion on MNIST to latent diffusion and text-to-image training. The non-toy examples require dataset-specific edits for WebDataset tar files. The latent and text-to-image examples also require a VAE checkpoint path in place of CKPT_PATH, so those configs are starting points rather than turnkey training jobs.

Trade-offs & Limitations

Choose sgm over a higher-level inference pipeline when the work involves changing conditioning, solvers, or training components. The flexibility comes with more integration work: configuration changes still have to respect input keys, embedder order, checkpoint compatibility, and dependency versions. The Streamlit entry point serves local experiments; teams building an application still need to provide their own serving and operational controls.

Local execution gives you control of checkpoints and configuration, but it also makes GPU capacity your responsibility. Profile VRAM at the intended resolution and batch size, then test the refiner and expected concurrency separately rather than extrapolating from a base-only run. License review is likewise checkpoint-specific: MIT covers code, SDXL 1.0 weights use CreativeML Open RAIL++-M, and SDXL 0.9 weights are gated under a separate research license.

Hardware & Deployment Guide

Use a local Python environment with a compatible GPU stack. The package metadata allows Python 3.8 or later, but Python 3.10 is the tested baseline. The PyTorch 2.0 installation path uses CUDA 11.8 wheels for torch, torchvision, and torchaudio, followed by requirements/pt2.txt and pip install .. Hatch packages the YAML configs under sgm/configs, but the package does not declare runtime dependencies for the installer to resolve. Download model checkpoints separately, then run inference locally rather than through a hosted generation API.

For training, install sdata from Stability AI's datapipelines project. Training supports PyTorch 1.13 and 2.0, but the autoencoder training path is limited to 1.13, so validate the environment against the actual configuration. Release 0.0.1 introduced the reworked sgm codebase, separated samplers from guiders, and shipped SDXL 0.9 base and refiner; release 0.1.0, dated July 27, 2023, added the SDXL 1.0 pair.

Composition: YAML and instantiate_from_config() wire the network, conditioner, sampler, and loss as separate components.
Conditioning: GeneralConditioner combines vector, sequence, and spatial embeddings; embedder order matters.
Sampling: sampler_config controls solver, step count, discretization, and classifier-free guidance independently of the model.
Inference: scripts/demo/sampling.py runs a local Streamlit demo for text-to-image and image-to-image with SDXL base and refiner variants.
Training: main.py --base merges YAML files left to right, so later files can override model, training, or data settings.
Artifact verification: SDXL 1.0 checkpoints have full-file and tensor-data hashes; scripts/demo/detect.py checks for the output watermark.
Best For

Teams running SDXL locally or experimenting with diffusion conditioning, sampling, and training at the component level.

Skip If

You need a ready-made production image API, an installer that resolves all runtime dependencies, or weights covered by the same MIT license as the code.

Reviewed on 2026-12-04 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

Local AIGPUCLI
python3.10 -m venv .generativemodels
source .generativemodels/bin/activate
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 # check CUDA version
pip3 install -r requirements/pt2.txt
pip3 install .
pip3 install -e git+https://github.com/Stability-AI/datapipelines.git@main#egg=sdata

Comparison vs. Top Voice, Vision & Video Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
generative-models ★27.4k+13PythonMITA YAML-driven diffusion framework for local SDXL inference and training experime
whisperX26.5k+677PythonBSD-2-ClauseBatched Whisper with forced alignment for word timings and optional speaker labe
hypit32.4k+731TypeScript—An SVML framework and CLI for turning video references into reusable workflows
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/Stability-AI/generative-models.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.

Stability-AI/generative-models Star History on RepoForAI

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

Frequently Asked Questions about generative-models

Can I change the sampler or add a conditioning input without rewriting the model?

Change sampler_config to select the solver, step count, discretization, and guidance wrapper without rewriting the model. To add a conditioning input, configure an AbstractEmbModel implementation in GeneralConditioner and supply its input_key in the batch. Preserve embedder order and check that the combined conditioning matches what the network expects.

How should I size a GPU for local SDXL inference?

Start with the tested Python 3.10 setup and the documented PyTorch 2.0 CUDA 11.8 wheel path. There is no fixed VRAM figure to size against. Measure peak memory with the intended checkpoint, resolution, and batch size, then repeat with the refiner and target concurrency before committing hardware.

Does the MIT code license cover commercial self-hosting of the weights?

MIT applies to the code, not the checkpoints. SDXL 1.0 weights use CreativeML Open RAIL++-M; SDXL 0.9 weights have separate research terms and gated access. Review the exact checkpoint license for your intended use and any redistribution obligations. Running the weights on your own hardware does not change those terms.

When is `sgm` a better fit than an inference pipeline or hosted API?

Choose sgm when you need to modify and compare conditioning, sampling, or training components directly. A higher-level inference pipeline is a better fit if you mainly want to run a supported checkpoint behind a stable application interface. A hosted API shifts GPU operation to the provider, but gives you less control over the underlying runtime and model internals.

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 Stability-AI/generative-models? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature Stability-AI/generative-models 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