DragGAN is the official code for the paper "Drag Your GAN: Interactive Point-based Manipulation on the Generative Image Manifold," published at SIGGRAPH 2023. The authors include Xingang Pan, Ayush Tewari, Thomas Leimkühler, Lingjie Liu, Abhimitra Meka, and Christian Theobalt. The project code is hosted on GitHub.
Purpose: DragGAN is used for interactive, point-based manipulation of generated images. Users can drag points on GAN-generated images to precisely control image content, such as changing an object's pose, shape, expression, or layout. The GUI supports editing GAN-generated images; to edit real images, you must first perform GAN inversion using tools such as PTI, then load the new latent code and model weights into the GUI.
Main capabilities: Provides point-based interactive image editing; includes a Gradio visualization interface and a desktop GUI; requires downloading pretrained StyleGAN2 weights, and you can try the StyleGAN-Human and Landscapes HQ (LHQ) dataset weights, or use other pretrained StyleGANs.
Usage: If using a CUDA GPU, you need to follow the requirements of NVlabs/stylegan3; the installation steps will set the correct CUDA version and all Python packages, then install additional dependencies. For GPU acceleration on MacOS Silicon Mac M1/M2 or CPU-only, or to run the Gradio visualizer in Docker: the provided Docker image is based on the NGC PyTorch repository. After running, you can open the Gradio shared link (the terminal will print it), but note that the Docker image takes about 25GB of disk space. To download pretrained weights, simply run the corresponding command; to try StyleGAN-Human and LHQ, download the weights from the provided links and place them under ./checkpoints. To run the DragGAN GUI, simply execute the corresponding command; Windows users can run a specific command; you can also run the DragGAN Gradio demo, which is suitable for Windows and Linux.
Applicable scenarios and limitations: Suitable for interactive editing of GAN-generated images; GAN inversion is required first to edit real images; the code is mainly developed based on StyleGAN3, with some code borrowed from StyleGAN-Human. Regarding licensing, the code related to the DragGAN algorithm uses the CC-BY-NC license, while most of the project code (the parts used or modified from StyleGAN3) uses the Nvidia Source Code License. Any form of use and derivative must retain the watermark function displaying "AI Generated." The Docker image requires about 25GB of disk space.
Notes: The project's specific installation commands, weight download commands, GUI run commands, etc. are all provided in the official repository and are not repeated here.