{"id":15028812,"url":"https://github.com/xingangpan/draggan","last_synced_at":"2025-05-11T03:42:33.723Z","repository":{"id":166795300,"uuid":"642323624","full_name":"XingangPan/DragGAN","owner":"XingangPan","description":"Official Code for DragGAN (SIGGRAPH 2023)","archived":false,"fork":false,"pushed_at":"2024-05-18T17:51:40.000Z","size":34847,"stargazers_count":35910,"open_issues_count":153,"forks_count":3445,"subscribers_count":981,"default_branch":"main","last_synced_at":"2025-05-11T03:42:24.905Z","etag":null,"topics":["artificial-intelligence","generative-adversarial-network","generative-models","image-manipulation"],"latest_commit_sha":null,"homepage":"https://vcai.mpi-inf.mpg.de/projects/DragGAN/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XingangPan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-18T10:08:02.000Z","updated_at":"2025-05-10T23:01:11.000Z","dependencies_parsed_at":"2023-07-06T11:16:14.379Z","dependency_job_id":"2f9420dc-5bb9-4f93-8294-c534fd698347","html_url":"https://github.com/XingangPan/DragGAN","commit_stats":{"total_commits":46,"total_committers":17,"mean_commits":"2.7058823529411766","dds":0.6956521739130435,"last_synced_commit":"336f120ce126aca6f55dc58537e76c10d19eabd0"},"previous_names":["xingangpan/draggan"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XingangPan%2FDragGAN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XingangPan%2FDragGAN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XingangPan%2FDragGAN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XingangPan%2FDragGAN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XingangPan","download_url":"https://codeload.github.com/XingangPan/DragGAN/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253514553,"owners_count":21920334,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artificial-intelligence","generative-adversarial-network","generative-models","image-manipulation"],"created_at":"2024-09-24T20:09:07.141Z","updated_at":"2025-05-11T03:42:33.702Z","avatar_url":"https://github.com/XingangPan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\n  \u003ch1 align=\"center\"\u003eDrag Your GAN: Interactive Point-based Manipulation on the Generative Image Manifold\u003c/h1\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://xingangpan.github.io/\"\u003e\u003cstrong\u003eXingang Pan\u003c/strong\u003e\u003c/a\u003e\n    ·\n    \u003ca href=\"https://ayushtewari.com/\"\u003e\u003cstrong\u003eAyush Tewari\u003c/strong\u003e\u003c/a\u003e\n    ·\n    \u003ca href=\"https://people.mpi-inf.mpg.de/~tleimkue/\"\u003e\u003cstrong\u003eThomas Leimkühler\u003c/strong\u003e\u003c/a\u003e\n    ·\n    \u003ca href=\"https://lingjie0206.github.io/\"\u003e\u003cstrong\u003eLingjie Liu\u003c/strong\u003e\u003c/a\u003e\n    ·\n    \u003ca href=\"https://www.meka.page/\"\u003e\u003cstrong\u003eAbhimitra Meka\u003c/strong\u003e\u003c/a\u003e\n    ·\n    \u003ca href=\"http://www.mpi-inf.mpg.de/~theobalt/\"\u003e\u003cstrong\u003eChristian Theobalt\u003c/strong\u003e\u003c/a\u003e\n  \u003c/p\u003e\n  \u003ch2 align=\"center\"\u003eSIGGRAPH 2023 Conference Proceedings\u003c/h2\u003e\n  \u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"DragGAN.gif\", width=\"600\"\u003e\n  \u003c/div\u003e\n\n  \u003cp align=\"center\"\u003e\n  \u003cbr\u003e\n    \u003ca href=\"https://pytorch.org/get-started/locally/\"\u003e\u003cimg alt=\"PyTorch\" src=\"https://img.shields.io/badge/PyTorch-ee4c2c?logo=pytorch\u0026logoColor=white\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://twitter.com/XingangP\"\u003e\u003cimg alt='Twitter' src=\"https://img.shields.io/twitter/follow/XingangP?label=%40XingangP\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://arxiv.org/abs/2305.10973\"\u003e\n      \u003cimg src='https://img.shields.io/badge/Paper-PDF-green?style=for-the-badge\u0026logo=adobeacrobatreader\u0026logoWidth=20\u0026logoColor=white\u0026labelColor=66cc00\u0026color=94DD15' alt='Paper PDF'\u003e\n    \u003c/a\u003e\n    \u003ca href='https://vcai.mpi-inf.mpg.de/projects/DragGAN/'\u003e\n      \u003cimg src='https://img.shields.io/badge/DragGAN-Page-orange?style=for-the-badge\u0026logo=Google%20chrome\u0026logoColor=white\u0026labelColor=D35400' alt='Project Page'\u003e\u003c/a\u003e\n    \u003ca href=\"https://colab.research.google.com/drive/1mey-IXPwQC_qSthI5hO-LTX7QL4ivtPh?usp=sharing\"\u003e\u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n## Web Demos\n\n[![Open in OpenXLab](https://cdn-static.openxlab.org.cn/app-center/openxlab_app.svg)](https://openxlab.org.cn/apps/detail/XingangPan/DragGAN)\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://huggingface.co/spaces/radames/DragGan\"\u003e\u003cimg alt=\"Huggingface\" src=\"https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-DragGAN-orange\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Requirements\n\nIf you have CUDA graphic card, please follow the requirements of [NVlabs/stylegan3](https://github.com/NVlabs/stylegan3#requirements).  \n\nThe usual installation steps involve the following commands, they should set up the correct CUDA version and all the python packages\n\n```\nconda env create -f environment.yml\nconda activate stylegan3\n```\n\nThen install the additional requirements\n\n```\npip install -r requirements.txt\n```\n\nOtherwise (for GPU acceleration on MacOS with Silicon Mac M1/M2, or just CPU) try the following:\n\n```sh\ncat environment.yml | \\\n  grep -v -E 'nvidia|cuda' \u003e environment-no-nvidia.yml \u0026\u0026 \\\n    conda env create -f environment-no-nvidia.yml\nconda activate stylegan3\n\n# On MacOS\nexport PYTORCH_ENABLE_MPS_FALLBACK=1\n```\n\n## Run Gradio visualizer in Docker \n\nProvided docker image is based on NGC PyTorch repository. To quickly try out visualizer in Docker, run the following:  \n\n```sh\n# before you build the docker container, make sure you have cloned this repo, and downloaded the pretrained model by `python scripts/download_model.py`.\ndocker build . -t draggan:latest  \ndocker run -p 7860:7860 -v \"$PWD\":/workspace/src -it draggan:latest bash\n# (Use GPU)if you want to utilize your Nvidia gpu to accelerate in docker, please add command tag `--gpus all`, like:\n#   docker run --gpus all  -p 7860:7860 -v \"$PWD\":/workspace/src -it draggan:latest bash\n\ncd src \u0026\u0026 python visualizer_drag_gradio.py --listen\n```\nNow you can open a shared link from Gradio (printed in the terminal console).   \nBeware the Docker image takes about 25GB of disk space!\n\n## Download pre-trained StyleGAN2 weights\n\nTo download pre-trained weights, simply run:\n\n```\npython scripts/download_model.py\n```\nIf you want to try StyleGAN-Human and the Landscapes HQ (LHQ) dataset, please download weights from these links: [StyleGAN-Human](https://drive.google.com/file/d/1dlFEHbu-WzQWJl7nBBZYcTyo000H9hVm/view?usp=sharing), [LHQ](https://drive.google.com/file/d/16twEf0T9QINAEoMsWefoWiyhcTd-aiWc/view?usp=sharing), and put them under `./checkpoints`.\n\nFeel free to try other pretrained StyleGAN.\n\n## Run DragGAN GUI\n\nTo start the DragGAN GUI, simply run:\n```sh\nsh scripts/gui.sh\n```\nIf you are using windows, you can run:\n```\n.\\scripts\\gui.bat\n```\n\nThis GUI supports editing GAN-generated images. To edit a real image, you need to first perform GAN inversion using tools like [PTI](https://github.com/danielroich/PTI). Then load the new latent code and model weights to the GUI.\n\nYou can run DragGAN Gradio demo as well, this is universal for both windows and linux:\n```sh\npython visualizer_drag_gradio.py\n```\n\n## Acknowledgement\n\nThis code is developed based on [StyleGAN3](https://github.com/NVlabs/stylegan3). Part of the code is borrowed from [StyleGAN-Human](https://github.com/stylegan-human/StyleGAN-Human).\n\n(cheers to the community as well)\n## License\n\nThe code related to the DragGAN algorithm is licensed under [CC-BY-NC](https://creativecommons.org/licenses/by-nc/4.0/).\nHowever, most of this project are available under a separate license terms: all codes used or modified from [StyleGAN3](https://github.com/NVlabs/stylegan3) is under the [Nvidia Source Code License](https://github.com/NVlabs/stylegan3/blob/main/LICENSE.txt).\n\nAny form of use and derivative of this code must preserve the watermarking functionality showing \"AI Generated\".\n\n## BibTeX\n\n```bibtex\n@inproceedings{pan2023draggan,\n    title={Drag Your GAN: Interactive Point-based Manipulation on the Generative Image Manifold},\n    author={Pan, Xingang and Tewari, Ayush, and Leimk{\\\"u}hler, Thomas and Liu, Lingjie and Meka, Abhimitra and Theobalt, Christian},\n    booktitle = {ACM SIGGRAPH 2023 Conference Proceedings},\n    year={2023}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxingangpan%2Fdraggan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxingangpan%2Fdraggan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxingangpan%2Fdraggan/lists"}