{"id":8772,"date":"2023-11-30T12:00:48","date_gmt":"2023-11-30T20:00:48","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/directx\/?p=8772"},"modified":"2023-11-30T14:42:21","modified_gmt":"2023-11-30T22:42:21","slug":"dml-extension-a1111webui","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/directx\/dml-extension-a1111webui\/","title":{"rendered":"Boost Your Gen AI Experience with our DirectML extension for Automatic1111&#8217;s WebUI"},"content":{"rendered":"<p>Olive is a powerful open-source Microsoft tool to optimize ONNX models for DirectML. You may remember from this year\u2019s Build that we showcased <a href=\"https:\/\/devblogs.microsoft.com\/directx\/dml-stable-diffusion\/\">Olive support for Stable Diffusion<\/a>, a cutting-edge Generative AI model that creates images from text.<\/p>\n<p>We didn\u2019t want to stop there, since many users access Stable Diffusion through <a href=\"https:\/\/github.com\/AUTOMATIC1111\/stable-diffusion-webui\">Automatic1111&#8217;s webUI<\/a>, a popular and versatile interface for Stable Diffusion.<\/p>\n<p>Luckily this webUI supports extensions, and today we&#8217;re thrilled to reveal our DirectML extension!<\/p>\n<p>Specifically, our extension offers DirectML support for the compute-heavy uNet models in Stable Diffusion. This unlocks the ability to run Automatic1111&#8217;s webUI performantly on wide range of GPUs from different vendors across the Windows ecosystem.<\/p>\n<p><a href=\"https:\/\/github.com\/microsoft\/Stable-Diffusion-WebUI-DirectML\">https:\/\/github.com\/microsoft\/Stable-Diffusion-WebUI-DirectML<\/a><\/p>\n<h3>See huge performance wins after optimizing for DirectML!<\/h3>\n<p>Our DirectML extensions means that users can see performance wins after running an <a href=\"https:\/\/github.com\/microsoft\/Olive\/tree\/main\/examples\/directml\/stable_diffusion\">Olive optimization pass<\/a>.<\/p>\n<p>These perf wins exist across a range of hardware \u2013 up to 2.8x in our tests!<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/directx\/wp-content\/uploads\/sites\/42\/2023\/11\/Olive-SD-graph.png\"><img decoding=\"async\" class=\"alignnone wp-image-8777\" src=\"https:\/\/devblogs.microsoft.com\/directx\/wp-content\/uploads\/sites\/42\/2023\/11\/Olive-SD-graph.png\" alt=\"Image Olive SD graph\" width=\"496\" height=\"249\" srcset=\"https:\/\/devblogs.microsoft.com\/directx\/wp-content\/uploads\/sites\/42\/2023\/11\/Olive-SD-graph.png 1789w, https:\/\/devblogs.microsoft.com\/directx\/wp-content\/uploads\/sites\/42\/2023\/11\/Olive-SD-graph-300x151.png 300w, https:\/\/devblogs.microsoft.com\/directx\/wp-content\/uploads\/sites\/42\/2023\/11\/Olive-SD-graph-1024x515.png 1024w, https:\/\/devblogs.microsoft.com\/directx\/wp-content\/uploads\/sites\/42\/2023\/11\/Olive-SD-graph-768x386.png 768w, https:\/\/devblogs.microsoft.com\/directx\/wp-content\/uploads\/sites\/42\/2023\/11\/Olive-SD-graph-1536x772.png 1536w\" sizes=\"(max-width: 496px) 100vw, 496px\" \/><\/a><\/p>\n<p><span style=\"font-size: 10pt;\"><em>Note that the unoptimized and optimized Stable Diffusion models were in the ONNX format in our tests to ensure an apples-to-apples comparison. Performance was measured inside Automatic1111&#8217;s webUI.<\/em><\/span><\/p>\n<p>Thank you to our partners for their work enabling Stable Diffusion on DirectML! For more from our partners, see:<\/p>\n<ul>\n<li><strong>AMD: <\/strong><a href=\"https:\/\/community.amd.com\/t5\/ai\/how-to-automatic1111-stable-diffusion-webui-with-directml\/ba-p\/649027\">https:\/\/community.amd.com\/t5\/ai\/how-to-automatic1111-stable-diffusion-webui-with-directml\/ba-p\/649027<\/a><\/li>\n<li><strong>Intel: <\/strong><a href=\"https:\/\/community.intel.com\/t5\/Blogs\/Tech-Innovation\/Artificial-Intelligence-AI\/Intel-and-Microsoft-Collaborate-to-Optimize-DirectML-for-Intel\/post\/1542055\">https:\/\/community.intel.com\/t5\/Blogs\/Tech-Innovation\/Artificial-Intelligence-AI\/Intel-and-Microsoft-Collaborate-to-Optimize-DirectML-for-Intel\/post\/1542055<\/a><\/li>\n<li><strong>NVIDIA:<\/strong> <a href=\"https:\/\/blogs.nvidia.com\/blog\/microsoft-build-nvidia-ai-windows-rtx\/\">https:\/\/blogs.nvidia.com\/blog\/microsoft-build-nvidia-ai-windows-rtx\/\u00a0<\/a><\/li>\n<\/ul>\n<h2>Getting Started<\/h2>\n<h5>Installation<\/h5>\n<p>To install our extension, launch the webUI and open the Extensions tab. Once there, go to <strong>Install from URL<\/strong> and paste in this URL (<a href=\"https:\/\/github.com\/microsoft\/Stable-Diffusion-WebUI-DirectML\">https:\/\/github.com\/microsoft\/Stable-Diffusion-WebUI-DirectML<\/a>) before clicking Install.<\/p>\n<h5>Model Conversion<\/h5>\n<p>This extension runs best after a converted Stable Diffusion model has been put through an Olive optimization pass.<\/p>\n<p>Stable Diffusion models with different checkpoints and\/or weights but the same architecture and layers as Stable Diffusion 1.5, 2.0 and 2.1 are also compatible. See our <a href=\"https:\/\/github.com\/microsoft\/Olive\/tree\/main\/examples\/directml\/stable_diffusion\">sample<\/a> to get started.<\/p>\n<p><span style=\"font-size: 1rem; text-align: var(--bs-body-text-align);\">Once this is complete, follow our <a href=\"https:\/\/github.com\/microsoft\/Stable-Diffusion-WebUI-DirectML\">extension&#8217;s readme<\/a> for next steps.<\/span><\/p>\n<h5>Drivers<\/h5>\n<p>We recommend upgrading to the latest drivers for the best performance.<\/p>\n<ul>\n<li><strong>AMD\u00a0<\/strong>has released optimized graphics drivers supporting AMD RDNA\u2122 3 devices including AMD Radeon\u2122 RX 7900 Series graphics cards. Download Adrenalin Edition\u2122 23.11.1 or newer (<a href=\"https:\/\/nam06.safelinks.protection.outlook.com\/?url=https%3A%2F%2Fwww.amd.com%2Fen%2Fsupport&amp;data=05%7C01%7CJacques.Van%40microsoft.com%7C59057e3f47d1440568a508dbf076960d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638368164360882020%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=7TUbdBI5p0ltJZNh9qO7vTO%2BJUBBK7O9SoZcdnG4OwQ%3D&amp;reserved=0\">https:\/\/www.amd.com\/en\/support<\/a>).<\/li>\n<li><strong>Intel <\/strong>has released optimized graphics drivers supporting Intel Arc A-Series graphics cards. Download the latest drivers\u00a0<a href=\"https:\/\/nam06.safelinks.protection.outlook.com\/?url=https%3A%2F%2Fwww.intel.com%2Fcontent%2Fwww%2Fus%2Fen%2Fdownload-center%2Fhome.html&amp;data=05%7C01%7CJacques.Van%40microsoft.com%7C67f0e75e9951406f182108dbf0576b28%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638368030507915490%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Fcscii%2Ft9h05RSs0wJfRfjC4w0Ld1aoXaMRxSOfXfmI%3D&amp;reserved=0\">here<\/a>.<\/li>\n<li><strong>NVIDIA<\/strong>: Users of NVIDIA GeForce RTX 20, 30 and 40 Series GPUs can see these improvements firsthand, with <a href=\"https:\/\/www.nvidia.com\/download\/index.aspx?lang=en-us\">NVIDIA Driver 535.98 or newer<\/a>.<\/li>\n<\/ul>\n<h5>Contributions<\/h5>\n<p>We cannot guarantee that all existing Automatic1111 functionality works with our DirectML extension. We welcome contributions from the community though; please see <a href=\"https:\/\/github.com\/microsoft\/Stable-Diffusion-WebUI-DirectML#contributing\">https:\/\/github.com\/microsoft\/Stable-Diffusion-WebUI-DirectML#contributing<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Olive is a powerful open-source Microsoft tool to optimize ONNX models for DirectML. You may remember from this year\u2019s Build that we showcased Olive support for Stable Diffusion, a cutting-edge Generative AI model that creates images from text. We didn\u2019t want to stop there, since many users access Stable Diffusion through Automatic1111&#8217;s webUI, a popular [&hellip;]<\/p>\n","protected":false},"author":2237,"featured_media":12651,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1205],"tags":[],"class_list":["post-8772","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-directml"],"acf":[],"blog_post_summary":"<p>Olive is a powerful open-source Microsoft tool to optimize ONNX models for DirectML. You may remember from this year\u2019s Build that we showcased Olive support for Stable Diffusion, a cutting-edge Generative AI model that creates images from text. We didn\u2019t want to stop there, since many users access Stable Diffusion through Automatic1111&#8217;s webUI, a popular [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/posts\/8772","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/users\/2237"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/comments?post=8772"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/posts\/8772\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/media\/12651"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/media?parent=8772"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/categories?post=8772"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/tags?post=8772"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}