Quickstart & Install
Go from a clean virtual environment to a validated hypergan-model/1 configuration,
live training telemetry in the Web Observatory, and a standalone exported generator in under a minute.
Lightweight package commands (new, validate, ps, status, logs, inspect, runs, queue, gc, rm)
support Python 3.11–3.14 on Linux, macOS, and Windows without importing PyTorch.
For training, CI tests Python 3.12+ with torch==2.14.0 and torchvision==0.29.0.
Install
Choose PyPI with NVIDIA CUDA 13.0, PyPI CPU-only, or an editable source checkout:
60-Second Quickstart
Scaffold a complete workspace (hypergan.toml, runs/, and configs/<template>.toml).
Pointing --dataset at an image folder reads only file headers, auto-detects resolution
(32, 64, 128, or 256) and color mode, and sizes the HNDL networks automatically.
# Explore starter templates and packaged wheel recipes
hypergan new --list
hypergan recipes
# Auto-size a project from an image directory (reads headers only)
hypergan new --project my_gan --dataset ./images
# Or start from a fast CPU 2D reference fixture
hypergan new --project my_toy --template gaussian-grid --device cpuValidate & Train
Validate structure and HNDL shapes statically before allocating a GPU, override any TOML field with -s KEY=VALUE, and launch training:
# Static validation (no PyTorch import)
hypergan validate my_gan/configs/dcgan.toml
hypergan validate my_gan/configs/dcgan.toml -s train.batch_size=32 --json
# Launch training with live telemetry
hypergan train my_gan/configs/dcgan.toml --steps 1000
hypergan train my_toy/configs/gaussian-grid.toml --steps 20 -d cpu --no-serverLive Run Management & Web Observatory
Every run registers in a daemonless global registry with a short ID, memorable Docker-style slug
(for example fleet-hawk), and optional tag. Control runs from any working directory
and inspect live curves and EMA preview sliders at 127.0.0.1:8765:
# Inspect active and historical runs from any directory
hypergan ps -a
hypergan status
hypergan logs -f
# Open the Web Observatory (default 127.0.0.1:8765)
hypergan view --open
# Tag, checkpoint, stop, and resume
hypergan tag fleet-hawk baseline-dcgan
hypergan checkpoint baseline-dcgan
hypergan stop baseline-dcgan
hypergan resume baseline-dcgan --steps 2000Sampling, Evaluation & Standalone Export
Draw grids from the EMA generator, run configured evaluations (FID, diversity, color moments), and export standalone inference bundles with SHA-256 digests:
# Draw fresh samples from the EMA generator
hypergan sample baseline-dcgan --count 16 --seed 42
# Condition the 128x128 colorizer on a single grayscale input
hypergan sample colorization-128 --input docs/assets/hg-bw-128.png --count 16 --output hg-grid.png
# Run configured evaluations (FID, diversity, color moments)
hypergan evaluate baseline-dcgan
# Export standalone generator bundle (+ SHA-256 digest)
hypergan export baseline-dcgan --checkpoint latest -o exported_model.pt
See the Deployment Guide
for serving bundle, pt2, onnx, and safetensors artifacts.
Which run rm, gc, stop and tag act on
Mutating commands resolve targets strictly to prevent accidental deletion: pass an exact run ID (or 8-character short ID),
slug, tag set via hypergan tag, run directory name, or path to a run directory (containing manifest.json or summary.json).
Prefix/substring matching, workspace roots, registered runs roots, $HOME, /, and symlinks are refused.
With no target, commands act on the current directory if it is a run; stop also stops a sole active run.
Python API Quickstart
Everything in the CLI is exposed as typed, lazy-loaded functions under import hypergan as hg
(importing hypergan never imports PyTorch until training or sampling starts):
import hypergan as hg
def main():
info = hg.new(project="my_gan", template="dcgan", data_dir="./images", device="cpu")
model = hg.load(info["recipe_path"])
model = hg.override(model, {"train.steps": 100, "train.batch_size": 16})
warnings = hg.validate(model)
run = hg.train(model, "my_gan/runs/exp1", steps=100)
st = hg.status("exp1")
hg.tag("exp1", "my-best-gan")
sample = hg.sample("my-best-gan", count=8, seed=42)
bundle_path = hg.export("my-best-gan", checkpoint="latest")
generator = hg.load_bundle(bundle_path, device="cuda")
walk = generator.interpolate(seed_a=100, seed_b=200, steps=10, mode="slerp")
if __name__ == "__main__":
main()