import{S as ui,i as mi,s as hi,e as i,k as l,w as D,t as s,M as gi,c as o,d as n,m as d,a,x as w,h as r,b as f,G as e,g as b,y,q as $,o as M,B as x,v as _i,L as bi}from"../../../../chunks/vendor-hf-doc-builder.js";import{T as vi}from"../../../../chunks/Tip-hf-doc-builder.js";import{D as G}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as Di}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Gn}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as wi}from"../../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function yi(me){let m,L,g,_,P;return{c(){m=i("p"),L=s("Make sure to check out the Stable Diffusion "),g=i("a"),_=s("Tips"),P=s(" section to learn how to explore the tradeoff between scheduler speed and quality, and how to reuse pipeline components efficiently!"),this.h()},l(p){m=o(p,"P",{});var v=a(m);L=r(v,"Make sure to check out the Stable Diffusion "),g=o(v,"A",{href:!0});var N=a(g);_=r(N,"Tips"),N.forEach(n),P=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(){f(g,"href","overview#tips")},m(p,v){b(p,m,v),e(m,L),e(m,g),e(g,_),e(m,P)},d(p){p&&n(m)}}}function $i(me){let m,L,g,_,P;return _=new Di({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uTERNM0RQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIySW50ZWwlMkZsZG0zZCUyMiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMmElMjBwaG90byUyMG9mJTIwYW4lMjBhc3Ryb25hdXQlMjByaWRpbmclMjBhJTIwaG9yc2UlMjBvbiUyMG1hcnMlMjIlMEFvdXRwdXQlMjAlM0QlMjBwaXBlKHByb21wdCklMEFyZ2JfaW1hZ2UlMkMlMjBkZXB0aF9pbWFnZSUyMCUzRCUyMG91dHB1dC5yZ2IlMkMlMjBvdXRwdXQuZGVwdGglMEFyZ2JfaW1hZ2UlNUIwJTVELnNhdmUoJTIyYXN0cm9uYXV0X2xkbTNkX3JnYi5qcGclMjIpJTBBZGVwdGhfaW1hZ2UlNUIwJTVELnNhdmUoJTIyYXN0cm9uYXV0X2xkbTNkX2RlcHRoLnBuZyUyMik=",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> StableDiffusionPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionLDM3DPipeline.from_pretrained(<span class="hljs-string">&quot;Intel/ldm3d&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"),L=s("Examples:"),g=l(),D(_.$$.fragment)},l(p){m=o(p,"P",{});var v=a(m);L=r(v,"Examples:"),v.forEach(n),g=d(p),w(_.$$.fragment,p)},m(p,v){b(p,m,v),e(m,L),b(p,g,v),y(_,p,v),P=!0},p:bi,i(p){P||($(_.$$.fragment,p),P=!0)},o(p){M(_.$$.fragment,p),P=!1},d(p){p&&n(m),p&&n(g),x(_,p)}}}function Mi(me){let m,L,g,_,P,p,v,N,ht,qe,T,gt,Y,_t,bt,he,vt,Dt,Xe,ge,wt,Ye,_e,Q,yt,H,$t,Mt,Qe,U,He,A,O,Ee,K,xt,ke,Pt,Ke,c,ee,Lt,Te,St,Et,te,kt,be,Tt,It,At,Ie,Ct,Gt,S,ve,De,Nt,Ut,Ot,we,ye,Bt,Rt,Vt,$e,Me,jt,Jt,Wt,B,xe,zt,Ft,Ae,Zt,qt,Xt,I,ne,Yt,Ce,Qt,Ht,R,Kt,V,ie,en,oe,tn,Ge,nn,on,an,j,ae,sn,se,rn,Ne,ln,dn,fn,J,re,pn,E,cn,Ue,un,mn,Oe,hn,gn,Be,_n,bn,vn,W,le,Dn,Re,wn,yn,z,de,$n,Ve,Mn,et,C,F,je,fe,xn,Je,Pn,tt,k,pe,Ln,We,Sn,En,Z,ce,kn,ze,Tn,nt;return p=new Gn({}),U=new vi({props:{$$slots:{default:[yi]},$$scope:{ctx:me}}}),K=new Gn({}),ee=new G({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.19.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> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIPTextModel</a>) &#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> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionLDM3DPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.19.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.19.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.19.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.19.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.19.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> (<a href="https://huggingface.co/docs/transformers/v4.31.0/en/model_doc/clip#transformers.CLIPImageProcessor" rel="nofollow">CLIPImageProcessor</a>) &#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.19.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_ldm3d.py#L79"}}),ne=new G({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[typing.List[str], 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.19.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.19.0/en/api/pipelines/stable_diffusion/inpaint#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/cross_attention.py" rel="nofollow"><code>self.processor</code></a>.`,name:"cross_attention_kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_ldm3d.py#L472",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#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.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),R=new wi({props:{anchor:"diffusers.StableDiffusionLDM3DPipeline.__call__.example",$$slots:{default:[$i]},$$scope:{ctx:me}}}),ie=new G({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionLDM3DPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_ldm3d.py#L166"}}),ae=new G({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionLDM3DPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_ldm3d.py#L183"}}),re=new G({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionLDM3DPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_ldm3d.py#L191"}}),le=new G({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionLDM3DPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_ldm3d.py#L158"}}),de=new G({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionLDM3DPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_ldm3d.py#L174"}}),fe=new Gn({}),pe=new G({props:{name:"class diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",parameters:[{name:"images",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.StableDiffusionPipelineOutput.images",description:`<strong>images</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:"images"},{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.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.19.0/src/diffusers/pipelines/stable_diffusion/__init__.py#L22"}}),ce=new G({props:{name:"__call__",anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]}}),{c(){m=i("meta"),L=l(),g=i("h1"),_=i("a"),P=i("span"),D(p.$$.fragment),v=l(),N=i("span"),ht=s("Text-to-(RGB, depth)"),qe=l(),T=i("p"),gt=s("LDM3D was proposed in "),Y=i("a"),_t=s("LDM3D: Latent Diffusion Model for 3D"),bt=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 "),he=i("a"),vt=s("Stable Diffusion"),Dt=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."),Xe=l(),ge=i("p"),wt=s("The abstract from the paper is:"),Ye=l(),_e=i("p"),Q=i("em"),yt=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 "),H=i("a"),$t=s("this url"),Mt=s("."),Qe=l(),D(U.$$.fragment),He=l(),A=i("h2"),O=i("a"),Ee=i("span"),D(K.$$.fragment),xt=l(),ke=i("span"),Pt=s("StableDiffusionLDM3DPipeline"),Ke=l(),c=i("div"),D(ee.$$.fragment),Lt=l(),Te=i("p"),St=s("Pipeline for text-to-image and 3D generation using LDM3D."),Et=l(),te=i("p"),kt=s("This model inherits from "),be=i("a"),Tt=s("DiffusionPipeline"),It=s(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),At=l(),Ie=i("p"),Ct=s("The pipeline also inherits the following loading methods:"),Gt=l(),S=i("ul"),ve=i("li"),De=i("a"),Nt=s("load_textual_inversion()"),Ut=s(" for loading textual inversion embeddings"),Ot=l(),we=i("li"),ye=i("a"),Bt=s("load_lora_weights()"),Rt=s(" for loading LoRA weights"),Vt=l(),$e=i("li"),Me=i("a"),jt=s("save_lora_weights()"),Jt=s(" for saving LoRA weights"),Wt=l(),B=i("li"),xe=i("a"),zt=s("from_single_file()"),Ft=s(" for loading "),Ae=i("code"),Zt=s(".ckpt"),qt=s(" files"),Xt=l(),I=i("div"),D(ne.$$.fragment),Yt=l(),Ce=i("p"),Qt=s("The call function to the pipeline for generation."),Ht=l(),D(R.$$.fragment),Kt=l(),V=i("div"),D(ie.$$.fragment),en=l(),oe=i("p"),tn=s("Disable sliced VAE decoding. If "),Ge=i("code"),nn=s("enable_vae_slicing"),on=s(` was previously enabled, this method will go back to
computing decoding in one step.`),an=l(),j=i("div"),D(ae.$$.fragment),sn=l(),se=i("p"),rn=s("Disable tiled VAE decoding. If "),Ne=i("code"),ln=s("enable_vae_tiling"),dn=s(` was previously enabled, this method will go back to
computing decoding in one step.`),fn=l(),J=i("div"),D(re.$$.fragment),pn=l(),E=i("p"),cn=s(`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),Ue=i("code"),un=s("forward"),mn=s(` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),Oe=i("code"),hn=s("enable_sequential_cpu_offload"),gn=s(`, but performance is much better due to the
iterative execution of the `),Be=i("code"),_n=s("unet"),bn=s("."),vn=l(),W=i("div"),D(le.$$.fragment),Dn=l(),Re=i("p"),wn=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.`),yn=l(),z=i("div"),D(de.$$.fragment),$n=l(),Ve=i("p"),Mn=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.`),et=l(),C=i("h2"),F=i("a"),je=i("span"),D(fe.$$.fragment),xn=l(),Je=i("span"),Pn=s("StableDiffusionPipelineOutput"),tt=l(),k=i("div"),D(pe.$$.fragment),Ln=l(),We=i("p"),Sn=s("Output class for Stable Diffusion pipelines."),En=l(),Z=i("div"),D(ce.$$.fragment),kn=l(),ze=i("p"),Tn=s("Call self as a function."),this.h()},l(t){const u=gi('[data-svelte="svelte-1phssyn"]',document.head);m=o(u,"META",{name:!0,content:!0}),u.forEach(n),L=d(t),g=o(t,"H1",{class:!0});var ue=a(g);_=o(ue,"A",{id:!0,class:!0,href:!0});var Fe=a(_);P=o(Fe,"SPAN",{});var Nn=a(P);w(p.$$.fragment,Nn),Nn.forEach(n),Fe.forEach(n),v=d(ue),N=o(ue,"SPAN",{});var Un=a(N);ht=r(Un,"Text-to-(RGB, depth)"),Un.forEach(n),ue.forEach(n),qe=d(t),T=o(t,"P",{});var Pe=a(T);gt=r(Pe,"LDM3D was proposed in "),Y=o(Pe,"A",{href:!0,rel:!0});var On=a(Y);_t=r(On,"LDM3D: Latent Diffusion Model for 3D"),On.forEach(n),bt=r(Pe," 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 "),he=o(Pe,"A",{href:!0});var Bn=a(he);vt=r(Bn,"Stable Diffusion"),Bn.forEach(n),Dt=r(Pe," 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."),Pe.forEach(n),Xe=d(t),ge=o(t,"P",{});var Rn=a(ge);wt=r(Rn,"The abstract from the paper is:"),Rn.forEach(n),Ye=d(t),_e=o(t,"P",{});var Vn=a(_e);Q=o(Vn,"EM",{});var it=a(Q);yt=r(it,"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 "),H=o(it,"A",{href:!0,rel:!0});var jn=a(H);$t=r(jn,"this url"),jn.forEach(n),Mt=r(it,"."),it.forEach(n),Vn.forEach(n),Qe=d(t),w(U.$$.fragment,t),He=d(t),A=o(t,"H2",{class:!0});var ot=a(A);O=o(ot,"A",{id:!0,class:!0,href:!0});var Jn=a(O);Ee=o(Jn,"SPAN",{});var Wn=a(Ee);w(K.$$.fragment,Wn),Wn.forEach(n),Jn.forEach(n),xt=d(ot),ke=o(ot,"SPAN",{});var zn=a(ke);Pt=r(zn,"StableDiffusionLDM3DPipeline"),zn.forEach(n),ot.forEach(n),Ke=d(t),c=o(t,"DIV",{class:!0});var h=a(c);w(ee.$$.fragment,h),Lt=d(h),Te=o(h,"P",{});var Fn=a(Te);St=r(Fn,"Pipeline for text-to-image and 3D generation using LDM3D."),Fn.forEach(n),Et=d(h),te=o(h,"P",{});var at=a(te);kt=r(at,"This model inherits from "),be=o(at,"A",{href:!0});var Zn=a(be);Tt=r(Zn,"DiffusionPipeline"),Zn.forEach(n),It=r(at,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),at.forEach(n),At=d(h),Ie=o(h,"P",{});var qn=a(Ie);Ct=r(qn,"The pipeline also inherits the following loading methods:"),qn.forEach(n),Gt=d(h),S=o(h,"UL",{});var q=a(S);ve=o(q,"LI",{});var In=a(ve);De=o(In,"A",{href:!0});var Xn=a(De);Nt=r(Xn,"load_textual_inversion()"),Xn.forEach(n),Ut=r(In," for loading textual inversion embeddings"),In.forEach(n),Ot=d(q),we=o(q,"LI",{});var An=a(we);ye=o(An,"A",{href:!0});var Yn=a(ye);Bt=r(Yn,"load_lora_weights()"),Yn.forEach(n),Rt=r(An," for loading LoRA weights"),An.forEach(n),Vt=d(q),$e=o(q,"LI",{});var Cn=a($e);Me=o(Cn,"A",{href:!0});var Qn=a(Me);jt=r(Qn,"save_lora_weights()"),Qn.forEach(n),Jt=r(Cn," for saving LoRA weights"),Cn.forEach(n),Wt=d(q),B=o(q,"LI",{});var Ze=a(B);xe=o(Ze,"A",{href:!0});var Hn=a(xe);zt=r(Hn,"from_single_file()"),Hn.forEach(n),Ft=r(Ze," for loading "),Ae=o(Ze,"CODE",{});var Kn=a(Ae);Zt=r(Kn,".ckpt"),Kn.forEach(n),qt=r(Ze," files"),Ze.forEach(n),q.forEach(n),Xt=d(h),I=o(h,"DIV",{class:!0});var Le=a(I);w(ne.$$.fragment,Le),Yt=d(Le),Ce=o(Le,"P",{});var ei=a(Ce);Qt=r(ei,"The call function to the pipeline for generation."),ei.forEach(n),Ht=d(Le),w(R.$$.fragment,Le),Le.forEach(n),Kt=d(h),V=o(h,"DIV",{class:!0});var st=a(V);w(ie.$$.fragment,st),en=d(st),oe=o(st,"P",{});var rt=a(oe);tn=r(rt,"Disable sliced VAE decoding. If "),Ge=o(rt,"CODE",{});var ti=a(Ge);nn=r(ti,"enable_vae_slicing"),ti.forEach(n),on=r(rt,` was previously enabled, this method will go back to
computing decoding in one step.`),rt.forEach(n),st.forEach(n),an=d(h),j=o(h,"DIV",{class:!0});var lt=a(j);w(ae.$$.fragment,lt),sn=d(lt),se=o(lt,"P",{});var dt=a(se);rn=r(dt,"Disable tiled VAE decoding. If "),Ne=o(dt,"CODE",{});var ni=a(Ne);ln=r(ni,"enable_vae_tiling"),ni.forEach(n),dn=r(dt,` was previously enabled, this method will go back to
computing decoding in one step.`),dt.forEach(n),lt.forEach(n),fn=d(h),J=o(h,"DIV",{class:!0});var ft=a(J);w(re.$$.fragment,ft),pn=d(ft),E=o(ft,"P",{});var X=a(E);cn=r(X,`Offload all models to CPU to reduce memory usage with a low impact on performance. Moves one whole model at a
time to the GPU when its `),Ue=o(X,"CODE",{});var ii=a(Ue);un=r(ii,"forward"),ii.forEach(n),mn=r(X,` method is called, and the model remains in GPU until the next model runs.
Memory savings are lower than using `),Oe=o(X,"CODE",{});var oi=a(Oe);hn=r(oi,"enable_sequential_cpu_offload"),oi.forEach(n),gn=r(X,`, but performance is much better due to the
iterative execution of the `),Be=o(X,"CODE",{});var ai=a(Be);_n=r(ai,"unet"),ai.forEach(n),bn=r(X,"."),X.forEach(n),ft.forEach(n),vn=d(h),W=o(h,"DIV",{class:!0});var pt=a(W);w(le.$$.fragment,pt),Dn=d(pt),Re=o(pt,"P",{});var si=a(Re);wn=r(si,`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.`),si.forEach(n),pt.forEach(n),yn=d(h),z=o(h,"DIV",{class:!0});var ct=a(z);w(de.$$.fragment,ct),$n=d(ct),Ve=o(ct,"P",{});var ri=a(Ve);Mn=r(ri,`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.`),ri.forEach(n),ct.forEach(n),h.forEach(n),et=d(t),C=o(t,"H2",{class:!0});var ut=a(C);F=o(ut,"A",{id:!0,class:!0,href:!0});var li=a(F);je=o(li,"SPAN",{});var di=a(je);w(fe.$$.fragment,di),di.forEach(n),li.forEach(n),xn=d(ut),Je=o(ut,"SPAN",{});var fi=a(Je);Pn=r(fi,"StableDiffusionPipelineOutput"),fi.forEach(n),ut.forEach(n),tt=d(t),k=o(t,"DIV",{class:!0});var Se=a(k);w(pe.$$.fragment,Se),Ln=d(Se),We=o(Se,"P",{});var pi=a(We);Sn=r(pi,"Output class for Stable Diffusion pipelines."),pi.forEach(n),En=d(Se),Z=o(Se,"DIV",{class:!0});var mt=a(Z);w(ce.$$.fragment,mt),kn=d(mt),ze=o(mt,"P",{});var ci=a(ze);Tn=r(ci,"Call self as a function."),ci.forEach(n),mt.forEach(n),Se.forEach(n),this.h()},h(){f(m,"name","hf:doc:metadata"),f(m,"content",JSON.stringify(xi)),f(_,"id","texttorgb-depth"),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"),f(_,"href","#texttorgb-depth"),f(g,"class","relative group"),f(Y,"href","https://huggingface.co/papers/2305.10853"),f(Y,"rel","nofollow"),f(he,"href","./stable_diffusion/overview"),f(H,"href","https://t.ly/tdi2"),f(H,"rel","nofollow"),f(O,"id","diffusers.StableDiffusionLDM3DPipeline"),f(O,"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"),f(O,"href","#diffusers.StableDiffusionLDM3DPipeline"),f(A,"class","relative group"),f(be,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),f(De,"href","/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.load_textual_inversion"),f(ye,"href","/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.load_lora_weights"),f(Me,"href","/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.save_lora_weights"),f(xe,"href","/docs/diffusers/v0.19.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.from_single_file"),f(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(c,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(F,"id","diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),f(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"),f(F,"href","#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),f(C,"class","relative group"),f(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(k,"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,L,u),b(t,g,u),e(g,_),e(_,P),y(p,P,null),e(g,v),e(g,N),e(N,ht),b(t,qe,u),b(t,T,u),e(T,gt),e(T,Y),e(Y,_t),e(T,bt),e(T,he),e(he,vt),e(T,Dt),b(t,Xe,u),b(t,ge,u),e(ge,wt),b(t,Ye,u),b(t,_e,u),e(_e,Q),e(Q,yt),e(Q,H),e(H,$t),e(Q,Mt),b(t,Qe,u),y(U,t,u),b(t,He,u),b(t,A,u),e(A,O),e(O,Ee),y(K,Ee,null),e(A,xt),e(A,ke),e(ke,Pt),b(t,Ke,u),b(t,c,u),y(ee,c,null),e(c,Lt),e(c,Te),e(Te,St),e(c,Et),e(c,te),e(te,kt),e(te,be),e(be,Tt),e(te,It),e(c,At),e(c,Ie),e(Ie,Ct),e(c,Gt),e(c,S),e(S,ve),e(ve,De),e(De,Nt),e(ve,Ut),e(S,Ot),e(S,we),e(we,ye),e(ye,Bt),e(we,Rt),e(S,Vt),e(S,$e),e($e,Me),e(Me,jt),e($e,Jt),e(S,Wt),e(S,B),e(B,xe),e(xe,zt),e(B,Ft),e(B,Ae),e(Ae,Zt),e(B,qt),e(c,Xt),e(c,I),y(ne,I,null),e(I,Yt),e(I,Ce),e(Ce,Qt),e(I,Ht),y(R,I,null),e(c,Kt),e(c,V),y(ie,V,null),e(V,en),e(V,oe),e(oe,tn),e(oe,Ge),e(Ge,nn),e(oe,on),e(c,an),e(c,j),y(ae,j,null),e(j,sn),e(j,se),e(se,rn),e(se,Ne),e(Ne,ln),e(se,dn),e(c,fn),e(c,J),y(re,J,null),e(J,pn),e(J,E),e(E,cn),e(E,Ue),e(Ue,un),e(E,mn),e(E,Oe),e(Oe,hn),e(E,gn),e(E,Be),e(Be,_n),e(E,bn),e(c,vn),e(c,W),y(le,W,null),e(W,Dn),e(W,Re),e(Re,wn),e(c,yn),e(c,z),y(de,z,null),e(z,$n),e(z,Ve),e(Ve,Mn),b(t,et,u),b(t,C,u),e(C,F),e(F,je),y(fe,je,null),e(C,xn),e(C,Je),e(Je,Pn),b(t,tt,u),b(t,k,u),y(pe,k,null),e(k,Ln),e(k,We),e(We,Sn),e(k,En),e(k,Z),y(ce,Z,null),e(Z,kn),e(Z,ze),e(ze,Tn),nt=!0},p(t,[u]){const ue={};u&2&&(ue.$$scope={dirty:u,ctx:t}),U.$set(ue);const Fe={};u&2&&(Fe.$$scope={dirty:u,ctx:t}),R.$set(Fe)},i(t){nt||($(p.$$.fragment,t),$(U.$$.fragment,t),$(K.$$.fragment,t),$(ee.$$.fragment,t),$(ne.$$.fragment,t),$(R.$$.fragment,t),$(ie.$$.fragment,t),$(ae.$$.fragment,t),$(re.$$.fragment,t),$(le.$$.fragment,t),$(de.$$.fragment,t),$(fe.$$.fragment,t),$(pe.$$.fragment,t),$(ce.$$.fragment,t),nt=!0)},o(t){M(p.$$.fragment,t),M(U.$$.fragment,t),M(K.$$.fragment,t),M(ee.$$.fragment,t),M(ne.$$.fragment,t),M(R.$$.fragment,t),M(ie.$$.fragment,t),M(ae.$$.fragment,t),M(re.$$.fragment,t),M(le.$$.fragment,t),M(de.$$.fragment,t),M(fe.$$.fragment,t),M(pe.$$.fragment,t),M(ce.$$.fragment,t),nt=!1},d(t){n(m),t&&n(L),t&&n(g),x(p),t&&n(qe),t&&n(T),t&&n(Xe),t&&n(ge),t&&n(Ye),t&&n(_e),t&&n(Qe),x(U,t),t&&n(He),t&&n(A),x(K),t&&n(Ke),t&&n(c),x(ee),x(ne),x(R),x(ie),x(ae),x(re),x(le),x(de),t&&n(et),t&&n(C),x(fe),t&&n(tt),t&&n(k),x(pe),x(ce)}}}const xi={local:"texttorgb-depth",sections:[{local:"diffusers.StableDiffusionLDM3DPipeline",title:"StableDiffusionLDM3DPipeline"},{local:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",title:"StableDiffusionPipelineOutput"}],title:"Text-to-(RGB, depth)"};function Pi(me){return _i(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ai extends ui{constructor(m){super();mi(this,m,Pi,Mi,hi,{})}}export{Ai as default,xi as metadata};
