import{S as dl,i as bl,s as wl,e as a,k as f,w as B,t as p,M as vl,c as i,d as l,m,a as n,x as P,h as r,b as u,G as t,g as o,y as W,L as _l,q as R,o as V,B as D,v as Jl}from"../../chunks/vendor-hf-doc-builder.js";import{I as hl}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as Je}from"../../chunks/CodeBlock-hf-doc-builder.js";function Tl(Fe){let h,K,d,w,C,M,Te,Q,Me,ee,I,Ne,le,N,$e,te,O,ye,se,$,oe,b,v,q,y,Ee,A,Ge,ae,c,Ue,F,je,xe,H,Xe,Se,L,Ie,Oe,ie,E,ne,_,Ze,G,Y,ke,Be,pe,U,re,Z,Pe,fe,j,me,J,We,z,Re,Ve,ue,x,X,De,Ce,ce,S,Qe,he,k,g,qe,de;return M=new hl({}),$=new Je({props:{code:"cGlwJTIwaW5zdGFsbCUyMG9wdGltdW0lNUIlMjJvbm54cnVudGltZSUyMiU1RA==",highlighted:'pip <span class="hljs-keyword">install</span> optimum[<span class="hljs-string">&quot;onnxruntime&quot;</span>]'}}),y=new hl({}),E=new Je({props:{code:"ZnJvbSUyMG9wdGltdW0ub25ueHJ1bnRpbWUlMjBpbXBvcnQlMjBPUlRTdGFibGVEaWZmdXNpb25QaXBlbGluZSUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMEFwaXBlJTIwJTNEJTIwT1JUU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2lkJTJDJTIwZXhwb3J0JTNEVHJ1ZSklMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIwb24lMjBtYXJzJTIyJTBBaW1hZ2VzJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQlMEFwaXBlLnNhdmVfcHJldHJhaW5lZCglMjIuJTJGb25ueC1zdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIp",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>
pipe = ORTStableDiffusionPipeline.from_pretrained(model_id, export=<span class="hljs-literal">True</span>)
prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
images = pipe(prompt).images[<span class="hljs-number">0</span>]
pipe.save_pretrained(<span class="hljs-string">&quot;./onnx-stable-diffusion-v1-5&quot;</span>)`}}),U=new Je({props:{code:"b3B0aW11bS1jbGklMjBleHBvcnQlMjBvbm54JTIwLS1tb2RlbCUyMHJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIwc2RfdjE1X29ubnglMkY=",highlighted:'optimum-cli <span class="hljs-built_in">export</span> onnx --model runwayml/stable-diffusion-v1-5 sd_v15_onnx/'}}),j=new Je({props:{code:"ZnJvbSUyMG9wdGltdW0ub25ueHJ1bnRpbWUlMjBpbXBvcnQlMjBPUlRTdGFibGVEaWZmdXNpb25QaXBlbGluZSUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIyc2RfdjE1X29ubnglMjIlMEFwaXBlJTIwJTNEJTIwT1JUU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2lkKSUwQXByb21wdCUyMCUzRCUyMCUyMmElMjBwaG90byUyMG9mJTIwYW4lMjBhc3Ryb25hdXQlMjByaWRpbmclMjBhJTIwaG9yc2UlMjBvbiUyMG1hcnMlMjIlMEFpbWFnZXMlMjAlM0QlMjBwaXBlKHByb21wdCkuaW1hZ2VzJTVCMCU1RA==",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>
pipe = ORTStableDiffusionPipeline.from_pretrained(model_id)
prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
images = pipe(prompt).images[<span class="hljs-number">0</span>]`}}),{c(){h=a("meta"),K=f(),d=a("h1"),w=a("a"),C=a("span"),B(M.$$.fragment),Te=f(),Q=a("span"),Me=p("\uCD94\uB860\uC744 \uC704\uD574 ONNX \uB7F0\uD0C0\uC784\uC744 \uC0AC\uC6A9\uD558\uB294 \uBC29\uBC95"),ee=f(),I=a("p"),Ne=p("\u{1F917} Diffusers\uB294 ONNX Runtime\uACFC \uD638\uD658\uB418\uB294 Stable Diffusion \uD30C\uC774\uD504\uB77C\uC778\uC744 \uC81C\uACF5\uD569\uB2C8\uB2E4. \uC774\uB97C \uD1B5\uD574 ONNX(CPU \uD3EC\uD568)\uB97C \uC9C0\uC6D0\uD558\uACE0 PyTorch\uC758 \uAC00\uC18D \uBC84\uC804\uC744 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uB294 \uBAA8\uB4E0 \uD558\uB4DC\uC6E8\uC5B4\uC5D0\uC11C Stable Diffusion\uC744 \uC2E4\uD589\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."),le=f(),N=a("h2"),$e=p("\uC124\uCE58"),te=f(),O=a("p"),ye=p("\uB2E4\uC74C \uBA85\uB839\uC5B4\uB85C ONNX Runtime\uB97C \uC9C0\uC6D0\uD558\uB294 \u{1F917} Optimum\uB97C \uC124\uCE58\uD569\uB2C8\uB2E4:"),se=f(),B($.$$.fragment),oe=f(),b=a("h2"),v=a("a"),q=a("span"),B(y.$$.fragment),Ee=f(),A=a("span"),Ge=p("Stable Diffusion \uCD94\uB860"),ae=f(),c=a("p"),Ue=p("\uC544\uB798 \uCF54\uB4DC\uB294 ONNX \uB7F0\uD0C0\uC784\uC744 \uC0AC\uC6A9\uD558\uB294 \uBC29\uBC95\uC744 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4. "),F=a("code"),je=p("StableDiffusionPipeline"),xe=p(" \uB300\uC2E0 "),H=a("code"),Xe=p("OnnxStableDiffusionPipeline"),Se=p(`\uC744 \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4.
PyTorch \uBAA8\uB378\uC744 \uBD88\uB7EC\uC624\uACE0 \uC989\uC2DC ONNX \uD615\uC2DD\uC73C\uB85C \uBCC0\uD658\uD558\uB824\uB294 \uACBD\uC6B0 `),L=a("code"),Ie=p("export=True"),Oe=p("\uB85C \uC124\uC815\uD569\uB2C8\uB2E4."),ie=f(),B(E.$$.fragment),ne=f(),_=a("p"),Ze=p(`\uD30C\uC774\uD504\uB77C\uC778\uC744 ONNX \uD615\uC2DD\uC73C\uB85C \uC624\uD504\uB77C\uC778\uC73C\uB85C \uB0B4\uBCF4\uB0B4\uACE0 \uB098\uC911\uC5D0 \uCD94\uB860\uC5D0 \uC0AC\uC6A9\uD558\uB824\uB294 \uACBD\uC6B0,
`),G=a("a"),Y=a("code"),ke=p("optimum-cli export"),Be=p(" \uBA85\uB839\uC5B4\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4:"),pe=f(),B(U.$$.fragment),re=f(),Z=a("p"),Pe=p("\uADF8 \uB2E4\uC74C \uCD94\uB860\uC744 \uC218\uD589\uD569\uB2C8\uB2E4:"),fe=f(),B(j.$$.fragment),me=f(),J=a("p"),We=p("Notice that we didn\u2019t have to specify "),z=a("code"),Re=p("export=True"),Ve=p(" above."),ue=f(),x=a("p"),X=a("a"),De=p("Optimum \uBB38\uC11C"),Ce=p("\uC5D0\uC11C \uB354 \uB9CE\uC740 \uC608\uC2DC\uB97C \uCC3E\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4."),ce=f(),S=a("h2"),Qe=p("\uC54C\uB824\uC9C4 \uC774\uC288\uB4E4"),he=f(),k=a("ul"),g=a("li"),qe=p("\uC5EC\uB7EC \uD504\uB86C\uD504\uD2B8\uB97C \uBC30\uCE58\uB85C \uC0DD\uC131\uD558\uBA74 \uB108\uBB34 \uB9CE\uC740 \uBA54\uBAA8\uB9AC\uAC00 \uC0AC\uC6A9\uB418\uB294 \uAC83 \uAC19\uC2B5\uB2C8\uB2E4. \uC774\uB97C \uC870\uC0AC\uD558\uB294 \uB3D9\uC548, \uBC30\uCE58 \uB300\uC2E0 \uBC18\uBCF5 \uBC29\uBC95\uC774 \uD544\uC694\uD560 \uC218\uB3C4 \uC788\uC2B5\uB2C8\uB2E4."),this.h()},l(e){const s=vl('[data-svelte="svelte-1phssyn"]',document.head);h=i(s,"META",{name:!0,content:!0}),s.forEach(l),K=m(e),d=i(e,"H1",{class:!0});var be=n(d);w=i(be,"A",{id:!0,class:!0,href:!0});var He=n(w);C=i(He,"SPAN",{});var Le=n(C);P(M.$$.fragment,Le),Le.forEach(l),He.forEach(l),Te=m(be),Q=i(be,"SPAN",{});var Ye=n(Q);Me=r(Ye,"\uCD94\uB860\uC744 \uC704\uD574 ONNX \uB7F0\uD0C0\uC784\uC744 \uC0AC\uC6A9\uD558\uB294 \uBC29\uBC95"),Ye.forEach(l),be.forEach(l),ee=m(e),I=i(e,"P",{});var ze=n(I);Ne=r(ze,"\u{1F917} Diffusers\uB294 ONNX Runtime\uACFC \uD638\uD658\uB418\uB294 Stable Diffusion \uD30C\uC774\uD504\uB77C\uC778\uC744 \uC81C\uACF5\uD569\uB2C8\uB2E4. \uC774\uB97C \uD1B5\uD574 ONNX(CPU \uD3EC\uD568)\uB97C \uC9C0\uC6D0\uD558\uACE0 PyTorch\uC758 \uAC00\uC18D \uBC84\uC804\uC744 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uB294 \uBAA8\uB4E0 \uD558\uB4DC\uC6E8\uC5B4\uC5D0\uC11C Stable Diffusion\uC744 \uC2E4\uD589\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."),ze.forEach(l),le=m(e),N=i(e,"H2",{id:!0});var ge=n(N);$e=r(ge,"\uC124\uCE58"),ge.forEach(l),te=m(e),O=i(e,"P",{});var Ke=n(O);ye=r(Ke,"\uB2E4\uC74C \uBA85\uB839\uC5B4\uB85C ONNX Runtime\uB97C \uC9C0\uC6D0\uD558\uB294 \u{1F917} Optimum\uB97C \uC124\uCE58\uD569\uB2C8\uB2E4:"),Ke.forEach(l),se=m(e),P($.$$.fragment,e),oe=m(e),b=i(e,"H2",{class:!0});var we=n(b);v=i(we,"A",{id:!0,class:!0,href:!0});var el=n(v);q=i(el,"SPAN",{});var ll=n(q);P(y.$$.fragment,ll),ll.forEach(l),el.forEach(l),Ee=m(we),A=i(we,"SPAN",{});var tl=n(A);Ge=r(tl,"Stable Diffusion \uCD94\uB860"),tl.forEach(l),we.forEach(l),ae=m(e),c=i(e,"P",{});var T=n(c);Ue=r(T,"\uC544\uB798 \uCF54\uB4DC\uB294 ONNX \uB7F0\uD0C0\uC784\uC744 \uC0AC\uC6A9\uD558\uB294 \uBC29\uBC95\uC744 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4. "),F=i(T,"CODE",{});var sl=n(F);je=r(sl,"StableDiffusionPipeline"),sl.forEach(l),xe=r(T," \uB300\uC2E0 "),H=i(T,"CODE",{});var ol=n(H);Xe=r(ol,"OnnxStableDiffusionPipeline"),ol.forEach(l),Se=r(T,`\uC744 \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4.
PyTorch \uBAA8\uB378\uC744 \uBD88\uB7EC\uC624\uACE0 \uC989\uC2DC ONNX \uD615\uC2DD\uC73C\uB85C \uBCC0\uD658\uD558\uB824\uB294 \uACBD\uC6B0 `),L=i(T,"CODE",{});var al=n(L);Ie=r(al,"export=True"),al.forEach(l),Oe=r(T,"\uB85C \uC124\uC815\uD569\uB2C8\uB2E4."),T.forEach(l),ie=m(e),P(E.$$.fragment,e),ne=m(e),_=i(e,"P",{});var ve=n(_);Ze=r(ve,`\uD30C\uC774\uD504\uB77C\uC778\uC744 ONNX \uD615\uC2DD\uC73C\uB85C \uC624\uD504\uB77C\uC778\uC73C\uB85C \uB0B4\uBCF4\uB0B4\uACE0 \uB098\uC911\uC5D0 \uCD94\uB860\uC5D0 \uC0AC\uC6A9\uD558\uB824\uB294 \uACBD\uC6B0,
`),G=i(ve,"A",{href:!0,rel:!0});var il=n(G);Y=i(il,"CODE",{});var nl=n(Y);ke=r(nl,"optimum-cli export"),nl.forEach(l),il.forEach(l),Be=r(ve," \uBA85\uB839\uC5B4\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4:"),ve.forEach(l),pe=m(e),P(U.$$.fragment,e),re=m(e),Z=i(e,"P",{});var pl=n(Z);Pe=r(pl,"\uADF8 \uB2E4\uC74C \uCD94\uB860\uC744 \uC218\uD589\uD569\uB2C8\uB2E4:"),pl.forEach(l),fe=m(e),P(j.$$.fragment,e),me=m(e),J=i(e,"P",{});var _e=n(J);We=r(_e,"Notice that we didn\u2019t have to specify "),z=i(_e,"CODE",{});var rl=n(z);Re=r(rl,"export=True"),rl.forEach(l),Ve=r(_e," above."),_e.forEach(l),ue=m(e),x=i(e,"P",{});var Ae=n(x);X=i(Ae,"A",{href:!0,rel:!0});var fl=n(X);De=r(fl,"Optimum \uBB38\uC11C"),fl.forEach(l),Ce=r(Ae,"\uC5D0\uC11C \uB354 \uB9CE\uC740 \uC608\uC2DC\uB97C \uCC3E\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4."),Ae.forEach(l),ce=m(e),S=i(e,"H2",{id:!0});var ml=n(S);Qe=r(ml,"\uC54C\uB824\uC9C4 \uC774\uC288\uB4E4"),ml.forEach(l),he=m(e),k=i(e,"UL",{});var ul=n(k);g=i(ul,"LI",{});var cl=n(g);qe=r(cl,"\uC5EC\uB7EC \uD504\uB86C\uD504\uD2B8\uB97C \uBC30\uCE58\uB85C \uC0DD\uC131\uD558\uBA74 \uB108\uBB34 \uB9CE\uC740 \uBA54\uBAA8\uB9AC\uAC00 \uC0AC\uC6A9\uB418\uB294 \uAC83 \uAC19\uC2B5\uB2C8\uB2E4. \uC774\uB97C \uC870\uC0AC\uD558\uB294 \uB3D9\uC548, \uBC30\uCE58 \uB300\uC2E0 \uBC18\uBCF5 \uBC29\uBC95\uC774 \uD544\uC694\uD560 \uC218\uB3C4 \uC788\uC2B5\uB2C8\uB2E4."),cl.forEach(l),ul.forEach(l),this.h()},h(){u(h,"name","hf:doc:metadata"),u(h,"content",JSON.stringify(Ml)),u(w,"id","onnx"),u(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"),u(w,"href","#onnx"),u(d,"class","relative group"),u(N,"id",""),u(v,"id","stable-diffusion"),u(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"),u(v,"href","#stable-diffusion"),u(b,"class","relative group"),u(G,"href","https://huggingface.co/docs/optimum/main/en/exporters/onnx/usage_guides/export_a_model#exporting-a-model-to-onnx-using-the-cli"),u(G,"rel","nofollow"),u(X,"href","https://huggingface.co/docs/optimum/"),u(X,"rel","nofollow"),u(S,"id","")},m(e,s){t(document.head,h),o(e,K,s),o(e,d,s),t(d,w),t(w,C),W(M,C,null),t(d,Te),t(d,Q),t(Q,Me),o(e,ee,s),o(e,I,s),t(I,Ne),o(e,le,s),o(e,N,s),t(N,$e),o(e,te,s),o(e,O,s),t(O,ye),o(e,se,s),W($,e,s),o(e,oe,s),o(e,b,s),t(b,v),t(v,q),W(y,q,null),t(b,Ee),t(b,A),t(A,Ge),o(e,ae,s),o(e,c,s),t(c,Ue),t(c,F),t(F,je),t(c,xe),t(c,H),t(H,Xe),t(c,Se),t(c,L),t(L,Ie),t(c,Oe),o(e,ie,s),W(E,e,s),o(e,ne,s),o(e,_,s),t(_,Ze),t(_,G),t(G,Y),t(Y,ke),t(_,Be),o(e,pe,s),W(U,e,s),o(e,re,s),o(e,Z,s),t(Z,Pe),o(e,fe,s),W(j,e,s),o(e,me,s),o(e,J,s),t(J,We),t(J,z),t(z,Re),t(J,Ve),o(e,ue,s),o(e,x,s),t(x,X),t(X,De),t(x,Ce),o(e,ce,s),o(e,S,s),t(S,Qe),o(e,he,s),o(e,k,s),t(k,g),t(g,qe),de=!0},p:_l,i(e){de||(R(M.$$.fragment,e),R($.$$.fragment,e),R(y.$$.fragment,e),R(E.$$.fragment,e),R(U.$$.fragment,e),R(j.$$.fragment,e),de=!0)},o(e){V(M.$$.fragment,e),V($.$$.fragment,e),V(y.$$.fragment,e),V(E.$$.fragment,e),V(U.$$.fragment,e),V(j.$$.fragment,e),de=!1},d(e){l(h),e&&l(K),e&&l(d),D(M),e&&l(ee),e&&l(I),e&&l(le),e&&l(N),e&&l(te),e&&l(O),e&&l(se),D($,e),e&&l(oe),e&&l(b),D(y),e&&l(ae),e&&l(c),e&&l(ie),D(E,e),e&&l(ne),e&&l(_),e&&l(pe),D(U,e),e&&l(re),e&&l(Z),e&&l(fe),D(j,e),e&&l(me),e&&l(J),e&&l(ue),e&&l(x),e&&l(ce),e&&l(S),e&&l(he),e&&l(k)}}}const Ml={local:"onnx",sections:[{local:"",title:"\uC124\uCE58"},{local:"stable-diffusion",title:"Stable Diffusion \uCD94\uB860"},{local:"",title:"\uC54C\uB824\uC9C4 \uC774\uC288\uB4E4"}],title:"\uCD94\uB860\uC744 \uC704\uD574 ONNX \uB7F0\uD0C0\uC784\uC744 \uC0AC\uC6A9\uD558\uB294 \uBC29\uBC95"};function Nl(Fe){return Jl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Gl extends dl{constructor(h){super();bl(this,h,Nl,Tl,wl,{})}}export{Gl as default,Ml as metadata};
