import{S as Er,i as yr,s as $r,e as o,k as h,w as d,t as n,M as Tr,c as a,d as t,m as u,a as r,x as c,h as f,b as s,N as Sr,G as l,g as p,y as m,L as xr,q as v,o as b,B as w,v as Nr}from"../../chunks/vendor-hf-doc-builder.js";import{I as E}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as Ge}from"../../chunks/CodeBlock-hf-doc-builder.js";function gr(ta){let y,Rt,$,G,Ie,z,Il,Oe,Ol,Gt,I,jl,K,Wl,Xl,It,T,O,je,ee,Dl,We,Zl,Ot,ke,Pl,jt,te,Wt,S,j,Xe,le,Bl,De,Cl,Xt,x,W,Ze,oe,Al,Pe,Hl,Dt,_,Ll,Me,Vl,Fl,Be,Yl,Ql,Ce,ql,zl,Zt,ae,Pt,X,Kl,re,Ae,eo,to,Bt,ie,Ct,Je,lo,At,se,Ht,D,oo,He,ao,ro,Lt,ne,Le,la,Vt,Z,io,fe,so,no,Ft,N,P,Ve,pe,fo,Fe,po,Yt,B,Ye,he,Qe,ho,uo,qe,co,mo,g,ue,ze,Ke,vo,bo,et,tt,wo,_o,de,lt,ot,Eo,yo,at,rt,$o,To,ce,it,st,So,xo,nt,ft,No,Qt,k,C,pt,me,go,ht,ko,qt,M,A,ut,ve,Mo,dt,Jo,zt,H,Uo,be,Ro,Go,Kt,we,el,J,L,ct,_e,Io,mt,Oo,tl,V,jo,Ee,Wo,Xo,ll,ye,ol,U,F,vt,$e,Do,bt,Zo,al,Y,wt,Te,_t,Po,Bo,Et,Co,Ao,Se,xe,yt,$t,Ho,Lo,Tt,St,Vo,Fo,Ne,xt,Nt,Yo,Qo,gt,kt,qo,rl,R,Q,Mt,ge,zo,Jt,Ko,il,Ue,Ut,ea,sl;return z=new E({}),ee=new E({}),te=new Ge({props:{code:"cGlwJTIwaW5zdGFsbCUyMG9wdGltdW0lNUIlMjJvbm54cnVudGltZSUyMiU1RA==",highlighted:'pip <span class="hljs-keyword">install</span> optimum[<span class="hljs-string">&quot;onnxruntime&quot;</span>]'}}),le=new E({}),oe=new E({}),ae=new Ge({props:{code:"ZnJvbSUyMG9wdGltdW0ub25ueHJ1bnRpbWUlMjBpbXBvcnQlMjBPUlRTdGFibGVEaWZmdXNpb25QaXBlbGluZSUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMEFwaXBlbGluZSUyMCUzRCUyME9SVFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMGV4cG9ydCUzRFRydWUpJTBBcHJvbXB0JTIwJTNEJTIwJTIyc2FpbGluZyUyMHNoaXAlMjBpbiUyMHN0b3JtJTIwYnklMjBMZW9uYXJkbyUyMGRhJTIwVmluY2klMjIlMEFpbWFnZSUyMCUzRCUyMHBpcGVsaW5lKHByb21wdCkuaW1hZ2VzJTVCMCU1RCUwQXBpcGVsaW5lLnNhdmVfcHJldHJhaW5lZCglMjIuJTJGb25ueC1zdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIp",highlighted:`<span class="hljs-keyword">from</span> optimum.onnxruntime <span class="hljs-keyword">import</span> ORTStableDiffusionPipeline

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipeline = ORTStableDiffusionPipeline.from_pretrained(model_id, export=<span class="hljs-literal">True</span>)
prompt = <span class="hljs-string">&quot;sailing ship in storm by Leonardo da Vinci&quot;</span>
image = pipeline(prompt).images[<span class="hljs-number">0</span>]
pipeline.save_pretrained(<span class="hljs-string">&quot;./onnx-stable-diffusion-v1-5&quot;</span>)`}}),ie=new Ge({props:{code:"b3B0aW11bS1jbGklMjBleHBvcnQlMjBvbm54JTIwLS1tb2RlbCUyMHJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIwc2RfdjE1X29ubnglMkY=",highlighted:'optimum-cli <span class="hljs-built_in">export</span> onnx --model runwayml/stable-diffusion-v1-5 sd_v15_onnx/'}}),se=new Ge({props:{code:"ZnJvbSUyMG9wdGltdW0ub25ueHJ1bnRpbWUlMjBpbXBvcnQlMjBPUlRTdGFibGVEaWZmdXNpb25QaXBlbGluZSUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIyc2RfdjE1X29ubnglMjIlMEFwaXBlbGluZSUyMCUzRCUyME9SVFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCklMEFwcm9tcHQlMjAlM0QlMjAlMjJzYWlsaW5nJTIwc2hpcCUyMGluJTIwc3Rvcm0lMjBieSUyMExlb25hcmRvJTIwZGElMjBWaW5jaSUyMiUwQWltYWdlJTIwJTNEJTIwcGlwZWxpbmUocHJvbXB0KS5pbWFnZXMlNUIwJTVE",highlighted:`<span class="hljs-keyword">from</span> optimum.onnxruntime <span class="hljs-keyword">import</span> ORTStableDiffusionPipeline

model_id = <span class="hljs-string">&quot;sd_v15_onnx&quot;</span>
pipeline = ORTStableDiffusionPipeline.from_pretrained(model_id)
prompt = <span class="hljs-string">&quot;sailing ship in storm by Leonardo da Vinci&quot;</span>
image = pipeline(prompt).images[<span class="hljs-number">0</span>]`}}),pe=new E({}),me=new E({}),ve=new E({}),we=new Ge({props:{code:"b3B0aW11bS1jbGklMjBleHBvcnQlMjBvbm54JTIwLS1tb2RlbCUyMHN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi14bC1iYXNlLTEuMCUyMC0tdGFzayUyMHN0YWJsZS1kaWZmdXNpb24teGwlMjBzZF94bF9vbm54JTJG",highlighted:'optimum-cli <span class="hljs-built_in">export</span> onnx --model stabilityai/stable-diffusion-xl-base-1.0 --task stable-diffusion-xl sd_xl_onnx/'}}),_e=new E({}),ye=new Ge({props:{code:"ZnJvbSUyMG9wdGltdW0ub25ueHJ1bnRpbWUlMjBpbXBvcnQlMjBPUlRTdGFibGVEaWZmdXNpb25YTFBpcGVsaW5lJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24teGwtYmFzZS0xLjAlMjIlMEFwaXBlbGluZSUyMCUzRCUyME9SVFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2lkKSUwQXByb21wdCUyMCUzRCUyMCUyMnNhaWxpbmclMjBzaGlwJTIwaW4lMjBzdG9ybSUyMGJ5JTIwTGVvbmFyZG8lMjBkYSUyMFZpbmNpJTIyJTBBaW1hZ2UlMjAlM0QlMjBwaXBlbGluZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-keyword">from</span> optimum.onnxruntime <span class="hljs-keyword">import</span> ORTStableDiffusionXLPipeline

model_id = <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>
pipeline = ORTStableDiffusionXLPipeline.from_pretrained(model_id)
prompt = <span class="hljs-string">&quot;sailing ship in storm by Leonardo da Vinci&quot;</span>
image = pipeline(prompt).images[<span class="hljs-number">0</span>]`}}),$e=new E({}),ge=new E({}),{c(){y=o("meta"),Rt=h(),$=o("h1"),G=o("a"),Ie=o("span"),d(z.$$.fragment),Il=h(),Oe=o("span"),Ol=n("How to use ONNX Runtime for inference"),Gt=h(),I=o("p"),jl=n("\u{1F917} "),K=o("a"),Wl=n("Optimum"),Xl=n(" provides a Stable Diffusion pipeline compatible with ONNX Runtime."),It=h(),T=o("h2"),O=o("a"),je=o("span"),d(ee.$$.fragment),Dl=h(),We=o("span"),Zl=n("Installation"),Ot=h(),ke=o("p"),Pl=n("Install \u{1F917} Optimum with the following command for ONNX Runtime support:"),jt=h(),d(te.$$.fragment),Wt=h(),S=o("h2"),j=o("a"),Xe=o("span"),d(le.$$.fragment),Bl=h(),De=o("span"),Cl=n("Stable Diffusion"),Xt=h(),x=o("h3"),W=o("a"),Ze=o("span"),d(oe.$$.fragment),Al=h(),Pe=o("span"),Hl=n("Inference"),Dt=h(),_=o("p"),Ll=n("To load an ONNX model and run inference with ONNX Runtime, you need to replace "),Me=o("a"),Vl=n("StableDiffusionPipeline"),Fl=n(" with "),Be=o("code"),Yl=n("ORTStableDiffusionPipeline"),Ql=n(". In case you want to load a PyTorch model and convert it to the ONNX format on-the-fly, you can set "),Ce=o("code"),ql=n("export=True"),zl=n("."),Zt=h(),d(ae.$$.fragment),Pt=h(),X=o("p"),Kl=n(`If you want to export the pipeline in the ONNX format offline and later use it for inference,
you can use the `),re=o("a"),Ae=o("code"),eo=n("optimum-cli export"),to=n(" command:"),Bt=h(),d(ie.$$.fragment),Ct=h(),Je=o("p"),lo=n("Then perform inference:"),At=h(),d(se.$$.fragment),Ht=h(),D=o("p"),oo=n("Notice that we didn\u2019t have to specify "),He=o("code"),ao=n("export=True"),ro=n(" above."),Lt=h(),ne=o("div"),Le=o("img"),Vt=h(),Z=o("p"),io=n("You can find more examples in "),fe=o("a"),so=n("optimum documentation"),no=n("."),Ft=h(),N=o("h3"),P=o("a"),Ve=o("span"),d(pe.$$.fragment),fo=h(),Fe=o("span"),po=n("Supported tasks"),Yt=h(),B=o("table"),Ye=o("thead"),he=o("tr"),Qe=o("th"),ho=n("Task"),uo=h(),qe=o("th"),co=n("Loading Class"),mo=h(),g=o("tbody"),ue=o("tr"),ze=o("td"),Ke=o("code"),vo=n("text-to-image"),bo=h(),et=o("td"),tt=o("code"),wo=n("ORTStableDiffusionPipeline"),_o=h(),de=o("tr"),lt=o("td"),ot=o("code"),Eo=n("image-to-image"),yo=h(),at=o("td"),rt=o("code"),$o=n("ORTStableDiffusionImg2ImgPipeline"),To=h(),ce=o("tr"),it=o("td"),st=o("code"),So=n("inpaint"),xo=h(),nt=o("td"),ft=o("code"),No=n("ORTStableDiffusionInpaintPipeline"),Qt=h(),k=o("h2"),C=o("a"),pt=o("span"),d(me.$$.fragment),go=h(),ht=o("span"),ko=n("Stable Diffusion XL"),qt=h(),M=o("h3"),A=o("a"),ut=o("span"),d(ve.$$.fragment),Mo=h(),dt=o("span"),Jo=n("Export"),zt=h(),H=o("p"),Uo=n("To export your model to ONNX, you can use the "),be=o("a"),Ro=n("Optimum CLI"),Go=n(" as follows :"),Kt=h(),d(we.$$.fragment),el=h(),J=o("h3"),L=o("a"),ct=o("span"),d(_e.$$.fragment),Io=h(),mt=o("span"),Oo=n("Inference"),tl=h(),V=o("p"),jo=n("Here is an example of how you can load a SDXL ONNX model from "),Ee=o("a"),Wo=n("stabilityai/stable-diffusion-xl-base-1.0"),Xo=n(" and run inference with ONNX Runtime :"),ll=h(),d(ye.$$.fragment),ol=h(),U=o("h3"),F=o("a"),vt=o("span"),d($e.$$.fragment),Do=h(),bt=o("span"),Zo=n("Supported tasks"),al=h(),Y=o("table"),wt=o("thead"),Te=o("tr"),_t=o("th"),Po=n("Task"),Bo=h(),Et=o("th"),Co=n("Loading Class"),Ao=h(),Se=o("tbody"),xe=o("tr"),yt=o("td"),$t=o("code"),Ho=n("text-to-image"),Lo=h(),Tt=o("td"),St=o("code"),Vo=n("ORTStableDiffusionXLPipeline"),Fo=h(),Ne=o("tr"),xt=o("td"),Nt=o("code"),Yo=n("image-to-image"),Qo=h(),gt=o("td"),kt=o("code"),qo=n("ORTStableDiffusionXLImg2ImgPipeline"),rl=h(),R=o("h2"),Q=o("a"),Mt=o("span"),d(ge.$$.fragment),zo=h(),Jt=o("span"),Ko=n("Known Issues"),il=h(),Ue=o("ul"),Ut=o("li"),ea=n("Generating multiple prompts in a batch seems to take too much memory. While we look into it, you may need to iterate instead of batching."),this.h()},l(e){const i=Tr('[data-svelte="svelte-1phssyn"]',document.head);y=a(i,"META",{name:!0,content:!0}),i.forEach(t),Rt=u(e),$=a(e,"H1",{class:!0});var nl=r($);G=a(nl,"A",{id:!0,class:!0,href:!0});var oa=r(G);Ie=a(oa,"SPAN",{});var aa=r(Ie);c(z.$$.fragment,aa),aa.forEach(t),oa.forEach(t),Il=u(nl),Oe=a(nl,"SPAN",{});var ra=r(Oe);Ol=f(ra,"How to use ONNX Runtime for inference"),ra.forEach(t),nl.forEach(t),Gt=u(e),I=a(e,"P",{});var fl=r(I);jl=f(fl,"\u{1F917} "),K=a(fl,"A",{href:!0,rel:!0});var ia=r(K);Wl=f(ia,"Optimum"),ia.forEach(t),Xl=f(fl," provides a Stable Diffusion pipeline compatible with ONNX Runtime."),fl.forEach(t),It=u(e),T=a(e,"H2",{class:!0});var pl=r(T);O=a(pl,"A",{id:!0,class:!0,href:!0});var sa=r(O);je=a(sa,"SPAN",{});var na=r(je);c(ee.$$.fragment,na),na.forEach(t),sa.forEach(t),Dl=u(pl),We=a(pl,"SPAN",{});var fa=r(We);Zl=f(fa,"Installation"),fa.forEach(t),pl.forEach(t),Ot=u(e),ke=a(e,"P",{});var pa=r(ke);Pl=f(pa,"Install \u{1F917} Optimum with the following command for ONNX Runtime support:"),pa.forEach(t),jt=u(e),c(te.$$.fragment,e),Wt=u(e),S=a(e,"H2",{class:!0});var hl=r(S);j=a(hl,"A",{id:!0,class:!0,href:!0});var ha=r(j);Xe=a(ha,"SPAN",{});var ua=r(Xe);c(le.$$.fragment,ua),ua.forEach(t),ha.forEach(t),Bl=u(hl),De=a(hl,"SPAN",{});var da=r(De);Cl=f(da,"Stable Diffusion"),da.forEach(t),hl.forEach(t),Xt=u(e),x=a(e,"H3",{class:!0});var ul=r(x);W=a(ul,"A",{id:!0,class:!0,href:!0});var ca=r(W);Ze=a(ca,"SPAN",{});var ma=r(Ze);c(oe.$$.fragment,ma),ma.forEach(t),ca.forEach(t),Al=u(ul),Pe=a(ul,"SPAN",{});var va=r(Pe);Hl=f(va,"Inference"),va.forEach(t),ul.forEach(t),Dt=u(e),_=a(e,"P",{});var q=r(_);Ll=f(q,"To load an ONNX model and run inference with ONNX Runtime, you need to replace "),Me=a(q,"A",{href:!0});var ba=r(Me);Vl=f(ba,"StableDiffusionPipeline"),ba.forEach(t),Fl=f(q," with "),Be=a(q,"CODE",{});var wa=r(Be);Yl=f(wa,"ORTStableDiffusionPipeline"),wa.forEach(t),Ql=f(q,". In case you want to load a PyTorch model and convert it to the ONNX format on-the-fly, you can set "),Ce=a(q,"CODE",{});var _a=r(Ce);ql=f(_a,"export=True"),_a.forEach(t),zl=f(q,"."),q.forEach(t),Zt=u(e),c(ae.$$.fragment,e),Pt=u(e),X=a(e,"P",{});var dl=r(X);Kl=f(dl,`If you want to export the pipeline in the ONNX format offline and later use it for inference,
you can use the `),re=a(dl,"A",{href:!0,rel:!0});var Ea=r(re);Ae=a(Ea,"CODE",{});var ya=r(Ae);eo=f(ya,"optimum-cli export"),ya.forEach(t),Ea.forEach(t),to=f(dl," command:"),dl.forEach(t),Bt=u(e),c(ie.$$.fragment,e),Ct=u(e),Je=a(e,"P",{});var $a=r(Je);lo=f($a,"Then perform inference:"),$a.forEach(t),At=u(e),c(se.$$.fragment,e),Ht=u(e),D=a(e,"P",{});var cl=r(D);oo=f(cl,"Notice that we didn\u2019t have to specify "),He=a(cl,"CODE",{});var Ta=r(He);ao=f(Ta,"export=True"),Ta.forEach(t),ro=f(cl," above."),cl.forEach(t),Lt=u(e),ne=a(e,"DIV",{class:!0});var Sa=r(ne);Le=a(Sa,"IMG",{src:!0}),Sa.forEach(t),Vt=u(e),Z=a(e,"P",{});var ml=r(Z);io=f(ml,"You can find more examples in "),fe=a(ml,"A",{href:!0,rel:!0});var xa=r(fe);so=f(xa,"optimum documentation"),xa.forEach(t),no=f(ml,"."),ml.forEach(t),Ft=u(e),N=a(e,"H3",{class:!0});var vl=r(N);P=a(vl,"A",{id:!0,class:!0,href:!0});var Na=r(P);Ve=a(Na,"SPAN",{});var ga=r(Ve);c(pe.$$.fragment,ga),ga.forEach(t),Na.forEach(t),fo=u(vl),Fe=a(vl,"SPAN",{});var ka=r(Fe);po=f(ka,"Supported tasks"),ka.forEach(t),vl.forEach(t),Yt=u(e),B=a(e,"TABLE",{});var bl=r(B);Ye=a(bl,"THEAD",{});var Ma=r(Ye);he=a(Ma,"TR",{});var wl=r(he);Qe=a(wl,"TH",{});var Ja=r(Qe);ho=f(Ja,"Task"),Ja.forEach(t),uo=u(wl),qe=a(wl,"TH",{});var Ua=r(qe);co=f(Ua,"Loading Class"),Ua.forEach(t),wl.forEach(t),Ma.forEach(t),mo=u(bl),g=a(bl,"TBODY",{});var Re=r(g);ue=a(Re,"TR",{});var _l=r(ue);ze=a(_l,"TD",{});var Ra=r(ze);Ke=a(Ra,"CODE",{});var Ga=r(Ke);vo=f(Ga,"text-to-image"),Ga.forEach(t),Ra.forEach(t),bo=u(_l),et=a(_l,"TD",{});var Ia=r(et);tt=a(Ia,"CODE",{});var Oa=r(tt);wo=f(Oa,"ORTStableDiffusionPipeline"),Oa.forEach(t),Ia.forEach(t),_l.forEach(t),_o=u(Re),de=a(Re,"TR",{});var El=r(de);lt=a(El,"TD",{});var ja=r(lt);ot=a(ja,"CODE",{});var Wa=r(ot);Eo=f(Wa,"image-to-image"),Wa.forEach(t),ja.forEach(t),yo=u(El),at=a(El,"TD",{});var Xa=r(at);rt=a(Xa,"CODE",{});var Da=r(rt);$o=f(Da,"ORTStableDiffusionImg2ImgPipeline"),Da.forEach(t),Xa.forEach(t),El.forEach(t),To=u(Re),ce=a(Re,"TR",{});var yl=r(ce);it=a(yl,"TD",{});var Za=r(it);st=a(Za,"CODE",{});var Pa=r(st);So=f(Pa,"inpaint"),Pa.forEach(t),Za.forEach(t),xo=u(yl),nt=a(yl,"TD",{});var Ba=r(nt);ft=a(Ba,"CODE",{});var Ca=r(ft);No=f(Ca,"ORTStableDiffusionInpaintPipeline"),Ca.forEach(t),Ba.forEach(t),yl.forEach(t),Re.forEach(t),bl.forEach(t),Qt=u(e),k=a(e,"H2",{class:!0});var $l=r(k);C=a($l,"A",{id:!0,class:!0,href:!0});var Aa=r(C);pt=a(Aa,"SPAN",{});var Ha=r(pt);c(me.$$.fragment,Ha),Ha.forEach(t),Aa.forEach(t),go=u($l),ht=a($l,"SPAN",{});var La=r(ht);ko=f(La,"Stable Diffusion XL"),La.forEach(t),$l.forEach(t),qt=u(e),M=a(e,"H3",{class:!0});var Tl=r(M);A=a(Tl,"A",{id:!0,class:!0,href:!0});var Va=r(A);ut=a(Va,"SPAN",{});var Fa=r(ut);c(ve.$$.fragment,Fa),Fa.forEach(t),Va.forEach(t),Mo=u(Tl),dt=a(Tl,"SPAN",{});var Ya=r(dt);Jo=f(Ya,"Export"),Ya.forEach(t),Tl.forEach(t),zt=u(e),H=a(e,"P",{});var Sl=r(H);Uo=f(Sl,"To export your model to ONNX, you can use the "),be=a(Sl,"A",{href:!0,rel:!0});var Qa=r(be);Ro=f(Qa,"Optimum CLI"),Qa.forEach(t),Go=f(Sl," as follows :"),Sl.forEach(t),Kt=u(e),c(we.$$.fragment,e),el=u(e),J=a(e,"H3",{class:!0});var xl=r(J);L=a(xl,"A",{id:!0,class:!0,href:!0});var qa=r(L);ct=a(qa,"SPAN",{});var za=r(ct);c(_e.$$.fragment,za),za.forEach(t),qa.forEach(t),Io=u(xl),mt=a(xl,"SPAN",{});var Ka=r(mt);Oo=f(Ka,"Inference"),Ka.forEach(t),xl.forEach(t),tl=u(e),V=a(e,"P",{});var Nl=r(V);jo=f(Nl,"Here is an example of how you can load a SDXL ONNX model from "),Ee=a(Nl,"A",{href:!0,rel:!0});var er=r(Ee);Wo=f(er,"stabilityai/stable-diffusion-xl-base-1.0"),er.forEach(t),Xo=f(Nl," and run inference with ONNX Runtime :"),Nl.forEach(t),ll=u(e),c(ye.$$.fragment,e),ol=u(e),U=a(e,"H3",{class:!0});var gl=r(U);F=a(gl,"A",{id:!0,class:!0,href:!0});var tr=r(F);vt=a(tr,"SPAN",{});var lr=r(vt);c($e.$$.fragment,lr),lr.forEach(t),tr.forEach(t),Do=u(gl),bt=a(gl,"SPAN",{});var or=r(bt);Zo=f(or,"Supported tasks"),or.forEach(t),gl.forEach(t),al=u(e),Y=a(e,"TABLE",{});var kl=r(Y);wt=a(kl,"THEAD",{});var ar=r(wt);Te=a(ar,"TR",{});var Ml=r(Te);_t=a(Ml,"TH",{});var rr=r(_t);Po=f(rr,"Task"),rr.forEach(t),Bo=u(Ml),Et=a(Ml,"TH",{});var ir=r(Et);Co=f(ir,"Loading Class"),ir.forEach(t),Ml.forEach(t),ar.forEach(t),Ao=u(kl),Se=a(kl,"TBODY",{});var Jl=r(Se);xe=a(Jl,"TR",{});var Ul=r(xe);yt=a(Ul,"TD",{});var sr=r(yt);$t=a(sr,"CODE",{});var nr=r($t);Ho=f(nr,"text-to-image"),nr.forEach(t),sr.forEach(t),Lo=u(Ul),Tt=a(Ul,"TD",{});var fr=r(Tt);St=a(fr,"CODE",{});var pr=r(St);Vo=f(pr,"ORTStableDiffusionXLPipeline"),pr.forEach(t),fr.forEach(t),Ul.forEach(t),Fo=u(Jl),Ne=a(Jl,"TR",{});var Rl=r(Ne);xt=a(Rl,"TD",{});var hr=r(xt);Nt=a(hr,"CODE",{});var ur=r(Nt);Yo=f(ur,"image-to-image"),ur.forEach(t),hr.forEach(t),Qo=u(Rl),gt=a(Rl,"TD",{});var dr=r(gt);kt=a(dr,"CODE",{});var cr=r(kt);qo=f(cr,"ORTStableDiffusionXLImg2ImgPipeline"),cr.forEach(t),dr.forEach(t),Rl.forEach(t),Jl.forEach(t),kl.forEach(t),rl=u(e),R=a(e,"H2",{class:!0});var Gl=r(R);Q=a(Gl,"A",{id:!0,class:!0,href:!0});var mr=r(Q);Mt=a(mr,"SPAN",{});var vr=r(Mt);c(ge.$$.fragment,vr),vr.forEach(t),mr.forEach(t),zo=u(Gl),Jt=a(Gl,"SPAN",{});var br=r(Jt);Ko=f(br,"Known Issues"),br.forEach(t),Gl.forEach(t),il=u(e),Ue=a(e,"UL",{});var wr=r(Ue);Ut=a(wr,"LI",{});var _r=r(Ut);ea=f(_r,"Generating multiple prompts in a batch seems to take too much memory. While we look into it, you may need to iterate instead of batching."),_r.forEach(t),wr.forEach(t),this.h()},h(){s(y,"name","hf:doc:metadata"),s(y,"content",JSON.stringify(kr)),s(G,"id","how-to-use-onnx-runtime-for-inference"),s(G,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(G,"href","#how-to-use-onnx-runtime-for-inference"),s($,"class","relative group"),s(K,"href","https://github.com/huggingface/optimum"),s(K,"rel","nofollow"),s(O,"id","installation"),s(O,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(O,"href","#installation"),s(T,"class","relative group"),s(j,"id","stable-diffusion"),s(j,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(j,"href","#stable-diffusion"),s(S,"class","relative group"),s(W,"id","inference"),s(W,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(W,"href","#inference"),s(x,"class","relative group"),s(Me,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),s(re,"href","https://huggingface.co/docs/optimum/main/en/exporters/onnx/usage_guides/export_a_model#exporting-a-model-to-onnx-using-the-cli"),s(re,"rel","nofollow"),Sr(Le.src,la="https://huggingface.co/datasets/optimum/documentation-images/resolve/main/onnxruntime/stable_diffusion_v1_5_ort_sail_boat.png")||s(Le,"src",la),s(ne,"class","flex justify-center"),s(fe,"href","https://huggingface.co/docs/optimum/"),s(fe,"rel","nofollow"),s(P,"id","supported-tasks"),s(P,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(P,"href","#supported-tasks"),s(N,"class","relative group"),s(C,"id","stable-diffusion-xl"),s(C,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(C,"href","#stable-diffusion-xl"),s(k,"class","relative group"),s(A,"id","export"),s(A,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(A,"href","#export"),s(M,"class","relative group"),s(be,"href","https://huggingface.co/docs/optimum/main/en/exporters/onnx/usage_guides/export_a_model#exporting-a-model-to-onnx-using-the-cli"),s(be,"rel","nofollow"),s(L,"id","inference"),s(L,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(L,"href","#inference"),s(J,"class","relative group"),s(Ee,"href","https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0"),s(Ee,"rel","nofollow"),s(F,"id","supported-tasks"),s(F,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(F,"href","#supported-tasks"),s(U,"class","relative group"),s(Q,"id","known-issues"),s(Q,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(Q,"href","#known-issues"),s(R,"class","relative group")},m(e,i){l(document.head,y),p(e,Rt,i),p(e,$,i),l($,G),l(G,Ie),m(z,Ie,null),l($,Il),l($,Oe),l(Oe,Ol),p(e,Gt,i),p(e,I,i),l(I,jl),l(I,K),l(K,Wl),l(I,Xl),p(e,It,i),p(e,T,i),l(T,O),l(O,je),m(ee,je,null),l(T,Dl),l(T,We),l(We,Zl),p(e,Ot,i),p(e,ke,i),l(ke,Pl),p(e,jt,i),m(te,e,i),p(e,Wt,i),p(e,S,i),l(S,j),l(j,Xe),m(le,Xe,null),l(S,Bl),l(S,De),l(De,Cl),p(e,Xt,i),p(e,x,i),l(x,W),l(W,Ze),m(oe,Ze,null),l(x,Al),l(x,Pe),l(Pe,Hl),p(e,Dt,i),p(e,_,i),l(_,Ll),l(_,Me),l(Me,Vl),l(_,Fl),l(_,Be),l(Be,Yl),l(_,Ql),l(_,Ce),l(Ce,ql),l(_,zl),p(e,Zt,i),m(ae,e,i),p(e,Pt,i),p(e,X,i),l(X,Kl),l(X,re),l(re,Ae),l(Ae,eo),l(X,to),p(e,Bt,i),m(ie,e,i),p(e,Ct,i),p(e,Je,i),l(Je,lo),p(e,At,i),m(se,e,i),p(e,Ht,i),p(e,D,i),l(D,oo),l(D,He),l(He,ao),l(D,ro),p(e,Lt,i),p(e,ne,i),l(ne,Le),p(e,Vt,i),p(e,Z,i),l(Z,io),l(Z,fe),l(fe,so),l(Z,no),p(e,Ft,i),p(e,N,i),l(N,P),l(P,Ve),m(pe,Ve,null),l(N,fo),l(N,Fe),l(Fe,po),p(e,Yt,i),p(e,B,i),l(B,Ye),l(Ye,he),l(he,Qe),l(Qe,ho),l(he,uo),l(he,qe),l(qe,co),l(B,mo),l(B,g),l(g,ue),l(ue,ze),l(ze,Ke),l(Ke,vo),l(ue,bo),l(ue,et),l(et,tt),l(tt,wo),l(g,_o),l(g,de),l(de,lt),l(lt,ot),l(ot,Eo),l(de,yo),l(de,at),l(at,rt),l(rt,$o),l(g,To),l(g,ce),l(ce,it),l(it,st),l(st,So),l(ce,xo),l(ce,nt),l(nt,ft),l(ft,No),p(e,Qt,i),p(e,k,i),l(k,C),l(C,pt),m(me,pt,null),l(k,go),l(k,ht),l(ht,ko),p(e,qt,i),p(e,M,i),l(M,A),l(A,ut),m(ve,ut,null),l(M,Mo),l(M,dt),l(dt,Jo),p(e,zt,i),p(e,H,i),l(H,Uo),l(H,be),l(be,Ro),l(H,Go),p(e,Kt,i),m(we,e,i),p(e,el,i),p(e,J,i),l(J,L),l(L,ct),m(_e,ct,null),l(J,Io),l(J,mt),l(mt,Oo),p(e,tl,i),p(e,V,i),l(V,jo),l(V,Ee),l(Ee,Wo),l(V,Xo),p(e,ll,i),m(ye,e,i),p(e,ol,i),p(e,U,i),l(U,F),l(F,vt),m($e,vt,null),l(U,Do),l(U,bt),l(bt,Zo),p(e,al,i),p(e,Y,i),l(Y,wt),l(wt,Te),l(Te,_t),l(_t,Po),l(Te,Bo),l(Te,Et),l(Et,Co),l(Y,Ao),l(Y,Se),l(Se,xe),l(xe,yt),l(yt,$t),l($t,Ho),l(xe,Lo),l(xe,Tt),l(Tt,St),l(St,Vo),l(Se,Fo),l(Se,Ne),l(Ne,xt),l(xt,Nt),l(Nt,Yo),l(Ne,Qo),l(Ne,gt),l(gt,kt),l(kt,qo),p(e,rl,i),p(e,R,i),l(R,Q),l(Q,Mt),m(ge,Mt,null),l(R,zo),l(R,Jt),l(Jt,Ko),p(e,il,i),p(e,Ue,i),l(Ue,Ut),l(Ut,ea),sl=!0},p:xr,i(e){sl||(v(z.$$.fragment,e),v(ee.$$.fragment,e),v(te.$$.fragment,e),v(le.$$.fragment,e),v(oe.$$.fragment,e),v(ae.$$.fragment,e),v(ie.$$.fragment,e),v(se.$$.fragment,e),v(pe.$$.fragment,e),v(me.$$.fragment,e),v(ve.$$.fragment,e),v(we.$$.fragment,e),v(_e.$$.fragment,e),v(ye.$$.fragment,e),v($e.$$.fragment,e),v(ge.$$.fragment,e),sl=!0)},o(e){b(z.$$.fragment,e),b(ee.$$.fragment,e),b(te.$$.fragment,e),b(le.$$.fragment,e),b(oe.$$.fragment,e),b(ae.$$.fragment,e),b(ie.$$.fragment,e),b(se.$$.fragment,e),b(pe.$$.fragment,e),b(me.$$.fragment,e),b(ve.$$.fragment,e),b(we.$$.fragment,e),b(_e.$$.fragment,e),b(ye.$$.fragment,e),b($e.$$.fragment,e),b(ge.$$.fragment,e),sl=!1},d(e){t(y),e&&t(Rt),e&&t($),w(z),e&&t(Gt),e&&t(I),e&&t(It),e&&t(T),w(ee),e&&t(Ot),e&&t(ke),e&&t(jt),w(te,e),e&&t(Wt),e&&t(S),w(le),e&&t(Xt),e&&t(x),w(oe),e&&t(Dt),e&&t(_),e&&t(Zt),w(ae,e),e&&t(Pt),e&&t(X),e&&t(Bt),w(ie,e),e&&t(Ct),e&&t(Je),e&&t(At),w(se,e),e&&t(Ht),e&&t(D),e&&t(Lt),e&&t(ne),e&&t(Vt),e&&t(Z),e&&t(Ft),e&&t(N),w(pe),e&&t(Yt),e&&t(B),e&&t(Qt),e&&t(k),w(me),e&&t(qt),e&&t(M),w(ve),e&&t(zt),e&&t(H),e&&t(Kt),w(we,e),e&&t(el),e&&t(J),w(_e),e&&t(tl),e&&t(V),e&&t(ll),w(ye,e),e&&t(ol),e&&t(U),w($e),e&&t(al),e&&t(Y),e&&t(rl),e&&t(R),w(ge),e&&t(il),e&&t(Ue)}}}const kr={local:"how-to-use-onnx-runtime-for-inference",sections:[{local:"installation",title:"Installation"},{local:"stable-diffusion",sections:[{local:"inference",title:"Inference"},{local:"supported-tasks",title:"Supported tasks"}],title:"Stable Diffusion"},{local:"stable-diffusion-xl",sections:[{local:"export",title:"Export"},{local:"inference",title:"Inference"},{local:"supported-tasks",title:"Supported tasks"}],title:"Stable Diffusion XL"},{local:"known-issues",title:"Known Issues"}],title:"How to use ONNX Runtime for inference"};function Mr(ta){return Nr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Gr extends Er{constructor(y){super();yr(this,y,Mr,gr,$r,{})}}export{Gr as default,kr as metadata};
