import{s as Me,n as Te,o as Je}from"../chunks/scheduler.8c3d61f6.js";import{S as ye,i as ge,g as a,s as i,r as u,A as Ue,h as p,f as l,c as s,j as we,u as r,x as o,k as ie,y as ve,a as n,v as d,d as c,t as h,w as b}from"../chunks/index.da70eac4.js";import{C as ne}from"../chunks/CodeBlock.a9c4becf.js";import{H as se,E as Ge}from"../chunks/getInferenceSnippets.ea1775db.js";function We(ae){let m,S,x,X,w,L,M,pe='🤗 Optimum provides Stable Diffusion pipelines compatible with OpenVINO to perform inference on a variety of Intel processors (see the full list of supported devices).',H,T,oe='You’ll need to install 🤗 Optimum Intel with the --upgrade-strategy eager option to ensure optimum-intel is using the latest version:',E,J,k,y,me="This guide will show you how to use the Stable Diffusion and Stable Diffusion XL (SDXL) pipelines with OpenVINO.",D,g,R,U,fe="To load and run inference, use the OVStableDiffusionPipeline. If you want to load a PyTorch model and convert it to the OpenVINO format on-the-fly, set export=True:",F,v,z,G,ue="To further speed-up inference, statically reshape the model. If you change any parameters such as the outputs height or width, you’ll need to statically reshape your model again.",N,W,Y,f,re='',Q,Z,de='You can find more examples in the 🤗 Optimum documentation, and Stable Diffusion is supported for text-to-image, image-to-image, and inpainting.',O,$,P,I,ce="To load and run inference with SDXL, use the OVStableDiffusionXLPipeline:",q,j,A,_,he='To further speed-up inference, statically reshape the model as shown in the Stable Diffusion section.',K,V,be='You can find more examples in the 🤗 Optimum documentation, and running SDXL in OpenVINO is supported for text-to-image and image-to-image.',ee,B,te,C,le;return w=new se({props:{title:"OpenVINO",local:"openvino",headingTag:"h1"}}),J=new ne({props:{code:"cGlwJTIwaW5zdGFsbCUyMC0tdXBncmFkZS1zdHJhdGVneSUyMGVhZ2VyJTIwb3B0aW11bSU1QiUyMm9wZW52aW5vJTIyJTVE",highlighted:'pip install --upgrade-strategy eager optimum["openvino"]',wrap:!1}}),g=new se({props:{title:"Stable Diffusion",local:"stable-diffusion",headingTag:"h2"}}),v=new ne({props:{code:"ZnJvbSUyMG9wdGltdW0uaW50ZWwlMjBpbXBvcnQlMjBPVlN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJzdGFibGUtZGlmZnVzaW9uLXYxLTUlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMEFwaXBlbGluZSUyMCUzRCUyME9WU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2lkJTJDJTIwZXhwb3J0JTNEVHJ1ZSklMEFwcm9tcHQlMjAlM0QlMjAlMjJzYWlsaW5nJTIwc2hpcCUyMGluJTIwc3Rvcm0lMjBieSUyMFJlbWJyYW5kdCUyMiUwQWltYWdlJTIwJTNEJTIwcGlwZWxpbmUocHJvbXB0KS5pbWFnZXMlNUIwJTVEJTBBJTBBJTIzJTIwRG9uJ3QlMjBmb3JnZXQlMjB0byUyMHNhdmUlMjB0aGUlMjBleHBvcnRlZCUyMG1vZGVsJTBBcGlwZWxpbmUuc2F2ZV9wcmV0cmFpbmVkKCUyMm9wZW52aW5vLXNkLXYxLTUlMjIp",highlighted:`from optimum.intel import OVStableDiffusionPipeline model_id = "stable-diffusion-v1-5/stable-diffusion-v1-5" pipeline = OVStableDiffusionPipeline.from_pretrained(model_id, export=True) prompt = "sailing ship in storm by Rembrandt" image = pipeline(prompt).images[0] # Don't forget to save the exported model pipeline.save_pretrained("openvino-sd-v1-5")`,wrap:!1}}),W=new ne({props:{code:"JTIzJTIwRGVmaW5lJTIwdGhlJTIwc2hhcGVzJTIwcmVsYXRlZCUyMHRvJTIwdGhlJTIwaW5wdXRzJTIwYW5kJTIwZGVzaXJlZCUyMG91dHB1dHMlMEFiYXRjaF9zaXplJTJDJTIwbnVtX2ltYWdlcyUyQyUyMGhlaWdodCUyQyUyMHdpZHRoJTIwJTNEJTIwMSUyQyUyMDElMkMlMjA1MTIlMkMlMjA1MTIlMEElMEElMjMlMjBTdGF0aWNhbGx5JTIwcmVzaGFwZSUyMHRoZSUyMG1vZGVsJTBBcGlwZWxpbmUucmVzaGFwZShiYXRjaF9zaXplJTJDJTIwaGVpZ2h0JTJDJTIwd2lkdGglMkMlMjBudW1faW1hZ2VzKSUwQSUyMyUyMENvbXBpbGUlMjB0aGUlMjBtb2RlbCUyMGJlZm9yZSUyMGluZmVyZW5jZSUwQXBpcGVsaW5lLmNvbXBpbGUoKSUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZWxpbmUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNEaGVpZ2h0JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0R3aWR0aCUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbWFnZXNfcGVyX3Byb21wdCUzRG51bV9pbWFnZXMlMkMlMEEpLmltYWdlcyU1QjAlNUQ=",highlighted:`# Define the shapes related to the inputs and desired outputs batch_size, num_images, height, width = 1, 1, 512, 512 # Statically reshape the model pipeline.reshape(batch_size, height, width, num_images) # Compile the model before inference pipeline.compile() image = pipeline( prompt, height=height, width=width, num_images_per_prompt=num_images, ).images[0]`,wrap:!1}}),$=new se({props:{title:"Stable Diffusion XL",local:"stable-diffusion-xl",headingTag:"h2"}}),j=new ne({props:{code:"ZnJvbSUyMG9wdGltdW0uaW50ZWwlMjBpbXBvcnQlMjBPVlN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUlMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi14bC1iYXNlLTEuMCUyMiUwQXBpcGVsaW5lJTIwJTNEJTIwT1ZTdGFibGVEaWZmdXNpb25YTFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCklMEFwcm9tcHQlMjAlM0QlMjAlMjJzYWlsaW5nJTIwc2hpcCUyMGluJTIwc3Rvcm0lMjBieSUyMFJlbWJyYW5kdCUyMiUwQWltYWdlJTIwJTNEJTIwcGlwZWxpbmUocHJvbXB0KS5pbWFnZXMlNUIwJTVE",highlighted:`from optimum.intel import OVStableDiffusionXLPipeline model_id = "stabilityai/stable-diffusion-xl-base-1.0" pipeline = OVStableDiffusionXLPipeline.from_pretrained(model_id) prompt = "sailing ship in storm by Rembrandt" image = pipeline(prompt).images[0]`,wrap:!1}}),B=new Ge({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/optimization/open_vino.md"}}),{c(){m=a("meta"),S=i(),x=a("p"),X=i(),u(w.$$.fragment),L=i(),M=a("p"),M.innerHTML=pe,H=i(),T=a("p"),T.innerHTML=oe,E=i(),u(J.$$.fragment),k=i(),y=a("p"),y.textContent=me,D=i(),u(g.$$.fragment),R=i(),U=a("p"),U.innerHTML=fe,F=i(),u(v.$$.fragment),z=i(),G=a("p"),G.textContent=ue,N=i(),u(W.$$.fragment),Y=i(),f=a("div"),f.innerHTML=re,Q=i(),Z=a("p"),Z.innerHTML=de,O=i(),u($.$$.fragment),P=i(),I=a("p"),I.innerHTML=ce,q=i(),u(j.$$.fragment),A=i(),_=a("p"),_.innerHTML=he,K=i(),V=a("p"),V.innerHTML=be,ee=i(),u(B.$$.fragment),te=i(),C=a("p"),this.h()},l(e){const t=Ue("svelte-u9bgzb",document.head);m=p(t,"META",{name:!0,content:!0}),t.forEach(l),S=s(e),x=p(e,"P",{}),we(x).forEach(l),X=s(e),r(w.$$.fragment,e),L=s(e),M=p(e,"P",{"data-svelte-h":!0}),o(M)!=="svelte-8v4mnh"&&(M.innerHTML=pe),H=s(e),T=p(e,"P",{"data-svelte-h":!0}),o(T)!=="svelte-1yjuyfl"&&(T.innerHTML=oe),E=s(e),r(J.$$.fragment,e),k=s(e),y=p(e,"P",{"data-svelte-h":!0}),o(y)!=="svelte-rxdhyz"&&(y.textContent=me),D=s(e),r(g.$$.fragment,e),R=s(e),U=p(e,"P",{"data-svelte-h":!0}),o(U)!=="svelte-1150q8r"&&(U.innerHTML=fe),F=s(e),r(v.$$.fragment,e),z=s(e),G=p(e,"P",{"data-svelte-h":!0}),o(G)!=="svelte-1pgwlbo"&&(G.textContent=ue),N=s(e),r(W.$$.fragment,e),Y=s(e),f=p(e,"DIV",{class:!0,"data-svelte-h":!0}),o(f)!=="svelte-1bbei4i"&&(f.innerHTML=re),Q=s(e),Z=p(e,"P",{"data-svelte-h":!0}),o(Z)!=="svelte-al50pl"&&(Z.innerHTML=de),O=s(e),r($.$$.fragment,e),P=s(e),I=p(e,"P",{"data-svelte-h":!0}),o(I)!=="svelte-1a3vd4r"&&(I.innerHTML=ce),q=s(e),r(j.$$.fragment,e),A=s(e),_=p(e,"P",{"data-svelte-h":!0}),o(_)!=="svelte-1ku614i"&&(_.innerHTML=he),K=s(e),V=p(e,"P",{"data-svelte-h":!0}),o(V)!=="svelte-ar6dc6"&&(V.innerHTML=be),ee=s(e),r(B.$$.fragment,e),te=s(e),C=p(e,"P",{}),we(C).forEach(l),this.h()},h(){ie(m,"name","hf:doc:metadata"),ie(m,"content",Ze),ie(f,"class","flex justify-center")},m(e,t){ve(document.head,m),n(e,S,t),n(e,x,t),n(e,X,t),d(w,e,t),n(e,L,t),n(e,M,t),n(e,H,t),n(e,T,t),n(e,E,t),d(J,e,t),n(e,k,t),n(e,y,t),n(e,D,t),d(g,e,t),n(e,R,t),n(e,U,t),n(e,F,t),d(v,e,t),n(e,z,t),n(e,G,t),n(e,N,t),d(W,e,t),n(e,Y,t),n(e,f,t),n(e,Q,t),n(e,Z,t),n(e,O,t),d($,e,t),n(e,P,t),n(e,I,t),n(e,q,t),d(j,e,t),n(e,A,t),n(e,_,t),n(e,K,t),n(e,V,t),n(e,ee,t),d(B,e,t),n(e,te,t),n(e,C,t),le=!0},p:Te,i(e){le||(c(w.$$.fragment,e),c(J.$$.fragment,e),c(g.$$.fragment,e),c(v.$$.fragment,e),c(W.$$.fragment,e),c($.$$.fragment,e),c(j.$$.fragment,e),c(B.$$.fragment,e),le=!0)},o(e){h(w.$$.fragment,e),h(J.$$.fragment,e),h(g.$$.fragment,e),h(v.$$.fragment,e),h(W.$$.fragment,e),h($.$$.fragment,e),h(j.$$.fragment,e),h(B.$$.fragment,e),le=!1},d(e){e&&(l(S),l(x),l(X),l(L),l(M),l(H),l(T),l(E),l(k),l(y),l(D),l(R),l(U),l(F),l(z),l(G),l(N),l(Y),l(f),l(Q),l(Z),l(O),l(P),l(I),l(q),l(A),l(_),l(K),l(V),l(ee),l(te),l(C)),l(m),b(w,e),b(J,e),b(g,e),b(v,e),b(W,e),b($,e),b(j,e),b(B,e)}}}const Ze='{"title":"OpenVINO","local":"openvino","sections":[{"title":"Stable Diffusion","local":"stable-diffusion","sections":[],"depth":2},{"title":"Stable Diffusion XL","local":"stable-diffusion-xl","sections":[],"depth":2}],"depth":1}';function $e(ae){return Je(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Be extends ye{constructor(m){super(),ge(this,m,$e,We,Me,{})}}export{Be as component};