DragGAN logo

DragGAN

Free

Drag Your GAN: Interactive Point-based Manipulation on the Generative Image Manifold.

FreeFree tier
Inputs: imageOutputs: image
Type
Open Source

About DragGAN

DragGAN is an open-source implementation of the SIGGRAPH 2023 paper 'Drag Your GAN: Interactive Point-based Manipulation on the Generative Image Manifold.' It enables users to interactively manipulate images generated by StyleGAN models by clicking and dragging points on the image surface. The tool provides both a local GUI and a Gradio web demo, supports GPU acceleration (CUDA), and can handle both GAN-generated images and real images after GAN inversion. Built on top of StyleGAN3, it includes pretrained models for StyleGAN2, StyleGAN-Human, and Landscapes HQ.

Key Features

Interactive point-based image manipulation on GAN-generated images
Local GUI and Gradio web demo for easy interaction
Supports StyleGAN2, StyleGAN3, StyleGAN-Human, and LHQ models
Ability to edit real images via GAN inversion (external tool)
Docker support for containerized execution
Open-source codebase with 35.8k+ GitHub stars
Works with CUDA, MacOS M1/M2, and CPU fallback

Pros & Cons

Pros
  • Open-source and free to use (CC-BY-NC license for the DragGAN algorithm)
  • Intuitive drag-based interaction paradigm for image editing
  • Large active community (35.8k stars) and wide adoption
  • Supports multiple StyleGAN variants and architectures
  • Provides both a GUI and a web demo for accessibility
Cons
  • Requires external GAN inversion tools (e.g., PTI) to edit real images
  • Docker image is large (~25 GB), demanding significant disk space
  • Performance depends on GPU; CPU mode may be slow
  • Only works with StyleGAN-based generator models
  • Non-commercial use license for the core algorithm (CC-BY-NC)

Best For

Interactive editing of GAN-generated images for research or creative purposesReal image manipulation after performing GAN inversion (e.g., with PTI)Exploring and demonstrating the capabilities of generative image manifoldsAcademic research in generative adversarial networks and image synthesis

FAQ

What is DragGAN?
DragGAN is an open-source implementation of the SIGGRAPH 2023 paper that allows interactive point-based manipulation of images on the generative image manifold using StyleGAN.
How do I run the DragGAN GUI?
After setting up the environment, run 'sh scripts/gui.sh' on Linux or '.\scripts\gui.bat' on Windows. Alternatively, you can use the Gradio demo with 'python visualizer_drag_gradio.py'.
Does DragGAN support editing real images?
Yes, but you need to first perform GAN inversion (e.g., with PTI) to obtain a latent code and model weights, then load them into the DragGAN GUI.
What are the hardware requirements?
A CUDA-capable GPU is recommended for performance. It also works on MacOS with M1/M2 chips using MPS fallback, or on CPU (slower). Docker builds require about 25 GB of disk space.
Is DragGAN free to use?
Yes, the code is open-source. The DragGAN algorithm is licensed under CC-BY-NC (non-commercial), while the StyleGAN3 components are under Nvidia Source License.