import{S as gi,i as _i,s as yi,e as s,k as m,w as g,t as i,M as Mi,c as n,d as a,m as h,a as l,x as _,h as r,b as c,N as ss,G as t,g as p,y,q as M,o as w,B as b,v as wi,L as ui}from"../../../chunks/vendor-hf-doc-builder.js";import{T as bi}from"../../../chunks/Tip-hf-doc-builder.js";import{D as wt}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as B}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as ge}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as fi}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ei(H){let f,I,E,u,J,d,j,N;return{c(){f=s("p"),I=i("Make sure to check out the Schedulers "),E=s("a"),u=i("guide"),J=i(" to learn how to explore the tradeoff between scheduler speed and quality, and see the "),d=s("a"),j=i("reuse components across pipelines"),N=i(" section to learn how to efficiently load the same components into multiple pipelines."),this.h()},l(D){f=n(D,"P",{});var S=l(f);I=r(S,"Make sure to check out the Schedulers "),E=n(S,"A",{href:!0});var Z=l(E);u=r(Z,"guide"),Z.forEach(a),J=r(S," to learn how to explore the tradeoff between scheduler speed and quality, and see the "),d=n(S,"A",{href:!0});var ze=l(d);j=r(ze,"reuse components across pipelines"),ze.forEach(a),N=r(S," section to learn how to efficiently load the same components into multiple pipelines."),S.forEach(a),this.h()},h(){c(E,"href","/using-diffusers/schedulers"),c(d,"href","/using-diffusers/loading#reuse-components-across-pipelines")},m(D,S){p(D,f,S),t(f,I),t(f,E),t(E,u),t(f,J),t(f,d),t(d,j),t(f,N)},d(D){D&&a(f)}}}function vi(H){let f,I,E,u,J;return u=new B({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX2dpZiUwQSUwQWRldmljZSUyMCUzRCUyMHRvcmNoLmRldmljZSglMjJjdWRhJTIyJTIwaWYlMjB0b3JjaC5jdWRhLmlzX2F2YWlsYWJsZSgpJTIwZWxzZSUyMCUyMmNwdSUyMiklMEElMEFyZXBvJTIwJTNEJTIwJTIyb3BlbmFpJTJGc2hhcC1lJTIyJTBBcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChyZXBvJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXBpcGUlMjAlM0QlMjBwaXBlLnRvKGRldmljZSklMEElMEFndWlkYW5jZV9zY2FsZSUyMCUzRCUyMDE1LjAlMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwc2hhcmslMjIlMEElMEFpbWFnZXMlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMHByb21wdCUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEZ3VpZGFuY2Vfc2NhbGUlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENjQlMkMlMEElMjAlMjAlMjAlMjBmcmFtZV9zaXplJTNEMjU2JTJDJTBBKS5pbWFnZXMlMEElMEFnaWZfcGF0aCUyMCUzRCUyMGV4cG9ydF90b19naWYoaW1hZ2VzJTVCMCU1RCUyQyUyMCUyMnNoYXJrXzNkLmdpZiUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif

<span class="hljs-meta">&gt;&gt;&gt; </span>device = torch.device(<span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>repo = <span class="hljs-string">&quot;openai/shap-e&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(repo, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(device)

<span class="hljs-meta">&gt;&gt;&gt; </span>guidance_scale = <span class="hljs-number">15.0</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a shark&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipe(
<span class="hljs-meta">... </span>    prompt,
<span class="hljs-meta">... </span>    guidance_scale=guidance_scale,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">64</span>,
<span class="hljs-meta">... </span>    frame_size=<span class="hljs-number">256</span>,
<span class="hljs-meta">... </span>).images

<span class="hljs-meta">&gt;&gt;&gt; </span>gif_path = export_to_gif(images[<span class="hljs-number">0</span>], <span class="hljs-string">&quot;shark_3d.gif&quot;</span>)`}}),{c(){f=s("p"),I=i("Examples:"),E=m(),g(u.$$.fragment)},l(d){f=n(d,"P",{});var j=l(f);I=r(j,"Examples:"),j.forEach(a),E=h(d),_(u.$$.fragment,d)},m(d,j){p(d,f,j),t(f,I),p(d,E,j),y(u,d,j),J=!0},p:ui,i(d){J||(M(u.$$.fragment,d),J=!0)},o(d){w(u.$$.fragment,d),J=!1},d(d){d&&a(f),d&&a(E),b(u,d)}}}function ji(H){let f,I,E,u,J;return u=new B({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX2dpZiUyQyUyMGxvYWRfaW1hZ2UlMEElMEFkZXZpY2UlMjAlM0QlMjB0b3JjaC5kZXZpY2UoJTIyY3VkYSUyMiUyMGlmJTIwdG9yY2guY3VkYS5pc19hdmFpbGFibGUoKSUyMGVsc2UlMjAlMjJjcHUlMjIpJTBBJTBBcmVwbyUyMCUzRCUyMCUyMm9wZW5haSUyRnNoYXAtZS1pbWcyaW1nJTIyJTBBcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChyZXBvJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXBpcGUlMjAlM0QlMjBwaXBlLnRvKGRldmljZSklMEElMEFndWlkYW5jZV9zY2FsZSUyMCUzRCUyMDMuMCUwQWltYWdlX3VybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGaGYuY28lMkZkYXRhc2V0cyUyRmRpZmZ1c2VycyUyRmRvY3MtaW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZzaGFwLWUlMkZjb3JnaS5wbmclMjIlMEFpbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoaW1hZ2VfdXJsKS5jb252ZXJ0KCUyMlJHQiUyMiklMEElMEFpbWFnZXMlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMGltYWdlJTJDJTBBJTIwJTIwJTIwJTIwZ3VpZGFuY2Vfc2NhbGUlM0RndWlkYW5jZV9zY2FsZSUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q2NCUyQyUwQSUyMCUyMCUyMCUyMGZyYW1lX3NpemUlM0QyNTYlMkMlMEEpLmltYWdlcyUwQSUwQWdpZl9wYXRoJTIwJTNEJTIwZXhwb3J0X3RvX2dpZihpbWFnZXMlNUIwJTVEJTJDJTIwJTIyY29yZ2lfM2QuZ2lmJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif, load_image

<span class="hljs-meta">&gt;&gt;&gt; </span>device = torch.device(<span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>repo = <span class="hljs-string">&quot;openai/shap-e-img2img&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(repo, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(device)

<span class="hljs-meta">&gt;&gt;&gt; </span>guidance_scale = <span class="hljs-number">3.0</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_url = <span class="hljs-string">&quot;https://hf.co/datasets/diffusers/docs-images/resolve/main/shap-e/corgi.png&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = load_image(image_url).convert(<span class="hljs-string">&quot;RGB&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipe(
<span class="hljs-meta">... </span>    image,
<span class="hljs-meta">... </span>    guidance_scale=guidance_scale,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">64</span>,
<span class="hljs-meta">... </span>    frame_size=<span class="hljs-number">256</span>,
<span class="hljs-meta">... </span>).images

<span class="hljs-meta">&gt;&gt;&gt; </span>gif_path = export_to_gif(images[<span class="hljs-number">0</span>], <span class="hljs-string">&quot;corgi_3d.gif&quot;</span>)`}}),{c(){f=s("p"),I=i("Examples:"),E=m(),g(u.$$.fragment)},l(d){f=n(d,"P",{});var j=l(f);I=r(j,"Examples:"),j.forEach(a),E=h(d),_(u.$$.fragment,d)},m(d,j){p(d,f,j),t(f,I),p(d,E,j),y(u,d,j),J=!0},p:ui,i(d){J||(M(u.$$.fragment,d),J=!0)},o(d){w(u.$$.fragment,d),J=!1},d(d){d&&a(f),d&&a(E),b(u,d)}}}function Ji(H){let f,I,E,u,J,d,j,N,D,S,Z,ze,_e,ns,ls,ye,is,rs,aa,qe,os,sa,Ae,bt,ps,na,L,cs,Me,ms,hs,la,O,ia,X,K,Et,we,ds,vt,fs,ra,Qe,us,oa,R,ee,jt,be,gs,Jt,_s,pa,te,ys,He,Ms,ws,ca,Ee,ma,P,bs,Le,Es,vs,Ut,js,Js,ha,ve,da,ae,Oe,al,Us,Ke,sl,fa,V,se,It,je,Is,Tt,Ts,ua,ne,Ss,et,Zs,$s,ga,tt,ks,_a,Je,ya,at,st,nl,Ma,nt,Ps,wa,Ue,ba,lt,it,ll,Ea,Y,le,St,Ie,Gs,Zt,Cs,va,v,Ws,rt,xs,Bs,ot,Ns,Ds,$t,Xs,Rs,kt,Vs,Ys,Pt,Fs,zs,Gt,qs,As,Ct,Qs,Hs,Wt,Ls,Os,ja,Te,Ja,G,Ks,xt,en,tn,Bt,an,sn,Ua,ie,nn,Nt,ln,rn,Ia,Se,Ta,re,on,Dt,pn,cn,Sa,Ze,Za,pt,mn,$a,$e,ka,ke,hn,Pe,dn,Pa,F,oe,Xt,Ge,fn,Rt,un,Ga,T,Ce,gn,Vt,_n,yn,We,Mn,ct,wn,bn,En,C,xe,vn,Yt,jn,Jn,pe,Un,ce,Be,In,k,Tn,Ft,Sn,Zn,zt,$n,kn,qt,Pn,Gn,Ca,z,me,At,Ne,Cn,Qt,Wn,Wa,$,De,xn,Ht,Bn,Nn,Xe,Dn,mt,Xn,Rn,Vn,W,Re,Yn,Lt,Fn,zn,he,xa,q,de,Ot,Ve,qn,Kt,An,Ba,A,Ye,Qn,Q,Hn,ht,Ln,On,dt,Kn,el,Na;return d=new ge({}),O=new bi({props:{$$slots:{default:[Ei]},$$scope:{ctx:H}}}),we=new ge({}),be=new ge({}),Ee=new B({props:{code:"aW1wb3J0JTIwdG9yY2glMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFkZXZpY2UlMjAlM0QlMjB0b3JjaC5kZXZpY2UoJTIyY3VkYSUyMiUyMGlmJTIwdG9yY2guY3VkYS5pc19hdmFpbGFibGUoKSUyMGVsc2UlMjAlMjJjcHUlMjIpJTBBJTBBcmVwbyUyMCUzRCUyMCUyMm9wZW5haSUyRnNoYXAtZSUyMiUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQocmVwbyUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byhkZXZpY2UpJTBBJTBBZ3VpZGFuY2Vfc2NhbGUlMjAlM0QlMjAxNS4wJTBBcHJvbXB0JTIwJTNEJTIwJTVCJTIyQSUyMGZpcmVjcmFja2VyJTIyJTJDJTIwJTIyQSUyMGJpcnRoZGF5JTIwY3VwY2FrZSUyMiU1RCUwQSUwQWltYWdlcyUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwZ3VpZGFuY2Vfc2NhbGUlM0RndWlkYW5jZV9zY2FsZSUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q2NCUyQyUwQSUyMCUyMCUyMCUyMGZyYW1lX3NpemUlM0QyNTYlMkMlMEEpLmltYWdlcw==",highlighted:`<span class="hljs-keyword">import</span> torch

<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

device = torch.device(<span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>)

repo = <span class="hljs-string">&quot;openai/shap-e&quot;</span>
pipe = DiffusionPipeline.from_pretrained(repo, torch_dtype=torch.float16)
pipe = pipe.to(device)

guidance_scale = <span class="hljs-number">15.0</span>
prompt = [<span class="hljs-string">&quot;A firecracker&quot;</span>, <span class="hljs-string">&quot;A birthday cupcake&quot;</span>]

images = pipe(
    prompt,
    guidance_scale=guidance_scale,
    num_inference_steps=<span class="hljs-number">64</span>,
    frame_size=<span class="hljs-number">256</span>,
).images`}}),ve=new B({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGV4cG9ydF90b19naWYlMEElMEFleHBvcnRfdG9fZ2lmKGltYWdlcyU1QjAlNUQlMkMlMjAlMjJmaXJlY3JhY2tlcl8zZC5naWYlMjIpJTBBZXhwb3J0X3RvX2dpZihpbWFnZXMlNUIxJTVEJTJDJTIwJTIyY2FrZV8zZC5naWYlMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif

export_to_gif(images[<span class="hljs-number">0</span>], <span class="hljs-string">&quot;firecracker_3d.gif&quot;</span>)
export_to_gif(images[<span class="hljs-number">1</span>], <span class="hljs-string">&quot;cake_3d.gif&quot;</span>)`}}),je=new ge({}),Je=new B({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlX3ByaW9yJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEF0MmlfcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEF0MmlfcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkElMjBjaGVlc2VidXJnZXIlMkMlMjB3aGl0ZSUyMGJhY2tncm91bmQlMjIlMEElMEFpbWFnZV9lbWJlZHMlMkMlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlMjAlM0QlMjBwaXBlX3ByaW9yKHByb21wdCUyQyUyMGd1aWRhbmNlX3NjYWxlJTNEMS4wKS50b190dXBsZSgpJTBBaW1hZ2UlMjAlM0QlMjB0MmlfcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWJlZHMlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0RuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlMkMlMEEpLmltYWdlcyU1QjAlNUQlMEElMEFpbWFnZS5zYXZlKCUyMmJ1cmdlci5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">import</span> torch

pipe_prior = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1-prior&quot;</span>, torch_dtype=torch.float16)
pipe_prior.to(<span class="hljs-string">&quot;cuda&quot;</span>)

t2i_pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1&quot;</span>, torch_dtype=torch.float16)
t2i_pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;A cheeseburger, white background&quot;</span>

image_embeds, negative_image_embeds = pipe_prior(prompt, guidance_scale=<span class="hljs-number">1.0</span>).to_tuple()
image = t2i_pipe(
    prompt,
    image_embeds=image_embeds,
    negative_image_embeds=negative_image_embeds,
).images[<span class="hljs-number">0</span>]

image.save(<span class="hljs-string">&quot;burger.png&quot;</span>)`}}),Ue=new B({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGV4cG9ydF90b19naWYlMEElMEFyZXBvJTIwJTNEJTIwJTIyb3BlbmFpJTJGc2hhcC1lLWltZzJpbWclMjIlMEFwaXBlJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKHJlcG8lMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBcGlwZSUyMCUzRCUyMHBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFndWlkYW5jZV9zY2FsZSUyMCUzRCUyMDMuMCUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbiglMjJidXJnZXIucG5nJTIyKS5yZXNpemUoKDI1NiUyQyUyMDI1NikpJTBBJTBBaW1hZ2VzJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBpbWFnZSUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEZ3VpZGFuY2Vfc2NhbGUlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENjQlMkMlMEElMjAlMjAlMjAlMjBmcmFtZV9zaXplJTNEMjU2JTJDJTBBKS5pbWFnZXMlMEElMEFnaWZfcGF0aCUyMCUzRCUyMGV4cG9ydF90b19naWYoaW1hZ2VzJTVCMCU1RCUyQyUyMCUyMmJ1cmdlcl8zZC5naWYlMjIp",highlighted:`<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif

repo = <span class="hljs-string">&quot;openai/shap-e-img2img&quot;</span>
pipe = DiffusionPipeline.from_pretrained(repo, torch_dtype=torch.float16)
pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

guidance_scale = <span class="hljs-number">3.0</span>
image = Image.<span class="hljs-built_in">open</span>(<span class="hljs-string">&quot;burger.png&quot;</span>).resize((<span class="hljs-number">256</span>, <span class="hljs-number">256</span>))

images = pipe(
    image,
    guidance_scale=guidance_scale,
    num_inference_steps=<span class="hljs-number">64</span>,
    frame_size=<span class="hljs-number">256</span>,
).images

gif_path = export_to_gif(images[<span class="hljs-number">0</span>], <span class="hljs-string">&quot;burger_3d.gif&quot;</span>)`}}),Ie=new ge({}),Te=new B({props:{code:"aW1wb3J0JTIwdG9yY2glMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX3BseSUwQSUwQWRldmljZSUyMCUzRCUyMHRvcmNoLmRldmljZSglMjJjdWRhJTIyJTIwaWYlMjB0b3JjaC5jdWRhLmlzX2F2YWlsYWJsZSgpJTIwZWxzZSUyMCUyMmNwdSUyMiklMEElMEFyZXBvJTIwJTNEJTIwJTIyb3BlbmFpJTJGc2hhcC1lJTIyJTBBcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChyZXBvJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTIwdmFyaWFudCUzRCUyMmZwMTYlMjIpJTBBcGlwZSUyMCUzRCUyMHBpcGUudG8oZGV2aWNlKSUwQSUwQWd1aWRhbmNlX3NjYWxlJTIwJTNEJTIwMTUuMCUwQXByb21wdCUyMCUzRCUyMCUyMkElMjBiaXJ0aGRheSUyMGN1cGNha2UlMjIlMEElMEFpbWFnZXMlMjAlM0QlMjBwaXBlKHByb21wdCUyQyUyMGd1aWRhbmNlX3NjYWxlJTNEZ3VpZGFuY2Vfc2NhbGUlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENjQlMkMlMjBmcmFtZV9zaXplJTNEMjU2JTJDJTIwb3V0cHV0X3R5cGUlM0QlMjJtZXNoJTIyKS5pbWFnZXMlMEElMEFwbHlfcGF0aCUyMCUzRCUyMGV4cG9ydF90b19wbHkoaW1hZ2VzJTVCMCU1RCUyQyUyMCUyMjNkX2Nha2UucGx5JTIyKSUwQXByaW50KGYlMjJzYXZlZCUyMHRvJTIwZm9sZGVyJTNBJTIwJTdCcGx5X3BhdGglN0QlMjIp",highlighted:`<span class="hljs-keyword">import</span> torch

<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_ply

device = torch.device(<span class="hljs-string">&quot;cuda&quot;</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">&quot;cpu&quot;</span>)

repo = <span class="hljs-string">&quot;openai/shap-e&quot;</span>
pipe = DiffusionPipeline.from_pretrained(repo, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>)
pipe = pipe.to(device)

guidance_scale = <span class="hljs-number">15.0</span>
prompt = <span class="hljs-string">&quot;A birthday cupcake&quot;</span>

images = pipe(prompt, guidance_scale=guidance_scale, num_inference_steps=<span class="hljs-number">64</span>, frame_size=<span class="hljs-number">256</span>, output_type=<span class="hljs-string">&quot;mesh&quot;</span>).images

ply_path = export_to_ply(images[<span class="hljs-number">0</span>], <span class="hljs-string">&quot;3d_cake.ply&quot;</span>)
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;saved to folder: <span class="hljs-subst">{ply_path}</span>&quot;</span>)`}}),Se=new B({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyaW1lc2g=",highlighted:'pip <span class="hljs-keyword">install</span> trimesh'}}),Ze=new B({props:{code:"aW1wb3J0JTIwdHJpbWVzaCUwQSUwQW1lc2glMjAlM0QlMjB0cmltZXNoLmxvYWQoJTIyM2RfY2FrZS5wbHklMjIpJTBBbWVzaC5leHBvcnQoJTIyM2RfY2FrZS5nbGIlMjIlMkMlMjBmaWxlX3R5cGUlM0QlMjJnbGIlMjIp",highlighted:`<span class="hljs-keyword">import</span> trimesh

mesh = trimesh.load(<span class="hljs-string">&quot;3d_cake.ply&quot;</span>)
mesh.export(<span class="hljs-string">&quot;3d_cake.glb&quot;</span>, file_type=<span class="hljs-string">&quot;glb&quot;</span>)`}}),$e=new B({props:{code:"aW1wb3J0JTIwdHJpbWVzaCUwQWltcG9ydCUyMG51bXB5JTIwYXMlMjBucCUwQSUwQW1lc2glMjAlM0QlMjB0cmltZXNoLmxvYWQoJTIyM2RfY2FrZS5wbHklMjIpJTBBcm90JTIwJTNEJTIwdHJpbWVzaC50cmFuc2Zvcm1hdGlvbnMucm90YXRpb25fbWF0cml4KC1ucC5waSUyMCUyRiUyMDIlMkMlMjAlNUIxJTJDJTIwMCUyQyUyMDAlNUQpJTBBbWVzaCUyMCUzRCUyMG1lc2guYXBwbHlfdHJhbnNmb3JtKHJvdCklMEFtZXNoLmV4cG9ydCglMjIzZF9jYWtlLmdsYiUyMiUyQyUyMGZpbGVfdHlwZSUzRCUyMmdsYiUyMik=",highlighted:`<span class="hljs-keyword">import</span> trimesh
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

mesh = trimesh.load(<span class="hljs-string">&quot;3d_cake.ply&quot;</span>)
rot = trimesh.transformations.rotation_matrix(-np.pi / <span class="hljs-number">2</span>, [<span class="hljs-number">1</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>])
mesh = mesh.apply_transform(rot)
mesh.export(<span class="hljs-string">&quot;3d_cake.glb&quot;</span>, file_type=<span class="hljs-string">&quot;glb&quot;</span>)`}}),Ge=new ge({}),Ce=new wt({props:{name:"class diffusers.ShapEPipeline",anchor:"diffusers.ShapEPipeline",parameters:[{name:"prior",val:": PriorTransformer"},{name:"text_encoder",val:": CLIPTextModelWithProjection"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"scheduler",val:": HeunDiscreteScheduler"},{name:"shap_e_renderer",val:": ShapERenderer"}],parametersDescription:[{anchor:"diffusers.ShapEPipeline.prior",description:`<strong>prior</strong> (<a href="/docs/diffusers/main/en/api/models/prior_transformer#diffusers.PriorTransformer">PriorTransformer</a>) &#x2014;
The canonincal unCLIP prior to approximate the image embedding from the text embedding.`,name:"prior"},{anchor:"diffusers.ShapEPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModelWithProjection</code>) &#x2014;
Frozen text-encoder.`,name:"text_encoder"},{anchor:"diffusers.ShapEPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
A <a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.ShapEPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/heun#diffusers.HeunDiscreteScheduler">HeunDiscreteScheduler</a>) &#x2014;
A scheduler to be used in combination with <code>prior</code> to generate image embedding.`,name:"scheduler"},{anchor:"diffusers.ShapEPipeline.shap_e_renderer",description:`<strong>shap_e_renderer</strong> (<code>ShapERenderer</code>) &#x2014;
Shap-E renderer projects the generated latents into parameters of a MLP that&#x2019;s used to create 3D objects
with the NeRF rendering method.`,name:"shap_e_renderer"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/shap_e/pipeline_shap_e.py#L81"}}),xe=new wt({props:{name:"__call__",anchor:"diffusers.ShapEPipeline.__call__",parameters:[{name:"prompt",val:": str"},{name:"num_images_per_prompt",val:": int = 1"},{name:"num_inference_steps",val:": int = 25"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"guidance_scale",val:": float = 4.0"},{name:"frame_size",val:": int = 64"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.ShapEPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.ShapEPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.ShapEPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 25) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.ShapEPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></a> to make
generation deterministic.`,name:"generator"},{anchor:"diffusers.ShapEPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor is generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.ShapEPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.ShapEPipeline.__call__.frame_size",description:`<strong>frame_size</strong> (<code>int</code>, <em>optional</em>, default to 64) &#x2014;
The width and height of each image frame of the generated 3D output.`,name:"frame_size"},{anchor:"diffusers.ShapEPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pt&quot;</code>) &#x2014;
The output format of the generate image. Choose between: <code>&quot;pil&quot;</code> (<code>PIL.Image.Image</code>), <code>&quot;np&quot;</code>
(<code>np.array</code>),<code>&quot;latent&quot;</code> (<code>torch.Tensor</code>), mesh (<code>MeshDecoderOutput</code>).`,name:"output_type"},{anchor:"diffusers.ShapEPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput">ShapEPipelineOutput</a> instead of a plain
tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/shap_e/pipeline_shap_e.py#L209",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput"
>ShapEPipelineOutput</a> is returned,
otherwise a <code>tuple</code> is returned where the first element is a list with the generated images.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput"
>ShapEPipelineOutput</a> or <code>tuple</code></p>
`}}),pe=new fi({props:{anchor:"diffusers.ShapEPipeline.__call__.example",$$slots:{default:[vi]},$$scope:{ctx:H}}}),Be=new wt({props:{name:"enable_model_cpu_offload",anchor:"diffusers.ShapEPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/shap_e/pipeline_shap_e.py#L132"}}),Ne=new ge({}),De=new wt({props:{name:"class diffusers.ShapEImg2ImgPipeline",anchor:"diffusers.ShapEImg2ImgPipeline",parameters:[{name:"prior",val:": PriorTransformer"},{name:"image_encoder",val:": CLIPVisionModel"},{name:"image_processor",val:": CLIPImageProcessor"},{name:"scheduler",val:": HeunDiscreteScheduler"},{name:"shap_e_renderer",val:": ShapERenderer"}],parametersDescription:[{anchor:"diffusers.ShapEImg2ImgPipeline.prior",description:`<strong>prior</strong> (<a href="/docs/diffusers/main/en/api/models/prior_transformer#diffusers.PriorTransformer">PriorTransformer</a>) &#x2014;
The canonincal unCLIP prior to approximate the image embedding from the text embedding.`,name:"prior"},{anchor:"diffusers.ShapEImg2ImgPipeline.image_encoder",description:`<strong>image_encoder</strong> (<code>CLIPVisionModel</code>) &#x2014;
Frozen image-encoder.`,name:"image_encoder"},{anchor:"diffusers.ShapEImg2ImgPipeline.image_processor",description:`<strong>image_processor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
A <a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor" rel="nofollow">CLIPImageProcessor</a> to process images.`,name:"image_processor"},{anchor:"diffusers.ShapEImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/heun#diffusers.HeunDiscreteScheduler">HeunDiscreteScheduler</a>) &#x2014;
A scheduler to be used in combination with <code>prior</code> to generate image embedding.`,name:"scheduler"},{anchor:"diffusers.ShapEImg2ImgPipeline.shap_e_renderer",description:`<strong>shap_e_renderer</strong> (<code>ShapERenderer</code>) &#x2014;
Shap-E renderer projects the generated latents into parameters of a MLP that&#x2019;s used to create 3D objects
with the NeRF rendering method.`,name:"shap_e_renderer"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py#L80"}}),Re=new wt({props:{name:"__call__",anchor:"diffusers.ShapEImg2ImgPipeline.__call__",parameters:[{name:"image",val:": typing.Union[PIL.Image.Image, typing.List[PIL.Image.Image]]"},{name:"num_images_per_prompt",val:": int = 1"},{name:"num_inference_steps",val:": int = 25"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"guidance_scale",val:": float = 4.0"},{name:"frame_size",val:": int = 64"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.ShapEImg2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, or <code>List[np.ndarray]</code>) &#x2014;
<code>Image</code> or tensor representing an image batch to be used as the starting point. Can also accept image
latents as <code>image</code>, if passing latents directly, it will not be encoded again.`,name:"image"},{anchor:"diffusers.ShapEImg2ImgPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.ShapEImg2ImgPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.ShapEImg2ImgPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></a> to make
generation deterministic.`,name:"generator"},{anchor:"diffusers.ShapEImg2ImgPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor is generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.ShapEImg2ImgPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,name:"guidance_scale"},{anchor:"diffusers.ShapEImg2ImgPipeline.__call__.frame_size",description:`<strong>frame_size</strong> (<code>int</code>, <em>optional</em>, default to 64) &#x2014;
The width and height of each image frame of the generated 3D output.`,name:"frame_size"},{anchor:"diffusers.ShapEImg2ImgPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pt&quot;</code>) &#x2014;
(<code>np.array</code>),<code>&quot;latent&quot;</code> (<code>torch.Tensor</code>), mesh (<code>MeshDecoderOutput</code>).`,name:"output_type"},{anchor:"diffusers.ShapEImg2ImgPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput">ShapEPipelineOutput</a> instead of a plain
tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py#L162",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput"
>ShapEPipelineOutput</a> is returned,
otherwise a <code>tuple</code> is returned where the first element is a list with the generated images.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput"
>ShapEPipelineOutput</a> or <code>tuple</code></p>
`}}),he=new fi({props:{anchor:"diffusers.ShapEImg2ImgPipeline.__call__.example",$$slots:{default:[ji]},$$scope:{ctx:H}}}),Ve=new ge({}),Ye=new wt({props:{name:"class diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput",anchor:"diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.List[typing.List[PIL.Image.Image]], typing.List[typing.List[numpy.ndarray]]]"}],parametersDescription:[{anchor:"diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput.images",description:`<strong>images</strong> (<code>torch.FloatTensor</code>) &#x2014;
A list of images for 3D rendering.`,name:"images"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/shap_e/pipeline_shap_e.py#L69"}}),{c(){f=s("meta"),I=m(),E=s("h1"),u=s("a"),J=s("span"),g(d.$$.fragment),j=m(),N=s("span"),D=i("Shap-E"),S=m(),Z=s("p"),ze=i("The Shap-E model was proposed in "),_e=s("a"),ns=i("Shap-E: Generating Conditional 3D Implicit Functions"),ls=i(" by Alex Nichol and Heewon Jun from "),ye=s("a"),is=i("OpenAI"),rs=i("."),aa=m(),qe=s("p"),os=i("The abstract from the paper is:"),sa=m(),Ae=s("p"),bt=s("em"),ps=i("We present Shap-E, a conditional generative model for 3D assets. Unlike recent work on 3D generative models which produce a single output representation, Shap-E directly generates the parameters of implicit functions that can be rendered as both textured meshes and neural radiance fields. We train Shap-E in two stages: first, we train an encoder that deterministically maps 3D assets into the parameters of an implicit function; second, we train a conditional diffusion model on outputs of the encoder. When trained on a large dataset of paired 3D and text data, our resulting models are capable of generating complex and diverse 3D assets in a matter of seconds. When compared to Point-E, an explicit generative model over point clouds, Shap-E converges faster and reaches comparable or better sample quality despite modeling a higher-dimensional, multi-representation output space."),na=m(),L=s("p"),cs=i("The original codebase can be found at "),Me=s("a"),ms=i("openai/shap-e"),hs=i("."),la=m(),g(O.$$.fragment),ia=m(),X=s("h2"),K=s("a"),Et=s("span"),g(we.$$.fragment),ds=m(),vt=s("span"),fs=i("Usage Examples"),ra=m(),Qe=s("p"),us=i("In the following, we will walk you through some examples of how to use Shap-E pipelines to create 3D objects in gif format."),oa=m(),R=s("h3"),ee=s("a"),jt=s("span"),g(be.$$.fragment),gs=m(),Jt=s("span"),_s=i("Text-to-3D image generation"),pa=m(),te=s("p"),ys=i("We can use "),He=s("a"),Ms=i("ShapEPipeline"),ws=i(" to create 3D object based on a text prompt. In this example, we will make a birthday cupcake for :firecracker: diffusers library\u2019s 1 year birthday. The workflow to use the Shap-E text-to-image pipeline is same as how you would use other text-to-image pipelines in diffusers."),ca=m(),g(Ee.$$.fragment),ma=m(),P=s("p"),bs=i("The output of "),Le=s("a"),Es=i("ShapEPipeline"),vs=i(" is a list of lists of images frames. Each list of frames can be used to create a 3D object. Let\u2019s use the "),Ut=s("code"),js=i("export_to_gif"),Js=i(" utility function in diffusers to make a 3D cupcake!"),ha=m(),g(ve.$$.fragment),da=m(),ae=s("p"),Oe=s("img"),Us=m(),Ke=s("img"),fa=m(),V=s("h3"),se=s("a"),It=s("span"),g(je.$$.fragment),Is=m(),Tt=s("span"),Ts=i("Image-to-Image generation"),ua=m(),ne=s("p"),Ss=i("You can use "),et=s("a"),Zs=i("ShapEImg2ImgPipeline"),$s=i(" along with other text-to-image pipelines in diffusers and turn your 2D generation into 3D."),ga=m(),tt=s("p"),ks=i("In this example, We will first genrate a cheeseburger with a simple prompt \u201CA cheeseburger, white background\u201D"),_a=m(),g(Je.$$.fragment),ya=m(),at=s("p"),st=s("img"),Ma=m(),nt=s("p"),Ps=i("we will then use the Shap-E image-to-image pipeline to turn it into a 3D cheeseburger :)"),wa=m(),g(Ue.$$.fragment),ba=m(),lt=s("p"),it=s("img"),Ea=m(),Y=s("h3"),le=s("a"),St=s("span"),g(Ie.$$.fragment),Gs=m(),Zt=s("span"),Cs=i("Generate mesh"),va=m(),v=s("p"),Ws=i("For both "),rt=s("a"),xs=i("ShapEPipeline"),Bs=i(" and "),ot=s("a"),Ns=i("ShapEImg2ImgPipeline"),Ds=i(", you can generate mesh output by passing "),$t=s("code"),Xs=i("output_type"),Rs=i(" as "),kt=s("code"),Vs=i("mesh"),Ys=i(" to the pipeline, and then use the "),Pt=s("code"),Fs=i("ShapEPipeline.export_to_ply"),zs=i(" utility function to save the output as a "),Gt=s("code"),qs=i("ply"),As=i(" file. We also provide a "),Ct=s("code"),Qs=i("ShapEPipeline.export_to_obj"),Hs=i(" function that you can use to save mesh outputs as "),Wt=s("code"),Ls=i("obj"),Os=i(" files."),ja=m(),g(Te.$$.fragment),Ja=m(),G=s("p"),Ks=i("Huggingface Datasets supports mesh visualization for mesh files in "),xt=s("code"),en=i("glb"),tn=i(" format. Below we will show you how to convert your mesh file into "),Bt=s("code"),an=i("glb"),sn=i(" format so that you can use the Dataset viewer to render 3D objects."),Ua=m(),ie=s("p"),nn=i("We need to install "),Nt=s("code"),ln=i("trimesh"),rn=i(" library."),Ia=m(),g(Se.$$.fragment),Ta=m(),re=s("p"),on=i("To convert the mesh file into "),Dt=s("code"),pn=i("glb"),cn=i(" format,"),Sa=m(),g(Ze.$$.fragment),Za=m(),pt=s("p"),mn=i("By default, the mesh output of Shap-E is from the bottom viewpoint; you can change the default viewpoint by applying a rotation transformation"),$a=m(),g($e.$$.fragment),ka=m(),ke=s("p"),hn=i(`Now you can upload your mesh file to your dataset and visualize it! Here is the link to the 3D cake we just generated
`),Pe=s("a"),dn=i("https://huggingface.co/datasets/hf-internal-testing/diffusers-images/blob/main/shap_e/3d_cake.glb"),Pa=m(),F=s("h2"),oe=s("a"),Xt=s("span"),g(Ge.$$.fragment),fn=m(),Rt=s("span"),un=i("ShapEPipeline"),Ga=m(),T=s("div"),g(Ce.$$.fragment),gn=m(),Vt=s("p"),_n=i("Pipeline for generating latent representation of a 3D asset and rendering with NeRF method with Shap-E."),yn=m(),We=s("p"),Mn=i("This model inherits from "),ct=s("a"),wn=i("DiffusionPipeline"),bn=i(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),En=m(),C=s("div"),g(xe.$$.fragment),vn=m(),Yt=s("p"),jn=i("The call function to the pipeline for generation."),Jn=m(),g(pe.$$.fragment),Un=m(),ce=s("div"),g(Be.$$.fragment),In=m(),k=s("p"),Tn=i(`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),Ft=s("code"),Sn=i("forward"),Zn=i(` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),zt=s("code"),$n=i("enable_sequential_cpu_offload"),kn=i(`, but performance is much better due to the
iterative execution of the `),qt=s("code"),Pn=i("unet"),Gn=i("."),Ca=m(),z=s("h2"),me=s("a"),At=s("span"),g(Ne.$$.fragment),Cn=m(),Qt=s("span"),Wn=i("ShapEImg2ImgPipeline"),Wa=m(),$=s("div"),g(De.$$.fragment),xn=m(),Ht=s("p"),Bn=i(`Pipeline for generating latent representation of a 3D asset and rendering with NeRF method with Shap-E from an
image.`),Nn=m(),Xe=s("p"),Dn=i("This model inherits from "),mt=s("a"),Xn=i("DiffusionPipeline"),Rn=i(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Vn=m(),W=s("div"),g(Re.$$.fragment),Yn=m(),Lt=s("p"),Fn=i("The call function to the pipeline for generation."),zn=m(),g(he.$$.fragment),xa=m(),q=s("h2"),de=s("a"),Ot=s("span"),g(Ve.$$.fragment),qn=m(),Kt=s("span"),An=i("ShapEPipelineOutput"),Ba=m(),A=s("div"),g(Ye.$$.fragment),Qn=m(),Q=s("p"),Hn=i("Output class for "),ht=s("a"),Ln=i("ShapEPipeline"),On=i(" and "),dt=s("a"),Kn=i("ShapEImg2ImgPipeline"),el=i("."),this.h()},l(e){const o=Mi('[data-svelte="svelte-1phssyn"]',document.head);f=n(o,"META",{name:!0,content:!0}),o.forEach(a),I=h(e),E=n(e,"H1",{class:!0});var Fe=l(E);u=n(Fe,"A",{id:!0,class:!0,href:!0});var ea=l(u);J=n(ea,"SPAN",{});var ta=l(J);_(d.$$.fragment,ta),ta.forEach(a),ea.forEach(a),j=h(Fe),N=n(Fe,"SPAN",{});var il=l(N);D=r(il,"Shap-E"),il.forEach(a),Fe.forEach(a),S=h(e),Z=n(e,"P",{});var ft=l(Z);ze=r(ft,"The Shap-E model was proposed in "),_e=n(ft,"A",{href:!0,rel:!0});var rl=l(_e);ns=r(rl,"Shap-E: Generating Conditional 3D Implicit Functions"),rl.forEach(a),ls=r(ft," by Alex Nichol and Heewon Jun from "),ye=n(ft,"A",{href:!0,rel:!0});var ol=l(ye);is=r(ol,"OpenAI"),ol.forEach(a),rs=r(ft,"."),ft.forEach(a),aa=h(e),qe=n(e,"P",{});var pl=l(qe);os=r(pl,"The abstract from the paper is:"),pl.forEach(a),sa=h(e),Ae=n(e,"P",{});var cl=l(Ae);bt=n(cl,"EM",{});var ml=l(bt);ps=r(ml,"We present Shap-E, a conditional generative model for 3D assets. Unlike recent work on 3D generative models which produce a single output representation, Shap-E directly generates the parameters of implicit functions that can be rendered as both textured meshes and neural radiance fields. We train Shap-E in two stages: first, we train an encoder that deterministically maps 3D assets into the parameters of an implicit function; second, we train a conditional diffusion model on outputs of the encoder. When trained on a large dataset of paired 3D and text data, our resulting models are capable of generating complex and diverse 3D assets in a matter of seconds. When compared to Point-E, an explicit generative model over point clouds, Shap-E converges faster and reaches comparable or better sample quality despite modeling a higher-dimensional, multi-representation output space."),ml.forEach(a),cl.forEach(a),na=h(e),L=n(e,"P",{});var Da=l(L);cs=r(Da,"The original codebase can be found at "),Me=n(Da,"A",{href:!0,rel:!0});var hl=l(Me);ms=r(hl,"openai/shap-e"),hl.forEach(a),hs=r(Da,"."),Da.forEach(a),la=h(e),_(O.$$.fragment,e),ia=h(e),X=n(e,"H2",{class:!0});var Xa=l(X);K=n(Xa,"A",{id:!0,class:!0,href:!0});var dl=l(K);Et=n(dl,"SPAN",{});var fl=l(Et);_(we.$$.fragment,fl),fl.forEach(a),dl.forEach(a),ds=h(Xa),vt=n(Xa,"SPAN",{});var ul=l(vt);fs=r(ul,"Usage Examples"),ul.forEach(a),Xa.forEach(a),ra=h(e),Qe=n(e,"P",{});var gl=l(Qe);us=r(gl,"In the following, we will walk you through some examples of how to use Shap-E pipelines to create 3D objects in gif format."),gl.forEach(a),oa=h(e),R=n(e,"H3",{class:!0});var Ra=l(R);ee=n(Ra,"A",{id:!0,class:!0,href:!0});var _l=l(ee);jt=n(_l,"SPAN",{});var yl=l(jt);_(be.$$.fragment,yl),yl.forEach(a),_l.forEach(a),gs=h(Ra),Jt=n(Ra,"SPAN",{});var Ml=l(Jt);_s=r(Ml,"Text-to-3D image generation"),Ml.forEach(a),Ra.forEach(a),pa=h(e),te=n(e,"P",{});var Va=l(te);ys=r(Va,"We can use "),He=n(Va,"A",{href:!0});var wl=l(He);Ms=r(wl,"ShapEPipeline"),wl.forEach(a),ws=r(Va," to create 3D object based on a text prompt. In this example, we will make a birthday cupcake for :firecracker: diffusers library\u2019s 1 year birthday. The workflow to use the Shap-E text-to-image pipeline is same as how you would use other text-to-image pipelines in diffusers."),Va.forEach(a),ca=h(e),_(Ee.$$.fragment,e),ma=h(e),P=n(e,"P",{});var ut=l(P);bs=r(ut,"The output of "),Le=n(ut,"A",{href:!0});var bl=l(Le);Es=r(bl,"ShapEPipeline"),bl.forEach(a),vs=r(ut," is a list of lists of images frames. Each list of frames can be used to create a 3D object. Let\u2019s use the "),Ut=n(ut,"CODE",{});var El=l(Ut);js=r(El,"export_to_gif"),El.forEach(a),Js=r(ut," utility function in diffusers to make a 3D cupcake!"),ut.forEach(a),ha=h(e),_(ve.$$.fragment,e),da=h(e),ae=n(e,"P",{});var Ya=l(ae);Oe=n(Ya,"IMG",{src:!0,alt:!0}),Us=h(Ya),Ke=n(Ya,"IMG",{src:!0,alt:!0}),Ya.forEach(a),fa=h(e),V=n(e,"H3",{class:!0});var Fa=l(V);se=n(Fa,"A",{id:!0,class:!0,href:!0});var vl=l(se);It=n(vl,"SPAN",{});var jl=l(It);_(je.$$.fragment,jl),jl.forEach(a),vl.forEach(a),Is=h(Fa),Tt=n(Fa,"SPAN",{});var Jl=l(Tt);Ts=r(Jl,"Image-to-Image generation"),Jl.forEach(a),Fa.forEach(a),ua=h(e),ne=n(e,"P",{});var za=l(ne);Ss=r(za,"You can use "),et=n(za,"A",{href:!0});var Ul=l(et);Zs=r(Ul,"ShapEImg2ImgPipeline"),Ul.forEach(a),$s=r(za," along with other text-to-image pipelines in diffusers and turn your 2D generation into 3D."),za.forEach(a),ga=h(e),tt=n(e,"P",{});var Il=l(tt);ks=r(Il,"In this example, We will first genrate a cheeseburger with a simple prompt \u201CA cheeseburger, white background\u201D"),Il.forEach(a),_a=h(e),_(Je.$$.fragment,e),ya=h(e),at=n(e,"P",{});var Tl=l(at);st=n(Tl,"IMG",{src:!0,alt:!0}),Tl.forEach(a),Ma=h(e),nt=n(e,"P",{});var Sl=l(nt);Ps=r(Sl,"we will then use the Shap-E image-to-image pipeline to turn it into a 3D cheeseburger :)"),Sl.forEach(a),wa=h(e),_(Ue.$$.fragment,e),ba=h(e),lt=n(e,"P",{});var Zl=l(lt);it=n(Zl,"IMG",{src:!0,alt:!0}),Zl.forEach(a),Ea=h(e),Y=n(e,"H3",{class:!0});var qa=l(Y);le=n(qa,"A",{id:!0,class:!0,href:!0});var $l=l(le);St=n($l,"SPAN",{});var kl=l(St);_(Ie.$$.fragment,kl),kl.forEach(a),$l.forEach(a),Gs=h(qa),Zt=n(qa,"SPAN",{});var Pl=l(Zt);Cs=r(Pl,"Generate mesh"),Pl.forEach(a),qa.forEach(a),va=h(e),v=n(e,"P",{});var U=l(v);Ws=r(U,"For both "),rt=n(U,"A",{href:!0});var Gl=l(rt);xs=r(Gl,"ShapEPipeline"),Gl.forEach(a),Bs=r(U," and "),ot=n(U,"A",{href:!0});var Cl=l(ot);Ns=r(Cl,"ShapEImg2ImgPipeline"),Cl.forEach(a),Ds=r(U,", you can generate mesh output by passing "),$t=n(U,"CODE",{});var Wl=l($t);Xs=r(Wl,"output_type"),Wl.forEach(a),Rs=r(U," as "),kt=n(U,"CODE",{});var xl=l(kt);Vs=r(xl,"mesh"),xl.forEach(a),Ys=r(U," to the pipeline, and then use the "),Pt=n(U,"CODE",{});var Bl=l(Pt);Fs=r(Bl,"ShapEPipeline.export_to_ply"),Bl.forEach(a),zs=r(U," utility function to save the output as a "),Gt=n(U,"CODE",{});var Nl=l(Gt);qs=r(Nl,"ply"),Nl.forEach(a),As=r(U," file. We also provide a "),Ct=n(U,"CODE",{});var Dl=l(Ct);Qs=r(Dl,"ShapEPipeline.export_to_obj"),Dl.forEach(a),Hs=r(U," function that you can use to save mesh outputs as "),Wt=n(U,"CODE",{});var Xl=l(Wt);Ls=r(Xl,"obj"),Xl.forEach(a),Os=r(U," files."),U.forEach(a),ja=h(e),_(Te.$$.fragment,e),Ja=h(e),G=n(e,"P",{});var gt=l(G);Ks=r(gt,"Huggingface Datasets supports mesh visualization for mesh files in "),xt=n(gt,"CODE",{});var Rl=l(xt);en=r(Rl,"glb"),Rl.forEach(a),tn=r(gt," format. Below we will show you how to convert your mesh file into "),Bt=n(gt,"CODE",{});var Vl=l(Bt);an=r(Vl,"glb"),Vl.forEach(a),sn=r(gt," format so that you can use the Dataset viewer to render 3D objects."),gt.forEach(a),Ua=h(e),ie=n(e,"P",{});var Aa=l(ie);nn=r(Aa,"We need to install "),Nt=n(Aa,"CODE",{});var Yl=l(Nt);ln=r(Yl,"trimesh"),Yl.forEach(a),rn=r(Aa," library."),Aa.forEach(a),Ia=h(e),_(Se.$$.fragment,e),Ta=h(e),re=n(e,"P",{});var Qa=l(re);on=r(Qa,"To convert the mesh file into "),Dt=n(Qa,"CODE",{});var Fl=l(Dt);pn=r(Fl,"glb"),Fl.forEach(a),cn=r(Qa," format,"),Qa.forEach(a),Sa=h(e),_(Ze.$$.fragment,e),Za=h(e),pt=n(e,"P",{});var zl=l(pt);mn=r(zl,"By default, the mesh output of Shap-E is from the bottom viewpoint; you can change the default viewpoint by applying a rotation transformation"),zl.forEach(a),$a=h(e),_($e.$$.fragment,e),ka=h(e),ke=n(e,"P",{});var tl=l(ke);hn=r(tl,`Now you can upload your mesh file to your dataset and visualize it! Here is the link to the 3D cake we just generated
`),Pe=n(tl,"A",{href:!0,rel:!0});var ql=l(Pe);dn=r(ql,"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/blob/main/shap_e/3d_cake.glb"),ql.forEach(a),tl.forEach(a),Pa=h(e),F=n(e,"H2",{class:!0});var Ha=l(F);oe=n(Ha,"A",{id:!0,class:!0,href:!0});var Al=l(oe);Xt=n(Al,"SPAN",{});var Ql=l(Xt);_(Ge.$$.fragment,Ql),Ql.forEach(a),Al.forEach(a),fn=h(Ha),Rt=n(Ha,"SPAN",{});var Hl=l(Rt);un=r(Hl,"ShapEPipeline"),Hl.forEach(a),Ha.forEach(a),Ga=h(e),T=n(e,"DIV",{class:!0});var x=l(T);_(Ce.$$.fragment,x),gn=h(x),Vt=n(x,"P",{});var Ll=l(Vt);_n=r(Ll,"Pipeline for generating latent representation of a 3D asset and rendering with NeRF method with Shap-E."),Ll.forEach(a),yn=h(x),We=n(x,"P",{});var La=l(We);Mn=r(La,"This model inherits from "),ct=n(La,"A",{href:!0});var Ol=l(ct);wn=r(Ol,"DiffusionPipeline"),Ol.forEach(a),bn=r(La,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),La.forEach(a),En=h(x),C=n(x,"DIV",{class:!0});var _t=l(C);_(xe.$$.fragment,_t),vn=h(_t),Yt=n(_t,"P",{});var Kl=l(Yt);jn=r(Kl,"The call function to the pipeline for generation."),Kl.forEach(a),Jn=h(_t),_(pe.$$.fragment,_t),_t.forEach(a),Un=h(x),ce=n(x,"DIV",{class:!0});var Oa=l(ce);_(Be.$$.fragment,Oa),In=h(Oa),k=n(Oa,"P",{});var fe=l(k);Tn=r(fe,`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),Ft=n(fe,"CODE",{});var ei=l(Ft);Sn=r(ei,"forward"),ei.forEach(a),Zn=r(fe,` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),zt=n(fe,"CODE",{});var ti=l(zt);$n=r(ti,"enable_sequential_cpu_offload"),ti.forEach(a),kn=r(fe,`, but performance is much better due to the
iterative execution of the `),qt=n(fe,"CODE",{});var ai=l(qt);Pn=r(ai,"unet"),ai.forEach(a),Gn=r(fe,"."),fe.forEach(a),Oa.forEach(a),x.forEach(a),Ca=h(e),z=n(e,"H2",{class:!0});var Ka=l(z);me=n(Ka,"A",{id:!0,class:!0,href:!0});var si=l(me);At=n(si,"SPAN",{});var ni=l(At);_(Ne.$$.fragment,ni),ni.forEach(a),si.forEach(a),Cn=h(Ka),Qt=n(Ka,"SPAN",{});var li=l(Qt);Wn=r(li,"ShapEImg2ImgPipeline"),li.forEach(a),Ka.forEach(a),Wa=h(e),$=n(e,"DIV",{class:!0});var ue=l($);_(De.$$.fragment,ue),xn=h(ue),Ht=n(ue,"P",{});var ii=l(Ht);Bn=r(ii,`Pipeline for generating latent representation of a 3D asset and rendering with NeRF method with Shap-E from an
image.`),ii.forEach(a),Nn=h(ue),Xe=n(ue,"P",{});var es=l(Xe);Dn=r(es,"This model inherits from "),mt=n(es,"A",{href:!0});var ri=l(mt);Xn=r(ri,"DiffusionPipeline"),ri.forEach(a),Rn=r(es,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),es.forEach(a),Vn=h(ue),W=n(ue,"DIV",{class:!0});var yt=l(W);_(Re.$$.fragment,yt),Yn=h(yt),Lt=n(yt,"P",{});var oi=l(Lt);Fn=r(oi,"The call function to the pipeline for generation."),oi.forEach(a),zn=h(yt),_(he.$$.fragment,yt),yt.forEach(a),ue.forEach(a),xa=h(e),q=n(e,"H2",{class:!0});var ts=l(q);de=n(ts,"A",{id:!0,class:!0,href:!0});var pi=l(de);Ot=n(pi,"SPAN",{});var ci=l(Ot);_(Ve.$$.fragment,ci),ci.forEach(a),pi.forEach(a),qn=h(ts),Kt=n(ts,"SPAN",{});var mi=l(Kt);An=r(mi,"ShapEPipelineOutput"),mi.forEach(a),ts.forEach(a),Ba=h(e),A=n(e,"DIV",{class:!0});var as=l(A);_(Ye.$$.fragment,as),Qn=h(as),Q=n(as,"P",{});var Mt=l(Q);Hn=r(Mt,"Output class for "),ht=n(Mt,"A",{href:!0});var hi=l(ht);Ln=r(hi,"ShapEPipeline"),hi.forEach(a),On=r(Mt," and "),dt=n(Mt,"A",{href:!0});var di=l(dt);Kn=r(di,"ShapEImg2ImgPipeline"),di.forEach(a),el=r(Mt,"."),Mt.forEach(a),as.forEach(a),this.h()},h(){c(f,"name","hf:doc:metadata"),c(f,"content",JSON.stringify(Ui)),c(u,"id","shape"),c(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"),c(u,"href","#shape"),c(E,"class","relative group"),c(_e,"href","https://huggingface.co/papers/2305.02463"),c(_e,"rel","nofollow"),c(ye,"href","https://github.com/openai"),c(ye,"rel","nofollow"),c(Me,"href","https://github.com/openai/shap-e"),c(Me,"rel","nofollow"),c(K,"id","usage-examples"),c(K,"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"),c(K,"href","#usage-examples"),c(X,"class","relative group"),c(ee,"id","textto3d-image-generation"),c(ee,"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"),c(ee,"href","#textto3d-image-generation"),c(R,"class","relative group"),c(He,"href","/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.ShapEPipeline"),c(Le,"href","/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.ShapEPipeline"),ss(Oe.src,al="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/shap_e/firecracker_out.gif")||c(Oe,"src",al),c(Oe,"alt","img"),ss(Ke.src,sl="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/shap_e/cake_out.gif")||c(Ke,"src",sl),c(Ke,"alt","img"),c(se,"id","imagetoimage-generation"),c(se,"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"),c(se,"href","#imagetoimage-generation"),c(V,"class","relative group"),c(et,"href","/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.ShapEImg2ImgPipeline"),ss(st.src,nl="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/shap_e/burger_in.png")||c(st,"src",nl),c(st,"alt","img"),ss(it.src,ll="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/shap_e/burger_out.gif")||c(it,"src",ll),c(it,"alt","img"),c(le,"id","generate-mesh"),c(le,"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"),c(le,"href","#generate-mesh"),c(Y,"class","relative group"),c(rt,"href","/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.ShapEPipeline"),c(ot,"href","/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.ShapEImg2ImgPipeline"),c(Pe,"href","https://huggingface.co/datasets/hf-internal-testing/diffusers-images/blob/main/shap_e/3d_cake.glb"),c(Pe,"rel","nofollow"),c(oe,"id","diffusers.ShapEPipeline"),c(oe,"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"),c(oe,"href","#diffusers.ShapEPipeline"),c(F,"class","relative group"),c(ct,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),c(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(me,"id","diffusers.ShapEImg2ImgPipeline"),c(me,"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"),c(me,"href","#diffusers.ShapEImg2ImgPipeline"),c(z,"class","relative group"),c(mt,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),c(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(de,"id","diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput"),c(de,"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"),c(de,"href","#diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput"),c(q,"class","relative group"),c(ht,"href","/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.ShapEPipeline"),c(dt,"href","/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.ShapEImg2ImgPipeline"),c(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,o){t(document.head,f),p(e,I,o),p(e,E,o),t(E,u),t(u,J),y(d,J,null),t(E,j),t(E,N),t(N,D),p(e,S,o),p(e,Z,o),t(Z,ze),t(Z,_e),t(_e,ns),t(Z,ls),t(Z,ye),t(ye,is),t(Z,rs),p(e,aa,o),p(e,qe,o),t(qe,os),p(e,sa,o),p(e,Ae,o),t(Ae,bt),t(bt,ps),p(e,na,o),p(e,L,o),t(L,cs),t(L,Me),t(Me,ms),t(L,hs),p(e,la,o),y(O,e,o),p(e,ia,o),p(e,X,o),t(X,K),t(K,Et),y(we,Et,null),t(X,ds),t(X,vt),t(vt,fs),p(e,ra,o),p(e,Qe,o),t(Qe,us),p(e,oa,o),p(e,R,o),t(R,ee),t(ee,jt),y(be,jt,null),t(R,gs),t(R,Jt),t(Jt,_s),p(e,pa,o),p(e,te,o),t(te,ys),t(te,He),t(He,Ms),t(te,ws),p(e,ca,o),y(Ee,e,o),p(e,ma,o),p(e,P,o),t(P,bs),t(P,Le),t(Le,Es),t(P,vs),t(P,Ut),t(Ut,js),t(P,Js),p(e,ha,o),y(ve,e,o),p(e,da,o),p(e,ae,o),t(ae,Oe),t(ae,Us),t(ae,Ke),p(e,fa,o),p(e,V,o),t(V,se),t(se,It),y(je,It,null),t(V,Is),t(V,Tt),t(Tt,Ts),p(e,ua,o),p(e,ne,o),t(ne,Ss),t(ne,et),t(et,Zs),t(ne,$s),p(e,ga,o),p(e,tt,o),t(tt,ks),p(e,_a,o),y(Je,e,o),p(e,ya,o),p(e,at,o),t(at,st),p(e,Ma,o),p(e,nt,o),t(nt,Ps),p(e,wa,o),y(Ue,e,o),p(e,ba,o),p(e,lt,o),t(lt,it),p(e,Ea,o),p(e,Y,o),t(Y,le),t(le,St),y(Ie,St,null),t(Y,Gs),t(Y,Zt),t(Zt,Cs),p(e,va,o),p(e,v,o),t(v,Ws),t(v,rt),t(rt,xs),t(v,Bs),t(v,ot),t(ot,Ns),t(v,Ds),t(v,$t),t($t,Xs),t(v,Rs),t(v,kt),t(kt,Vs),t(v,Ys),t(v,Pt),t(Pt,Fs),t(v,zs),t(v,Gt),t(Gt,qs),t(v,As),t(v,Ct),t(Ct,Qs),t(v,Hs),t(v,Wt),t(Wt,Ls),t(v,Os),p(e,ja,o),y(Te,e,o),p(e,Ja,o),p(e,G,o),t(G,Ks),t(G,xt),t(xt,en),t(G,tn),t(G,Bt),t(Bt,an),t(G,sn),p(e,Ua,o),p(e,ie,o),t(ie,nn),t(ie,Nt),t(Nt,ln),t(ie,rn),p(e,Ia,o),y(Se,e,o),p(e,Ta,o),p(e,re,o),t(re,on),t(re,Dt),t(Dt,pn),t(re,cn),p(e,Sa,o),y(Ze,e,o),p(e,Za,o),p(e,pt,o),t(pt,mn),p(e,$a,o),y($e,e,o),p(e,ka,o),p(e,ke,o),t(ke,hn),t(ke,Pe),t(Pe,dn),p(e,Pa,o),p(e,F,o),t(F,oe),t(oe,Xt),y(Ge,Xt,null),t(F,fn),t(F,Rt),t(Rt,un),p(e,Ga,o),p(e,T,o),y(Ce,T,null),t(T,gn),t(T,Vt),t(Vt,_n),t(T,yn),t(T,We),t(We,Mn),t(We,ct),t(ct,wn),t(We,bn),t(T,En),t(T,C),y(xe,C,null),t(C,vn),t(C,Yt),t(Yt,jn),t(C,Jn),y(pe,C,null),t(T,Un),t(T,ce),y(Be,ce,null),t(ce,In),t(ce,k),t(k,Tn),t(k,Ft),t(Ft,Sn),t(k,Zn),t(k,zt),t(zt,$n),t(k,kn),t(k,qt),t(qt,Pn),t(k,Gn),p(e,Ca,o),p(e,z,o),t(z,me),t(me,At),y(Ne,At,null),t(z,Cn),t(z,Qt),t(Qt,Wn),p(e,Wa,o),p(e,$,o),y(De,$,null),t($,xn),t($,Ht),t(Ht,Bn),t($,Nn),t($,Xe),t(Xe,Dn),t(Xe,mt),t(mt,Xn),t(Xe,Rn),t($,Vn),t($,W),y(Re,W,null),t(W,Yn),t(W,Lt),t(Lt,Fn),t(W,zn),y(he,W,null),p(e,xa,o),p(e,q,o),t(q,de),t(de,Ot),y(Ve,Ot,null),t(q,qn),t(q,Kt),t(Kt,An),p(e,Ba,o),p(e,A,o),y(Ye,A,null),t(A,Qn),t(A,Q),t(Q,Hn),t(Q,ht),t(ht,Ln),t(Q,On),t(Q,dt),t(dt,Kn),t(Q,el),Na=!0},p(e,[o]){const Fe={};o&2&&(Fe.$$scope={dirty:o,ctx:e}),O.$set(Fe);const ea={};o&2&&(ea.$$scope={dirty:o,ctx:e}),pe.$set(ea);const ta={};o&2&&(ta.$$scope={dirty:o,ctx:e}),he.$set(ta)},i(e){Na||(M(d.$$.fragment,e),M(O.$$.fragment,e),M(we.$$.fragment,e),M(be.$$.fragment,e),M(Ee.$$.fragment,e),M(ve.$$.fragment,e),M(je.$$.fragment,e),M(Je.$$.fragment,e),M(Ue.$$.fragment,e),M(Ie.$$.fragment,e),M(Te.$$.fragment,e),M(Se.$$.fragment,e),M(Ze.$$.fragment,e),M($e.$$.fragment,e),M(Ge.$$.fragment,e),M(Ce.$$.fragment,e),M(xe.$$.fragment,e),M(pe.$$.fragment,e),M(Be.$$.fragment,e),M(Ne.$$.fragment,e),M(De.$$.fragment,e),M(Re.$$.fragment,e),M(he.$$.fragment,e),M(Ve.$$.fragment,e),M(Ye.$$.fragment,e),Na=!0)},o(e){w(d.$$.fragment,e),w(O.$$.fragment,e),w(we.$$.fragment,e),w(be.$$.fragment,e),w(Ee.$$.fragment,e),w(ve.$$.fragment,e),w(je.$$.fragment,e),w(Je.$$.fragment,e),w(Ue.$$.fragment,e),w(Ie.$$.fragment,e),w(Te.$$.fragment,e),w(Se.$$.fragment,e),w(Ze.$$.fragment,e),w($e.$$.fragment,e),w(Ge.$$.fragment,e),w(Ce.$$.fragment,e),w(xe.$$.fragment,e),w(pe.$$.fragment,e),w(Be.$$.fragment,e),w(Ne.$$.fragment,e),w(De.$$.fragment,e),w(Re.$$.fragment,e),w(he.$$.fragment,e),w(Ve.$$.fragment,e),w(Ye.$$.fragment,e),Na=!1},d(e){a(f),e&&a(I),e&&a(E),b(d),e&&a(S),e&&a(Z),e&&a(aa),e&&a(qe),e&&a(sa),e&&a(Ae),e&&a(na),e&&a(L),e&&a(la),b(O,e),e&&a(ia),e&&a(X),b(we),e&&a(ra),e&&a(Qe),e&&a(oa),e&&a(R),b(be),e&&a(pa),e&&a(te),e&&a(ca),b(Ee,e),e&&a(ma),e&&a(P),e&&a(ha),b(ve,e),e&&a(da),e&&a(ae),e&&a(fa),e&&a(V),b(je),e&&a(ua),e&&a(ne),e&&a(ga),e&&a(tt),e&&a(_a),b(Je,e),e&&a(ya),e&&a(at),e&&a(Ma),e&&a(nt),e&&a(wa),b(Ue,e),e&&a(ba),e&&a(lt),e&&a(Ea),e&&a(Y),b(Ie),e&&a(va),e&&a(v),e&&a(ja),b(Te,e),e&&a(Ja),e&&a(G),e&&a(Ua),e&&a(ie),e&&a(Ia),b(Se,e),e&&a(Ta),e&&a(re),e&&a(Sa),b(Ze,e),e&&a(Za),e&&a(pt),e&&a($a),b($e,e),e&&a(ka),e&&a(ke),e&&a(Pa),e&&a(F),b(Ge),e&&a(Ga),e&&a(T),b(Ce),b(xe),b(pe),b(Be),e&&a(Ca),e&&a(z),b(Ne),e&&a(Wa),e&&a($),b(De),b(Re),b(he),e&&a(xa),e&&a(q),b(Ve),e&&a(Ba),e&&a(A),b(Ye)}}}const Ui={local:"shape",sections:[{local:"usage-examples",sections:[{local:"textto3d-image-generation",title:"Text-to-3D image generation "},{local:"imagetoimage-generation",title:"Image-to-Image generation"},{local:"generate-mesh",title:"Generate mesh"}],title:"Usage Examples"},{local:"diffusers.ShapEPipeline",title:"ShapEPipeline"},{local:"diffusers.ShapEImg2ImgPipeline",title:"ShapEImg2ImgPipeline"},{local:"diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput",title:"ShapEPipelineOutput"}],title:"Shap-E"};function Ii(H){return wi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Gi extends gi{constructor(f){super();_i(this,f,Ii,Ji,yi,{})}}export{Gi as default,Ui as metadata};
