import{S as gr,i as _r,s as yr,e as a,k as m,w as g,t as r,M as Mr,c as n,d as s,m as h,a as l,x as _,h as i,b as c,N as aa,G as t,g as p,y,q as M,o as w,B as b,v as wr,L as ur}from"../../../chunks/vendor-hf-doc-builder.js";import{T as br}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 fr}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Er(H){let f,I,E,u,J,d,j,N;return{c(){f=a("p"),I=r("Make sure to check out the Schedulers "),E=a("a"),u=r("guide"),J=r(" to learn how to explore the tradeoff between scheduler speed and quality, and see the "),d=a("a"),j=r("reuse components across pipelines"),N=r(" 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=i(S,"Make sure to check out the Schedulers "),E=n(S,"A",{href:!0});var Z=l(E);u=i(Z,"guide"),Z.forEach(s),J=i(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=i(ze,"reuse components across pipelines"),ze.forEach(s),N=i(S," section to learn how to efficiently load the same components into multiple pipelines."),S.forEach(s),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&&s(f)}}}function vr(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=a("p"),I=r("Examples:"),E=m(),g(u.$$.fragment)},l(d){f=n(d,"P",{});var j=l(f);I=i(j,"Examples:"),j.forEach(s),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:ur,i(d){J||(M(u.$$.fragment,d),J=!0)},o(d){w(u.$$.fragment,d),J=!1},d(d){d&&s(f),d&&s(E),b(u,d)}}}function jr(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=a("p"),I=r("Examples:"),E=m(),g(u.$$.fragment)},l(d){f=n(d,"P",{});var j=l(f);I=i(j,"Examples:"),j.forEach(s),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:ur,i(d){J||(M(u.$$.fragment,d),J=!0)},o(d){w(u.$$.fragment,d),J=!1},d(d){d&&s(f),d&&s(E),b(u,d)}}}function Jr(H){let f,I,E,u,J,d,j,N,D,S,Z,ze,_e,na,la,ye,ra,ia,ss,qe,oa,as,Ae,bt,pa,ns,L,ca,Me,ma,ha,ls,O,rs,X,K,Et,we,da,vt,fa,is,Qe,ua,os,R,ee,jt,be,ga,Jt,_a,ps,te,ya,He,Ma,wa,cs,Ee,ms,P,ba,Le,Ea,va,Ut,ja,Ja,hs,ve,ds,se,Oe,sl,Ua,Ke,al,fs,V,ae,It,je,Ia,Tt,Ta,us,ne,Sa,et,Za,$a,gs,tt,ka,_s,Je,ys,st,at,nl,Ms,nt,Pa,ws,Ue,bs,lt,rt,ll,Es,Y,le,St,Ie,Ga,Zt,Ca,vs,v,Wa,it,xa,Ba,ot,Na,Da,$t,Xa,Ra,kt,Va,Ya,Pt,Fa,za,Gt,qa,Aa,Ct,Qa,Ha,Wt,La,Oa,js,Te,Js,G,Ka,xt,en,tn,Bt,sn,an,Us,re,nn,Nt,ln,rn,Is,Se,Ts,ie,on,Dt,pn,cn,Ss,Ze,Zs,pt,mn,$s,$e,ks,ke,hn,Pe,dn,Ps,F,oe,Xt,Ge,fn,Rt,un,Gs,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,Cs,z,me,At,Ne,Cn,Qt,Wn,Ws,$,De,xn,Ht,Bn,Nn,Xe,Dn,mt,Xn,Rn,Vn,W,Re,Yn,Lt,Fn,zn,he,xs,q,de,Ot,Ve,qn,Kt,An,Bs,A,Ye,Qn,Q,Hn,ht,Ln,On,dt,Kn,el,Ns;return d=new ge({}),O=new br({props:{$$slots:{default:[Er]},$$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/v0.20.0/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/v4.31.0/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/v0.20.0/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/v0.20.0/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/v0.20.0/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/v0.20.0/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/v0.20.0/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/v0.20.0/en/api/pipelines/shap_e#diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput"
>ShapEPipelineOutput</a> or <code>tuple</code></p>
`}}),pe=new fr({props:{anchor:"diffusers.ShapEPipeline.__call__.example",$$slots:{default:[vr]},$$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/v0.20.0/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/v0.20.0/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/v4.31.0/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/v0.20.0/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/v0.20.0/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/v0.20.0/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/v0.20.0/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/v0.20.0/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/v0.20.0/en/api/pipelines/shap_e#diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput"
>ShapEPipelineOutput</a> or <code>tuple</code></p>
`}}),he=new fr({props:{anchor:"diffusers.ShapEImg2ImgPipeline.__call__.example",$$slots:{default:[jr]},$$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/v0.20.0/src/diffusers/pipelines/shap_e/pipeline_shap_e.py#L69"}}),{c(){f=a("meta"),I=m(),E=a("h1"),u=a("a"),J=a("span"),g(d.$$.fragment),j=m(),N=a("span"),D=r("Shap-E"),S=m(),Z=a("p"),ze=r("The Shap-E model was proposed in "),_e=a("a"),na=r("Shap-E: Generating Conditional 3D Implicit Functions"),la=r(" by Alex Nichol and Heewon Jun from "),ye=a("a"),ra=r("OpenAI"),ia=r("."),ss=m(),qe=a("p"),oa=r("The abstract from the paper is:"),as=m(),Ae=a("p"),bt=a("em"),pa=r("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."),ns=m(),L=a("p"),ca=r("The original codebase can be found at "),Me=a("a"),ma=r("openai/shap-e"),ha=r("."),ls=m(),g(O.$$.fragment),rs=m(),X=a("h2"),K=a("a"),Et=a("span"),g(we.$$.fragment),da=m(),vt=a("span"),fa=r("Usage Examples"),is=m(),Qe=a("p"),ua=r("In the following, we will walk you through some examples of how to use Shap-E pipelines to create 3D objects in gif format."),os=m(),R=a("h3"),ee=a("a"),jt=a("span"),g(be.$$.fragment),ga=m(),Jt=a("span"),_a=r("Text-to-3D image generation"),ps=m(),te=a("p"),ya=r("We can use "),He=a("a"),Ma=r("ShapEPipeline"),wa=r(" 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."),cs=m(),g(Ee.$$.fragment),ms=m(),P=a("p"),ba=r("The output of "),Le=a("a"),Ea=r("ShapEPipeline"),va=r(" 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=a("code"),ja=r("export_to_gif"),Ja=r(" utility function in diffusers to make a 3D cupcake!"),hs=m(),g(ve.$$.fragment),ds=m(),se=a("p"),Oe=a("img"),Ua=m(),Ke=a("img"),fs=m(),V=a("h3"),ae=a("a"),It=a("span"),g(je.$$.fragment),Ia=m(),Tt=a("span"),Ta=r("Image-to-Image generation"),us=m(),ne=a("p"),Sa=r("You can use "),et=a("a"),Za=r("ShapEImg2ImgPipeline"),$a=r(" along with other text-to-image pipelines in diffusers and turn your 2D generation into 3D."),gs=m(),tt=a("p"),ka=r("In this example, We will first genrate a cheeseburger with a simple prompt \u201CA cheeseburger, white background\u201D"),_s=m(),g(Je.$$.fragment),ys=m(),st=a("p"),at=a("img"),Ms=m(),nt=a("p"),Pa=r("we will then use the Shap-E image-to-image pipeline to turn it into a 3D cheeseburger :)"),ws=m(),g(Ue.$$.fragment),bs=m(),lt=a("p"),rt=a("img"),Es=m(),Y=a("h3"),le=a("a"),St=a("span"),g(Ie.$$.fragment),Ga=m(),Zt=a("span"),Ca=r("Generate mesh"),vs=m(),v=a("p"),Wa=r("For both "),it=a("a"),xa=r("ShapEPipeline"),Ba=r(" and "),ot=a("a"),Na=r("ShapEImg2ImgPipeline"),Da=r(", you can generate mesh output by passing "),$t=a("code"),Xa=r("output_type"),Ra=r(" as "),kt=a("code"),Va=r("mesh"),Ya=r(" to the pipeline, and then use the "),Pt=a("code"),Fa=r("ShapEPipeline.export_to_ply"),za=r(" utility function to save the output as a "),Gt=a("code"),qa=r("ply"),Aa=r(" file. We also provide a "),Ct=a("code"),Qa=r("ShapEPipeline.export_to_obj"),Ha=r(" function that you can use to save mesh outputs as "),Wt=a("code"),La=r("obj"),Oa=r(" files."),js=m(),g(Te.$$.fragment),Js=m(),G=a("p"),Ka=r("Huggingface Datasets supports mesh visualization for mesh files in "),xt=a("code"),en=r("glb"),tn=r(" format. Below we will show you how to convert your mesh file into "),Bt=a("code"),sn=r("glb"),an=r(" format so that you can use the Dataset viewer to render 3D objects."),Us=m(),re=a("p"),nn=r("We need to install "),Nt=a("code"),ln=r("trimesh"),rn=r(" library."),Is=m(),g(Se.$$.fragment),Ts=m(),ie=a("p"),on=r("To convert the mesh file into "),Dt=a("code"),pn=r("glb"),cn=r(" format,"),Ss=m(),g(Ze.$$.fragment),Zs=m(),pt=a("p"),mn=r("By default, the mesh output of Shap-E is from the bottom viewpoint; you can change the default viewpoint by applying a rotation transformation"),$s=m(),g($e.$$.fragment),ks=m(),ke=a("p"),hn=r(`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=a("a"),dn=r("https://huggingface.co/datasets/hf-internal-testing/diffusers-images/blob/main/shap_e/3d_cake.glb"),Ps=m(),F=a("h2"),oe=a("a"),Xt=a("span"),g(Ge.$$.fragment),fn=m(),Rt=a("span"),un=r("ShapEPipeline"),Gs=m(),T=a("div"),g(Ce.$$.fragment),gn=m(),Vt=a("p"),_n=r("Pipeline for generating latent representation of a 3D asset and rendering with NeRF method with Shap-E."),yn=m(),We=a("p"),Mn=r("This model inherits from "),ct=a("a"),wn=r("DiffusionPipeline"),bn=r(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),En=m(),C=a("div"),g(xe.$$.fragment),vn=m(),Yt=a("p"),jn=r("The call function to the pipeline for generation."),Jn=m(),g(pe.$$.fragment),Un=m(),ce=a("div"),g(Be.$$.fragment),In=m(),k=a("p"),Tn=r(`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=a("code"),Sn=r("forward"),Zn=r(` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),zt=a("code"),$n=r("enable_sequential_cpu_offload"),kn=r(`, but performance is much better due to the
iterative execution of the `),qt=a("code"),Pn=r("unet"),Gn=r("."),Cs=m(),z=a("h2"),me=a("a"),At=a("span"),g(Ne.$$.fragment),Cn=m(),Qt=a("span"),Wn=r("ShapEImg2ImgPipeline"),Ws=m(),$=a("div"),g(De.$$.fragment),xn=m(),Ht=a("p"),Bn=r(`Pipeline for generating latent representation of a 3D asset and rendering with NeRF method with Shap-E from an
image.`),Nn=m(),Xe=a("p"),Dn=r("This model inherits from "),mt=a("a"),Xn=r("DiffusionPipeline"),Rn=r(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Vn=m(),W=a("div"),g(Re.$$.fragment),Yn=m(),Lt=a("p"),Fn=r("The call function to the pipeline for generation."),zn=m(),g(he.$$.fragment),xs=m(),q=a("h2"),de=a("a"),Ot=a("span"),g(Ve.$$.fragment),qn=m(),Kt=a("span"),An=r("ShapEPipelineOutput"),Bs=m(),A=a("div"),g(Ye.$$.fragment),Qn=m(),Q=a("p"),Hn=r("Output class for "),ht=a("a"),Ln=r("ShapEPipeline"),On=r(" and "),dt=a("a"),Kn=r("ShapEImg2ImgPipeline"),el=r("."),this.h()},l(e){const o=Mr('[data-svelte="svelte-1phssyn"]',document.head);f=n(o,"META",{name:!0,content:!0}),o.forEach(s),I=h(e),E=n(e,"H1",{class:!0});var Fe=l(E);u=n(Fe,"A",{id:!0,class:!0,href:!0});var es=l(u);J=n(es,"SPAN",{});var ts=l(J);_(d.$$.fragment,ts),ts.forEach(s),es.forEach(s),j=h(Fe),N=n(Fe,"SPAN",{});var rl=l(N);D=i(rl,"Shap-E"),rl.forEach(s),Fe.forEach(s),S=h(e),Z=n(e,"P",{});var ft=l(Z);ze=i(ft,"The Shap-E model was proposed in "),_e=n(ft,"A",{href:!0,rel:!0});var il=l(_e);na=i(il,"Shap-E: Generating Conditional 3D Implicit Functions"),il.forEach(s),la=i(ft," by Alex Nichol and Heewon Jun from "),ye=n(ft,"A",{href:!0,rel:!0});var ol=l(ye);ra=i(ol,"OpenAI"),ol.forEach(s),ia=i(ft,"."),ft.forEach(s),ss=h(e),qe=n(e,"P",{});var pl=l(qe);oa=i(pl,"The abstract from the paper is:"),pl.forEach(s),as=h(e),Ae=n(e,"P",{});var cl=l(Ae);bt=n(cl,"EM",{});var ml=l(bt);pa=i(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(s),cl.forEach(s),ns=h(e),L=n(e,"P",{});var Ds=l(L);ca=i(Ds,"The original codebase can be found at "),Me=n(Ds,"A",{href:!0,rel:!0});var hl=l(Me);ma=i(hl,"openai/shap-e"),hl.forEach(s),ha=i(Ds,"."),Ds.forEach(s),ls=h(e),_(O.$$.fragment,e),rs=h(e),X=n(e,"H2",{class:!0});var Xs=l(X);K=n(Xs,"A",{id:!0,class:!0,href:!0});var dl=l(K);Et=n(dl,"SPAN",{});var fl=l(Et);_(we.$$.fragment,fl),fl.forEach(s),dl.forEach(s),da=h(Xs),vt=n(Xs,"SPAN",{});var ul=l(vt);fa=i(ul,"Usage Examples"),ul.forEach(s),Xs.forEach(s),is=h(e),Qe=n(e,"P",{});var gl=l(Qe);ua=i(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(s),os=h(e),R=n(e,"H3",{class:!0});var Rs=l(R);ee=n(Rs,"A",{id:!0,class:!0,href:!0});var _l=l(ee);jt=n(_l,"SPAN",{});var yl=l(jt);_(be.$$.fragment,yl),yl.forEach(s),_l.forEach(s),ga=h(Rs),Jt=n(Rs,"SPAN",{});var Ml=l(Jt);_a=i(Ml,"Text-to-3D image generation"),Ml.forEach(s),Rs.forEach(s),ps=h(e),te=n(e,"P",{});var Vs=l(te);ya=i(Vs,"We can use "),He=n(Vs,"A",{href:!0});var wl=l(He);Ma=i(wl,"ShapEPipeline"),wl.forEach(s),wa=i(Vs," 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."),Vs.forEach(s),cs=h(e),_(Ee.$$.fragment,e),ms=h(e),P=n(e,"P",{});var ut=l(P);ba=i(ut,"The output of "),Le=n(ut,"A",{href:!0});var bl=l(Le);Ea=i(bl,"ShapEPipeline"),bl.forEach(s),va=i(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);ja=i(El,"export_to_gif"),El.forEach(s),Ja=i(ut," utility function in diffusers to make a 3D cupcake!"),ut.forEach(s),hs=h(e),_(ve.$$.fragment,e),ds=h(e),se=n(e,"P",{});var Ys=l(se);Oe=n(Ys,"IMG",{src:!0,alt:!0}),Ua=h(Ys),Ke=n(Ys,"IMG",{src:!0,alt:!0}),Ys.forEach(s),fs=h(e),V=n(e,"H3",{class:!0});var Fs=l(V);ae=n(Fs,"A",{id:!0,class:!0,href:!0});var vl=l(ae);It=n(vl,"SPAN",{});var jl=l(It);_(je.$$.fragment,jl),jl.forEach(s),vl.forEach(s),Ia=h(Fs),Tt=n(Fs,"SPAN",{});var Jl=l(Tt);Ta=i(Jl,"Image-to-Image generation"),Jl.forEach(s),Fs.forEach(s),us=h(e),ne=n(e,"P",{});var zs=l(ne);Sa=i(zs,"You can use "),et=n(zs,"A",{href:!0});var Ul=l(et);Za=i(Ul,"ShapEImg2ImgPipeline"),Ul.forEach(s),$a=i(zs," along with other text-to-image pipelines in diffusers and turn your 2D generation into 3D."),zs.forEach(s),gs=h(e),tt=n(e,"P",{});var Il=l(tt);ka=i(Il,"In this example, We will first genrate a cheeseburger with a simple prompt \u201CA cheeseburger, white background\u201D"),Il.forEach(s),_s=h(e),_(Je.$$.fragment,e),ys=h(e),st=n(e,"P",{});var Tl=l(st);at=n(Tl,"IMG",{src:!0,alt:!0}),Tl.forEach(s),Ms=h(e),nt=n(e,"P",{});var Sl=l(nt);Pa=i(Sl,"we will then use the Shap-E image-to-image pipeline to turn it into a 3D cheeseburger :)"),Sl.forEach(s),ws=h(e),_(Ue.$$.fragment,e),bs=h(e),lt=n(e,"P",{});var Zl=l(lt);rt=n(Zl,"IMG",{src:!0,alt:!0}),Zl.forEach(s),Es=h(e),Y=n(e,"H3",{class:!0});var qs=l(Y);le=n(qs,"A",{id:!0,class:!0,href:!0});var $l=l(le);St=n($l,"SPAN",{});var kl=l(St);_(Ie.$$.fragment,kl),kl.forEach(s),$l.forEach(s),Ga=h(qs),Zt=n(qs,"SPAN",{});var Pl=l(Zt);Ca=i(Pl,"Generate mesh"),Pl.forEach(s),qs.forEach(s),vs=h(e),v=n(e,"P",{});var U=l(v);Wa=i(U,"For both "),it=n(U,"A",{href:!0});var Gl=l(it);xa=i(Gl,"ShapEPipeline"),Gl.forEach(s),Ba=i(U," and "),ot=n(U,"A",{href:!0});var Cl=l(ot);Na=i(Cl,"ShapEImg2ImgPipeline"),Cl.forEach(s),Da=i(U,", you can generate mesh output by passing "),$t=n(U,"CODE",{});var Wl=l($t);Xa=i(Wl,"output_type"),Wl.forEach(s),Ra=i(U," as "),kt=n(U,"CODE",{});var xl=l(kt);Va=i(xl,"mesh"),xl.forEach(s),Ya=i(U," to the pipeline, and then use the "),Pt=n(U,"CODE",{});var Bl=l(Pt);Fa=i(Bl,"ShapEPipeline.export_to_ply"),Bl.forEach(s),za=i(U," utility function to save the output as a "),Gt=n(U,"CODE",{});var Nl=l(Gt);qa=i(Nl,"ply"),Nl.forEach(s),Aa=i(U," file. We also provide a "),Ct=n(U,"CODE",{});var Dl=l(Ct);Qa=i(Dl,"ShapEPipeline.export_to_obj"),Dl.forEach(s),Ha=i(U," function that you can use to save mesh outputs as "),Wt=n(U,"CODE",{});var Xl=l(Wt);La=i(Xl,"obj"),Xl.forEach(s),Oa=i(U," files."),U.forEach(s),js=h(e),_(Te.$$.fragment,e),Js=h(e),G=n(e,"P",{});var gt=l(G);Ka=i(gt,"Huggingface Datasets supports mesh visualization for mesh files in "),xt=n(gt,"CODE",{});var Rl=l(xt);en=i(Rl,"glb"),Rl.forEach(s),tn=i(gt," format. Below we will show you how to convert your mesh file into "),Bt=n(gt,"CODE",{});var Vl=l(Bt);sn=i(Vl,"glb"),Vl.forEach(s),an=i(gt," format so that you can use the Dataset viewer to render 3D objects."),gt.forEach(s),Us=h(e),re=n(e,"P",{});var As=l(re);nn=i(As,"We need to install "),Nt=n(As,"CODE",{});var Yl=l(Nt);ln=i(Yl,"trimesh"),Yl.forEach(s),rn=i(As," library."),As.forEach(s),Is=h(e),_(Se.$$.fragment,e),Ts=h(e),ie=n(e,"P",{});var Qs=l(ie);on=i(Qs,"To convert the mesh file into "),Dt=n(Qs,"CODE",{});var Fl=l(Dt);pn=i(Fl,"glb"),Fl.forEach(s),cn=i(Qs," format,"),Qs.forEach(s),Ss=h(e),_(Ze.$$.fragment,e),Zs=h(e),pt=n(e,"P",{});var zl=l(pt);mn=i(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(s),$s=h(e),_($e.$$.fragment,e),ks=h(e),ke=n(e,"P",{});var tl=l(ke);hn=i(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=i(ql,"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/blob/main/shap_e/3d_cake.glb"),ql.forEach(s),tl.forEach(s),Ps=h(e),F=n(e,"H2",{class:!0});var Hs=l(F);oe=n(Hs,"A",{id:!0,class:!0,href:!0});var Al=l(oe);Xt=n(Al,"SPAN",{});var Ql=l(Xt);_(Ge.$$.fragment,Ql),Ql.forEach(s),Al.forEach(s),fn=h(Hs),Rt=n(Hs,"SPAN",{});var Hl=l(Rt);un=i(Hl,"ShapEPipeline"),Hl.forEach(s),Hs.forEach(s),Gs=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=i(Ll,"Pipeline for generating latent representation of a 3D asset and rendering with NeRF method with Shap-E."),Ll.forEach(s),yn=h(x),We=n(x,"P",{});var Ls=l(We);Mn=i(Ls,"This model inherits from "),ct=n(Ls,"A",{href:!0});var Ol=l(ct);wn=i(Ol,"DiffusionPipeline"),Ol.forEach(s),bn=i(Ls,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Ls.forEach(s),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=i(Kl,"The call function to the pipeline for generation."),Kl.forEach(s),Jn=h(_t),_(pe.$$.fragment,_t),_t.forEach(s),Un=h(x),ce=n(x,"DIV",{class:!0});var Os=l(ce);_(Be.$$.fragment,Os),In=h(Os),k=n(Os,"P",{});var fe=l(k);Tn=i(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 er=l(Ft);Sn=i(er,"forward"),er.forEach(s),Zn=i(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 tr=l(zt);$n=i(tr,"enable_sequential_cpu_offload"),tr.forEach(s),kn=i(fe,`, but performance is much better due to the
iterative execution of the `),qt=n(fe,"CODE",{});var sr=l(qt);Pn=i(sr,"unet"),sr.forEach(s),Gn=i(fe,"."),fe.forEach(s),Os.forEach(s),x.forEach(s),Cs=h(e),z=n(e,"H2",{class:!0});var Ks=l(z);me=n(Ks,"A",{id:!0,class:!0,href:!0});var ar=l(me);At=n(ar,"SPAN",{});var nr=l(At);_(Ne.$$.fragment,nr),nr.forEach(s),ar.forEach(s),Cn=h(Ks),Qt=n(Ks,"SPAN",{});var lr=l(Qt);Wn=i(lr,"ShapEImg2ImgPipeline"),lr.forEach(s),Ks.forEach(s),Ws=h(e),$=n(e,"DIV",{class:!0});var ue=l($);_(De.$$.fragment,ue),xn=h(ue),Ht=n(ue,"P",{});var rr=l(Ht);Bn=i(rr,`Pipeline for generating latent representation of a 3D asset and rendering with NeRF method with Shap-E from an
image.`),rr.forEach(s),Nn=h(ue),Xe=n(ue,"P",{});var ea=l(Xe);Dn=i(ea,"This model inherits from "),mt=n(ea,"A",{href:!0});var ir=l(mt);Xn=i(ir,"DiffusionPipeline"),ir.forEach(s),Rn=i(ea,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),ea.forEach(s),Vn=h(ue),W=n(ue,"DIV",{class:!0});var yt=l(W);_(Re.$$.fragment,yt),Yn=h(yt),Lt=n(yt,"P",{});var or=l(Lt);Fn=i(or,"The call function to the pipeline for generation."),or.forEach(s),zn=h(yt),_(he.$$.fragment,yt),yt.forEach(s),ue.forEach(s),xs=h(e),q=n(e,"H2",{class:!0});var ta=l(q);de=n(ta,"A",{id:!0,class:!0,href:!0});var pr=l(de);Ot=n(pr,"SPAN",{});var cr=l(Ot);_(Ve.$$.fragment,cr),cr.forEach(s),pr.forEach(s),qn=h(ta),Kt=n(ta,"SPAN",{});var mr=l(Kt);An=i(mr,"ShapEPipelineOutput"),mr.forEach(s),ta.forEach(s),Bs=h(e),A=n(e,"DIV",{class:!0});var sa=l(A);_(Ye.$$.fragment,sa),Qn=h(sa),Q=n(sa,"P",{});var Mt=l(Q);Hn=i(Mt,"Output class for "),ht=n(Mt,"A",{href:!0});var hr=l(ht);Ln=i(hr,"ShapEPipeline"),hr.forEach(s),On=i(Mt," and "),dt=n(Mt,"A",{href:!0});var dr=l(dt);Kn=i(dr,"ShapEImg2ImgPipeline"),dr.forEach(s),el=i(Mt,"."),Mt.forEach(s),sa.forEach(s),this.h()},h(){c(f,"name","hf:doc:metadata"),c(f,"content",JSON.stringify(Ur)),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/v0.20.0/en/api/pipelines/shap_e#diffusers.ShapEPipeline"),c(Le,"href","/docs/diffusers/v0.20.0/en/api/pipelines/shap_e#diffusers.ShapEPipeline"),aa(Oe.src,sl="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/shap_e/firecracker_out.gif")||c(Oe,"src",sl),c(Oe,"alt","img"),aa(Ke.src,al="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/shap_e/cake_out.gif")||c(Ke,"src",al),c(Ke,"alt","img"),c(ae,"id","imagetoimage-generation"),c(ae,"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(ae,"href","#imagetoimage-generation"),c(V,"class","relative group"),c(et,"href","/docs/diffusers/v0.20.0/en/api/pipelines/shap_e#diffusers.ShapEImg2ImgPipeline"),aa(at.src,nl="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/shap_e/burger_in.png")||c(at,"src",nl),c(at,"alt","img"),aa(rt.src,ll="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/shap_e/burger_out.gif")||c(rt,"src",ll),c(rt,"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(it,"href","/docs/diffusers/v0.20.0/en/api/pipelines/shap_e#diffusers.ShapEPipeline"),c(ot,"href","/docs/diffusers/v0.20.0/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/v0.20.0/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/v0.20.0/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/v0.20.0/en/api/pipelines/shap_e#diffusers.ShapEPipeline"),c(dt,"href","/docs/diffusers/v0.20.0/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,na),t(Z,la),t(Z,ye),t(ye,ra),t(Z,ia),p(e,ss,o),p(e,qe,o),t(qe,oa),p(e,as,o),p(e,Ae,o),t(Ae,bt),t(bt,pa),p(e,ns,o),p(e,L,o),t(L,ca),t(L,Me),t(Me,ma),t(L,ha),p(e,ls,o),y(O,e,o),p(e,rs,o),p(e,X,o),t(X,K),t(K,Et),y(we,Et,null),t(X,da),t(X,vt),t(vt,fa),p(e,is,o),p(e,Qe,o),t(Qe,ua),p(e,os,o),p(e,R,o),t(R,ee),t(ee,jt),y(be,jt,null),t(R,ga),t(R,Jt),t(Jt,_a),p(e,ps,o),p(e,te,o),t(te,ya),t(te,He),t(He,Ma),t(te,wa),p(e,cs,o),y(Ee,e,o),p(e,ms,o),p(e,P,o),t(P,ba),t(P,Le),t(Le,Ea),t(P,va),t(P,Ut),t(Ut,ja),t(P,Ja),p(e,hs,o),y(ve,e,o),p(e,ds,o),p(e,se,o),t(se,Oe),t(se,Ua),t(se,Ke),p(e,fs,o),p(e,V,o),t(V,ae),t(ae,It),y(je,It,null),t(V,Ia),t(V,Tt),t(Tt,Ta),p(e,us,o),p(e,ne,o),t(ne,Sa),t(ne,et),t(et,Za),t(ne,$a),p(e,gs,o),p(e,tt,o),t(tt,ka),p(e,_s,o),y(Je,e,o),p(e,ys,o),p(e,st,o),t(st,at),p(e,Ms,o),p(e,nt,o),t(nt,Pa),p(e,ws,o),y(Ue,e,o),p(e,bs,o),p(e,lt,o),t(lt,rt),p(e,Es,o),p(e,Y,o),t(Y,le),t(le,St),y(Ie,St,null),t(Y,Ga),t(Y,Zt),t(Zt,Ca),p(e,vs,o),p(e,v,o),t(v,Wa),t(v,it),t(it,xa),t(v,Ba),t(v,ot),t(ot,Na),t(v,Da),t(v,$t),t($t,Xa),t(v,Ra),t(v,kt),t(kt,Va),t(v,Ya),t(v,Pt),t(Pt,Fa),t(v,za),t(v,Gt),t(Gt,qa),t(v,Aa),t(v,Ct),t(Ct,Qa),t(v,Ha),t(v,Wt),t(Wt,La),t(v,Oa),p(e,js,o),y(Te,e,o),p(e,Js,o),p(e,G,o),t(G,Ka),t(G,xt),t(xt,en),t(G,tn),t(G,Bt),t(Bt,sn),t(G,an),p(e,Us,o),p(e,re,o),t(re,nn),t(re,Nt),t(Nt,ln),t(re,rn),p(e,Is,o),y(Se,e,o),p(e,Ts,o),p(e,ie,o),t(ie,on),t(ie,Dt),t(Dt,pn),t(ie,cn),p(e,Ss,o),y(Ze,e,o),p(e,Zs,o),p(e,pt,o),t(pt,mn),p(e,$s,o),y($e,e,o),p(e,ks,o),p(e,ke,o),t(ke,hn),t(ke,Pe),t(Pe,dn),p(e,Ps,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,Gs,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,Cs,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,Ws,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,xs,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,Bs,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),Ns=!0},p(e,[o]){const Fe={};o&2&&(Fe.$$scope={dirty:o,ctx:e}),O.$set(Fe);const es={};o&2&&(es.$$scope={dirty:o,ctx:e}),pe.$set(es);const ts={};o&2&&(ts.$$scope={dirty:o,ctx:e}),he.$set(ts)},i(e){Ns||(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),Ns=!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),Ns=!1},d(e){s(f),e&&s(I),e&&s(E),b(d),e&&s(S),e&&s(Z),e&&s(ss),e&&s(qe),e&&s(as),e&&s(Ae),e&&s(ns),e&&s(L),e&&s(ls),b(O,e),e&&s(rs),e&&s(X),b(we),e&&s(is),e&&s(Qe),e&&s(os),e&&s(R),b(be),e&&s(ps),e&&s(te),e&&s(cs),b(Ee,e),e&&s(ms),e&&s(P),e&&s(hs),b(ve,e),e&&s(ds),e&&s(se),e&&s(fs),e&&s(V),b(je),e&&s(us),e&&s(ne),e&&s(gs),e&&s(tt),e&&s(_s),b(Je,e),e&&s(ys),e&&s(st),e&&s(Ms),e&&s(nt),e&&s(ws),b(Ue,e),e&&s(bs),e&&s(lt),e&&s(Es),e&&s(Y),b(Ie),e&&s(vs),e&&s(v),e&&s(js),b(Te,e),e&&s(Js),e&&s(G),e&&s(Us),e&&s(re),e&&s(Is),b(Se,e),e&&s(Ts),e&&s(ie),e&&s(Ss),b(Ze,e),e&&s(Zs),e&&s(pt),e&&s($s),b($e,e),e&&s(ks),e&&s(ke),e&&s(Ps),e&&s(F),b(Ge),e&&s(Gs),e&&s(T),b(Ce),b(xe),b(pe),b(Be),e&&s(Cs),e&&s(z),b(Ne),e&&s(Ws),e&&s($),b(De),b(Re),b(he),e&&s(xs),e&&s(q),b(Ve),e&&s(Bs),e&&s(A),b(Ye)}}}const Ur={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 Ir(H){return wr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Gr extends gr{constructor(f){super();_r(this,f,Ir,Jr,yr,{})}}export{Gr as default,Ur as metadata};
