Skip to content
Composable GAN framework with api and user interface
Python Other
  1. Python 99.7%
  2. Other 0.3%
Branch: master
Clone or download
Latest commit 5869e47 Aug 5, 2019

HyperGAN 0.10

CircleCI Discord Twitter

A composable GAN API and CLI. Built for developers, researchers, and artists.

0.10 is now available in pip. Installation instructions and support are available in our discord

HyperGAN is in open beta.

Colorizer 0.9 1

Logos generated with examples/colorizer

See more on the hypergan youtube

Table of contents


Generative Adversarial Networks consist of 2 learning systems that learn together. HyperGAN implements these learning systems in Tensorflow with deep learning.

For an introduction to GANs, see

HyperGAN is a community project. GANs are a very new and active field of research. Join the community discord.


  • Community project
  • Unsupervised learning
  • Transfer learning
  • Online learning
  • Dataset agnostic
  • Reproducible architectures using json configurations
  • Domain Specific Language to define custom architectures
  • GUI(pygame and tk)
  • API
  • CLI


See the Discord



See the full changelog here:

Quick start


Recommended: GTX 1080+


Install hypergan:

  pip3 install hypergan --upgrade

Testing install

To see that tensorflow and hypergan are installed correctly and have access to devices, please run:

  hypergan test

Optional virtualenv:

If you use virtualenv:

  virtualenv --system-site-packages -p python3 hypergan
  source hypergan/bin/activate


If installation fails try this.

  pip3 install numpy tensorflow-gpu hyperchamber pillow pygame

Dependency help

If the above step fails see the dependency documentation:

Create a new model

  hypergan new mymodel

This will create a mymodel.json based off the default configuration. You can change configuration templates with the -c flag.

List configuration templates

  hypergan new mymodel -l

See all configuration templates with --list-templates or -l.


  # Train a 32x32 gan with batch size 32 on a folder of folders of pngs, resizing images as necessary
  hypergan train folder/ -s 32x32x3 -f png -c mymodel --resize

Development mode

If you wish to modify hypergan

git clone
cd hypergan
python3 develop

Running on CPU

Make sure to include the following 2 arguments:

CUDA_VISIBLE_DEVICES= hypergan --device '/cpu:0'

Don't train on CPU! It's too slow.

The pip package hypergan

 hypergan -h


  # Train a 32x32 gan with batch size 32 on a folder of pngs
  hypergan train [folder] -s 32x32x3 -f png -b 32 --config [name]


  hypergan sample [folder] -s 32x32x3 -f png -b 32 --config [name] --sampler batch_walk --sample_every 5 --save_samples

By default hypergan will not save samples to disk. To change this, use --save_samples.

One way a network learns:

Demo CountPages alpha

To create videos:

  ffmpeg -i samples/%06d.png -vcodec libx264 -crf 22 -threads 0 gan.mp4


To see a detailed list, run

  hypergan -h


See the example documentation


To build a new network you need a dataset. Your data should be structured like:


Creating a Dataset

Datasets in HyperGAN are meant to be simple to create. Just use a folder of images.


For jpg(pass -f jpg)

Downloadable datasets

Cleaning up data

To convert and resize your data for processing, you can use imagemagick

for i in *.jpg; do convert $i  -resize "300x256" -gravity north   -extent 256x256 -format png -crop 256x256+0+0 +repage $i-256x256.png;done


Contributions are welcome and appreciated! We have many open issues in the Issues tab. Join the discord.

See how to contribute.


HyperGAN uses semantic versioning.

TLDR: x.y.z

  • x is incremented on stable public releases.
  • y is incremented on API breaking changes. This includes configuration file changes and graph construction changes.
  • z is incremented on non-API breaking changes. z changes will be able to reload a saved graph.

Other GAN projects




  HyperGAN Community
  HyperGAN, (2016-2019+), 
  GitHub repository,

HyperGAN comes with no warranty or support.

You can’t perform that action at this time.