Unofficial implementation of StyleGAN2 config-f using TensorFlow 2.x.

Official paper from Nvidia:
Official repo using TensorFlow 1.x:


Extra features

  • Support for TensorFlow custom operations
  • Support for CPU usage

Download network parameters to weights folder manually, or simpy run script located in weights folder.

# Create stylegan2 architecture (generator and discriminator) using cuda operations.
model = StyleGan2(resolution, impl='cuda', gpu=True)

# Load stylegan2 'ffhq' (generator and discriminator) using tensorflow operations.
model = StyleGan2(weights='ffhq', impl='ref', gpu=True)

# Load stylegan2 'horse' (generator and discriminator) using tensorflow operations in cpu.
model = StyleGan2(weights='horse', impl='ref', gpu=False)

# Load only generator network with 'car' weights
generator = StyleGan2Generator(weights='car', impl, gpu)

Examples on how to create, load and run the networks can be found in example_how_to_use notebook.

Examples on how to make a random walk in the latent vector and generate a gif, can be found in example_latent_changes notebook.

Training loop and metrics has not been implemented yet. Stay tuned.