Buckets:
| import{s as Be,o as Ye,n as Ce}from"../chunks/scheduler.8c3d61f6.js";import{S as Fe,i as He,g as l,s as r,r as u,A as Ne,h as c,f as n,c as o,j as F,u as g,x as w,k as H,y as m,a as i,v as _,d as M,t as y,w as b}from"../chunks/index.da70eac4.js";import{T as Qe}from"../chunks/Tip.1d9b8c37.js";import{D as ae}from"../chunks/Docstring.ee4b6913.js";import{C as Xe}from"../chunks/CodeBlock.00a903b3.js";import{E as Ve}from"../chunks/ExampleCodeBlock.f7bd2c1f.js";import{H as ye,E as Ae}from"../chunks/EditOnGithub.1e64e623.js";function Oe(C){let a,$='See the <a href="../../using-diffusers/loading#reuse-components-across-pipelines">reuse components across pipelines</a> section to learn how to efficiently load the same components into multiple pipelines.';return{c(){a=l("p"),a.innerHTML=$},l(d){a=c(d,"P",{"data-svelte-h":!0}),w(a)!=="svelte-1o9umhf"&&(a.innerHTML=$)},m(d,p){i(d,a,p)},p:Ce,d(d){d&&n(a)}}}function Ke(C){let a,$="Examples:",d,p,h;return p=new Xe({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX2dpZiUwQSUwQWRldmljZSUyMCUzRCUyMHRvcmNoLmRldmljZSglMjJjdWRhJTIyJTIwaWYlMjB0b3JjaC5jdWRhLmlzX2F2YWlsYWJsZSgpJTIwZWxzZSUyMCUyMmNwdSUyMiklMEElMEFyZXBvJTIwJTNEJTIwJTIyb3BlbmFpJTJGc2hhcC1lJTIyJTBBcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChyZXBvJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXBpcGUlMjAlM0QlMjBwaXBlLnRvKGRldmljZSklMEElMEFndWlkYW5jZV9zY2FsZSUyMCUzRCUyMDE1LjAlMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwc2hhcmslMjIlMEElMEFpbWFnZXMlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMHByb21wdCUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEZ3VpZGFuY2Vfc2NhbGUlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENjQlMkMlMEElMjAlMjAlMjAlMjBmcmFtZV9zaXplJTNEMjU2JTJDJTBBKS5pbWFnZXMlMEElMEFnaWZfcGF0aCUyMCUzRCUyMGV4cG9ydF90b19naWYoaW1hZ2VzJTVCMCU1RCUyQyUyMCUyMnNoYXJrXzNkLmdpZiUyMik=",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif | |
| <span class="hljs-meta">>>> </span>device = torch.device(<span class="hljs-string">"cuda"</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">"cpu"</span>) | |
| <span class="hljs-meta">>>> </span>repo = <span class="hljs-string">"openai/shap-e"</span> | |
| <span class="hljs-meta">>>> </span>pipe = DiffusionPipeline.from_pretrained(repo, torch_dtype=torch.float16) | |
| <span class="hljs-meta">>>> </span>pipe = pipe.to(device) | |
| <span class="hljs-meta">>>> </span>guidance_scale = <span class="hljs-number">15.0</span> | |
| <span class="hljs-meta">>>> </span>prompt = <span class="hljs-string">"a shark"</span> | |
| <span class="hljs-meta">>>> </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">>>> </span>gif_path = export_to_gif(images[<span class="hljs-number">0</span>], <span class="hljs-string">"shark_3d.gif"</span>)`,wrap:!1}}),{c(){a=l("p"),a.textContent=$,d=r(),u(p.$$.fragment)},l(s){a=c(s,"P",{"data-svelte-h":!0}),w(a)!=="svelte-kvfsh7"&&(a.textContent=$),d=o(s),g(p.$$.fragment,s)},m(s,f){i(s,a,f),i(s,d,f),_(p,s,f),h=!0},p:Ce,i(s){h||(M(p.$$.fragment,s),h=!0)},o(s){y(p.$$.fragment,s),h=!1},d(s){s&&(n(a),n(d)),b(p,s)}}}function et(C){let a,$="Examples:",d,p,h;return p=new Xe({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX2dpZiUyQyUyMGxvYWRfaW1hZ2UlMEElMEFkZXZpY2UlMjAlM0QlMjB0b3JjaC5kZXZpY2UoJTIyY3VkYSUyMiUyMGlmJTIwdG9yY2guY3VkYS5pc19hdmFpbGFibGUoKSUyMGVsc2UlMjAlMjJjcHUlMjIpJTBBJTBBcmVwbyUyMCUzRCUyMCUyMm9wZW5haSUyRnNoYXAtZS1pbWcyaW1nJTIyJTBBcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChyZXBvJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXBpcGUlMjAlM0QlMjBwaXBlLnRvKGRldmljZSklMEElMEFndWlkYW5jZV9zY2FsZSUyMCUzRCUyMDMuMCUwQWltYWdlX3VybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGaGYuY28lMkZkYXRhc2V0cyUyRmRpZmZ1c2VycyUyRmRvY3MtaW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZzaGFwLWUlMkZjb3JnaS5wbmclMjIlMEFpbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoaW1hZ2VfdXJsKS5jb252ZXJ0KCUyMlJHQiUyMiklMEElMEFpbWFnZXMlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMGltYWdlJTJDJTBBJTIwJTIwJTIwJTIwZ3VpZGFuY2Vfc2NhbGUlM0RndWlkYW5jZV9zY2FsZSUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q2NCUyQyUwQSUyMCUyMCUyMCUyMGZyYW1lX3NpemUlM0QyNTYlMkMlMEEpLmltYWdlcyUwQSUwQWdpZl9wYXRoJTIwJTNEJTIwZXhwb3J0X3RvX2dpZihpbWFnZXMlNUIwJTVEJTJDJTIwJTIyY29yZ2lfM2QuZ2lmJTIyKQ==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif, load_image | |
| <span class="hljs-meta">>>> </span>device = torch.device(<span class="hljs-string">"cuda"</span> <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> <span class="hljs-string">"cpu"</span>) | |
| <span class="hljs-meta">>>> </span>repo = <span class="hljs-string">"openai/shap-e-img2img"</span> | |
| <span class="hljs-meta">>>> </span>pipe = DiffusionPipeline.from_pretrained(repo, torch_dtype=torch.float16) | |
| <span class="hljs-meta">>>> </span>pipe = pipe.to(device) | |
| <span class="hljs-meta">>>> </span>guidance_scale = <span class="hljs-number">3.0</span> | |
| <span class="hljs-meta">>>> </span>image_url = <span class="hljs-string">"https://hf.co/datasets/diffusers/docs-images/resolve/main/shap-e/corgi.png"</span> | |
| <span class="hljs-meta">>>> </span>image = load_image(image_url).convert(<span class="hljs-string">"RGB"</span>) | |
| <span class="hljs-meta">>>> </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">>>> </span>gif_path = export_to_gif(images[<span class="hljs-number">0</span>], <span class="hljs-string">"corgi_3d.gif"</span>)`,wrap:!1}}),{c(){a=l("p"),a.textContent=$,d=r(),u(p.$$.fragment)},l(s){a=c(s,"P",{"data-svelte-h":!0}),w(a)!=="svelte-kvfsh7"&&(a.textContent=$),d=o(s),g(p.$$.fragment,s)},m(s,f){i(s,a,f),i(s,d,f),_(p,s,f),h=!0},p:Ce,i(s){h||(M(p.$$.fragment,s),h=!0)},o(s){y(p.$$.fragment,s),h=!1},d(s){s&&(n(a),n(d)),b(p,s)}}}function tt(C){let a,$,d,p,h,s,f,Ue='The Shap-E model was proposed in <a href="https://huggingface.co/papers/2305.02463" rel="nofollow">Shap-E: Generating Conditional 3D Implicit Functions</a> by Alex Nichol and Heewoo Jun from <a href="https://github.com/openai" rel="nofollow">OpenAI</a>.',ie,k,Je="The abstract from the paper is:",re,W,Ze="<em>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.</em>",oe,G,ke='The original codebase can be found at <a href="https://github.com/openai/shap-e" rel="nofollow">openai/shap-e</a>.',pe,U,le,L,ce,E,z,be,N,We="Pipeline for generating latent representation of a 3D asset and rendering with the NeRF method.",we,Q,Ge=`This model inherits from <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>. Check the superclass documentation for the generic methods | |
| implemented for all pipelines (downloading, saving, running on a particular device, etc.).`,$e,j,R,Ee,A,Le="The call function to the pipeline for generation.",Pe,J,de,D,me,P,q,Ie,O,ze="Pipeline for generating latent representation of a 3D asset and rendering with the NeRF method from an image.",Te,K,Re=`This model inherits from <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>. Check the superclass documentation for the generic methods | |
| implemented for all pipelines (downloading, saving, running on a particular device, etc.).`,je,v,V,ve,ee,De="The call function to the pipeline for generation.",Se,Z,he,X,fe,S,B,xe,te,qe='Output class for <a href="/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.ShapEPipeline">ShapEPipeline</a> and <a href="/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.ShapEImg2ImgPipeline">ShapEImg2ImgPipeline</a>.',ue,Y,ge,se,_e;return h=new ye({props:{title:"Shap-E",local:"shap-e",headingTag:"h1"}}),U=new Qe({props:{$$slots:{default:[Oe]},$$scope:{ctx:C}}}),L=new ye({props:{title:"ShapEPipeline",local:"diffusers.ShapEPipeline",headingTag:"h2"}}),z=new ae({props:{name:"class diffusers.ShapEPipeline",anchor:"diffusers.ShapEPipeline",parameters:[{name:"prior",val:": PriorTransformer"},{name:"text_encoder",val:": CLIPTextModelWithProjection"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"scheduler",val:": HeunDiscreteScheduler"},{name:"shap_e_renderer",val:": ShapERenderer"}],parametersDescription:[{anchor:"diffusers.ShapEPipeline.prior",description:`<strong>prior</strong> (<a href="/docs/diffusers/main/en/api/models/prior_transformer#diffusers.PriorTransformer">PriorTransformer</a>) — | |
| 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> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModelWithProjection" rel="nofollow">CLIPTextModelWithProjection</a>) — | |
| Frozen text-encoder.`,name:"text_encoder"},{anchor:"diffusers.ShapEPipeline.tokenizer",description:`<strong>tokenizer</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>) — | |
| A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.ShapEPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/heun#diffusers.HeunDiscreteScheduler">HeunDiscreteScheduler</a>) — | |
| 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>) — | |
| 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/main/src/diffusers/pipelines/shap_e/pipeline_shap_e.py#L79"}}),R=new ae({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:": Union = None"},{name:"latents",val:": Optional = None"},{name:"guidance_scale",val:": float = 4.0"},{name:"frame_size",val:": int = 64"},{name:"output_type",val:": Optional = '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>) — | |
| 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) — | |
| 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) — | |
| 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>) — | |
| 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.Tensor</code>, <em>optional</em>) — | |
| 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) — | |
| 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 > 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) — | |
| 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>"pil"</code>) — | |
| The output format of the generated image. Choose between <code>"pil"</code> (<code>PIL.Image.Image</code>), <code>"np"</code> | |
| (<code>np.array</code>), <code>"latent"</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>) — | |
| Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput">ShapEPipelineOutput</a> instead of a plain | |
| tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/shap_e/pipeline_shap_e.py#L182",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>If <code>return_dict</code> is <code>True</code>, <a | |
| href="/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput" | |
| >ShapEPipelineOutput</a> is returned, | |
| otherwise a <code>tuple</code> is returned where the first element is a list with the generated images.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput" | |
| >ShapEPipelineOutput</a> or <code>tuple</code></p> | |
| `}}),J=new Ve({props:{anchor:"diffusers.ShapEPipeline.__call__.example",$$slots:{default:[Ke]},$$scope:{ctx:C}}}),D=new ye({props:{title:"ShapEImg2ImgPipeline",local:"diffusers.ShapEImg2ImgPipeline",headingTag:"h2"}}),q=new ae({props:{name:"class diffusers.ShapEImg2ImgPipeline",anchor:"diffusers.ShapEImg2ImgPipeline",parameters:[{name:"prior",val:": PriorTransformer"},{name:"image_encoder",val:": CLIPVisionModel"},{name:"image_processor",val:": CLIPImageProcessor"},{name:"scheduler",val:": HeunDiscreteScheduler"},{name:"shap_e_renderer",val:": ShapERenderer"}],parametersDescription:[{anchor:"diffusers.ShapEImg2ImgPipeline.prior",description:`<strong>prior</strong> (<a href="/docs/diffusers/main/en/api/models/prior_transformer#diffusers.PriorTransformer">PriorTransformer</a>) — | |
| The canonical unCLIP prior to approximate the image embedding from the text embedding.`,name:"prior"},{anchor:"diffusers.ShapEImg2ImgPipeline.image_encoder",description:`<strong>image_encoder</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPVisionModel" rel="nofollow">CLIPVisionModel</a>) — | |
| Frozen image-encoder.`,name:"image_encoder"},{anchor:"diffusers.ShapEImg2ImgPipeline.image_processor",description:`<strong>image_processor</strong> (<a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor" rel="nofollow">CLIPImageProcessor</a>) — | |
| A <code>CLIPImageProcessor</code> to process images.`,name:"image_processor"},{anchor:"diffusers.ShapEImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/heun#diffusers.HeunDiscreteScheduler">HeunDiscreteScheduler</a>) — | |
| 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>) — | |
| 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/main/src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py#L80"}}),V=new ae({props:{name:"__call__",anchor:"diffusers.ShapEImg2ImgPipeline.__call__",parameters:[{name:"image",val:": Union"},{name:"num_images_per_prompt",val:": int = 1"},{name:"num_inference_steps",val:": int = 25"},{name:"generator",val:": Union = None"},{name:"latents",val:": Optional = None"},{name:"guidance_scale",val:": float = 4.0"},{name:"frame_size",val:": int = 64"},{name:"output_type",val:": Optional = 'pil'"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.ShapEImg2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.Tensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.Tensor]</code>, <code>List[PIL.Image.Image]</code>, or <code>List[np.ndarray]</code>) — | |
| <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) — | |
| 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) — | |
| 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>) — | |
| 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.Tensor</code>, <em>optional</em>) — | |
| 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) — | |
| 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 > 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) — | |
| 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>"pil"</code>) — | |
| The output format of the generated image. Choose between <code>"pil"</code> (<code>PIL.Image.Image</code>), <code>"np"</code> | |
| (<code>np.array</code>), <code>"latent"</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>) — | |
| Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput">ShapEPipelineOutput</a> instead of a plain | |
| tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/shap_e/pipeline_shap_e_img2img.py#L164",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>If <code>return_dict</code> is <code>True</code>, <a | |
| href="/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput" | |
| >ShapEPipelineOutput</a> is returned, | |
| otherwise a <code>tuple</code> is returned where the first element is a list with the generated images.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/diffusers/main/en/api/pipelines/shap_e#diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput" | |
| >ShapEPipelineOutput</a> or <code>tuple</code></p> | |
| `}}),Z=new Ve({props:{anchor:"diffusers.ShapEImg2ImgPipeline.__call__.example",$$slots:{default:[et]},$$scope:{ctx:C}}}),X=new ye({props:{title:"ShapEPipelineOutput",local:"diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput",headingTag:"h2"}}),B=new ae({props:{name:"class diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput",anchor:"diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput",parameters:[{name:"images",val:": Union"}],parametersDescription:[{anchor:"diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput.images",description:`<strong>images</strong> (<code>torch.Tensor</code>) — | |
| A list of images for 3D rendering.`,name:"images"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/shap_e/pipeline_shap_e.py#L66"}}),Y=new Ae({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/api/pipelines/shap_e.md"}}),{c(){a=l("meta"),$=r(),d=l("p"),p=r(),u(h.$$.fragment),s=r(),f=l("p"),f.innerHTML=Ue,ie=r(),k=l("p"),k.textContent=Je,re=r(),W=l("p"),W.innerHTML=Ze,oe=r(),G=l("p"),G.innerHTML=ke,pe=r(),u(U.$$.fragment),le=r(),u(L.$$.fragment),ce=r(),E=l("div"),u(z.$$.fragment),be=r(),N=l("p"),N.textContent=We,we=r(),Q=l("p"),Q.innerHTML=Ge,$e=r(),j=l("div"),u(R.$$.fragment),Ee=r(),A=l("p"),A.textContent=Le,Pe=r(),u(J.$$.fragment),de=r(),u(D.$$.fragment),me=r(),P=l("div"),u(q.$$.fragment),Ie=r(),O=l("p"),O.textContent=ze,Te=r(),K=l("p"),K.innerHTML=Re,je=r(),v=l("div"),u(V.$$.fragment),ve=r(),ee=l("p"),ee.textContent=De,Se=r(),u(Z.$$.fragment),he=r(),u(X.$$.fragment),fe=r(),S=l("div"),u(B.$$.fragment),xe=r(),te=l("p"),te.innerHTML=qe,ue=r(),u(Y.$$.fragment),ge=r(),se=l("p"),this.h()},l(e){const t=Ne("svelte-u9bgzb",document.head);a=c(t,"META",{name:!0,content:!0}),t.forEach(n),$=o(e),d=c(e,"P",{}),F(d).forEach(n),p=o(e),g(h.$$.fragment,e),s=o(e),f=c(e,"P",{"data-svelte-h":!0}),w(f)!=="svelte-hlst0d"&&(f.innerHTML=Ue),ie=o(e),k=c(e,"P",{"data-svelte-h":!0}),w(k)!=="svelte-1cwsb16"&&(k.textContent=Je),re=o(e),W=c(e,"P",{"data-svelte-h":!0}),w(W)!=="svelte-x8b1j2"&&(W.innerHTML=Ze),oe=o(e),G=c(e,"P",{"data-svelte-h":!0}),w(G)!=="svelte-1ctozyl"&&(G.innerHTML=ke),pe=o(e),g(U.$$.fragment,e),le=o(e),g(L.$$.fragment,e),ce=o(e),E=c(e,"DIV",{class:!0});var I=F(E);g(z.$$.fragment,I),be=o(I),N=c(I,"P",{"data-svelte-h":!0}),w(N)!=="svelte-13hoayd"&&(N.textContent=We),we=o(I),Q=c(I,"P",{"data-svelte-h":!0}),w(Q)!=="svelte-496sm0"&&(Q.innerHTML=Ge),$e=o(I),j=c(I,"DIV",{class:!0});var x=F(j);g(R.$$.fragment,x),Ee=o(x),A=c(x,"P",{"data-svelte-h":!0}),w(A)!=="svelte-50j04k"&&(A.textContent=Le),Pe=o(x),g(J.$$.fragment,x),x.forEach(n),I.forEach(n),de=o(e),g(D.$$.fragment,e),me=o(e),P=c(e,"DIV",{class:!0});var T=F(P);g(q.$$.fragment,T),Ie=o(T),O=c(T,"P",{"data-svelte-h":!0}),w(O)!=="svelte-16fhar3"&&(O.textContent=ze),Te=o(T),K=c(T,"P",{"data-svelte-h":!0}),w(K)!=="svelte-496sm0"&&(K.innerHTML=Re),je=o(T),v=c(T,"DIV",{class:!0});var ne=F(v);g(V.$$.fragment,ne),ve=o(ne),ee=c(ne,"P",{"data-svelte-h":!0}),w(ee)!=="svelte-50j04k"&&(ee.textContent=De),Se=o(ne),g(Z.$$.fragment,ne),ne.forEach(n),T.forEach(n),he=o(e),g(X.$$.fragment,e),fe=o(e),S=c(e,"DIV",{class:!0});var Me=F(S);g(B.$$.fragment,Me),xe=o(Me),te=c(Me,"P",{"data-svelte-h":!0}),w(te)!=="svelte-1ursby5"&&(te.innerHTML=qe),Me.forEach(n),ue=o(e),g(Y.$$.fragment,e),ge=o(e),se=c(e,"P",{}),F(se).forEach(n),this.h()},h(){H(a,"name","hf:doc:metadata"),H(a,"content",nt),H(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),H(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),H(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),H(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),H(S,"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,t){m(document.head,a),i(e,$,t),i(e,d,t),i(e,p,t),_(h,e,t),i(e,s,t),i(e,f,t),i(e,ie,t),i(e,k,t),i(e,re,t),i(e,W,t),i(e,oe,t),i(e,G,t),i(e,pe,t),_(U,e,t),i(e,le,t),_(L,e,t),i(e,ce,t),i(e,E,t),_(z,E,null),m(E,be),m(E,N),m(E,we),m(E,Q),m(E,$e),m(E,j),_(R,j,null),m(j,Ee),m(j,A),m(j,Pe),_(J,j,null),i(e,de,t),_(D,e,t),i(e,me,t),i(e,P,t),_(q,P,null),m(P,Ie),m(P,O),m(P,Te),m(P,K),m(P,je),m(P,v),_(V,v,null),m(v,ve),m(v,ee),m(v,Se),_(Z,v,null),i(e,he,t),_(X,e,t),i(e,fe,t),i(e,S,t),_(B,S,null),m(S,xe),m(S,te),i(e,ue,t),_(Y,e,t),i(e,ge,t),i(e,se,t),_e=!0},p(e,[t]){const I={};t&2&&(I.$$scope={dirty:t,ctx:e}),U.$set(I);const x={};t&2&&(x.$$scope={dirty:t,ctx:e}),J.$set(x);const T={};t&2&&(T.$$scope={dirty:t,ctx:e}),Z.$set(T)},i(e){_e||(M(h.$$.fragment,e),M(U.$$.fragment,e),M(L.$$.fragment,e),M(z.$$.fragment,e),M(R.$$.fragment,e),M(J.$$.fragment,e),M(D.$$.fragment,e),M(q.$$.fragment,e),M(V.$$.fragment,e),M(Z.$$.fragment,e),M(X.$$.fragment,e),M(B.$$.fragment,e),M(Y.$$.fragment,e),_e=!0)},o(e){y(h.$$.fragment,e),y(U.$$.fragment,e),y(L.$$.fragment,e),y(z.$$.fragment,e),y(R.$$.fragment,e),y(J.$$.fragment,e),y(D.$$.fragment,e),y(q.$$.fragment,e),y(V.$$.fragment,e),y(Z.$$.fragment,e),y(X.$$.fragment,e),y(B.$$.fragment,e),y(Y.$$.fragment,e),_e=!1},d(e){e&&(n($),n(d),n(p),n(s),n(f),n(ie),n(k),n(re),n(W),n(oe),n(G),n(pe),n(le),n(ce),n(E),n(de),n(me),n(P),n(he),n(fe),n(S),n(ue),n(ge),n(se)),n(a),b(h,e),b(U,e),b(L,e),b(z),b(R),b(J),b(D,e),b(q),b(V),b(Z),b(X,e),b(B),b(Y,e)}}}const nt='{"title":"Shap-E","local":"shap-e","sections":[{"title":"ShapEPipeline","local":"diffusers.ShapEPipeline","sections":[],"depth":2},{"title":"ShapEImg2ImgPipeline","local":"diffusers.ShapEImg2ImgPipeline","sections":[],"depth":2},{"title":"ShapEPipelineOutput","local":"diffusers.pipelines.shap_e.pipeline_shap_e.ShapEPipelineOutput","sections":[],"depth":2}],"depth":1}';function st(C){return Ye(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class dt extends Fe{constructor(a){super(),He(this,a,st,tt,Be,{})}}export{dt as component}; | |
Xet Storage Details
- Size:
- 29.9 kB
- Xet hash:
- bf66c12544d8dea049311196b0c3f1b54069530a5907a29be7d5a99a2b95de7e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.