explaingit

xingangpan/draggan

35,855PythonAudience · researcherComplexity · 4/5DormantSetup · hard

TLDR

Interactive image editing tool that lets you drag points on AI-generated images to smoothly deform them while keeping them realistic.

Mindmap

mindmap
  root((repo))
    What it does
      Point-based image editing
      Drag to deform naturally
      Works on GAN images
    How it works
      Navigates generative space
      Maintains realism
      Smooth transformations
    Interfaces
      Desktop GUI
      Web interface
      Pre-trained models
    Tech stack
      PyTorch
      StyleGAN
      CUDA GPU
    Use cases
      Facial expression editing
      Object pose adjustment
      Creative image manipulation
    Audience
      Researchers
      Artists
      ML practitioners

Things people build with this

USE CASE 1

Edit facial expressions by dragging mouth, eyes, or other features to create smiles or different emotions.

USE CASE 2

Adjust object poses and angles, like rotating a car's wheels or repositioning an animal's limbs.

USE CASE 3

Create variations of AI-generated images by interactively exploring the model's generative space.

Tech stack

PythonPyTorchStyleGANCUDAGradio

Getting it running

Difficulty · hard Time to first run · 1day+

Requires CUDA-capable GPU, PyTorch compilation, StyleGAN model download, and multiple deep learning dependencies.

License could not be detected automatically. Check the repository's LICENSE file before use.

In plain English

DragGAN is the official code for a research project published at SIGGRAPH 2023, the premier conference for computer graphics. It implements an interactive technique for editing images generated by a GAN, a Generative Adversarial Network, which is a type of AI model that can generate realistic images. The specific problem DragGAN solves is that traditional ways of editing AI-generated images are imprecise. DragGAN introduces point-based manipulation: you click on a point in the image, drag it to where you want it, and the model smoothly deforms the image so the content moves naturally, staying realistic throughout the transformation. For example, you could drag a person's mouth to a smile, change a car's wheel angle, or reposition a lion's leg. The technique works by operating directly on what the paper calls the "generative image manifold", the internal space of all images the GAN model knows how to produce. Dragging a point navigates through this space rather than crudely warping pixels, which is why the results look coherent rather than distorted. The project provides a graphical desktop interface for experimenting with this technique, as well as a Gradio-based web interface (Gradio is a Python library for building simple interactive ML demos). Pre-trained model weights for several StyleGAN variants are downloadable via a provided script. Running it requires a CUDA-capable GPU, though the README describes a fallback path for Apple Silicon Macs. A researcher, artist, or ML practitioner interested in interactive image editing or generative model manipulation would use this project. It is built in Python using PyTorch, the standard deep learning framework.

Copy-paste prompts

Prompt 1
How do I set up DragGAN on my machine and download the pre-trained StyleGAN weights?
Prompt 2
Show me how to use the desktop GUI to drag a point on an image and see the deformation in real time.
Prompt 3
Can I run DragGAN on an Apple Silicon Mac, and what are the limitations compared to CUDA?
Prompt 4
Explain how dragging a point in DragGAN navigates the generative image manifold instead of just warping pixels.
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.