whatisgithub

What is pix2pixhd?

nvidia/pix2pixhd — explained in plain English

Analysis updated 2026-06-24

6,917PythonAudience · researcherComplexity · 5/5Setup · hard

In one sentence

NVIDIA research code that converts color-coded label maps into photorealistic images up to 2048x1024 pixels using a generative adversarial network published at CVPR 2018.

Mindmap

mindmap
  root((pix2pixHD))
    What it does
      Label map to photo
      High resolution output
    Demos
      Street scenes
      Face portrait editing
    Requirements
      NVIDIA GPU 11GB
      Linux or macOS
    Tech
      Python
      PyTorch
      GAN architecture
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Generate photorealistic street-scene images from Cityscapes label maps using the included pre-trained model without training from scratch

USE CASE 2

Train a custom high-resolution image synthesis model on your own paired label-and-photo dataset

USE CASE 3

Use the interactive face editing demo to swap individual facial features like hair or eye color while keeping the rest of the portrait consistent

What is it built with?

PythonPyTorchCUDA

How does it compare?

nvidia/pix2pixhdflask-restful/flask-restfulnvlabs/stylegan3
Stars6,9176,9196,926
LanguagePythonPythonPython
Setup difficultyhardeasyhard
Complexity5/52/55/5
Audienceresearcherdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1day+

CUDA-only, requires an NVIDIA GPU with at least 11GB VRAM for inference, full-resolution training needs 24GB VRAM.

So what is it?

pix2pixHD is a research project from NVIDIA that turns simple label maps into photorealistic images at high resolution, up to 2048 by 1024 pixels. A label map is a diagram where each region is painted a flat color corresponding to a category, such as sky, road, car, or building. The model learns to translate those color-coded regions into convincing photographs that look like real street scenes or real faces. The technique is based on a type of AI called a generative adversarial network, or GAN, which was published in a research paper at the CVPR 2018 conference. The repository contains the code that accompanied that paper, along with pre-trained model weights for city street images so you can test it without training from scratch. There are two main use cases demonstrated. The first converts maps of city street layouts into photo-realistic images that look like actual urban scenes, using the Cityscapes dataset. The second converts maps of face geometry into photo-realistic portraits, and includes an interactive editing interface that lets you swap individual features like hair or eye color while keeping the rest of the face consistent. Running the pre-trained model requires a machine running Linux or macOS with an NVIDIA GPU that has at least 11 GB of video memory. Training a new model at the highest resolution requires a GPU with 24 GB of memory, though lower-resolution training works with 12 GB. The code also supports training on your own images if you can provide paired label-and-photo datasets. This repository is a research release and has not been updated since the paper was published. It uses Python and PyTorch and is intended for researchers exploring image synthesis techniques rather than for production deployment.

Copy-paste prompts

Prompt 1
I have pix2pixHD cloned and a GPU with 11GB VRAM. Walk me through running inference on the pre-trained Cityscapes model to turn a label map into a photorealistic street image.
Prompt 2
How do I prepare a custom paired dataset of label maps and photos to train pix2pixHD on my own domain? What folder structure and naming convention does the training script expect?
Prompt 3
Show me how to use pix2pixHD's interactive face editing interface to change the hair color of a generated portrait while keeping the rest of the face consistent.
Prompt 4
What are the GPU VRAM requirements for pix2pixHD at each resolution, and what is the highest resolution I can train at with 12GB versus 24GB of VRAM?

Frequently asked questions

What is pix2pixhd?

NVIDIA research code that converts color-coded label maps into photorealistic images up to 2048x1024 pixels using a generative adversarial network published at CVPR 2018.

What language is pix2pixhd written in?

Mainly Python. The stack also includes Python, PyTorch, CUDA.

How hard is pix2pixhd to set up?

Setup difficulty is rated hard, with roughly 1day+ to a first successful run.

Who is pix2pixhd for?

Mainly researcher.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.