Generative Vision: GANs & VAEs

stylegan

StyleGAN (Karras et al., NVIDIA, 2018) re-engineered the generator so that you can control an image's attributes at different scales — coarse things like pose and face shape separately from fine things like hair texture and freckles — and so the latent space becomes much more disentangled. Instead of feeding the noise vector in at the bottom and letting it flow through, StyleGAN injects a learned "style" at every layer, controlling each resolution independently. This is why StyleGAN produces both extremely realistic faces and intuitive editing knobs.

There are two key ideas. First, a mapping network (an 8-layer MLP) transforms the input noise z in the space Z into an intermediate latent w in the space W; W need not follow the prior's fixed Gaussian shape, so it can "unwarp" the data's factors of variation, making W more disentangled than Z. Second, the synthesis network starts from a learned constant tensor (not from z) and, at each resolution, the style w is mapped via learned affine transforms to per-channel scale and bias that modulate the activations through adaptive instance normalization (AdaIN): AdaIN normalizes each feature map, then re-scales and shifts it by the style. Per-pixel Gaussian noise is added at each layer to generate stochastic detail (hair strands, pores) without consuming latent capacity.

Because styles act at specific resolutions, style mixing — taking w for the coarse layers from one image and for the fine layers from another — transfers high-level structure from one face and fine texture from another, demonstrating disentanglement. StyleGAN2 removed AdaIN-induced "blob" artifacts by replacing it with weight demodulation and added path-length regularization; StyleGAN3 made the generator equivariant to translation and rotation, fixing "texture sticking" in animations. The W and W+ spaces are the workhorse for GAN inversion and semantic image editing (find a direction in W that adds a smile or ages a face). StyleGAN remains a benchmark for high-resolution, controllable image synthesis even in the diffusion era.

StyleGAN's realism can mask entanglement — many semantic edits still affect correlated attributes (for instance, adding "smile" may also change apparent age or open the mouth) because the training data correlates them; disentanglement is improved, not perfect. Also, faithfully editing a real photo requires inverting it into W+ first, and inversion quality bounds edit quality.

Also called
StyleGANStyleGAN2StyleGAN3