[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-71178":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":17,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":16,"starSnapshotCount":16,"syncStatus":28,"lastSyncTime":29,"discoverSource":30},71178,"sd-webui-EasyPhoto","aigc-apps\u002Fsd-webui-EasyPhoto","aigc-apps","📷 EasyPhoto | Your Smart AI Photo Generator.","",null,"Python",5152,403,34,86,0,1,3,66.42,"Apache License 2.0",false,"main",true,[],"2026-06-12 04:00:59","# 📷 EasyPhoto | Your Smart AI Photo Generator.\n🦜 EasyPhoto is a Webui UI plugin for generating AI portraits that can be used to train digital doppelgangers relevant to you.\n\n🦜 🦜 Welcome!\n\n[![Hugging Face Spaces](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97%20Hugging%20Face-Spaces-yellow)](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Falibaba-pai\u002Feasyphoto)\n\nEnglish | [简体中文](.\u002FREADME_zh-CN.md)\n\n# Table of Contents\n- [Introduction](#introduction)\n- [TODO List](#todo-list)\n- [Quick Start](#quick-start)\n    - [1. Cloud usage: AliyunDSW\u002FAutoDL\u002FDocker](#1-cloud-usage-aliyundswautodldocker)\n    - [2. Local install: Check\u002FDownloading\u002FInstallation](#2-local-install-environment-checkdownloadinginstallation)\n- [How to use](#how-to-use)\n    - [1. Model Training](#1-model-training)\n    - [2. Inference](#2-inference)\n- [API test](.\u002Fapi_test\u002FREADME.md)\n- [Algorithm Detailed](#algorithm-detailed)\n    - [1. Architectural Overview](#1-architectural-overview)\n    - [2. Training Detailed](#2-training-detailed)\n    - [3. Inference Detailed](#3-inference-detailed)\n- [Reference](#reference)\n- [Related Project](#Related-Project)\n- [License](#license)\n- [ContactUS](#contactus)\n\n# Introduction\nEasyPhoto is a Webui UI plugin for generating AI portraits that can be used to train digital doppelgangers relevant to you. Training is recommended to be done with 5 to 20 portrait images, preferably half-body photos, and do not wear glasses (It doesn't matter if the characters in a few pictures wear glasses). After the training is done, we can generate it in the Inference section. We support using preset template images or uploading your own images for Inference.\n\nPlease read our Contributor Covenant [covenant](.\u002FCOVENANT.md) | [简体中文](.\u002FCOVENANT_zh-CN.md).\n\nIf you encounter any problems in the training, please refer to the [VQA](https:\u002F\u002Fgithub.com\u002Faigc-apps\u002Fsd-webui-EasyPhoto\u002Fwiki).\n\nWe now support quick pull-ups from different platforms, refer to [Quick Start](#quick-start).\n\nNow you can experience EasyPhoto demo quickly on ModelScope, [demo](https:\u002F\u002Fmodelscope.cn\u002Fstudios\u002FPAI\u002FEasyPhoto\u002Fsummary).\n\nWhat's New:\n- Support LCM-Lora based sampling acceleration, now you only need 12 step (vs 50 steps) for both Image & Video generation, and we provide Scene Lora training and inference in both text2Image and text2Video.[🔥 🔥 🔥 🔥 2023.12.09]\n- Support Concepts-Sliders based attribute editing and Virtual TryOn， please refer to [sliders-wiki](https:\u002F\u002Fgithub.com\u002Faigc-apps\u002Fsd-webui-EasyPhoto\u002Fwiki\u002FAttribute-Edit) , [tryon-wiki](https:\u002F\u002Fgithub.com\u002Faigc-apps\u002Fsd-webui-EasyPhoto\u002Fwiki\u002FTryOn) for more details. [🔥 🔥 🔥 🔥 2023.12.08]\n- Thanks to [lanrui-ai](https:\u002F\u002Fwww.lanrui-ai.com\u002F). It offers an SDWebUI image with built-in EasyPhoto, promising bi-weekly updates. Personally tested, it can pull up resources in 2 minutes and complete startup within 5 minutes. [ 2023.11.20 ]\n- We are already support Video Inference without more traning! Specific details can go [here](https:\u002F\u002Fgithub.com\u002Faigc-apps\u002Fsd-webui-EasyPhoto\u002Fwiki\u002FVideo)![🔥 🔥 🔥 🔥 2023.11.10]\n- SDXL Training and Inference Support. Specific details can go [here](https:\u002F\u002Fgithub.com\u002Faigc-apps\u002Fsd-webui-EasyPhoto\u002Fwiki\u002FSDXL)![🔥 🔥 🔥 🔥 2023.11.10]\n- ComfyUI Support at [repo](https:\u002F\u002Fgithub.com\u002FTHtianhao\u002FComfyUI-Portrait-Maker), thanks to [THtianhao](https:\u002F\u002Fgithub.com\u002FTHtianhao) great work![🔥 🔥 🔥 2023.10.17]\n- EasyPhoto arxiv [arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F2310.04672)[🔥 🔥 🔥 2023.10.10]\n- Support SDXL to generate High resolution template, no more upload image need in this mode(SDXL), need 16GB GPU memory! Specific details can go [here](https:\u002F\u002Fzhuanlan.zhihu.com\u002Fp\u002F658940203)[ 2023.09.26 ]\n- We also support the [Diffusers Edition](https:\u002F\u002Fgithub.com\u002Faigc-apps\u002FEasyPhoto\u002F). [ 2023.09.25 ]\n- **Support fine-tuning the background and calculating the similarity score between the generated image and the user.** [ 2023.09.15 ]\n- **Support different base models for training and inference.** [ 2023.09.08 ]\n- **Support multi-people generation! Add cache option to optimize inference speed. Add log refreshing on UI.** [ 2023.09.06 ]\n- Create Code! Support for Windows and Linux Now. [ 2023.09.02 ]\n\nThese are our generated results:\n![results_1](images\u002Fresults_1.jpg)\n\nVideo Part:\n|  Example |  1  |  2  |  3  |\n|  ---- | ---- | ---- | ---- |\n| - | \u003Cimg src=\"http:\u002F\u002Fpai-vision-data-hz.oss-accelerate.aliyuncs.com\u002Feasyphoto\u002Fdata\u002Fvideo\u002Ftext2video\u002F51s3.gif\" width=\"400\"> | \u003Cimg src=\"http:\u002F\u002Fpai-vision-data-hz.oss-accelerate.aliyuncs.com\u002Feasyphoto\u002Fdata\u002Fvideo\u002Fv2videos\u002Fring_3644.gif\" width=\"400\"> | \u003Cimg src=\"http:\u002F\u002Fpai-vision-data-hz.oss-accelerate.aliyuncs.com\u002Feasyphoto\u002Fdata\u002Fvideo\u002Fimg2video_2imgs\u002F29s3.gif\" width=\"400\"> |\n\nPhoto Part:\n![results_2](images\u002Fresults_2.jpg)\n![results_3](images\u002Fresults_3.jpg)\n\nOur UI interface is as follows:\n**train part:**\n![train_ui](images\u002Ftrain_ui.jpg)\n**inference part:**\n![infer_ui](images\u002Finfer_ui.jpg)\n\n# TODO List\n- Support chinese ui.\n- Support change in template's background.\n- Support high resolution.\n\n# Quick Start\n### 1. Cloud usage: AliyunDSW\u002FAutoDL\u002Flanrui-ai\u002FDocker\n#### a. From AliyunDSW\nDSW has free GPU time, which can be applied once by a user and is valid for 3 months after applying.\n\nAliyun provide free GPU time in [Freetier](https:\u002F\u002Fhelp.aliyun.com\u002Fdocument_detail\u002F2567864.html), get it and use in Aliyun PAI-DSW to start EasyPhoto within 3min!\n\n[![DSW Notebook](images\u002Fdsw.png)](https:\u002F\u002Fgallery.pai-ml.com\u002F#\u002Fpreview\u002FdeepLearning\u002Fcv\u002Fstable_diffusion_easyphoto)\n\n#### b. From AutoDL\u002Flanrui-ai\n##### lanrui-ai\nThe official full-plugin version of lanrui-ai comes with EasyPhoto built-in. They promise bi-weekly testing and updates. Personally tested and found to be effective, it can be launched within 5 minutes. Thanks to their support and contributions to the community.\n\n##### AutoDL\nIf you are using Lanrui-ai\u002FAutoDL, you can quickly pull up the Stable DIffusion webui using the mirror we provide.\n\nYou can select the desired mirror by filling in the following information in Community Mirrors, or using offical Image provide by lanrui-ai.\n```\naigc-apps\u002Fsd-webui-EasyPhoto\u002Fsd-webui-EasyPhoto\n```\n\n#### c. From docker\nIf you are using docker, please make sure that the graphics card driver and CUDA environment have been installed correctly in your machine.\n\nThen execute the following commands in this way:\n```\n# pull image\ndocker pull registry.cn-beijing.aliyuncs.com\u002Fmybigpai\u002Fsd-webui-easyphoto:0.0.3\n\n# enter image\ndocker run -it -p 7860:7860 --network host --gpus all registry.cn-beijing.aliyuncs.com\u002Fmybigpai\u002Fsd-webui-easyphoto:0.0.3\n\n# launch webui\npython3 launch.py --port 7860\n```\nThe docker updates may be slightly slower than the github repository of sd-webui-EasyPhoto, so you can go to extensions\u002Fsd-webui-EasyPhoto and do a git pull first.\n```\ncd extensions\u002Fsd-webui-EasyPhoto\u002F\ngit pull\ncd \u002Fworkspace\n```\n\n### 2. Local install: Environment Check\u002FDownloading\u002FInstallation\n#### a. Environment Check\nWe have verified EasyPhoto execution on the following environment:\nIf you meet problem with WebUI auto killed by OOM, please refer to [ISSUE21](https:\u002F\u002Fgithub.com\u002Faigc-apps\u002Fsd-webui-EasyPhoto\u002Fissues\u002F21), and setting some `num_threads` to `0` and report other fix to us, thanks.\n\nThe detailed of Windows 10:\n- OS: Windows10\n- python: py3.10\n- pytorch: torch2.0.1\n- tensorflow-cpu: 2.13.0\n- CUDA: 11.7\n- CUDNN: 8+\n- GPU: Nvidia-3060 12G\n\nThe detailed of Linux:\n- OS: Ubuntu 20.04, CentOS\n- python: py3.10 & py3.11\n- pytorch: torch2.0.1\n- tensorflow-cpu: 2.13.0\n- CUDA: 11.7\n- CUDNN: 8+\n- GPU: Nvidia-A10 24G & Nvidia-V100 16G & Nvidia-A100 40G\n\nWe need about 60GB available on disk (for saving weights and datasets process), please check!\n\n#### b.  Relevant Repositories & Weights Downloading\n##### i. Controlnet\nWe need to use Controlnet for inference. The related repo is [Mikubill\u002Fsd-webui-controlnet](https:\u002F\u002Fgithub.com\u002FMikubill\u002Fsd-webui-controlnet). You need install this repo before using EasyPhoto.\n\nIn addition, we need at least three Controlnets for inference. So you need to set the **Multi ControlNet: Max models amount (requires restart)** in Setting.\n![controlnet_num](images\u002Fcontrolnet_num.jpg)\n\n##### ii. Other Dependencies.\nWe are mutually compatible with the existing stable-diffusion-webui environment, and the relevant repositories are installed when starting stable-diffusion-webui.\n\nThe weights we need will be downloaded automatically when you start training first time.\n\n#### c. Plug-in Installation\nWe now support installing EasyPhoto from git. The url of our Repository is `https:\u002F\u002Fgithub.com\u002Faigc-apps\u002Fsd-webui-EasyPhoto`.\n\nWe will support installing EasyPhoto from **Available** in the future.\n\n![install](images\u002Finstall.jpg)\n\n\n# How to use\n### 1. Model Training\nThe EasyPhoto training interface is as follows:\n\n- On the left is the training image. Simply click `Upload Photos` to upload the image, and click `Clear Photos` to delete the uploaded image;\n- On the right are the training parameters, which cannot be adjusted for the first training.\n\nAfter clicking `Upload Photos`, we can start uploading images. **It is best to upload 5 to 20 images here, including different angles and lighting conditions**. It is best to have some images that do not include glasses. If they are all glasses, the generated results may easily generate glasses.\n![train_1](images\u002Ftrain_1.jpg)\n\nThen we click on `Start Training` below, and at this point, we need to fill in the `User ID` above, such as the user's name, to start training.\n![train_2](images\u002Ftrain_2.jpg)\n\nAfter the model starts training, the webui will automatically refresh the training log. If there is no refresh, click `Refresh Log` button.\n![train_3](images\u002Ftrain_3.jpg)\n\nIf you want to set parameters, the parsing of each parameter is as follows:\n\n|Parameter Name | Meaning|\n|--|--|\n|Resolution | The size of the image fed into the network during training, with a default value of `512`|\n|Validation & save steps | The number of steps between validating the image and saving intermediate weights, with a default value of `100`, representing verifying the image every `100` steps and saving the weights|\n|Max train steps | Maximum number of training steps, default value is `800`|\n|Max steps per photos | The maximum number of training sessions per image, default to `200`|\n|Train batch size | The batch size of the training, with a default value of `1`|\n|Gradient accumulation steps | Whether to perform gradient accumulation. The default value is `4`. Combined with the train batch size, each step is equivalent to feeding four images|\n|Dataloader num workers | The number of jobs loaded with data, which does not take effect under Windows because an error will be reported if set, but is set normally on Linux|\n|Learning rate | Train Lora's learning rate, default to `1e-4`|\n|Rank Lora | The feature length of the weight, default to `128`|\n|Network alpha | The regularization parameter for Lora training, usually half of the rank, defaults to `64`|\n\n### 2. Inference\n#### a. single people\n- Step 1: Click the refresh button to query the model corresponding to the trained user ID.\n- Step 2: Select the `user ID`.\n- Step 3: Select the template that needs to be generated.\n- Step 4: Click the Generate button to generate the results.\n\n![single_people](images\u002Fsingle_people.jpg)\n\n#### b. multi people\n- Step 1: Go to the settings page of EasyPhoto and set `num_of_faceid` as greater than `1`.\n- Step 2: Apply settings.\n- Step 3: Restart the ui interface of the webui.\n- Step 4: Return to EasyPhoto and upload the two person template.\n- Step 5: Select the user IDs of two people.\n- Step 6: Click the `Generate` button. Perform image generation.\n\n![single_people](images\u002Fmulti_people_1.jpg)\n![single_people](images\u002Fmulti_people_2.jpg)\n# Algorithm Detailed\n- Arxiv paper EasyPhoto [arxiv](https:\u002F\u002Farxiv.org\u002Fabs\u002F2310.04672)\n- More detailed principles and details can be found [BLOG](https:\u002F\u002Fblog.csdn.net\u002Fweixin_44791964\u002Farticle\u002Fdetails\u002F132922309)\n\n\n### 1. Architectural Overview\n\n![overview](images\u002Foverview.jpg)\n\nIn the field of AI portraits, we expect model-generated images to be realistic and resemble the user, and traditional approaches introduce unrealistic lighting (such as face fusion or roop). To address this unrealism, we introduce the image-to-image capability of the stable diffusion model. Generating a perfect personal portrait takes into account the desired generation scenario and the user's digital doppelgänger. We use a pre-prepared template as the desired generation scene and an online trained face LoRA model as the user's digital doppelganger, which is a popular stable diffusion fine-tuning model. We use a small number of user images to train a stable digital doppelgänger of the user, and generate a personal portrait image based on the face LoRA model and the expected generative scene during inference.\n\n### 2. Training Detailed\n\n![overview](images\u002Ftrain_detail1.jpg)\n\nFirst, we perform face detection on the input user image, and after determining the face location, we intercept the input image according to a certain ratio. Then, we use the saliency detection model and the skin beautification model to obtain a clean face training image, which basically consists of only faces. Then, we label each image with a fixed label. There is no need to use a labeler here, and the results are good. Finally, we fine-tune the stabilizing diffusion model to get the user's digital doppelganger.\n\nDuring training, we utilize the template image for verification in real time, and at the end of training, we calculate the face id gap between the verification image and the user's image to achieve Lora fusion, which ensures that our Lora is a perfect digital doppelganger of the user.\n\nIn addition, we will choose the image that is most similar to the user in the validation as the face_id image, which will be used in Inference.\n\n### 3. Inference Detailed\n#### a. First Diffusion:\nFirst, we will perform face detection on our incoming template image to determine the mask that needs to be inpainted for stable diffusion. then we will use the template image to perform face fusion with the optimal user image. After the face fusion is completed, we use the above mask to inpaint (fusion_image) with the face fused image. In addition, we will affix the optimal face_id image obtained during training to the template image by affine transformation (replaced_image). Then we will apply Controlnets on it, we use canny with color to extract features for fusion_image and openpose for replaced_image to ensure the similarity and stability of the images. Then we will use Stable Diffusion combined with the user's digital split for generation.\n\n#### b. Second Diffusion:\nAfter getting the result of First Diffusion, we will fuse the result with the optimal user image for face fusion, and then we will use Stable Diffusion again with the user's digital doppelganger for generation. The second generation will use higher resolution.\n\n# Special thanks\nSpecial thanks to DevelopmentZheng, qiuyanxin, rainlee, jhuang1207, bubbliiiing, wuziheng, yjjinjie, hkunzhe, yunkchen for their code contributions (in no particular order).\n\n# Reference\n- insightface：https:\u002F\u002Fgithub.com\u002Fdeepinsight\u002Finsightface\n- cv_resnet50_face：https:\u002F\u002Fwww.modelscope.cn\u002Fmodels\u002Fdamo\u002Fcv_resnet50_face-detection_retinaface\u002Fsummary\n- cv_u2net_salient：https:\u002F\u002Fwww.modelscope.cn\u002Fmodels\u002Fdamo\u002Fcv_u2net_salient-detection\u002Fsummary\n- cv_unet_skin_retouching_torch：https:\u002F\u002Fwww.modelscope.cn\u002Fmodels\u002Fdamo\u002Fcv_unet_skin_retouching_torch\u002Fsummary\n- cv_unet-image-face-fusion：https:\u002F\u002Fwww.modelscope.cn\u002Fmodels\u002Fdamo\u002Fcv_unet-image-face-fusion_damo\u002Fsummary\n- kohya：https:\u002F\u002Fgithub.com\u002Fbmaltais\u002Fkohya_ss\n- controlnet-webui：https:\u002F\u002Fgithub.com\u002FMikubill\u002Fsd-webui-controlnet\n\n# Related Project\nWe've also listed some great open source projects as well as any extensions you might be interested in:\n- [ModelScope](https:\u002F\u002Fgithub.com\u002Fmodelscope\u002Fmodelscope).\n- [FaceChain](https:\u002F\u002Fgithub.com\u002Fmodelscope\u002Ffacechain).\n- [sd-webui-controlnet](https:\u002F\u002Fgithub.com\u002FMikubill\u002Fsd-webui-controlnet).\n- [sd-webui-roop](https:\u002F\u002Fgithub.com\u002Fs0md3v\u002Fsd-webui-roop).\n- [roop](https:\u002F\u002Fgithub.com\u002Fs0md3v\u002Froop).\n- [sd-webui-deforum](https:\u002F\u002Fgithub.com\u002Fdeforum-art\u002Fsd-webui-deforum).\n- [sd-webui-additional-networks](https:\u002F\u002Fgithub.com\u002Fkohya-ss\u002Fsd-webui-additional-networks).\n- [a1111-sd-webui-tagcomplete](https:\u002F\u002Fgithub.com\u002FDominikDoom\u002Fa1111-sd-webui-tagcomplete).\n- [sd-webui-segment-anything](https:\u002F\u002Fgithub.com\u002Fcontinue-revolution\u002Fsd-webui-segment-anything).\n- [sd-webui-tunnels](https:\u002F\u002Fgithub.com\u002FBing-su\u002Fsd-webui-tunnels).\n- [sd-webui-mov2mov](https:\u002F\u002Fgithub.com\u002FScholar01\u002Fsd-webui-mov2mov).\n\n# License\n\nThis project is licensed under the [Apache License (Version 2.0)](https:\u002F\u002Fgithub.com\u002Fmodelscope\u002Fmodelscope\u002Fblob\u002Fmaster\u002FLICENSE).\n\n# ContactUS\n1. Use [Dingding](https:\u002F\u002Fwww.dingtalk.com\u002F) to search group-2 `54095000124` or Scan to join\n2. Since the WeChat group is full, you need to scan the image on the right to add this student as a friend first, and then join the WeChat group.\n\n\u003Cfigure>\n\u003Cimg src=\"images\u002Fding_erweima.jpg\" width=300\u002F>\n\u003Cimg src=\"images\u002Fwechat.jpg\" width=300\u002F>\n\u003C\u002Ffigure>\n\n\n# Contributors ✨\n\nThanks goes to these wonderful people :\n\n\u003Ctable>\n  \u003Ctr>\n     \u003Ctd>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Faigc-apps\u002Fsd-webui-EasyPhoto\u002Fgraphs\u002Fcontributors\">\n  \u003Cimg src=\"https:\u002F\u002Fcontrib.rocks\u002Fimage?repo=aigc-apps\u002Fsd-webui-EasyPhoto\" \u002F>\n  \u003C\u002Fa>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\nThis project follows the [all-contributors](https:\u002F\u002Fgithub.com\u002Fall-contributors\u002Fall-contributors) specification. Contributions of any kind are welcome!\n\n\u003Cp align=\"right\">\u003Ca href=\"#top\">Back to top\u003C\u002Fa>\u003C\u002Fp>\n","EasyPhoto 是一个基于 WebUI 的插件，用于生成 AI 人像，可以用来训练与你相关的数字分身。其核心功能包括通过5到20张半身照片（不建议戴眼镜）进行模型训练，并在推理阶段生成高质量的人像图片或视频。该项目采用 LCM-Lora 技术实现了高效的采样加速，仅需12步即可完成图像和视频的生成；同时支持基于 Concepts-Sliders 的属性编辑和虚拟试穿功能。EasyPhoto 适用于需要个性化AI人像生成的应用场景，如个人形象设计、虚拟角色创建等。",2,"2026-06-11 03:36:25","high_star"]