← all repositories
eladrich/pixel2style2pixel

Ditch the two-step: direct image-to-image via StyleGAN encoding

This framework reframes image-to-image translation as a direct encoding problem, using a single network to map sketches, low-res photos, or profile shots into StyleGAN’s W+ latent space without per-image optimization.

3.3k stars Jupyter Notebook Image · Video · Audio
pixel2style2pixel
Not currently ranked — collecting fresh signals.
star history

What it does

pSp is an encoder network that swallows an input image—a segmentation map, a blurry thumbnail, a side-profile face—and spits out a set of style vectors. Those vectors flow straight into a frozen, pretrained StyleGAN generator, which reconstructs or translates the image. The authors package it as a generic image-to-image translation engine, with pretrained checkpoints for frontalization, sketch-to-portrait, super-resolution, and toonification.

The interesting bit

Most StyleGAN workflows force you to invert an image into latent space before you can edit it; pSp skips that separate optimization step entirely. By treating translation as a direct encoding problem, it can handle inputs that never lived in the StyleGAN domain to begin with—like a hand-drawn sketch—and still produce a coherent face. It also inherits multi-modal synthesis for free by resampling style vectors, so one sketch can yield several plausible portraits.

Key highlights

  • Directly encodes real images into StyleGAN’s extended W+ latent space with no additional optimization.
  • Handles tasks lacking pixel-to-pixel correspondence, such as sketch or segmentation-map-to-face synthesis.
  • Supports multi-modal output via style-mixing and style resampling.
  • Training requires no adversarial component; the encoder and frozen StyleGAN generator do the work.
  • Pretrained models cover inversion, frontalization, super-resolution (up to ×32), and toonification.

Caveats

  • GPU dependency is strict: the README states CPU support is not inherent and requires modifications.

Verdict

Researchers and generative-art tinkerers who want a single, reusable StyleGAN encoder will find pSp a solid starting point. If you need a lightweight, CPU-friendly face filter, look elsewhere.

Frequently asked

What is eladrich/pixel2style2pixel?
This framework reframes image-to-image translation as a direct encoding problem, using a single network to map sketches, low-res photos, or profile shots into StyleGAN’s W+ latent space without per-image optimization.
Is pixel2style2pixel open source?
Yes — eladrich/pixel2style2pixel is open source, released under the MIT license.
What language is pixel2style2pixel written in?
eladrich/pixel2style2pixel is primarily written in Jupyter Notebook.
How popular is pixel2style2pixel?
eladrich/pixel2style2pixel has 3.3k stars on GitHub.
Where can I find pixel2style2pixel?
eladrich/pixel2style2pixel is on GitHub at https://github.com/eladrich/pixel2style2pixel.

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