import{S as ti,i as ni,s as ii,e as i,k as l,w as D,t as s,M as oi,c as o,d as n,m as d,a,x as w,h as r,b as p,G as e,g as b,y,q as M,o as L,B as x,v as ai,L as si}from"../../../../chunks/vendor-hf-doc-builder.js";import{T as ri}from"../../../../chunks/Tip-hf-doc-builder.js";import{D as C}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as li}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as xn}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as di}from"../../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function pi(ce){let m,P,h,_,$;return{c(){m=i("p"),P=s("Make sure to check out the Stable Diffusion "),h=i("a"),_=s("Tips"),$=s(" section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!"),this.h()},l(f){m=o(f,"P",{});var v=a(m);P=r(v,"Make sure to check out the Stable Diffusion "),h=o(v,"A",{href:!0});var N=a(h);_=r(N,"Tips"),N.forEach(n),$=r(v," section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!"),v.forEach(n),this.h()},h(){p(h,"href","overview#tips")},m(f,v){b(f,m,v),e(m,P),e(m,h),e(h,_),e(m,$)},d(f){f&&n(m)}}}function fi(ce){let m,P,h,_,$;return _=new li({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkxETTNEUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uTERNM0RQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIySW50ZWwlMkZsZG0zZC00YyUyMiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMmElMjBwaG90byUyMG9mJTIwYW4lMjBhc3Ryb25hdXQlMjByaWRpbmclMjBhJTIwaG9yc2UlMjBvbiUyMG1hcnMlMjIlMEFvdXRwdXQlMjAlM0QlMjBwaXBlKHByb21wdCklMEFyZ2JfaW1hZ2UlMkMlMjBkZXB0aF9pbWFnZSUyMCUzRCUyMG91dHB1dC5yZ2IlMkMlMjBvdXRwdXQuZGVwdGglMEFyZ2JfaW1hZ2UlNUIwJTVELnNhdmUoJTIyYXN0cm9uYXV0X2xkbTNkX3JnYi5qcGclMjIpJTBBZGVwdGhfaW1hZ2UlNUIwJTVELnNhdmUoJTIyYXN0cm9uYXV0X2xkbTNkX2RlcHRoLnBuZyUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionLDM3DPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionLDM3DPipeline.from_pretrained(<span class="hljs-string">&quot;Intel/ldm3d-4c&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>output = pipe(prompt)
<span class="hljs-meta">&gt;&gt;&gt; </span>rgb_image, depth_image = output.rgb, output.depth
<span class="hljs-meta">&gt;&gt;&gt; </span>rgb_image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;astronaut_ldm3d_rgb.jpg&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>depth_image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;astronaut_ldm3d_depth.png&quot;</span>)`}}),{c(){m=i("p"),P=s("Examples:"),h=l(),D(_.$$.fragment)},l(f){m=o(f,"P",{});var v=a(m);P=r(v,"Examples:"),v.forEach(n),h=d(f),w(_.$$.fragment,f)},m(f,v){b(f,m,v),e(m,P),b(f,h,v),y(_,f,v),$=!0},p:si,i(f){$||(M(_.$$.fragment,f),$=!0)},o(f){L(_.$$.fragment,f),$=!1},d(f){f&&n(m),f&&n(h),x(_,f)}}}function ci(ce){let m,P,h,_,$,f,v,N,ft,We,k,ct,q,ut,mt,ue,gt,ht,Ze,me,_t,ze,ge,X,bt,Y,vt,Dt,Je,U,qe,T,G,Pe,Q,wt,Se,yt,Xe,c,H,Mt,Ee,Lt,xt,K,$t,he,Pt,St,Et,ke,kt,It,S,_e,be,Tt,At,Ct,ve,De,Nt,Ut,Gt,we,ye,Ot,Bt,Rt,O,Me,Vt,jt,Ie,Ft,Wt,Zt,I,ee,zt,Te,Jt,qt,B,Xt,R,te,Yt,ne,Qt,Ae,Ht,Kt,en,V,ie,tn,oe,nn,Ce,on,an,sn,j,ae,rn,Ne,ln,dn,F,se,pn,Ue,fn,cn,W,re,un,Ge,mn,Ye,A,Z,Oe,le,gn,Be,hn,Qe,E,de,_n,Re,bn,vn,z,pe,Dn,Ve,wn,He;return f=new xn({}),U=new ri({props:{$$slots:{default:[pi]},$$scope:{ctx:ce}}}),Q=new xn({}),H=new C({props:{name:"class diffusers.StableDiffusionLDM3DPipeline",anchor:"diffusers.StableDiffusionLDM3DPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionLDM3DPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <code>UNet2DConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.21.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.21.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.21.0/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for more details
about a model&#x2019;s potential harms.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
A <code>CLIPImageProcessor</code> to extract features from generated images; used as inputs to the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_ldm3d.py#L81"}}),ee=new C({props:{name:"__call__",anchor:"diffusers.StableDiffusionLDM3DPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 49"},{name:"guidance_scale",val:": float = 5.0"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionLDM3DPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide image generation. If not defined, you need to pass <code>prompt_embeds</code>.`,name:"prompt"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#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.StableDiffusionLDM3DPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 5.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.StableDiffusionLDM3DPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide what to not include in image generation. If not defined, you need to
pass <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (<code>guidance_scale &lt; 1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.__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.StableDiffusionLDM3DPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) from the <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">DDIM</a> paper. Only applies
to the <a href="/docs/diffusers/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,name:"eta"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.__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.StableDiffusionLDM3DPipeline.__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.StableDiffusionLDM3DPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs (prompt weighting). If not
provided, text embeddings are generated from the <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs (prompt weighting). If
not provided, <code>negative_prompt_embeds</code> are generated from the <code>negative_prompt</code> input argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.__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>PIL.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.__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/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is called with the
following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function is called. If not specified, the callback is called at
every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow"><code>self.processor</code></a>.`,name:"cross_attention_kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_ldm3d.py#L483",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> is returned,
otherwise a <code>tuple</code> is returned where the first element is a list with the generated images and the
second element is a list of <code>bool</code>s indicating whether the corresponding generated image contains
\u201Cnot-safe-for-work\u201D (nsfw) content.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),B=new di({props:{anchor:"diffusers.StableDiffusionLDM3DPipeline.__call__.example",$$slots:{default:[fi]},$$scope:{ctx:ce}}}),te=new C({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionLDM3DPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_ldm3d.py#L170"}}),ie=new C({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionLDM3DPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_ldm3d.py#L187"}}),ae=new C({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionLDM3DPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_ldm3d.py#L162"}}),se=new C({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionLDM3DPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_ldm3d.py#L178"}}),re=new C({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionLDM3DPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"device",val:""},{name:"num_images_per_prompt",val:""},{name:"do_classifier_free_guidance",val:""},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionLDM3DPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_ldm3d.py#L226"}}),le=new xn({}),de=new C({props:{name:"class diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_ldm3d.LDM3DPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_ldm3d.LDM3DPipelineOutput",parameters:[{name:"rgb",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"},{name:"depth",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"},{name:"nsfw_content_detected",val:": typing.Optional[typing.List[bool]]"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_ldm3d.LDM3DPipelineOutput.rgb",description:`<strong>rgb</strong> (<code>List[PIL.Image.Image]</code> or <code>np.ndarray</code>) &#x2014;
List of denoised PIL images of length <code>batch_size</code> or NumPy array of shape <code>(batch_size, height, width, num_channels)</code>.`,name:"rgb"},{anchor:"diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_ldm3d.LDM3DPipelineOutput.depth",description:`<strong>depth</strong> (<code>List[PIL.Image.Image]</code> or <code>np.ndarray</code>) &#x2014;
List of denoised PIL images of length <code>batch_size</code> or NumPy array of shape <code>(batch_size, height, width, num_channels)</code>.`,name:"depth"},{anchor:"diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_ldm3d.LDM3DPipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) &#x2014;
List indicating whether the corresponding generated image contains &#x201C;not-safe-for-work&#x201D; (nsfw) content or
<code>None</code> if safety checking could not be performed.`,name:"nsfw_content_detected"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_ldm3d.py#L60"}}),pe=new C({props:{name:"__call__",anchor:"diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_ldm3d.LDM3DPipelineOutput.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]}}),{c(){m=i("meta"),P=l(),h=i("h1"),_=i("a"),$=i("span"),D(f.$$.fragment),v=l(),N=i("span"),ft=s("Text-to-(RGB, depth)"),We=l(),k=i("p"),ct=s("LDM3D was proposed in "),q=i("a"),ut=s("LDM3D: Latent Diffusion Model for 3D"),mt=s(" by Gabriela Ben Melech Stan, Diana Wofk, Scottie Fox, Alex Redden, Will Saxton, Jean Yu, Estelle Aflalo, Shao-Yen Tseng, Fabio Nonato, Matthias Muller, and Vasudev Lal. LDM3D generates an image and a depth map from a given text prompt unlike the existing text-to-image diffusion models such as "),ue=i("a"),gt=s("Stable Diffusion"),ht=s(" which only generates an image. With almost the same number of parameters, LDM3D achieves to create a latent space that can compress both the RGB images and the depth maps."),Ze=l(),me=i("p"),_t=s("The abstract from the paper is:"),ze=l(),ge=i("p"),X=i("em"),bt=s("This research paper proposes a Latent Diffusion Model for 3D (LDM3D) that generates both image and depth map data from a given text prompt, allowing users to generate RGBD images from text prompts. The LDM3D model is fine-tuned on a dataset of tuples containing an RGB image, depth map and caption, and validated through extensive experiments. We also develop an application called DepthFusion, which uses the generated RGB images and depth maps to create immersive and interactive 360-degree-view experiences using TouchDesigner. This technology has the potential to transform a wide range of industries, from entertainment and gaming to architecture and design. Overall, this paper presents a significant contribution to the field of generative AI and computer vision, and showcases the potential of LDM3D and DepthFusion to revolutionize content creation and digital experiences. A short video summarizing the approach can be found at "),Y=i("a"),vt=s("this url"),Dt=s("."),Je=l(),D(U.$$.fragment),qe=l(),T=i("h2"),G=i("a"),Pe=i("span"),D(Q.$$.fragment),wt=l(),Se=i("span"),yt=s("StableDiffusionLDM3DPipeline"),Xe=l(),c=i("div"),D(H.$$.fragment),Mt=l(),Ee=i("p"),Lt=s("Pipeline for text-to-image and 3D generation using LDM3D."),xt=l(),K=i("p"),$t=s("This model inherits from "),he=i("a"),Pt=s("DiffusionPipeline"),St=s(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Et=l(),ke=i("p"),kt=s("The pipeline also inherits the following loading methods:"),It=l(),S=i("ul"),_e=i("li"),be=i("a"),Tt=s("load_textual_inversion()"),At=s(" for loading textual inversion embeddings"),Ct=l(),ve=i("li"),De=i("a"),Nt=s("load_lora_weights()"),Ut=s(" for loading LoRA weights"),Gt=l(),we=i("li"),ye=i("a"),Ot=s("save_lora_weights()"),Bt=s(" for saving LoRA weights"),Rt=l(),O=i("li"),Me=i("a"),Vt=s("from_single_file()"),jt=s(" for loading "),Ie=i("code"),Ft=s(".ckpt"),Wt=s(" files"),Zt=l(),I=i("div"),D(ee.$$.fragment),zt=l(),Te=i("p"),Jt=s("The call function to the pipeline for generation."),qt=l(),D(B.$$.fragment),Xt=l(),R=i("div"),D(te.$$.fragment),Yt=l(),ne=i("p"),Qt=s("Disable sliced VAE decoding. If "),Ae=i("code"),Ht=s("enable_vae_slicing"),Kt=s(` was previously enabled, this method will go back to
computing decoding in one step.`),en=l(),V=i("div"),D(ie.$$.fragment),tn=l(),oe=i("p"),nn=s("Disable tiled VAE decoding. If "),Ce=i("code"),on=s("enable_vae_tiling"),an=s(` was previously enabled, this method will go back to
computing decoding in one step.`),sn=l(),j=i("div"),D(ae.$$.fragment),rn=l(),Ne=i("p"),ln=s(`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),dn=l(),F=i("div"),D(se.$$.fragment),pn=l(),Ue=i("p"),fn=s(`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),cn=l(),W=i("div"),D(re.$$.fragment),un=l(),Ge=i("p"),mn=s("Encodes the prompt into text encoder hidden states."),Ye=l(),A=i("h2"),Z=i("a"),Oe=i("span"),D(le.$$.fragment),gn=l(),Be=i("span"),hn=s("LDM3DPipelineOutput"),Qe=l(),E=i("div"),D(de.$$.fragment),_n=l(),Re=i("p"),bn=s("Output class for Stable Diffusion pipelines."),vn=l(),z=i("div"),D(pe.$$.fragment),Dn=l(),Ve=i("p"),wn=s("Call self as a function."),this.h()},l(t){const u=oi('[data-svelte="svelte-1phssyn"]',document.head);m=o(u,"META",{name:!0,content:!0}),u.forEach(n),P=d(t),h=o(t,"H1",{class:!0});var fe=a(h);_=o(fe,"A",{id:!0,class:!0,href:!0});var je=a(_);$=o(je,"SPAN",{});var $n=a($);w(f.$$.fragment,$n),$n.forEach(n),je.forEach(n),v=d(fe),N=o(fe,"SPAN",{});var Pn=a(N);ft=r(Pn,"Text-to-(RGB, depth)"),Pn.forEach(n),fe.forEach(n),We=d(t),k=o(t,"P",{});var Le=a(k);ct=r(Le,"LDM3D was proposed in "),q=o(Le,"A",{href:!0,rel:!0});var Sn=a(q);ut=r(Sn,"LDM3D: Latent Diffusion Model for 3D"),Sn.forEach(n),mt=r(Le," by Gabriela Ben Melech Stan, Diana Wofk, Scottie Fox, Alex Redden, Will Saxton, Jean Yu, Estelle Aflalo, Shao-Yen Tseng, Fabio Nonato, Matthias Muller, and Vasudev Lal. LDM3D generates an image and a depth map from a given text prompt unlike the existing text-to-image diffusion models such as "),ue=o(Le,"A",{href:!0});var En=a(ue);gt=r(En,"Stable Diffusion"),En.forEach(n),ht=r(Le," which only generates an image. With almost the same number of parameters, LDM3D achieves to create a latent space that can compress both the RGB images and the depth maps."),Le.forEach(n),Ze=d(t),me=o(t,"P",{});var kn=a(me);_t=r(kn,"The abstract from the paper is:"),kn.forEach(n),ze=d(t),ge=o(t,"P",{});var In=a(ge);X=o(In,"EM",{});var Ke=a(X);bt=r(Ke,"This research paper proposes a Latent Diffusion Model for 3D (LDM3D) that generates both image and depth map data from a given text prompt, allowing users to generate RGBD images from text prompts. The LDM3D model is fine-tuned on a dataset of tuples containing an RGB image, depth map and caption, and validated through extensive experiments. We also develop an application called DepthFusion, which uses the generated RGB images and depth maps to create immersive and interactive 360-degree-view experiences using TouchDesigner. This technology has the potential to transform a wide range of industries, from entertainment and gaming to architecture and design. Overall, this paper presents a significant contribution to the field of generative AI and computer vision, and showcases the potential of LDM3D and DepthFusion to revolutionize content creation and digital experiences. A short video summarizing the approach can be found at "),Y=o(Ke,"A",{href:!0,rel:!0});var Tn=a(Y);vt=r(Tn,"this url"),Tn.forEach(n),Dt=r(Ke,"."),Ke.forEach(n),In.forEach(n),Je=d(t),w(U.$$.fragment,t),qe=d(t),T=o(t,"H2",{class:!0});var et=a(T);G=o(et,"A",{id:!0,class:!0,href:!0});var An=a(G);Pe=o(An,"SPAN",{});var Cn=a(Pe);w(Q.$$.fragment,Cn),Cn.forEach(n),An.forEach(n),wt=d(et),Se=o(et,"SPAN",{});var Nn=a(Se);yt=r(Nn,"StableDiffusionLDM3DPipeline"),Nn.forEach(n),et.forEach(n),Xe=d(t),c=o(t,"DIV",{class:!0});var g=a(c);w(H.$$.fragment,g),Mt=d(g),Ee=o(g,"P",{});var Un=a(Ee);Lt=r(Un,"Pipeline for text-to-image and 3D generation using LDM3D."),Un.forEach(n),xt=d(g),K=o(g,"P",{});var tt=a(K);$t=r(tt,"This model inherits from "),he=o(tt,"A",{href:!0});var Gn=a(he);Pt=r(Gn,"DiffusionPipeline"),Gn.forEach(n),St=r(tt,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),tt.forEach(n),Et=d(g),ke=o(g,"P",{});var On=a(ke);kt=r(On,"The pipeline also inherits the following loading methods:"),On.forEach(n),It=d(g),S=o(g,"UL",{});var J=a(S);_e=o(J,"LI",{});var yn=a(_e);be=o(yn,"A",{href:!0});var Bn=a(be);Tt=r(Bn,"load_textual_inversion()"),Bn.forEach(n),At=r(yn," for loading textual inversion embeddings"),yn.forEach(n),Ct=d(J),ve=o(J,"LI",{});var Mn=a(ve);De=o(Mn,"A",{href:!0});var Rn=a(De);Nt=r(Rn,"load_lora_weights()"),Rn.forEach(n),Ut=r(Mn," for loading LoRA weights"),Mn.forEach(n),Gt=d(J),we=o(J,"LI",{});var Ln=a(we);ye=o(Ln,"A",{href:!0});var Vn=a(ye);Ot=r(Vn,"save_lora_weights()"),Vn.forEach(n),Bt=r(Ln," for saving LoRA weights"),Ln.forEach(n),Rt=d(J),O=o(J,"LI",{});var Fe=a(O);Me=o(Fe,"A",{href:!0});var jn=a(Me);Vt=r(jn,"from_single_file()"),jn.forEach(n),jt=r(Fe," for loading "),Ie=o(Fe,"CODE",{});var Fn=a(Ie);Ft=r(Fn,".ckpt"),Fn.forEach(n),Wt=r(Fe," files"),Fe.forEach(n),J.forEach(n),Zt=d(g),I=o(g,"DIV",{class:!0});var xe=a(I);w(ee.$$.fragment,xe),zt=d(xe),Te=o(xe,"P",{});var Wn=a(Te);Jt=r(Wn,"The call function to the pipeline for generation."),Wn.forEach(n),qt=d(xe),w(B.$$.fragment,xe),xe.forEach(n),Xt=d(g),R=o(g,"DIV",{class:!0});var nt=a(R);w(te.$$.fragment,nt),Yt=d(nt),ne=o(nt,"P",{});var it=a(ne);Qt=r(it,"Disable sliced VAE decoding. If "),Ae=o(it,"CODE",{});var Zn=a(Ae);Ht=r(Zn,"enable_vae_slicing"),Zn.forEach(n),Kt=r(it,` was previously enabled, this method will go back to
computing decoding in one step.`),it.forEach(n),nt.forEach(n),en=d(g),V=o(g,"DIV",{class:!0});var ot=a(V);w(ie.$$.fragment,ot),tn=d(ot),oe=o(ot,"P",{});var at=a(oe);nn=r(at,"Disable tiled VAE decoding. If "),Ce=o(at,"CODE",{});var zn=a(Ce);on=r(zn,"enable_vae_tiling"),zn.forEach(n),an=r(at,` was previously enabled, this method will go back to
computing decoding in one step.`),at.forEach(n),ot.forEach(n),sn=d(g),j=o(g,"DIV",{class:!0});var st=a(j);w(ae.$$.fragment,st),rn=d(st),Ne=o(st,"P",{});var Jn=a(Ne);ln=r(Jn,`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),Jn.forEach(n),st.forEach(n),dn=d(g),F=o(g,"DIV",{class:!0});var rt=a(F);w(se.$$.fragment,rt),pn=d(rt),Ue=o(rt,"P",{});var qn=a(Ue);fn=r(qn,`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),qn.forEach(n),rt.forEach(n),cn=d(g),W=o(g,"DIV",{class:!0});var lt=a(W);w(re.$$.fragment,lt),un=d(lt),Ge=o(lt,"P",{});var Xn=a(Ge);mn=r(Xn,"Encodes the prompt into text encoder hidden states."),Xn.forEach(n),lt.forEach(n),g.forEach(n),Ye=d(t),A=o(t,"H2",{class:!0});var dt=a(A);Z=o(dt,"A",{id:!0,class:!0,href:!0});var Yn=a(Z);Oe=o(Yn,"SPAN",{});var Qn=a(Oe);w(le.$$.fragment,Qn),Qn.forEach(n),Yn.forEach(n),gn=d(dt),Be=o(dt,"SPAN",{});var Hn=a(Be);hn=r(Hn,"LDM3DPipelineOutput"),Hn.forEach(n),dt.forEach(n),Qe=d(t),E=o(t,"DIV",{class:!0});var $e=a(E);w(de.$$.fragment,$e),_n=d($e),Re=o($e,"P",{});var Kn=a(Re);bn=r(Kn,"Output class for Stable Diffusion pipelines."),Kn.forEach(n),vn=d($e),z=o($e,"DIV",{class:!0});var pt=a(z);w(pe.$$.fragment,pt),Dn=d(pt),Ve=o(pt,"P",{});var ei=a(Ve);wn=r(ei,"Call self as a function."),ei.forEach(n),pt.forEach(n),$e.forEach(n),this.h()},h(){p(m,"name","hf:doc:metadata"),p(m,"content",JSON.stringify(ui)),p(_,"id","texttorgb-depth"),p(_,"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(_,"href","#texttorgb-depth"),p(h,"class","relative group"),p(q,"href","https://huggingface.co/papers/2305.10853"),p(q,"rel","nofollow"),p(ue,"href","./stable_diffusion/overview"),p(Y,"href","https://t.ly/tdi2"),p(Y,"rel","nofollow"),p(G,"id","diffusers.StableDiffusionLDM3DPipeline"),p(G,"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(G,"href","#diffusers.StableDiffusionLDM3DPipeline"),p(T,"class","relative group"),p(he,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(be,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion"),p(De,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_lora_weights"),p(ye,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.save_lora_weights"),p(Me,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.from_single_file"),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(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(c,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Z,"id","diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_ldm3d.LDM3DPipelineOutput"),p(Z,"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(Z,"href","#diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_ldm3d.LDM3DPipelineOutput"),p(A,"class","relative group"),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"),p(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,u){e(document.head,m),b(t,P,u),b(t,h,u),e(h,_),e(_,$),y(f,$,null),e(h,v),e(h,N),e(N,ft),b(t,We,u),b(t,k,u),e(k,ct),e(k,q),e(q,ut),e(k,mt),e(k,ue),e(ue,gt),e(k,ht),b(t,Ze,u),b(t,me,u),e(me,_t),b(t,ze,u),b(t,ge,u),e(ge,X),e(X,bt),e(X,Y),e(Y,vt),e(X,Dt),b(t,Je,u),y(U,t,u),b(t,qe,u),b(t,T,u),e(T,G),e(G,Pe),y(Q,Pe,null),e(T,wt),e(T,Se),e(Se,yt),b(t,Xe,u),b(t,c,u),y(H,c,null),e(c,Mt),e(c,Ee),e(Ee,Lt),e(c,xt),e(c,K),e(K,$t),e(K,he),e(he,Pt),e(K,St),e(c,Et),e(c,ke),e(ke,kt),e(c,It),e(c,S),e(S,_e),e(_e,be),e(be,Tt),e(_e,At),e(S,Ct),e(S,ve),e(ve,De),e(De,Nt),e(ve,Ut),e(S,Gt),e(S,we),e(we,ye),e(ye,Ot),e(we,Bt),e(S,Rt),e(S,O),e(O,Me),e(Me,Vt),e(O,jt),e(O,Ie),e(Ie,Ft),e(O,Wt),e(c,Zt),e(c,I),y(ee,I,null),e(I,zt),e(I,Te),e(Te,Jt),e(I,qt),y(B,I,null),e(c,Xt),e(c,R),y(te,R,null),e(R,Yt),e(R,ne),e(ne,Qt),e(ne,Ae),e(Ae,Ht),e(ne,Kt),e(c,en),e(c,V),y(ie,V,null),e(V,tn),e(V,oe),e(oe,nn),e(oe,Ce),e(Ce,on),e(oe,an),e(c,sn),e(c,j),y(ae,j,null),e(j,rn),e(j,Ne),e(Ne,ln),e(c,dn),e(c,F),y(se,F,null),e(F,pn),e(F,Ue),e(Ue,fn),e(c,cn),e(c,W),y(re,W,null),e(W,un),e(W,Ge),e(Ge,mn),b(t,Ye,u),b(t,A,u),e(A,Z),e(Z,Oe),y(le,Oe,null),e(A,gn),e(A,Be),e(Be,hn),b(t,Qe,u),b(t,E,u),y(de,E,null),e(E,_n),e(E,Re),e(Re,bn),e(E,vn),e(E,z),y(pe,z,null),e(z,Dn),e(z,Ve),e(Ve,wn),He=!0},p(t,[u]){const fe={};u&2&&(fe.$$scope={dirty:u,ctx:t}),U.$set(fe);const je={};u&2&&(je.$$scope={dirty:u,ctx:t}),B.$set(je)},i(t){He||(M(f.$$.fragment,t),M(U.$$.fragment,t),M(Q.$$.fragment,t),M(H.$$.fragment,t),M(ee.$$.fragment,t),M(B.$$.fragment,t),M(te.$$.fragment,t),M(ie.$$.fragment,t),M(ae.$$.fragment,t),M(se.$$.fragment,t),M(re.$$.fragment,t),M(le.$$.fragment,t),M(de.$$.fragment,t),M(pe.$$.fragment,t),He=!0)},o(t){L(f.$$.fragment,t),L(U.$$.fragment,t),L(Q.$$.fragment,t),L(H.$$.fragment,t),L(ee.$$.fragment,t),L(B.$$.fragment,t),L(te.$$.fragment,t),L(ie.$$.fragment,t),L(ae.$$.fragment,t),L(se.$$.fragment,t),L(re.$$.fragment,t),L(le.$$.fragment,t),L(de.$$.fragment,t),L(pe.$$.fragment,t),He=!1},d(t){n(m),t&&n(P),t&&n(h),x(f),t&&n(We),t&&n(k),t&&n(Ze),t&&n(me),t&&n(ze),t&&n(ge),t&&n(Je),x(U,t),t&&n(qe),t&&n(T),x(Q),t&&n(Xe),t&&n(c),x(H),x(ee),x(B),x(te),x(ie),x(ae),x(se),x(re),t&&n(Ye),t&&n(A),x(le),t&&n(Qe),t&&n(E),x(de),x(pe)}}}const ui={local:"texttorgb-depth",sections:[{local:"diffusers.StableDiffusionLDM3DPipeline",title:"StableDiffusionLDM3DPipeline"},{local:"diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_ldm3d.LDM3DPipelineOutput",title:"LDM3DPipelineOutput"}],title:"Text-to-(RGB, depth)"};function mi(ce){return ai(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class wi extends ti{constructor(m){super();ni(this,m,mi,ci,ii,{})}}export{wi as default,ui as metadata};
