import{S as ha,i as fa,s as ua,e as n,k as m,w as E,t as l,M as ga,c as r,d as a,m as h,a as i,x as w,h as c,b as p,G as t,g as u,y as b,q as M,o as P,B as S,v as _a,L as da}from"../../../chunks/vendor-hf-doc-builder.js";import{T as ya}from"../../../chunks/Tip-hf-doc-builder.js";import{D as Ue}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as ma}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Oe}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ca}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function va(W){let d,v,g,f,y;return{c(){d=n("p"),v=l("See the "),g=n("a"),f=l("reuse components across pipelines"),y=l(" section to learn how to efficiently load the same components into multiple pipelines."),this.h()},l(s){d=r(s,"P",{});var _=i(d);v=c(_,"See the "),g=r(_,"A",{href:!0});var G=i(g);f=c(G,"reuse components across pipelines"),G.forEach(a),y=c(_," section to learn how to efficiently load the same components into multiple pipelines."),_.forEach(a),this.h()},h(){p(g,"href","/using-diffusers/loading#reuse-components-across-pipelines")},m(s,_){u(s,d,_),t(d,v),t(d,g),t(g,f),t(d,y)},d(s){s&&a(d)}}}function Ea(W){let d,v,g,f,y;return f=new ma({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(){d=n("p"),v=l("Examples:"),g=m(),E(f.$$.fragment)},l(s){d=r(s,"P",{});var _=i(d);v=c(_,"Examples:"),_.forEach(a),g=h(s),w(f.$$.fragment,s)},m(s,_){u(s,d,_),t(d,v),u(s,g,_),b(f,s,_),y=!0},p:da,i(s){y||(M(f.$$.fragment,s),y=!0)},o(s){P(f.$$.fragment,s),y=!1},d(s){s&&a(d),s&&a(g),S(f,s)}}}function wa(W){let d,v,g,f,y;return f=new ma({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(){d=n("p"),v=l("Examples:"),g=m(),E(f.$$.fragment)},l(s){d=r(s,"P",{});var _=i(d);v=c(_,"Examples:"),_.forEach(a),g=h(s),w(f.$$.fragment,s)},m(s,_){u(s,d,_),t(d,v),u(s,g,_),b(f,s,_),y=!0},p:da,i(s){y||(M(f.$$.fragment,s),y=!0)},o(s){P(f.$$.fragment,s),y=!1},d(s){s&&a(d),s&&a(g),S(f,s)}}}function ba(W){let d,v,g,f,y,s,_,G,Qe,Je,j,He,X,Ke,et,V,tt,at,xe,oe,st,Ce,pe,_e,nt,Ze,D,rt,Y,it,ot,ke,L,We,J,R,ye,O,pt,ve,lt,Ge,I,Q,ct,Ee,dt,mt,H,ht,le,ft,ut,gt,T,K,_t,we,yt,vt,z,De,x,A,be,ee,Et,Me,wt,Le,$,te,bt,Pe,Mt,Pt,ae,St,ce,It,$t,jt,U,se,Tt,Se,Ut,Jt,F,Re,C,q,Ie,ne,xt,$e,Ct,ze,Z,re,Zt,k,kt,de,Wt,Gt,me,Dt,Lt,Ae;return s=new Oe({}),L=new ya({props:{$$slots:{default:[va]},$$scope:{ctx:W}}}),O=new Oe({}),Q=new Ue({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.21.0/en/api/models/prior_transformer#diffusers.PriorTransformer">PriorTransformer</a>) &#x2014;
The canonical 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 <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.ShapEPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.21.0/en/api/schedulers/heun#diffusers.HeunDiscreteScheduler">HeunDiscreteScheduler</a>) &#x2014;
A scheduler to be used in combination with the <code>prior</code> model 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 to create 3D objects with the NeRF
rendering method.`,name:"shap_e_renderer"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/shap_e/pipeline_shap_e.py#L79"}}),K=new Ue({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>.`,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;pil&quot;</code>) &#x2014;
The output format of the generated 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>), or 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.21.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.21.0/src/diffusers/pipelines/shap_e/pipeline_shap_e.py#L182",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.21.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.21.0/en/api/pipelines/shap_e#diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput"
>ShapEPipelineOutput</a> or <code>tuple</code></p>
`}}),z=new ca({props:{anchor:"diffusers.ShapEPipeline.__call__.example",$$slots:{default:[Ea]},$$scope:{ctx:W}}}),ee=new Oe({}),te=new Ue({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.21.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 <code>CLIPImageProcessor</code> to process images.`,name:"image_processor"},{anchor:"diffusers.ShapEImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.21.0/en/api/schedulers/heun#diffusers.HeunDiscreteScheduler">HeunDiscreteScheduler</a>) &#x2014;
A scheduler to be used in combination with the <code>prior</code> model 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 to create 3D objects with the NeRF
rendering method.`,name:"shap_e_renderer"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py#L80"}}),se=new Ue({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 image, but if passing latents directly it is not 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 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.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;pil&quot;</code>) &#x2014;
The output format of the generated 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>), or 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.21.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.21.0/src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py#L164",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.21.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.21.0/en/api/pipelines/shap_e#diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput"
>ShapEPipelineOutput</a> or <code>tuple</code></p>
`}}),F=new ca({props:{anchor:"diffusers.ShapEImg2ImgPipeline.__call__.example",$$slots:{default:[wa]},$$scope:{ctx:W}}}),ne=new Oe({}),re=new Ue({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.21.0/src/diffusers/pipelines/shap_e/pipeline_shap_e.py#L67"}}),{c(){d=n("meta"),v=m(),g=n("h1"),f=n("a"),y=n("span"),E(s.$$.fragment),_=m(),G=n("span"),Qe=l("Shap-E"),Je=m(),j=n("p"),He=l("The Shap-E model was proposed in "),X=n("a"),Ke=l("Shap-E: Generating Conditional 3D Implicit Functions"),et=l(" by Alex Nichol and Heewon Jun from "),V=n("a"),tt=l("OpenAI"),at=l("."),xe=m(),oe=n("p"),st=l("The abstract from the paper is:"),Ce=m(),pe=n("p"),_e=n("em"),nt=l("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."),Ze=m(),D=n("p"),rt=l("The original codebase can be found at "),Y=n("a"),it=l("openai/shap-e"),ot=l("."),ke=m(),E(L.$$.fragment),We=m(),J=n("h2"),R=n("a"),ye=n("span"),E(O.$$.fragment),pt=m(),ve=n("span"),lt=l("ShapEPipeline"),Ge=m(),I=n("div"),E(Q.$$.fragment),ct=m(),Ee=n("p"),dt=l("Pipeline for generating latent representation of a 3D asset and rendering with the NeRF method."),mt=m(),H=n("p"),ht=l("This model inherits from "),le=n("a"),ft=l("DiffusionPipeline"),ut=l(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),gt=m(),T=n("div"),E(K.$$.fragment),_t=m(),we=n("p"),yt=l("The call function to the pipeline for generation."),vt=m(),E(z.$$.fragment),De=m(),x=n("h2"),A=n("a"),be=n("span"),E(ee.$$.fragment),Et=m(),Me=n("span"),wt=l("ShapEImg2ImgPipeline"),Le=m(),$=n("div"),E(te.$$.fragment),bt=m(),Pe=n("p"),Mt=l("Pipeline for generating latent representation of a 3D asset and rendering with the NeRF method from an image."),Pt=m(),ae=n("p"),St=l("This model inherits from "),ce=n("a"),It=l("DiffusionPipeline"),$t=l(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),jt=m(),U=n("div"),E(se.$$.fragment),Tt=m(),Se=n("p"),Ut=l("The call function to the pipeline for generation."),Jt=m(),E(F.$$.fragment),Re=m(),C=n("h2"),q=n("a"),Ie=n("span"),E(ne.$$.fragment),xt=m(),$e=n("span"),Ct=l("ShapEPipelineOutput"),ze=m(),Z=n("div"),E(re.$$.fragment),Zt=m(),k=n("p"),kt=l("Output class for "),de=n("a"),Wt=l("ShapEPipeline"),Gt=l(" and "),me=n("a"),Dt=l("ShapEImg2ImgPipeline"),Lt=l("."),this.h()},l(e){const o=ga('[data-svelte="svelte-1phssyn"]',document.head);d=r(o,"META",{name:!0,content:!0}),o.forEach(a),v=h(e),g=r(e,"H1",{class:!0});var ie=i(g);f=r(ie,"A",{id:!0,class:!0,href:!0});var je=i(f);y=r(je,"SPAN",{});var Te=i(y);w(s.$$.fragment,Te),Te.forEach(a),je.forEach(a),_=h(ie),G=r(ie,"SPAN",{});var Rt=i(G);Qe=c(Rt,"Shap-E"),Rt.forEach(a),ie.forEach(a),Je=h(e),j=r(e,"P",{});var he=i(j);He=c(he,"The Shap-E model was proposed in "),X=r(he,"A",{href:!0,rel:!0});var zt=i(X);Ke=c(zt,"Shap-E: Generating Conditional 3D Implicit Functions"),zt.forEach(a),et=c(he," by Alex Nichol and Heewon Jun from "),V=r(he,"A",{href:!0,rel:!0});var At=i(V);tt=c(At,"OpenAI"),At.forEach(a),at=c(he,"."),he.forEach(a),xe=h(e),oe=r(e,"P",{});var Ft=i(oe);st=c(Ft,"The abstract from the paper is:"),Ft.forEach(a),Ce=h(e),pe=r(e,"P",{});var qt=i(pe);_e=r(qt,"EM",{});var Nt=i(_e);nt=c(Nt,"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."),Nt.forEach(a),qt.forEach(a),Ze=h(e),D=r(e,"P",{});var Fe=i(D);rt=c(Fe,"The original codebase can be found at "),Y=r(Fe,"A",{href:!0,rel:!0});var Bt=i(Y);it=c(Bt,"openai/shap-e"),Bt.forEach(a),ot=c(Fe,"."),Fe.forEach(a),ke=h(e),w(L.$$.fragment,e),We=h(e),J=r(e,"H2",{class:!0});var qe=i(J);R=r(qe,"A",{id:!0,class:!0,href:!0});var Xt=i(R);ye=r(Xt,"SPAN",{});var Vt=i(ye);w(O.$$.fragment,Vt),Vt.forEach(a),Xt.forEach(a),pt=h(qe),ve=r(qe,"SPAN",{});var Yt=i(ve);lt=c(Yt,"ShapEPipeline"),Yt.forEach(a),qe.forEach(a),Ge=h(e),I=r(e,"DIV",{class:!0});var N=i(I);w(Q.$$.fragment,N),ct=h(N),Ee=r(N,"P",{});var Ot=i(Ee);dt=c(Ot,"Pipeline for generating latent representation of a 3D asset and rendering with the NeRF method."),Ot.forEach(a),mt=h(N),H=r(N,"P",{});var Ne=i(H);ht=c(Ne,"This model inherits from "),le=r(Ne,"A",{href:!0});var Qt=i(le);ft=c(Qt,"DiffusionPipeline"),Qt.forEach(a),ut=c(Ne,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Ne.forEach(a),gt=h(N),T=r(N,"DIV",{class:!0});var fe=i(T);w(K.$$.fragment,fe),_t=h(fe),we=r(fe,"P",{});var Ht=i(we);yt=c(Ht,"The call function to the pipeline for generation."),Ht.forEach(a),vt=h(fe),w(z.$$.fragment,fe),fe.forEach(a),N.forEach(a),De=h(e),x=r(e,"H2",{class:!0});var Be=i(x);A=r(Be,"A",{id:!0,class:!0,href:!0});var Kt=i(A);be=r(Kt,"SPAN",{});var ea=i(be);w(ee.$$.fragment,ea),ea.forEach(a),Kt.forEach(a),Et=h(Be),Me=r(Be,"SPAN",{});var ta=i(Me);wt=c(ta,"ShapEImg2ImgPipeline"),ta.forEach(a),Be.forEach(a),Le=h(e),$=r(e,"DIV",{class:!0});var B=i($);w(te.$$.fragment,B),bt=h(B),Pe=r(B,"P",{});var aa=i(Pe);Mt=c(aa,"Pipeline for generating latent representation of a 3D asset and rendering with the NeRF method from an image."),aa.forEach(a),Pt=h(B),ae=r(B,"P",{});var Xe=i(ae);St=c(Xe,"This model inherits from "),ce=r(Xe,"A",{href:!0});var sa=i(ce);It=c(sa,"DiffusionPipeline"),sa.forEach(a),$t=c(Xe,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Xe.forEach(a),jt=h(B),U=r(B,"DIV",{class:!0});var ue=i(U);w(se.$$.fragment,ue),Tt=h(ue),Se=r(ue,"P",{});var na=i(Se);Ut=c(na,"The call function to the pipeline for generation."),na.forEach(a),Jt=h(ue),w(F.$$.fragment,ue),ue.forEach(a),B.forEach(a),Re=h(e),C=r(e,"H2",{class:!0});var Ve=i(C);q=r(Ve,"A",{id:!0,class:!0,href:!0});var ra=i(q);Ie=r(ra,"SPAN",{});var ia=i(Ie);w(ne.$$.fragment,ia),ia.forEach(a),ra.forEach(a),xt=h(Ve),$e=r(Ve,"SPAN",{});var oa=i($e);Ct=c(oa,"ShapEPipelineOutput"),oa.forEach(a),Ve.forEach(a),ze=h(e),Z=r(e,"DIV",{class:!0});var Ye=i(Z);w(re.$$.fragment,Ye),Zt=h(Ye),k=r(Ye,"P",{});var ge=i(k);kt=c(ge,"Output class for "),de=r(ge,"A",{href:!0});var pa=i(de);Wt=c(pa,"ShapEPipeline"),pa.forEach(a),Gt=c(ge," and "),me=r(ge,"A",{href:!0});var la=i(me);Dt=c(la,"ShapEImg2ImgPipeline"),la.forEach(a),Lt=c(ge,"."),ge.forEach(a),Ye.forEach(a),this.h()},h(){p(d,"name","hf:doc:metadata"),p(d,"content",JSON.stringify(Ma)),p(f,"id","shape"),p(f,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(f,"href","#shape"),p(g,"class","relative group"),p(X,"href","https://huggingface.co/papers/2305.02463"),p(X,"rel","nofollow"),p(V,"href","https://github.com/openai"),p(V,"rel","nofollow"),p(Y,"href","https://github.com/openai/shap-e"),p(Y,"rel","nofollow"),p(R,"id","diffusers.ShapEPipeline"),p(R,"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"),p(R,"href","#diffusers.ShapEPipeline"),p(J,"class","relative group"),p(le,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(A,"id","diffusers.ShapEImg2ImgPipeline"),p(A,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(A,"href","#diffusers.ShapEImg2ImgPipeline"),p(x,"class","relative group"),p(ce,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(q,"id","diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput"),p(q,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(q,"href","#diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput"),p(C,"class","relative group"),p(de,"href","/docs/diffusers/v0.21.0/en/api/pipelines/shap_e#diffusers.ShapEPipeline"),p(me,"href","/docs/diffusers/v0.21.0/en/api/pipelines/shap_e#diffusers.ShapEImg2ImgPipeline"),p(Z,"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,d),u(e,v,o),u(e,g,o),t(g,f),t(f,y),b(s,y,null),t(g,_),t(g,G),t(G,Qe),u(e,Je,o),u(e,j,o),t(j,He),t(j,X),t(X,Ke),t(j,et),t(j,V),t(V,tt),t(j,at),u(e,xe,o),u(e,oe,o),t(oe,st),u(e,Ce,o),u(e,pe,o),t(pe,_e),t(_e,nt),u(e,Ze,o),u(e,D,o),t(D,rt),t(D,Y),t(Y,it),t(D,ot),u(e,ke,o),b(L,e,o),u(e,We,o),u(e,J,o),t(J,R),t(R,ye),b(O,ye,null),t(J,pt),t(J,ve),t(ve,lt),u(e,Ge,o),u(e,I,o),b(Q,I,null),t(I,ct),t(I,Ee),t(Ee,dt),t(I,mt),t(I,H),t(H,ht),t(H,le),t(le,ft),t(H,ut),t(I,gt),t(I,T),b(K,T,null),t(T,_t),t(T,we),t(we,yt),t(T,vt),b(z,T,null),u(e,De,o),u(e,x,o),t(x,A),t(A,be),b(ee,be,null),t(x,Et),t(x,Me),t(Me,wt),u(e,Le,o),u(e,$,o),b(te,$,null),t($,bt),t($,Pe),t(Pe,Mt),t($,Pt),t($,ae),t(ae,St),t(ae,ce),t(ce,It),t(ae,$t),t($,jt),t($,U),b(se,U,null),t(U,Tt),t(U,Se),t(Se,Ut),t(U,Jt),b(F,U,null),u(e,Re,o),u(e,C,o),t(C,q),t(q,Ie),b(ne,Ie,null),t(C,xt),t(C,$e),t($e,Ct),u(e,ze,o),u(e,Z,o),b(re,Z,null),t(Z,Zt),t(Z,k),t(k,kt),t(k,de),t(de,Wt),t(k,Gt),t(k,me),t(me,Dt),t(k,Lt),Ae=!0},p(e,[o]){const ie={};o&2&&(ie.$$scope={dirty:o,ctx:e}),L.$set(ie);const je={};o&2&&(je.$$scope={dirty:o,ctx:e}),z.$set(je);const Te={};o&2&&(Te.$$scope={dirty:o,ctx:e}),F.$set(Te)},i(e){Ae||(M(s.$$.fragment,e),M(L.$$.fragment,e),M(O.$$.fragment,e),M(Q.$$.fragment,e),M(K.$$.fragment,e),M(z.$$.fragment,e),M(ee.$$.fragment,e),M(te.$$.fragment,e),M(se.$$.fragment,e),M(F.$$.fragment,e),M(ne.$$.fragment,e),M(re.$$.fragment,e),Ae=!0)},o(e){P(s.$$.fragment,e),P(L.$$.fragment,e),P(O.$$.fragment,e),P(Q.$$.fragment,e),P(K.$$.fragment,e),P(z.$$.fragment,e),P(ee.$$.fragment,e),P(te.$$.fragment,e),P(se.$$.fragment,e),P(F.$$.fragment,e),P(ne.$$.fragment,e),P(re.$$.fragment,e),Ae=!1},d(e){a(d),e&&a(v),e&&a(g),S(s),e&&a(Je),e&&a(j),e&&a(xe),e&&a(oe),e&&a(Ce),e&&a(pe),e&&a(Ze),e&&a(D),e&&a(ke),S(L,e),e&&a(We),e&&a(J),S(O),e&&a(Ge),e&&a(I),S(Q),S(K),S(z),e&&a(De),e&&a(x),S(ee),e&&a(Le),e&&a($),S(te),S(se),S(F),e&&a(Re),e&&a(C),S(ne),e&&a(ze),e&&a(Z),S(re)}}}const Ma={local:"shape",sections:[{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 Pa(W){return _a(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ja extends ha{constructor(d){super();fa(this,d,Pa,ba,ua,{})}}export{Ja as default,Ma as metadata};
