Fork: 332 Star: 3407 (更新于 2023-06-03 18:32:39)

license: 暂无

Language: Python.

Online Demo and Implementation of DragGAN - "Drag Your GAN: Interactive Point-based Manipulation on the Generative Image Manifold" (DragGAN 全功能实现,在线Demo,本地部署试用,代码、模型已全部开源,支持Windows, macOS, Linux)



PyPI support

:boom: Colab Demo | InternGPT Free Online Demo | Local Deployment

An out-of-box online demo is integrated in InternGPT - a super cool pointing-language-driven visual interactive system. Enjoy for free.:lollipop:

Note for Colab, remember to select a GPU via Runtime/Change runtime type (代码执行程序/更改运行时类型).

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

How it Work ?

Here is a simple tutorial video showing how to use our implementation.

Check out the original paper for the backend algorithm and math.



:star2: What's New

  • [2023/5/29] A new version is in beta, install via pip install draggan==1.1.0b2, includes speed improvement and more models.
  • [2023/5/25] DragGAN is on PyPI, simple install via pip install draggan. Also addressed the common CUDA problems
  • [2023/5/25] We now support StyleGAN2-ada with much higher quality and more types of images. Try it by selecting models started with "ada".
  • [2023/5/24] Custom Image with GAN inversion is supported, but it is possible that your custom images are distorted due to the limitation of GAN inversion. Besides, it is also possible the manipulations fail due to the limitation of our implementation.

:star2: Changelog

  • PTI GAN inversion
  • Tweak performance.
  • Improving installation experience, DragGAN is now on PyPI.
  • Automatically determining the number of iterations.
  • Allow to save video without point annotations, custom image size.
  • Support StyleGAN2-ada.
  • Integrate into InternGPT
  • Custom Image with GAN inversion.
  • Download generated image and generation trajectory.
  • Controlling generation process with GUI.
  • Automatically download stylegan2 checkpoint.
  • Support movable region, multiple handle points.
  • Gradio and Colab Demo.

This project is now a sub-project of InternGPT for interactive image editing. Future updates of more cool tools beyond DragGAN would be added in InternGPT.

Running Locally

With PyPI

📑 Step by Step Tutorial | 中文部署教程

We recommend to use Conda to install requirements.

conda create -n draggan python=3.7
conda activate draggan

Install PyTorch following the official instructions

conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia 

Install DragGAN

pip install draggan
# If you meet ERROR: Could not find a version that satisfies the requirement draggan (from versions: none), use
pip install draggan -i

Launch the Gradio demo

# if you have a Nvidia GPU
python -m draggan.web
# if you use m1/m2 mac
python -m draggan.web --device mps
# otherwise
python -m draggan.web --device cpu

Clone and Install

Ensure you have a GPU and CUDA installed. We use Python 3.7 for testing, other versions (>= 3.7) of Python should work too, but not tested. We recommend to use Conda to prepare all the requirements.

For Windows users, you might encounter some issues caused by StyleGAN custom ops, youd could find some solutions from the issues pannel. We are also working on a more friendly package without setup.

git clone
cd DragGAN
conda create -n draggan python=3.7
conda activate draggan
pip install -r requirements.txt

Launch the Gradio demo

# if you have a Nvidia GPU
# if you use m1/m2 mac
python --device mps
# otherwise
python --device cpu

If you have any issue for downloading the checkpoint, you could manually download it from here and put it into the folder checkpoints.


    title={Drag Your GAN: Interactive Point-based Manipulation on the Generative Image Manifold}, 
    author={Pan, Xingang and Tewari, Ayush, and Leimk{\"u}hler, Thomas and Liu, Lingjie and Meka, Abhimitra and Theobalt, Christian},
    booktitle = {ACM SIGGRAPH 2023 Conference Proceedings},


Official DragGANStyleGAN2StyleGAN2-pytorchStyleGAN2-Ada

Welcome to discuss with us and continuously improve the user experience of DragGAN. Reach us with this WeChat QR Code.


最近版本更新:(数据更新于2023-06-05 05:22:38)


draggan, gradio-interface, image-editing, image-generation, interngpt


2023-06-06 01:35:05 mmabrouk/chatgpt-wrapper

2023-06-05 23:25:24 bmaltais/kohya_ss

2023-06-05 23:03:20 zauberzeug/nicegui

2023-06-05 11:05:30 hwchase17/langchain

2023-06-05 07:01:44 bridgecrewio/checkov

2023-06-04 20:21:14 arc53/DocsGPT