DragGAN

DragGAN

★ 3.8 🔖 1200 saves 💰 Free GitHubImage Editing

DragGAN is an open-source implementation of the DragGAN research project (Interactive Point-based Manipulation on the Generative Image Manifold), published on GitHub by JiauZhang. It brings the well-known “drag” style of image editing to StyleGAN2: instead of painting masks or typing prompts, you click handle points on a generated face, animal or object and drag them towards target points, and the image reshapes itself while staying photorealistic. The repository has gathered around 2,100 stars and its code was last updated in 2023.

Overview

The implementation follows the two core ideas of the paper: feature-based motion supervision, which moves the latent features around a handle point towards its target, and point tracking, which re-locates the handle points after each step so the drag stays accurate. A lightweight desktop GUI built on DearPyGui lets you load a pretrained StyleGAN2 model (the README links Rosinality’s FFHQ model trained for 550k iterations at 256px), set handle and target points, optionally paint a movable-region mask, and watch the edit progress interactively.

Key Features

  • Point-based drag editing: move facial features, poses, shapes and layouts by dragging points
  • Interactive DearPyGui desktop interface with start, multi-point and masked editing modes
  • Built on StyleGAN2 with pretrained FFHQ weights linked from the README
  • Feature-based motion supervision plus point tracking for stable, precise edits
  • Simple setup: pip install dearpygui, then run gui.py
  • MIT-licensed research code that is easy to read and extend

💳 Pricing

Free. The code is released under the MIT license; you only need your own GPU and the freely downloadable pretrained StyleGAN2 weights.

Who Is It For

Researchers and tinkerers who want to experiment with GAN-based drag editing locally, study how the DragGAN algorithm works, or prototype interactive photo-manipulation tools without relying on a hosted service.

Beyond the GUI, the code is a compact PyTorch implementation of the paper’s method, which makes it a popular starting point for students and researchers who want to understand how latent-space motion supervision works in practice. Because it operates on pretrained StyleGAN2 generators, results are strongest on the domains those generators were trained on, such as faces, cats, cars and landscapes, and the interactive demo runs best on a machine with a CUDA-capable GPU.

🚀 Visit DragGAN Official Site

🚩 Report an issue