HyperGAN
Train generative models. Follow their progress. Export the result.
HyperGAN 2.0.0 trains generative models from declarative TOML files using HNDL networks and ParticleGAN recipes. Use the CLI or typed Python API (import hypergan as hg) to train, checkpoint, inspect runs in the Web Observatory, and export generators for serving.
The wheel includes two CIFAR-10 architectures and a 128×128 colorizer. A 256×256 DINOv3 logo colorizer is available as a source example. CIFAR recipes and measured results · Colorization setup
Install
Use Python 3.12+ for the tested training runtime. Lightweight package checks cover Python 3.11–3.14 on Linux, macOS and Windows; the CPU reference profile is tested on Linux. The train extra accepts torch>=2.6,<3, but CI tests only torch==2.14.0, the version the commands below install; other versions are untested.
Install HyperGAN 2.0.0 from PyPI.
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.0.0"
hypergan --help
python -m hypergan --version
For NVIDIA GPU acceleration:
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.0.0"
Or install from a source checkout:
git clone https://github.com/HyperGAN/HyperGAN.git
cd HyperGAN
python -m venv .venv
. .venv/bin/activate
python -m pip install -e .
hypergan --help
python -m hypergan --version
For local NVIDIA GPU training from source:
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]"
For a local CPU correctness fixture from source, install the CPU PyTorch wheel instead (python -m pip install "torch==2.14.0" "torchvision==0.29.0" --index-url https://download.pytorch.org/whl/cpu) before python -m pip install -e ".[all]" and pass --device cpu (or -d cpu). Lightweight CLI commands (new, validate, ps, status, logs, inspect, tag, runs, queue, gc, rm) do not import PyTorch or ParticleGAN.
Quickstart: Project Scaffolding & Starter Templates
The core install can scaffold and validate gaussian-grid. For image templates using defaults = "particlegan", install the train extra so structural validation can read the installed ParticleGAN preset. The all extra includes it.
Explore starter architectures (dcgan, tiny-transformer, resnet, gaussian-grid) or packaged recipes:
hypergan new --list
hypergan recipes
Scaffold a complete project workspace (hypergan.toml, runs/, and configs/<template>.toml). When --dataset points at an image folder, hypergan new inspects image headers without loading pixels into RAM, auto-detects the resolution (32, 64, 128, or 256) and color mode (RGB or L), and sizes the generator/critic HNDL architectures automatically:
# Image GAN project sized automatically from a folder of images
hypergan new --project my_gan --dataset ./images
# Or specify an explicit template and resolution (or 2D toy fixture on CPU)
hypergan new --project my_transformer --template tiny-transformer --resolution 64
hypergan new --project my_toy --template gaussian-grid --device cpu
Validate the generated format = "hypergan-model/1" configuration (or the project directory itself):
# Fast structural validation (no Torch imports)
hypergan validate my_gan/configs/dcgan.toml
hypergan validate my_gan
# Validate with inline overrides and emit resolved JSON
hypergan validate my_gan/configs/dcgan.toml -s train.batch_size=32 -s optimizer.lr=0.0002 --json
# Verify image dataset inventory/hashes (--data) and construct networks in a worker (--runtime)
hypergan validate my_gan/configs/dcgan.toml --data
hypergan validate my_gan/configs/dcgan.toml --runtime
Training & Docker-Style Live Run Management
Start training from a model .toml file. You can customize the run name (-n), override any config setting (-s KEY=VALUE), or select the execution device (-d):
hypergan train my_gan/configs/dcgan.toml --steps 1000
hypergan train my_gan/configs/dcgan.toml -n exp-lr2e4 -s train.lr=0.0002 -s train.batch_size=32
hypergan train my_toy/configs/gaussian-grid.toml --steps 20 -d cpu --no-server
Every run is registered in a daemonless global registry with a unique Run ID (<short_id>, e.g. 0608d849), a memorable Docker-style Slug (<adj>-<noun>, e.g. fleet-hawk), and an experiment Name / tag. You can inspect and control runs from any working directory using zero arguments (which automatically targets the active or most recent run) or by passing <slug>, <short_id>, <tag>, or <run_dir>:
# List active runs, live GPU VRAM usage, and queued jobs
hypergan ps
# List all historical runs (active, completed, stopped, failed) across the host/workspace
hypergan ps -a
hypergan ps -a --json
# Concise single-screen status summary (progress, speed, ETA, latest losses, best FID, checkpoints)
hypergan status
hypergan status fleet-hawk
# View or follow (-f) formatted training logs (Ctrl-C detaches without stopping training)
hypergan logs -n 50
hypergan logs -f fleet-hawk
# Request an immediate durable checkpoint at the next update boundary
hypergan checkpoint
hypergan checkpoint fleet-hawk
# Gracefully stop an active run (saves a complete checkpoint before exiting)
hypergan stop
hypergan stop fleet-hawk
hypergan stop --all
Post-Run Inspection, Tagging, Resuming, Sampling, Evaluation, Export & Cleanup
Tagging & Inspecting Runs
# Tag (rename) a run. The tag is stored in RUN/tag.json, which the trainer never
# rewrites, so an active run can be tagged; a stopped run also gets the new name in
# its manifest and summary. The global registry is updated either way.
hypergan tag fleet-hawk baseline-dcgan32
# Inspect full run manifest JSON or model architecture/loss/optimizer summary
hypergan inspect baseline-dcgan32
hypergan model baseline-dcgan32
hypergan model baseline-dcgan32 --write # build on meta device and save RUN/model.json
Resuming Training
Continue a stopped or completed run from its latest checkpoint (or a specific --checkpoint). When lr_floor = 1.0 (constant learning rate), --steps can extend the total step budget seamlessly:
hypergan resume baseline-dcgan32 --steps 2000
Sampling, Evaluation & Standalone Export
The HyperGAN icon is generated by conditioning the 128×128 HNDL particle colorizer on a grayscale HG monogram across 16 particle draws. See the single badge, colorized grid, and grayscale source.
# Draw fresh samples from the EMA generator (writes PNG grid for image models or JSON)
hypergan sample baseline-dcgan32 --count 16 --seed 42
# Condition a trained colorizer on a single grayscale input image across 16 particles
hypergan sample logos-colorization-128 --input docs/assets/hg-bw-128.png --count 16 --output hg-grid.png
# Run configured snapshot evaluations (e.g. FID, color moments, sample diversity)
hypergan eval baseline-dcgan32
hypergan evaluate baseline-dcgan32 --metric sample_diversity
# Export the EMA inference bundle and its SHA-256 digest
hypergan export baseline-dcgan32 --checkpoint latest -o exported_model.pt
For HNDL bundles, install HyperGAN, Torch, NumPy and HNDL on the serving host. The deployment guide includes separate load commands for Python bundles, PT2, ONNX Runtime and SafeTensors. Serve an exported generator · Upgrade an alpha run
Comparing Runs & Multi-GPU Job Queue
# List and filter runs, or compare metrics across step milestones side-by-side
hypergan runs ls --sort fid
hypergan runs compare baseline-dcgan32 exp-lr2e4
hypergan runs compare baseline-dcgan32 exp-lr2e4 --metric loss_g --at 500,1000,best,latest --json
# Schedule and run experiments sequentially across GPUs
hypergan queue status
hypergan queue add my_gan/configs/dcgan.toml -n job1 --steps 5000 -s train.lr=0.0005 -d gpu0
hypergan queue ls --json
hypergan queue run --once
hypergan queue stop --all
Garbage Collection & Run Removal
# Reclaim disk space by cleaning rebuildable views and compacting routine train events
hypergan gc baseline-dcgan32 --dry-run
hypergan gc baseline-dcgan32
hypergan gc --all # every finished run in this workspace's runs root
hypergan checkpoints prune baseline-dcgan32 --dry-run
# Delete a run directory and unregister it from the global registry (-f stops if active)
hypergan rm exp-lr2e4
Which run rm, gc, stop and tag act on
These commands change or delete a run, so they resolve their target strictly. The target must be exactly one of:
- a run ID or its 8-character short ID;
- a slug;
- a tag set with
hypergan tag; - a run directory name;
- a path to a run directory, meaning a directory whose
manifest.jsonorsummary.jsonrecords arun_id(a path to thatmanifest.jsonalso works).
There is no prefix, substring or config-name matching. A reference that matches more than one run is an error that lists the candidates with their run IDs; repeat the command with one of them. A workspace root (a directory with hypergan.toml), a workspace or registered runs root, any directory that contains runs, $HOME, / and symbolic links are refused before anything is touched. With no target, the command acts on the current directory when it is a run; otherwise stop stops the only active run (and refuses when several are active), and the others ask you to name the run.
hypergan gc --all cleans every finished run under the current workspace's runs root and skips active ones. It needs a workspace (a hypergan.toml in this directory or above) or an explicit root, hypergan gc --all <runs-root>, and never reaches runs the registry knows about elsewhere.
Web Observatory (hypergan view)
With .[web] installed, interactive training runs launch the local Web Observatory on 127.0.0.1:8765 by default. To bind across local network interfaces, pass -b 0.0.0.0 (or --bind 0.0.0.0):
# Start the global runs dashboard and per-run observatory
hypergan view
hypergan view my_gan/runs --port 8765 --open
hypergan view baseline-dcgan32 --port 8765
hypergan view -b 0.0.0.0
# Check status or stop a background dashboard
hypergan view --status
hypergan view --stop
In non-interactive environments (CI, background jobs, AI coding agent sandboxes), viewer autostart is automatically suppressed (can also be disabled via HYPERGAN_NO_SERVER=1 or --no-server).
The Web Observatory provides:
- Global Runs Dashboard (
GET /andGET /api/runs): Live-updating table of all runs with search/status filtering, sortable columns, progress bars, active throughput (steps/sandsamples/s), latest/best FID, hardware topology, batch size, and disk usage. Click a row to open its Observatory and use the per-run controls. - Per-Run Observatory (
GET /runs/<id_or_slug_or_tag>): Real-time learning curves backed by a WebAssembly streaming reducer, retained EMA sample history sliders, snapshot evaluation charts, and an inline Model section showing the ParticleGAN integration, loss metrics, and per-layer HNDL network tables.
See Local browser and streaming API for authentication (--auth token), TLS proxy setup (--public-origin), and the full /api/runs/* and /api/v1/runs/* REST/SSE contract.
Distributed Multi-GPU Scaling
Use --devices 0,1 for single-host replicated training with NCCL. The packaged CIFAR tiny transformer saved a checkpoint and resumed on the same two RTX A6000s with ParticleGAN 0.10.1. In a separate throughput benchmark, two A6000s reached 2.20× single-GPU throughput at global batch 256 and 0.79× at batch 64. Scaling measurements
Multi-host training is experimental. The two-node A10 smoke exercised the internal trainer for three updates. Shared-storage recovery and the public multi-host supervisor still need qualification. Tested topologies and recovery conditions
Python Developer API (import hypergan as hg) & Environment Variables
Everything available in the CLI is exposed as a clean, functional Python API at the top level of hypergan (lazy-loaded so importing hypergan never imports PyTorch until training or sampling runs):
import hypergan as hg
def main():
# 1. Scaffold or load a model configuration
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)
# 2. Train and inspect runs by slug, short ID, custom tag, or path
run = hg.train(model, "my_gan/runs/exp1", steps=100)
active_and_all = hg.ps(all_runs=True)
all_runs = hg.list_runs()
st = hg.status("exp1") # typed RunStatus with step, status, latest_metrics, best_fid, etc.
log_lines = hg.logs("exp1", tail=20) # list[str] of formatted log lines (silent on stdout)
manifest = hg.inspect("exp1") # dict of the run's manifest.json
hg.tag("exp1", "my-best-gan")
# 3. Sample, export, and reload standalone generator
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") # nn.Module LoadedGenerator
samples = generator.sample(count=16, seed=42)
walk = generator.interpolate(seed_a=100, seed_b=200, steps=10, mode="slerp")
# 4. Clean up
hg.gc("my-best-gan", dry_run=True)
hg.rm("my-best-gan")
# Training starts worker processes that re-import this script, so keep the
# work under the main guard.
if __name__ == "__main__":
main()
hg.train(model) without a run directory starts a fresh <runs_root>/<stem>-<adj>-<noun> run on every call, as hypergan train does (an overridden model still uses its file's workspace and stem). Pass name= to name the directory instead; if that directory already holds a different configuration, the run starts in a sibling <name>-<adj>-<noun> directory, as the CLI does.
Environment Variables
| Variable | Purpose |
|---|---|
HYPERGAN_HOME / HYPERGAN_STATE_DIR |
Override the directory used for the global run registry (runs.json and registry.lock). Defaults to ~/.local/share/hypergan (or $XDG_DATA_HOME/hypergan). Setting either variable isolates run discovery to that state directory. |
HYPERGAN_WORKSPACE |
Explicitly point to a workspace hypergan.toml file (or its parent directory) when running outside the workspace directory tree. |
HYPERGAN_QUEUE_FILE |
Override the path to the multi-GPU job queue state file (defaults to <workspace>/.hypergan/queue.json or ./.hypergan/queue.json). |
HYPERGAN_DEBUG |
Set to 1 (true/yes/on) to print the full traceback when a CLI command fails (same as hypergan --debug). |
HYPERGAN_VIEWER_DEV |
Set to 1 (true/yes/on) to serve Web Observatory frontend assets fresh from disk on every request with auto-reload. |
Configure the recipe
hypergan new generates format = "hypergan-model/1" TOML model files ([data], [prior], [networks.generator], [networks.discriminator], [[losses]], [train], [metrics], [evaluations.<id>], [checkpoints], [sampling]). During validation and training, HyperGAN lowers the model file into the engine's resolved numerical recipe.
ParticleGAN supplies the released GAN formulation and its selected defaults for loss, learning rates, hyperparameters, normalization and optimizers. HyperGAN consumes its public recipe and owns networks, data, execution, checkpoints and metrics. See the integration boundary. Networks are declared in HNDL (source = "..." or hndl = "file.hndl") or importable Python modules (module = "pkg.mod:Class"), with full source recorded in every run.
See:
- Configuration and component contracts and the paired synthetic example
- Image data and preprocessing
- Recovery and compatibility and Run observation contract
- Public execution profiles, Execution profiles and preflight, Replicated run service, CUDA/NCCL workers, and Bounded previews and progress
Development and migration
HyperGAN uses Foldlite DB (foldlitedb>=0.1.2,<0.2) for append-only event journals, .fold views, and shared Rust/WASM reducers:
python -m pip install "foldlitedb>=0.1.2,<0.2"
python -m pip install -e '.[dev,web]'
For testing unpublished Foldlite revisions in CI or local development, set FOLDLITEDB_SOURCE to an accessible wheel URL, a pip source reference pinned to an exact revision, or a local Foldlite checkout path; when unset, foldlitedb>=0.1.2,<0.2 is installed from the configured package index. See the Foldlite integration and cache contract.
Install .[dev,train,image,web] in the tested runtime environment, then run python -m pytest for CPU and lightweight correctness tests. That default selection deselects the heavy marker, which gates the tests that start real subprocesses, multi-rank jobs and worker services; run those deliberately with python -m pytest -m heavy. The default run covers tests/foundation, tests/reference, tests/unit, tests/playbooks, tests/e2e and tests/e2e_integration; the viewer, browser, reducer and CUDA tiers need extra dependencies or hardware and are run by path. tests/README.md lists every tier and how to run it; see also CUDA execution and validation and CI and PyPI releases. All guides are indexed in docs/README.md, and CONTRIBUTING.md covers the pull-request workflow.
Historical HyperGAN code and experiments are preserved in archive tags. Legacy configurations and checkpoints require their archived runtime; see migration notes, preservation evidence, the September 2026 execution ledger, and resurrection plan.
Metadata
Release files for hypergan 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hypergan-2.0.0.tar.gz | 1.8 MB | With provenance | Details for hypergan-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hypergan-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for hypergan-2.0.0-py3-none-any.whl |
Total release size: 2.7 MB
Release files / hypergan-2.0.0.tar.gz
| Download URL | hypergan-2.0.0.tar.gz |
|---|---|
| Size | 1.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
177dfbf5dd2e342e2e7b8ef9b729fa411e506b075b622aed0e44d295ac2e1d4f
|
|
BLAKE2b-256 checksum How to use checksums |
b1b170cc8a88f5ab494351e60582d505650cf32b5d860b3a46335e5fa50b99c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logRelease files / hypergan-2.0.0-py3-none-any.whl
| Download URL | hypergan-2.0.0-py3-none-any.whl |
|---|---|
| Size | 917.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9d5bf9901a14d8000f3fd5658ee0e2670641f8f69721bcdf7e2cec7e126bb34d
|
|
BLAKE2b-256 checksum How to use checksums |
15f561f73b04dffe61c488ef83e63c835234bd147af302bbee21097cf22d9045
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logSecurity for hypergan 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for hypergan-2.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.