{"id":8342,"date":"2024-04-18T10:03:16","date_gmt":"2024-04-18T02:03:16","guid":{"rendered":"https:\/\/www.1ai.net\/?p=8342"},"modified":"2024-04-21T10:19:07","modified_gmt":"2024-04-21T02:19:07","slug":"%e4%bd%bf%e7%94%a8%e4%b8%80%e6%ac%be%e6%96%b0%e5%9e%8b%e7%9a%84%e6%8d%a2%e8%84%b8%e6%8f%92%e4%bb%b6instantid%e5%ae%9e%e7%8e%b0%e4%ba%ba%e7%89%a9%e8%a7%92%e8%89%b2%e4%b8%80%e8%87%b4%e6%80%a7","status":"publish","type":"post","link":"https:\/\/www.1ai.net\/en\/8342.html","title":{"rendered":"Use a new face-changing plug-in InstantID to achieve character consistency"},"content":{"rendered":"<p data-track=\"26\" data-pm-slice=\"0 0 []\">I wrote an article before [AI Image Tool]<a href=\"https:\/\/www.1ai.net\/en\/tag\/instantid\" title=\"[See articles with [InstantID] labels]\" target=\"_blank\" >InstantID<\/a>\u3011\uff1a<a href=\"https:\/\/www.1ai.net\/en\/8617.html\/\">Create different styles of pictures from a single photo in seconds<\/a>\u3011InstantID has been introduced in detail. It can achieve personalized image synthesis using only a single facial image reference while maintaining high-fidelity identity preservation, and supports a variety of different styles.<\/p>\n<p data-track=\"27\">When I wrote that article, InstantID had just been out for a short time.<a href=\"https:\/\/www.1ai.net\/en\/tag\/stable-diffusion\" title=\"_Other Organiser\" target=\"_blank\" >Stable Diffusion<\/a>The plugin did not support it yet, but InstantID was soon introduced in the ControlNet plugin of Stable Diffusion.<a href=\"https:\/\/www.1ai.net\/en\/tag\/%e6%a8%a1%e5%9e%8b%e6%8f%92%e4%bb%b6\" title=\"[Sees articles with [model plugin] labels]\" target=\"_blank\" >Model plugin<\/a>Today we will look at the use of the InstantID model in the ControlNet plug-in of Stable Diffusion.<\/p>\n<p data-track=\"28\"><strong>1. Introduction to InstantID<\/strong><\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8344\" title=\"get-519\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/04\/get-519.jpg\" alt=\"get-519\" width=\"1024\" height=\"604\" \/><\/div>\n<p data-track=\"29\">InstantID uses InsightFace to detect, crop, and extract face embeddings from reference faces. The embeddings are then used with the IP-Adapter to control image generation. This part is very similar to IP-Adapter Face ID. However, it also uses ControlNet to detect and inpaint multiple facial landmarks (eyes, nose, and mouth).<\/p>\n<p data-track=\"30\">Using IP-Adapter Face ID in conjunction with ControlNet, we were able to replicate the reference images we provided with high fidelity, ultimately achieving consistency across the characters.<\/p>\n<p data-track=\"31\">Note: InstantID requires the use of the SDXL large model, and there is currently no corresponding version for Stable Diffusion 1.5.<\/p>\n<p data-track=\"32\"><strong>2. Installation of InstantID plugin<\/strong><\/p>\n<p data-track=\"33\">First, upgrade controlnet to the latest version, preferably V1.1.440 or above.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8345\" title=\"get-520\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/04\/get-520.jpg\" alt=\"get-520\" width=\"1024\" height=\"653\" \/><\/div>\n<p data-track=\"34\">Download the IP-adapter model for InstantID.<\/p>\n<blockquote class=\"pgc-blockquote-abstract\">\n<p data-track=\"35\">Download address: https:\/\/huggingface.co\/InstantX\/InstantID\/blob\/main\/ip-adapter.bin<\/p>\n<\/blockquote>\n<p data-track=\"36\">Rename the downloaded file to ip-adapter_instant_id_sdxl.bin.<\/p>\n<p data-track=\"37\">Download the InstantID ControlNet model.<\/p>\n<blockquote class=\"pgc-blockquote-abstract\">\n<p data-track=\"38\">Download address: https:\/\/huggingface.co\/InstantX\/InstantID\/blob\/main<\/p>\n<p data-track=\"39\">\/ControlNetModel\/diffusion_pytorch_model.safetensors<\/p>\n<\/blockquote>\n<p data-track=\"40\">Rename the downloaded file to control_instant_id_sdxl.safetensors.<\/p>\n<p data-track=\"41\">Put the two files downloaded above in the stable-diffusion-webui &gt; models &gt; ControlNet folder directory. You can follow your own directory for specific situations.<\/p>\n<p data-track=\"42\">Then restart our SD tool, and you can see that there is an additional Instant_ID option in the control options, indicating that InstantID has been installed.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8346\" title=\"get-521\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/04\/get-521.jpg\" alt=\"get-521\" width=\"853\" height=\"1012\" \/><\/div>\n<p data-track=\"43\"><strong>3. Use of InstantID plugin in SD 1.5<\/strong><\/p>\n<p data-track=\"44\">There are a few things to note when using the InstantID model:<\/p>\n<ul>\n<li data-track=\"45\">Large models can only use SDXL large models<\/li>\n<li data-track=\"46\">The prompt word guidance coefficient (CFG Scale) is lower than the usual parameter value (3-5)<\/li>\n<li data-track=\"47\">Need to use 2 ControlNet as InstantID<\/li>\n<li data-track=\"48\">Reduce the control weights and ending control steps of the two ControlNets<\/li>\n<\/ul>\n<p data-track=\"50\">Let&#039;s take a closer look at how to use the InstantID plug-in.<\/p>\n<p data-track=\"51\"><strong>[Step 1]: Selection of large model<\/strong><\/p>\n<p data-track=\"52\">Here we use the Dreamshaper SDXL Turbo large model. Select None for the VAE large model.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8347\" title=\"get-522\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/04\/get-522.jpg\" alt=\"get-522\" width=\"712\" height=\"79\" \/><\/div>\n<p data-track=\"53\"><strong>\u3010Step 2\u3011\uff1aWriting prompt words<\/strong><\/p>\n<p data-track=\"54\"><strong>Positive prompt words:<\/strong><\/p>\n<blockquote class=\"pgc-blockquote-abstract\">\n<p data-track=\"55\">Prompt: watercolors portrait of a woman (happy laughing:1.15),masterpiece,artistry,<\/p>\n<p data-track=\"56\">Prompt words: Watercolor portrait of a woman (laughing happily: 1.15), masterpiece, art<\/p>\n<\/blockquote>\n<p data-track=\"57\"><strong>Reverse prompt words:<\/strong><\/p>\n<blockquote class=\"pgc-blockquote-abstract\">\n<p data-track=\"58\">Prompt: low quality, blurry, malformed, distorted<\/p>\n<p data-track=\"59\">Hint words: low quality, blurry, deformed, distorted<\/p>\n<\/blockquote>\n<p data-track=\"60\">Related parameter settings of Wensheng diagram<\/p>\n<ul>\n<li data-track=\"61\">Sampler: DPM++SDE Karras<\/li>\n<li data-track=\"62\">Sampling iteration number: 7<\/li>\n<li data-track=\"63\">Image width and height: 1016*1016 (the default image size of 1024\u00d71024 does not work with Instant ID. Use a resolution close to but not exactly 1024\u00d71024).<\/li>\n<li data-track=\"64\">Cue word guidance coefficient (CFG): 2 (CFG ratio must be set quite low for InstantID to be effective)<\/li>\n<\/ul>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8348\" title=\"get-523\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/04\/get-523.jpg\" alt=\"get-523\" width=\"889\" height=\"406\" \/><\/div>\n<p data-track=\"65\"><strong>[Step 3]: ControlNet plug-in InstantID model settings<\/strong><\/p>\n<p data-track=\"66\">Two InstantID models need to be used. In other words, two ControlNets need to be used.<\/p>\n<p data-track=\"67\"><strong>ControlNet Unit 0 Settings<\/strong><\/p>\n<p data-track=\"68\">The first ControlNet mainly uses InsightFace to extract facial features of people.<\/p>\n<p data-track=\"69\">Here we use the picture of Zixia Fairy as the reference image.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8349\" title=\"get-524\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/04\/get-524.jpg\" alt=\"get-524\" width=\"858\" height=\"990\" \/><\/div>\n<ul>\n<li data-track=\"70\">Enable: Checked<\/li>\n<li data-track=\"71\">Pixel Perfect Mode: Checked<\/li>\n<li data-track=\"72\">Control Type: Instant_ID<\/li>\n<li data-track=\"73\">Preprocessor: instant_id_face_embedding<\/li>\n<li data-track=\"74\">Model: ip-adapter_instant_id_sdxl<\/li>\n<li data-track=\"75\">Control weight: 1<\/li>\n<li data-track=\"76\">Guided intervention time: 0<\/li>\n<li data-track=\"77\">Boot termination time: 1<\/li>\n<\/ul>\n<p data-track=\"78\"><strong>ControlNet Unit 1 Settings<\/strong><\/p>\n<p data-track=\"79\">The second ControlNet is used to extract facial key points, such as the location of the eyes, nose, and mouth. You can use different images, but it is recommended to use the same image. Here we still use the image uploaded by the first ControlNet.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8350\" title=\"get-525\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/04\/get-525.jpg\" alt=\"get-525\" width=\"856\" height=\"987\" \/><\/div>\n<ul>\n<li data-track=\"80\">Enable: Checked<\/li>\n<li data-track=\"81\">Pixel Perfect Mode: Checked<\/li>\n<li data-track=\"82\">Control Type: Instant_ID<\/li>\n<li data-track=\"83\">Preprocessor: instant_id_face_keypoints<\/li>\n<li data-track=\"84\">Model: control_instant_id_sdxl<\/li>\n<li data-track=\"85\">Control weight: 0.45<\/li>\n<li data-track=\"86\">Guided intervention time: 0<\/li>\n<li data-track=\"87\">Boot termination time: 1<\/li>\n<\/ul>\n<p data-track=\"88\"><strong>[Step 4]: Generate pictures<\/strong><\/p>\n<p data-track=\"89\">Click the [Generate] button, and the final generated image will look like this.<\/p>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8351\" title=\"get-526\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/04\/get-526.jpg\" alt=\"get-526\" width=\"1016\" height=\"1016\" \/><\/div>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8352\" title=\"get-527\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/04\/get-527.jpg\" alt=\"get-527\" width=\"1016\" height=\"1016\" \/><\/div>\n<p data-track=\"90\"><strong>4. Picture style<\/strong><\/p>\n<p data-track=\"91\">The style of the image is controlled by the prompt words. You can use SDXL&#039;s prompt words to optimize the display content and background elements of the image.<\/p>\n<p data-track=\"92\"><strong>1. Portraits<\/strong><\/p>\n<blockquote class=\"pgc-blockquote-abstract\">\n<p data-track=\"93\"><strong>Prompt<\/strong>\uff1ahigh quality,masterpiece,rich details,realistic photography,8k,high-definition image quality,<\/p>\n<p data-track=\"94\">portrait of a woman,(happy laughing:1.15),<\/p>\n<p data-track=\"95\"><strong>Prompt word<\/strong>: High quality, masterpiece, rich details, realistic photography, 8k, HD quality,<\/p>\n<p data-track=\"96\">Portrait of a woman, (laughing happily: 1.15),<\/p>\n<\/blockquote>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8353\" title=\"get-528\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/04\/get-528.jpg\" alt=\"get-528\" width=\"1080\" height=\"1080\" \/><\/div>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8354\" title=\"get-529\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/04\/get-529.jpg\" alt=\"get-529\" width=\"1080\" height=\"1080\" \/><\/div>\n<p data-track=\"97\"><strong>2. Cyberpunk style<\/strong><\/p>\n<blockquote class=\"pgc-blockquote-abstract\">\n<p data-track=\"98\"><strong>Prompt<\/strong>\uff1ahigh quality,masterpiece,rich details,realistic photography,8k,high-definition image quality,<\/p>\n<p data-track=\"99\">Cyberpunk style,portrait of a woman,(happy laughing:1.15),<\/p>\n<p data-track=\"100\"><strong>Prompt word<\/strong>: High quality, masterpiece, rich details, realistic photography, 8k, HD quality,<\/p>\n<p data-track=\"101\">Cyberpunk style, portrait of a woman, (happy smile: 1.15),<\/p>\n<\/blockquote>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8355\" title=\"get-530\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/04\/get-530.jpg\" alt=\"get-530\" width=\"1080\" height=\"1080\" \/><\/div>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8356\" title=\"get-531\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/04\/get-531.jpg\" alt=\"get-531\" width=\"1080\" height=\"1080\" \/><\/div>\n<p data-track=\"102\"><strong>3. Line art style<\/strong><\/p>\n<blockquote class=\"pgc-blockquote-abstract\">\n<p data-track=\"103\"><strong>Prompt<\/strong>\uff1ahigh quality,masterpiece,rich details,realistic photography,8k,high-definition image quality,<\/p>\n<p data-track=\"104\">line art style,portrait of a woman,(happy laughing:1.15),<\/p>\n<p data-track=\"105\"><strong>Prompt word<\/strong>: High quality, masterpiece, rich details, realistic photography, 8k, HD quality,<\/p>\n<p data-track=\"106\">Line art style, portrait of a woman, (happy smile: 1.15),<\/p>\n<\/blockquote>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8357\" title=\"get-532\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/04\/get-532.jpg\" alt=\"get-532\" width=\"1080\" height=\"1080\" \/><\/div>\n<div class=\"pgc-img\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8358\" title=\"get-533\" src=\"https:\/\/www.1ai.net\/wp-content\/uploads\/2024\/04\/get-533.jpg\" alt=\"get-533\" width=\"1080\" height=\"1080\" \/><\/div>\n<p data-track=\"107\">In the test example here, I changed the expression of the character in the original picture (smile). Overall, the Instant_ID plug-in is good at achieving face replacement and maintaining character consistency.<\/p>\n<p data-track=\"108\">Okay, that\u2019s all for today\u2019s sharing. I hope that what I shared today will be helpful to you.<\/p>","protected":false},"excerpt":{"rendered":"<p>Previously wrote an article [AI image tool [InstantID]: a single photo second generation of different styles of images] introduced InstantID in detail. it can be achieved while maintaining a high degree of fidelity identity preservation, using only a single facial image reference can be achieved personalized image synthesis, and support a variety of different styles. At the time of writing, InstantID had not been out long enough for the Stable Diffusion plugin to support it, but the InstantID modeling plugin was soon to be introduced in Stable Diffusion's ControlNet plugin. Today we'll take a look at the InstantID modeling plugin in Stable Diffusion's ControlNet plugin.<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[149,144],"tags":[1221,197,198,2283],"collection":[262],"class_list":{"0":"post-8342","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-jiaocheng","7":"category-baike","8":"tag-instantid","9":"tag-stable-diffusion","11":"tag-2283","12":"collection-stablediffusion"},"acf":[],"_links":{"self":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/8342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/comments?post=8342"}],"version-history":[{"count":0,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/posts\/8342\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/media?parent=8342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/categories?post=8342"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/tags?post=8342"},{"taxonomy":"collection","embeddable":true,"href":"https:\/\/www.1ai.net\/en\/wp-json\/wp\/v2\/collection?post=8342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}