← all repositories
yuval-alaluf/hyperstyle

A hypernetwork that modulates StyleGAN per image in one shot

It learns to modulate StyleGAN weights per image, delivering optimization-level reconstruction at encoder speed.

1k stars Python Image · Video · Audio
hyperstyle
Not currently ranked — collecting fresh signals.
star history

What it does

HyperStyle is an encoder-based inversion system for StyleGAN. You feed it a real image, and a hypernetwork predicts weight modulations for a pretrained StyleGAN generator. The result is a reconstructed version of your photo sitting in a latent region that still plays nicely with editing tools like StyleCLIP and InterFaceGAN. The repository includes training and evaluation code, plus pretrained models for human faces, cars, and wild animals.

The interesting bit

The clever part is shrinking the problem. A naive hypernetwork that directly outputs StyleGAN weight deltas would balloon past three billion parameters. The authors instead designed a compact network that performs on par with existing encoders while still giving each image its own custom generator tweak. It is essentially doing per-image fine-tuning, but in a single forward pass.

Key highlights

  • Reconstructs real images into editable StyleGAN latent regions without per-image optimization loops.
  • Hypernetwork architecture keeps parameter count practical—down from a naive 3B+ to encoder-scale size.
  • Supports downstream editing via StyleCLIP, InterFaceGAN, and GanSpace out of the box.
  • Includes domain adaptation capabilities for out-of-domain images (e.g., toon or Pixar styles) never seen during training.
  • Ships with pretrained models for FFHQ faces, Stanford Cars, and AFHQ Wild, plus Colab notebooks for inference and animation.

Caveats

  • Requires an NVIDIA GPU and CUDA; CPU support is explicitly not guaranteed and would need modifications.
  • Depends on a stack of auxiliary pretrained models—e4e encoders, StyleGAN2 checkpoints, and several domain-specific loss networks—that must be downloaded separately.
  • The README notes that training your own model involves a fair bit of path configuration and data preparation.

Verdict

Researchers and practitioners working with real-image StyleGAN editing should look here; if you just need a quick face filter on a phone, this is still very much a GPU-bound research codebase.

Frequently asked

What is yuval-alaluf/hyperstyle?
It learns to modulate StyleGAN weights per image, delivering optimization-level reconstruction at encoder speed.
Is hyperstyle open source?
Yes — yuval-alaluf/hyperstyle is open source, released under the MIT license.
What language is hyperstyle written in?
yuval-alaluf/hyperstyle is primarily written in Python.
How popular is hyperstyle?
yuval-alaluf/hyperstyle has 1k stars on GitHub.
Where can I find hyperstyle?
yuval-alaluf/hyperstyle is on GitHub at https://github.com/yuval-alaluf/hyperstyle.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.