Retour au classement

Official Code for DragGAN (SIGGRAPH 2023)

artificial-intelligencegenerative-adversarial-networkgenerative-modelsimage-manipulation
Croissance des étoiles
Étoiles
35.8k
Forks
3.4k
Croissance hebdomadaire
Issues
145
20k30k
mai 2023mai 2024juin 2025juil. 2026
ArtefactsPyPIpip install draggan
README

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

Xingang Pan · Ayush Tewari · Thomas Leimkühler · Lingjie Liu · Abhimitra Meka · Christian Theobalt

SIGGRAPH 2023 Conference Proceedings


PyTorch Twitter Paper PDF Project Page Open In Colab

Web Demos

Open in OpenXLab

Huggingface

Requirements

If you have CUDA graphic card, please follow the requirements of NVlabs/stylegan3.

The usual installation steps involve the following commands, they should set up the correct CUDA version and all the python packages

conda env create -f environment.yml
conda activate stylegan3

Then install the additional requirements

pip install -r requirements.txt

Otherwise (for GPU acceleration on MacOS with Silicon Mac M1/M2, or just CPU) try the following:

cat environment.yml | \
  grep -v -E 'nvidia|cuda' > environment-no-nvidia.yml && \
    conda env create -f environment-no-nvidia.yml
conda activate stylegan3

# On MacOS
export PYTORCH_ENABLE_MPS_FALLBACK=1

Run Gradio visualizer in Docker

Provided docker image is based on NGC PyTorch repository. To quickly try out visualizer in Docker, run the following:

# before you build the docker container, make sure you have cloned this repo, and downloaded the pretrained model by `python scripts/download_model.py`.
docker build . -t draggan:latest  
docker run -p 7860:7860 -v "$PWD":/workspace/src -it draggan:latest bash
# (Use GPU)if you want to utilize your Nvidia gpu to accelerate in docker, please add command tag `--gpus all`, like:
#   docker run --gpus all  -p 7860:7860 -v "$PWD":/workspace/src -it draggan:latest bash

cd src && python visualizer_drag_gradio.py --listen

Now you can open a shared link from Gradio (printed in the terminal console).
Beware the Docker image takes about 25GB of disk space!

Download pre-trained StyleGAN2 weights

To download pre-trained weights, simply run:

python scripts/download_model.py

If you want to try StyleGAN-Human and the Landscapes HQ (LHQ) dataset, please download weights from these links: StyleGAN-Human, LHQ, and put them under ./checkpoints.

Feel free to try other pretrained StyleGAN.

Run DragGAN GUI

To start the DragGAN GUI, simply run:

sh scripts/gui.sh

If you are using windows, you can run:

.\scripts\gui.bat

This GUI supports editing GAN-generated images. To edit a real image, you need to first perform GAN inversion using tools like PTI. Then load the new latent code and model weights to the GUI.

You can run DragGAN Gradio demo as well, this is universal for both windows and linux:

python visualizer_drag_gradio.py

Acknowledgement

This code is developed based on StyleGAN3. Part of the code is borrowed from StyleGAN-Human.

(cheers to the community as well)

License

The code related to the DragGAN algorithm is licensed under CC-BY-NC. However, most of this project are available under a separate license terms: all codes used or modified from StyleGAN3 is under the Nvidia Source Code License.

Any form of use and derivative of this code must preserve the watermarking functionality showing "AI Generated".

BibTeX

@inproceedings{pan2023draggan,
    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},
    year={2023}
}
Dépôts similaires
Significant-Gravitas/AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

PythonPyPIOtheraiopenai
agpt.co
185.6k46.1k
f/prompts.chat

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

HTMLOtherchatgptai
prompts.chat
166.1k21.5k
rasbt/LLMs-from-scratch

Implement a ChatGPT-like LLM in PyTorch from scratch, step by step

Jupyter NotebookOthergptlarge-language-models
amzn.to/4fqvn0D
99.5k15.3k
hacksider/Deep-Live-Cam

real time face swap and one-click video deepfake with only a single image

PythonPyPIGNU Affero General Public License v3.0ai-facedeepfake
deeplivecam.net
95k13.8k
thedotmack/claude-mem

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

JavaScriptnpmApache License 2.0aiai-agents
claude-mem.ai
88k7.6k
OpenHands/OpenHands

🙌 OpenHands: AI-Driven Development

PythonPyPIOtheragentartificial-intelligence
openhands.dev
81.4k10.4k
FlowiseAI/Flowise

Build AI Agents, Visually

TypeScriptnpmOtherartificial-intelligencechatgpt
flowiseai.com
54.8k24.7k
jingyaogong/minimind

🧠「大模型」2小时完全从0训练64M的小参数LLM!Train a 64M-parameter LLM from scratch in just 2h!

PythonPyPIApache License 2.0artificial-intelligencelarge-language-model
jingyaogong.github.io/minimind
53.7k7k
microsoft/AI-For-Beginners

12 Weeks, 24 Lessons, AI for All!

Jupyter NotebookMIT Licensedeep-learningartificial-intelligence
52.5k10.6k
All-Hands-AI/OpenHands

🙌 OpenHands: Code Less, Make More

PythonPyPIMIT Licenseagentartificial-intelligence
all-hands.dev
49.7k5.5k
Kong/kong

🦍 The API and AI Gateway

LuaApache License 2.0api-gatewaymicroservices
konghq.com/install/
43.8k5.2k
usestrix/strix

Open-source AI penetration testing tool to find and fix your app’s vulnerabilities.

PythonPyPIApache License 2.0agentsartificial-intelligence
strix.ai
43k4.4k