[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-72915":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":28,"discoverSource":29},72915,"PhotoMaker","TencentARC\u002FPhotoMaker","TencentARC","PhotoMaker [CVPR 2024]","https:\u002F\u002Fphoto-maker.github.io\u002F",null,"Jupyter Notebook",10100,811,98,152,0,2,7,6,76.93,"Other",false,"main",[],"2026-06-12 04:01:07","\u003Cp align=\"center\">\r\n  \u003Cimg src=\"https:\u002F\u002Fphoto-maker.github.io\u002Fassets\u002Flogo.png\" height=100>\r\n\r\n\u003C\u002Fp>\r\n\r\n\u003C!-- ## \u003Cdiv align=\"center\">\u003Cb>PhotoMaker\u003C\u002Fb>\u003C\u002Fdiv> -->\r\n\r\n\u003Cdiv align=\"center\">\r\n  \r\n## PhotoMaker: Customizing Realistic Human Photos via Stacked ID Embedding  [![Paper page](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fhuggingface\u002Fbadges\u002Fresolve\u002Fmain\u002Fpaper-page-md-dark.svg)](https:\u002F\u002Fhuggingface.co\u002Fpapers\u002F2312.04461)\r\n[[Paper](https:\u002F\u002Fhuggingface.co\u002Fpapers\u002F2312.04461)] &emsp; [[Project Page](https:\u002F\u002Fphoto-maker.github.io)] &emsp; [[Model Card](https:\u002F\u002Fhuggingface.co\u002FTencentARC\u002FPhotoMaker)] \u003Cbr>\r\n\r\n[[💥New 🤗 **Demo (PhotoMaker V2)**](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FTencentARC\u002FPhotoMaker-V2)] &emsp; [[🤗 Demo (Realistic)](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FTencentARC\u002FPhotoMaker)] &emsp; [[🤗 Demo (Stylization)](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FTencentARC\u002FPhotoMaker-Style)] \u003Cbr>\r\n\r\n[[Replicate Demo (Realistic)](https:\u002F\u002Freplicate.com\u002Fjd7h\u002Fphotomaker)] &emsp; [[Replicate Demo (Stylization)](https:\u002F\u002Freplicate.com\u002Fyorickvp\u002Fphotomaker-style)] &emsp; [[Jittor version](https:\u002F\u002Fgithub.com\u002FNK-JittorCV\u002Fnk-diffusion)]  \u003Cbe>\r\n\r\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fd7d99f0b-2f1e-4d13-8ca8-e08685bcda2a\" height=40>\r\n\r\n**PhotoMaker-V2** is supported by the [HunyuanDiT](https:\u002F\u002Fgithub.com\u002FTencent\u002FHunyuanDiT) team. \r\n\r\n🥳 We release **PhotoMaker V2**. Please refer to [comparisons](.\u002FREADME_pmv2.md) between PhotoMaker V1, PhotoMaker V2, IP-Adapter-FaceID-plus-V2, and InstantID. Please watch [this video](https:\u002F\u002Fphoto-maker.github.io\u002Fassets\u002Fdemo_pm_v2_full.mp4) for how to use our demo. For PhotoMaker V2 ComfyUI nodes, please refer to the [Related Resources](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FPhotoMaker?tab=readme-ov-file#related-resources) \r\n\u003C\u002Fdiv>\r\n\r\n\r\n---\r\n\r\n### 🌠  **Key Features:**\r\n\r\n1. Rapid customization **within seconds**, with no additional LoRA training.\r\n2. Ensures impressive ID fidelity, offering diversity, promising text controllability, and high-quality generation.\r\n3. Can serve as an **Adapter** to collaborate with other Base Models alongside LoRA modules in community.\r\n\r\n---\r\n\u003Ca href=\"https:\u002F\u002Ftrendshift.io\u002Frepositories\u002F7008\" target=\"_blank\" align=center>\u003Cimg src=\"https:\u002F\u002Ftrendshift.io\u002Fapi\u002Fbadge\u002Frepositories\u002F7008\" alt=\"TencentARC%2FPhotoMaker | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"\u002F>\u003C\u002Fa>\r\n\r\n❗❗ Note: If there are any PhotoMaker based resources and applications, please leave them in the [discussion](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FPhotoMaker\u002Fdiscussions\u002F36) and we will list them in the [Related Resources](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FPhotoMaker?tab=readme-ov-file#related-resources) section in README file.\r\nNow we know the implementation of **Replicate**, **Windows**, **ComfyUI**, and **WebUI**. Thank you all! \r\n\r\n\u003Cdiv align=\"center\">\r\n\r\n![photomaker_demo_fast](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FPhotoMaker\u002Fassets\u002F21050959\u002Fe72cbf4d-938f-417d-b308-55e76a4bc5c8)\r\n\u003C\u002Fdiv>\r\n\r\n\r\n## 🚩 **New Features\u002FUpdates**\r\n- ✅ July 22, 2024. 💥 We release PhotoMaker V2 with **improved ID fidelity**. At the same time, it still maintains the generation quality, editability, and compatibility with any plugins that PhotoMaker V1 offers. We have also provided scripts for integration with [ControlNet](.\u002Finference_scripts\u002Finference_pmv2_contronet.py), [T2I-Adapter](.\u002Finference_scripts\u002Finference_pmv2_t2i_adapter.py), and [IP-Adapter](.\u002Finference_scripts\u002Finference_pmv2_ip_adapter.py) to offer excellent control capabilities. Users can further customize scripts for upgrades, such as combining with LCM for acceleration or integrating with IP-Adapter-FaceID or InstantID to further improve ID fidelity. We will release technical report of PhotoMaker V2 soon. Please refer to [this doc](.\u002FREADME_pmv2.md) for a quick preview. \r\n- ✅ January 20, 2024. An **important** note: For those GPUs that do not support bfloat16, please change [this line](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FPhotoMaker\u002Fblob\u002F6ec44fc13909d64a65c635b9e3b6f238eb1de9fe\u002Fgradio_demo\u002Fapp.py#L39) to `torch_dtype = torch.float16`, the speed will be **greatly improved** (1min\u002Fimg (before) vs. 14s\u002Fimg (after) on V100). The minimum GPU memory requirement for PhotoMaker is **11G** (Please refer to [this link](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FPhotoMaker\u002Fdiscussions\u002F114) for saving GPU memory).\r\n- ✅ January 15, 2024. We release PhotoMaker.\r\n\r\n---\r\n\r\n## 🔥 **Examples**\r\n\r\n\r\n### Realistic generation \r\n\r\n- [![Huggingface PhotoMaker](https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=Demo&message=Huggingface%20Gradio&color=orange)](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FTencentARC\u002FPhotoMaker)\r\n- [**PhotoMaker notebook demo**](photomaker_demo.ipynb)\r\n\r\n\u003Cp align=\"center\">\r\n  \u003Cimg src=\"https:\u002F\u002Fcdn-uploads.huggingface.co\u002Fproduction\u002Fuploads\u002F6285a9133ab6642179158944\u002FBYBZNyfmN4jBKBxxt4uxz.jpeg\" height=450>\r\n\u003C\u002Fp>\r\n\r\n\u003Cp align=\"center\">\r\n  \u003Cimg src=\"https:\u002F\u002Fcdn-uploads.huggingface.co\u002Fproduction\u002Fuploads\u002F6285a9133ab6642179158944\u002F9KYqoDxfbNVLzVKZzSzwo.jpeg\" height=450>\r\n\u003C\u002Fp>\r\n\r\n### Stylization generation \r\n\r\nNote: only change the base model and add the LoRA modules for better stylization\r\n\r\n- [![Huggingface PhotoMaker-Style](https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=Demo&message=Huggingface%20Gradio&color=orange)](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FTencentARC\u002FPhotoMaker-Style)\r\n- [**PhotoMaker-Style notebook demo**](photomaker_style_demo.ipynb) \r\n\r\n\u003Cp align=\"center\">\r\n  \u003Cimg src=\"https:\u002F\u002Fcdn-uploads.huggingface.co\u002Fproduction\u002Fuploads\u002F6285a9133ab6642179158944\u002Fdu884lcjpqqjnJIxpATM2.jpeg\" height=450>\r\n\u003C\u002Fp>\r\n  \r\n\u003Cp align=\"center\">\r\n  \u003Cimg src=\"https:\u002F\u002Fcdn-uploads.huggingface.co\u002Fproduction\u002Fuploads\u002F6285a9133ab6642179158944\u002F-AC7Hr5YL4yW1zXGe_Izl.jpeg\" height=450>\r\n\u003C\u002Fp>\r\n\r\n# 🔧 Dependencies and Installation\r\n\r\n- Python >= 3.8 (Recommend to use [Anaconda](https:\u002F\u002Fwww.anaconda.com\u002Fdownload\u002F#linux) or [Miniconda](https:\u002F\u002Fdocs.conda.io\u002Fen\u002Flatest\u002Fminiconda.html))\r\n- [PyTorch >= 2.0.0](https:\u002F\u002Fpytorch.org\u002F)\r\n```bash\r\nconda create --name photomaker python=3.10\r\nconda activate photomaker\r\npip install -U pip\r\n\r\n# Install requirements\r\npip install -r requirements.txt\r\n\r\n# Install photomaker\r\npip install git+https:\u002F\u002Fgithub.com\u002FTencentARC\u002FPhotoMaker.git\r\n```\r\n\r\nThen you can run the following command to use it\r\n```python\r\nfrom photomaker import PhotoMakerStableDiffusionXLPipeline\r\n```\r\n\r\n# ⏬ Download Models \r\nThe model will be automatically downloaded through the following two lines:\r\n\r\n```python\r\nfrom huggingface_hub import hf_hub_download\r\nphotomaker_path = hf_hub_download(repo_id=\"TencentARC\u002FPhotoMaker\", filename=\"photomaker-v1.bin\", repo_type=\"model\")\r\n```\r\n\r\nYou can also choose to download manually from this [url](https:\u002F\u002Fhuggingface.co\u002FTencentARC\u002FPhotoMaker).\r\n\r\n# 💻 How to Test\r\n\r\n## Use like [diffusers](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fdiffusers)\r\n\r\n- Dependency\r\n```py\r\nimport torch\r\nimport os\r\nfrom diffusers.utils import load_image\r\nfrom diffusers import EulerDiscreteScheduler\r\nfrom photomaker import PhotoMakerStableDiffusionXLPipeline\r\n\r\n### Load base model\r\npipe = PhotoMakerStableDiffusionXLPipeline.from_pretrained(\r\n    base_model_path,  # can change to any base model based on SDXL\r\n    torch_dtype=torch.bfloat16, \r\n    use_safetensors=True, \r\n    variant=\"fp16\"\r\n).to(device)\r\n\r\n### Load PhotoMaker checkpoint\r\npipe.load_photomaker_adapter(\r\n    os.path.dirname(photomaker_path),\r\n    subfolder=\"\",\r\n    weight_name=os.path.basename(photomaker_path),\r\n    trigger_word=\"img\"  # define the trigger word\r\n)     \r\n\r\npipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config)\r\n\r\n### Also can cooperate with other LoRA modules\r\n# pipe.load_lora_weights(os.path.dirname(lora_path), weight_name=lora_model_name, adapter_name=\"xl_more_art-full\")\r\n# pipe.set_adapters([\"photomaker\", \"xl_more_art-full\"], adapter_weights=[1.0, 0.5])\r\n\r\npipe.fuse_lora()\r\n```\r\n\r\n- Input ID Images\r\n```py\r\n### define the input ID images\r\ninput_folder_name = '.\u002Fexamples\u002Fnewton_man'\r\nimage_basename_list = os.listdir(input_folder_name)\r\nimage_path_list = sorted([os.path.join(input_folder_name, basename) for basename in image_basename_list])\r\n\r\ninput_id_images = []\r\nfor image_path in image_path_list:\r\n    input_id_images.append(load_image(image_path))\r\n```\r\n\r\n\u003Cdiv align=\"center\">\r\n\r\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002FTencentARC\u002FPhotoMaker\u002Fassets\u002F21050959\u002F01d53dfa-7528-4f09-a1a5-96b349ae7800\" align=\"center\">\u003Cimg style=\"margin:0;padding:0;\" src=\"https:\u002F\u002Fgithub.com\u002FTencentARC\u002FPhotoMaker\u002Fassets\u002F21050959\u002F01d53dfa-7528-4f09-a1a5-96b349ae7800\"\u002F>\u003C\u002Fa>\r\n\u003C\u002Fdiv>\r\n\r\n- Generation\r\n```py\r\n# Note that the trigger word `img` must follow the class word for personalization\r\nprompt = \"a half-body portrait of a man img wearing the sunglasses in Iron man suit, best quality\"\r\nnegative_prompt = \"(asymmetry, worst quality, low quality, illustration, 3d, 2d, painting, cartoons, sketch), open mouth, grayscale\"\r\ngenerator = torch.Generator(device=device).manual_seed(42)\r\nimages = pipe(\r\n    prompt=prompt,\r\n    input_id_images=input_id_images,\r\n    negative_prompt=negative_prompt,\r\n    num_images_per_prompt=1,\r\n    num_inference_steps=num_steps,\r\n    start_merge_step=10,\r\n    generator=generator,\r\n).images[0]\r\ngen_images.save('out_photomaker.png')\r\n```\r\n\r\n\u003Cdiv align=\"center\">\r\n\r\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002FTencentARC\u002FPhotoMaker\u002Fassets\u002F21050959\u002F703c00e1-5e50-4c19-899e-25ee682d2c06\" align=\"center\">\u003Cimg width=400 style=\"margin:0;padding:0;\" src=\"https:\u002F\u002Fgithub.com\u002FTencentARC\u002FPhotoMaker\u002Fassets\u002F21050959\u002F703c00e1-5e50-4c19-899e-25ee682d2c06\"\u002F>\u003C\u002Fa>\r\n\r\n\u003C\u002Fdiv>\r\n\r\n## Start a local gradio demo\r\nRun the following command:\r\n\r\n```python\r\npython gradio_demo\u002Fapp.py\r\n```\r\n\r\nYou could customize this script in [this file](gradio_demo\u002Fapp.py).\r\n\r\nIf you want to run it on MAC, you should follow [this Instruction](MacGPUEnv.md) and then run the app.py.\r\n\r\n## Usage Tips:\r\n- Upload more photos of the person to be customized to improve ID fidelity. If the input is Asian face(s), maybe consider adding 'Asian' before the class word, e.g., `Asian woman img`\r\n- When stylizing, does the generated face look too realistic? Adjust the Style strength to 30-50, the larger the number, the less ID fidelity, but the stylization ability will be better. You could also try out other base models or LoRAs with good stylization effects.\r\n- Reduce the number of generated images and sampling steps for faster speed. However, please keep in mind that reducing the sampling steps may compromise the ID fidelity.\r\n\r\n# Related Resources\r\n### Replicate demo of PhotoMaker: \r\n1. [Demo link](https:\u002F\u002Freplicate.com\u002Fjd7h\u002Fphotomaker), run PhotoMaker on replicate, provided by [@yorickvP](https:\u002F\u002Fgithub.com\u002FyorickvP) and [@jd7h](https:\u002F\u002Fgithub.com\u002Fjd7h).\r\n2. [Demo link (style version)](https:\u002F\u002Freplicate.com\u002Fyorickvp\u002Fphotomaker-style).\r\n\r\n### WebUI version of PhotoMaker: \r\n1. **stable-diffusion-webui-forge**: https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge provided by [@Lvmin Zhang](https:\u002F\u002Fgithub.com\u002Flllyasviel)\r\n2. **Fooocus App**: [Fooocus-inswapper](https:\u002F\u002Fgithub.com\u002Fmachineminded\u002FFooocus-inswapper) provided by [@machineminded](https:\u002F\u002Fgithub.com\u002Fmachineminded)\r\n\r\n### Windows version of PhotoMaker: \r\n1. [bmaltais\u002FPhotoMaker](https:\u002F\u002Fgithub.com\u002Fbmaltais\u002FPhotoMaker\u002Ftree\u002Fv1.0.1) by [@bmaltais](https:\u002F\u002Fgithub.com\u002Fbmaltais), easy to deploy PhotoMaker on Windows. The description can be found in [this link](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FPhotoMaker\u002Fdiscussions\u002F36#discussioncomment-8156199).\r\n2. [sdbds\u002FPhotoMaker-for-windows](https:\u002F\u002Fgithub.com\u002Fsdbds\u002FPhotoMaker-for-windows\u002Ftree\u002Fwindows) by [@sdbds](https:\u002F\u002Fgithub.com\u002Fsdbds).\r\n   \r\n### ComfyUI:\r\n1. 🔥 **Official Implementation by [ComfyUI](https:\u002F\u002Fgithub.com\u002Fcomfyanonymous\u002FComfyUI)**: https:\u002F\u002Fgithub.com\u002Fcomfyanonymous\u002FComfyUI\u002Fcommit\u002Fd1533d9c0f1dde192f738ef1b745b15f49f41e02\r\n2. https:\u002F\u002Fgithub.com\u002FZHO-ZHO-ZHO\u002FComfyUI-PhotoMaker\r\n3. https:\u002F\u002Fgithub.com\u002FStartHua\u002FComfyui-Mine-PhotoMaker\r\n4. https:\u002F\u002Fgithub.com\u002Fshiimizu\u002FComfyUI-PhotoMaker\r\n\r\n### ComfyUI (for PhotoMaker V2):\r\n1. https:\u002F\u002Fgithub.com\u002Fshiimizu\u002FComfyUI-PhotoMaker-Plus\r\n2. https:\u002F\u002Fgithub.com\u002Fedwios\u002FComfyUI-PhotoMakerV2-ZHO\u002Ftree\u002Fmain\r\n3. https:\u002F\u002Fopenart.ai\u002Fworkflows\u002Fshalacai\u002Fphotomakerv2\u002FfttT4ztRM85JxBJ2eUyr\r\n4. https:\u002F\u002Fgithub.com\u002Fzhangp365\u002FComfyUI_photomakerV2_native\r\n\r\n### Purely C\u002FC++\u002FCUDA version of PhotoMaker:\r\n1. [stable-diffusion.cpp](https:\u002F\u002Fgithub.com\u002Fleejet\u002Fstable-diffusion.cpp\u002Fpull\u002F179) by [@bssrdf](https:\u002F\u002Fgithub.com\u002Fbssrdf).\r\n\r\n### Other Applications \u002F Web Demos\r\n1. **Wisemodel 始智 (Easy to use in China)** https:\u002F\u002Fwisemodel.cn\u002Fspace\u002Fgradio\u002Fphotomaker \r\n2. **OpenXLab (Easy to use in China)**: https:\u002F\u002Fopenxlab.org.cn\u002Fapps\u002Fdetail\u002Fcamenduru\u002FPhotoMaker\r\n [![Open in OpenXLab](https:\u002F\u002Fcdn-static.openxlab.org.cn\u002Fapp-center\u002Fopenxlab_app.svg)](https:\u002F\u002Fopenxlab.org.cn\u002Fapps\u002Fdetail\u002Fcamenduru\u002FPhotoMaker)\r\nby [@camenduru](https:\u002F\u002Fgithub.com\u002Fcamenduru).\r\n3. **Colab**: https:\u002F\u002Fgithub.com\u002Fcamenduru\u002FPhotoMaker-colab by [@camenduru](https:\u002F\u002Fgithub.com\u002Fcamenduru)\r\n4. **Monster API**: https:\u002F\u002Fmonsterapi.ai\u002Fplayground?model=photo-maker\r\n5. **Pinokio**: https:\u002F\u002Fpinokio.computer\u002Fitem?uri=https:\u002F\u002Fgithub.com\u002Fcocktailpeanutlabs\u002Fphotomaker\r\n\r\n### Graido demo in 45 lines\r\nProvided by [@Gradio](https:\u002F\u002Ftwitter.com\u002FGradio\u002Fstatus\u002F1747683500495691942)\r\n\r\n\r\n# 🤗 Acknowledgements\r\n- PhotoMaker is co-hosted by Tencent ARC Lab and Nankai University [MCG-NKU](https:\u002F\u002Fmmcheng.net\u002Fcmm\u002F).\r\n- Inspired from many excellent demos and repos, including [IP-Adapter](https:\u002F\u002Fgithub.com\u002Ftencent-ailab\u002FIP-Adapter), [multimodalart\u002FIp-Adapter-FaceID](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fmultimodalart\u002FIp-Adapter-FaceID), [FastComposer](https:\u002F\u002Fgithub.com\u002Fmit-han-lab\u002Ffastcomposer), and [T2I-Adapter](https:\u002F\u002Fgithub.com\u002FTencentARC\u002FT2I-Adapter). Thanks for their great work!\r\n- Thanks to the [HunyuanDiT](https:\u002F\u002Fgithub.com\u002FTencent\u002FHunyuanDiT) team for their generous support and suggestions!\r\n- Thanks to the Venus team in Tencent PCG for their feedback and suggestions.\r\n- Thanks to the HuggingFace team for their generous support! \r\n\r\n# Disclaimer\r\nThis project strives to impact the domain of AI-driven image generation positively. Users are granted the freedom to create images using this tool, but they are expected to comply with local laws and utilize it responsibly. The developers do not assume any responsibility for potential misuse by users.\r\n\r\n# BibTeX\r\nIf you find PhotoMaker useful for your research and applications, please cite using this BibTeX:\r\n\r\n```BibTeX\r\n@inproceedings{li2023photomaker,\r\n  title={PhotoMaker: Customizing Realistic Human Photos via Stacked ID Embedding},\r\n  author={Li, Zhen and Cao, Mingdeng and Wang, Xintao and Qi, Zhongang and Cheng, Ming-Ming and Shan, Ying},\r\n  booktitle={IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},\r\n  year={2024}\r\n}\r\n","PhotoMaker 是一个用于定制真实人物照片的工具。它通过堆叠的身份嵌入技术，实现了快速且高质量的人像生成，无需额外的LoRA训练即可在几秒钟内完成个性化定制。其核心功能包括出色的身份保真度、多样性和文本可控性，并可作为适配器与其他基础模型和LoRA模块协同工作。适用于需要高效生成或修改人像图片的场景，如个人形象设计、虚拟角色创建等。","2026-06-11 03:43:57","high_star"]