ganlive

Explore the latent space of a GAN trained on my photographs in real time. Turn the dials by hand, or let a drum machine play them over MIDI.

A picture drawn by ganlive-lichen, a GAN trained on my photographs

How it works

lichen and amber are FastGANs (opens in a new tab) trained on 5,469 of my photographs, and ffhq is NVIDIA's StyleGAN2 trained on faces. Each generator is compiled into WebGPU compute shaders, one per operation and specialized to its shapes, with half-precision weights. On a $350 GPU, lichen draws 87 frames a second at 3072×2048.

Eight dials push the latent along directions from closed-form factorization (opens in a new tab), the leading eigenvectors of AᵀA, where A is the weight that reads the latent. A direction is kept only if it changes the picture at least twice as much as a random direction of the same length, and each dial is calibrated so that equal turns make equal visible change. Other dials scale FastGAN's skip-layer excitation, which sets how much a coarse stage shapes a finer one, or add the network's noise.

The latent walks by spherical interpolation between random draws, one segment per bar. Over MIDI, a drum machine's clock sets the tempo, each hit pushes the dials routed to it with an exponential decay, and its knobs hold them.