Skip to content
Simplest working implementation of Stylegan2 in Pytorch
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin make package Jan 14, 2020
stylegan2_pytorch make package Jan 14, 2020
.gitignore Initial commit Jan 9, 2020
LICENSE Initial commit Jan 9, 2020 Update Jan 14, 2020
requirements.txt add pillow to requirements.txt Jan 14, 2020
sample.jpg first commit Jan 9, 2020
setup.cfg make package Jan 14, 2020 make package Jan 14, 2020

Simple StyleGan2 for Pytorch

Simple working Pytorch implementation of Stylegan2 based on


You will need a machine with a GPU and CUDA installed. Then pip install the package like so

> pip install stylegan2_pytorch


> stylegan2_pytorch --data /path/to/images

That's it. Sample images will be saved to results/default and models will be saved periodically to models/default

Advanced Use

You can specify the name of your project with

> stylegan2_pytorch --data /path/to/images --name my-project-name

By default, if the training gets cut off, it will automatically resume from the last checkpointed file. If you want to restart with new settings, just add a new flag

> stylegan2_pytorch --new --data /path/to/images --name my-project-name --image-size 512 --network-capacity 20


  1. Add mixed precision and multi-GPU support


Thank you to Matthew Mann for his inspiring simple port for Tensorflow 2.0


  title   = {Analyzing and Improving the Image Quality of {StyleGAN}},
  author  = {Tero Karras and Samuli Laine and Miika Aittala and Janne Hellsten and Jaakko Lehtinen and Timo Aila},
  journal = {CoRR},
  volume  = {abs/1912.04958},
  year    = {2019},
You can’t perform that action at this time.