HyperGAN logo HyperGAN v2.2.0

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.

Runtime & Python Support

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:

Shell
python -m venv .venv
. .venv/bin/activate
python -m pip install "torch==2.14.0" "torchvision==0.29.0" --index-url https://download.pytorch.org/whl/cu130
python -m pip install "hypergan[all]==2.2.0"
hypergan --help
python -m hypergan --version
Shell
python -m venv .venv
. .venv/bin/activate
python -m pip install "torch==2.14.0" "torchvision==0.29.0" --index-url https://download.pytorch.org/whl/cpu
python -m pip install "hypergan[all]==2.2.0"
hypergan --help
python -m hypergan --version
Shell
git clone https://github.com/HyperGAN/HyperGAN.git
cd HyperGAN
python -m venv .venv
. .venv/bin/activate
python -m pip install "torch==2.14.0" "torchvision==0.29.0" --index-url https://download.pytorch.org/whl/cu130
python -m pip install -e ".[all]"
hypergan --help

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.

Shell
# 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 cpu

Validate & Train

Validate structure and HNDL shapes statically before allocating a GPU, override any TOML field with -s KEY=VALUE, and launch training:

Shell
# 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-server

Live 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:

Shell
# 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 2000

Sampling, 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:

Shell
# 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):

Python
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()