Practical overview
When it fits
Use DragGAN to experiment with interactive point-based changes to GAN-generated images, or as a research-code starting point for a visual image-editing prototype.
Who it is for
- Researchers exploring interactive manipulation of generative models.
- Developers who want to run or adapt point-based GAN image-editing research code.
- Users who want to experiment with dragging points in GAN-generated images through a visualizer.
Documented uses
- Explore point-based edits to images generated by GANs.
- Run a local GUI or Gradio visualizer with pretrained StyleGAN weights.
- Edit a real image after performing GAN inversion with a separate tool and loading its latent code and model weights.
Requirements & limits
The repository links hosted demos on OpenXLab and Hugging Face, plus a Google Colab notebook. It also documents local installation for CUDA-capable graphics cards, Apple Silicon Macs, or CPU use.
- Real-image editing requires a separate GAN inversion step, such as PTI.
- The local setup requires pretrained model weights and a Python environment.
- The Docker visualizer image is approximately 25 GB.
- Licensing differs between the DragGAN algorithm code and much of the StyleGAN3-derived code; derivative use must preserve the “AI Generated” watermark.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Start the local DragGAN GUI
Prepare the documented environment and model weights before launching the GUI.
Before you start
- A cloned DragGAN repository.
- A CUDA-capable graphics card, Apple Silicon Mac, or CPU environment; CUDA users should follow the StyleGAN3 requirements.
- Conda and the Python packages listed in the repository.
Steps
Create and activate the Conda environment using the repository's CUDA or non-NVIDIA instructions.
Install additional packages with the command below.
pip install -r requirements.txtDownload pretrained StyleGAN2 weights with the command below.
python scripts/download_model.pyLaunch the GUI with the command below; on Windows, use
scripts/gui.bat.sh scripts/gui.sh
Expected outcome
The DragGAN GUI is started for editing GAN-generated images.
Guide limitations
- Editing a real image requires GAN inversion with a separate tool such as PTI, followed by loading the latent code and model weights.
- The README's Docker route notes an image size of about 25 GB.
- The project has distinct licensing terms for DragGAN algorithm code and StyleGAN3-derived code, and derivatives must preserve the “AI Generated” watermark.
Launch the Gradio visualizer in Docker
Build and start the repository's Docker-based Gradio visualizer.
Before you start
- A cloned DragGAN repository.
- Pretrained model weights downloaded with
python scripts/download_model.py. - Docker; add
--gpus allto the documented run command when using an NVIDIA GPU.
Steps
Build the image with the command below.
docker build . -t draggan:latestStart the container with the documented port and workspace mapping.
Inside the container, run
cd src && python visualizer_drag_gradio.py --listen.Open the Gradio shared link printed in the terminal.
Expected outcome
A Gradio visualizer is started and provides a shared link in the terminal.
Guide limitations
- The Docker image takes about 25 GB of disk space.
- The documented command starts the visualizer; it does not specify additional deployment or access-control configuration.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 17 October 2026
- Original website title
- XingangPan/DragGAN · Official homepage title · retained in its source language

