StyleGAN2 PyTorch is a clean, minimal implementation of NVIDIA’s StyleGAN2 โ the generative adversarial network behind the famous thispersondoesnotexist.com faces โ written in PyTorch by lucidrains. It aims to be the simplest working version of the architecture, enabling everyone to experience the disentanglement properties that made StyleGAN2 a landmark in image generation. The repository has around 3,800 stars on GitHub and is MIT licensed.
StyleGAN2 generates high-resolution images from a learned latent space in which directions correspond to interpretable attributes such as age, pose or lighting. This implementation covers training and inference, including the style mixing, path-length regularisation and lazy regularisation techniques from the paper, while keeping the code readable enough to learn from. It supports training on your own image folders, multi-GPU setups, and exporting samples and interpolations. Because the generator is fully convolutional and the latent space is well structured, the repo is also a popular base for experiments with image editing, inversion and style transfer built on top of pretrained StyleGAN2 weights.
StyleGAN2 PyTorch is completely free and open source under the MIT license. The only cost is the GPU compute you train or run it on.
Researchers and engineers who want to understand or build on StyleGAN2 without wading through the original TensorFlow codebase, plus artists and tinkerers generating faces, artwork and other imagery from custom datasets.