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

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