import{S as Za,i as Va,s as ja,e as i,k as c,w as $,t as s,M as Fa,c as n,d as a,m as f,a as o,x as k,h as r,b as p,N as Oa,G as t,g as d,y as S,q as x,o as M,B as E,v as Ja,L as Ba}from"../../../chunks/vendor-hf-doc-builder.js";import{T as Ra}from"../../../chunks/Tip-hf-doc-builder.js";import{D as Ne}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as Wa}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as pt}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as qa}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ya(ce){let m,P,h,g,b,u,v,U;return{c(){m=i("p"),P=s("Make sure to check out the Schedulers "),h=i("a"),g=s("guide"),b=s(" to learn how to explore the tradeoff between scheduler speed and quality, and see the "),u=i("a"),v=s("reuse components across pipelines"),U=s(" section to learn how to efficiently load the same components into multiple pipelines."),this.h()},l(L){m=n(L,"P",{});var w=o(m);P=r(w,"Make sure to check out the Schedulers "),h=n(w,"A",{href:!0});var T=o(h);g=r(T,"guide"),T.forEach(a),b=r(w," to learn how to explore the tradeoff between scheduler speed and quality, and see the "),u=n(w,"A",{href:!0});var I=o(u);v=r(I,"reuse components across pipelines"),I.forEach(a),U=r(w," section to learn how to efficiently load the same components into multiple pipelines."),w.forEach(a),this.h()},h(){p(h,"href","/using-diffusers/schedulers"),p(u,"href","/using-diffusers/loading#reuse-components-across-pipelines")},m(L,w){d(L,m,w),t(m,P),t(m,h),t(h,g),t(m,b),t(m,u),t(u,v),t(m,U)},d(L){L&&a(m)}}}function Ha(ce){let m,P,h,g,b;return g=new Wa({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGFub3JhbWFQaXBlbGluZSUyQyUyMERESU1TY2hlZHVsZXIlMEElMEFtb2RlbF9ja3B0JTIwJTNEJTIwJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItYmFzZSUyMiUwQXNjaGVkdWxlciUyMCUzRCUyMERESU1TY2hlZHVsZXIuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2NrcHQlMkMlMjBzdWJmb2xkZXIlM0QlMjJzY2hlZHVsZXIlMjIpJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBhbm9yYW1hUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMG1vZGVsX2NrcHQlMkMlMjBzY2hlZHVsZXIlM0RzY2hlZHVsZXIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTBBJTBBcGlwZSUyMCUzRCUyMHBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMHRoZSUyMGRvbG9taXRlcyUyMiUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",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> StableDiffusionPanoramaPipeline, DDIMScheduler

<span class="hljs-meta">&gt;&gt;&gt; </span>model_ckpt = <span class="hljs-string">&quot;stabilityai/stable-diffusion-2-base&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>scheduler = DDIMScheduler.from_pretrained(model_ckpt, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionPanoramaPipeline.from_pretrained(
<span class="hljs-meta">... </span>    model_ckpt, scheduler=scheduler, torch_dtype=torch.float16
<span class="hljs-meta">... </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 the dolomites&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`}}),{c(){m=i("p"),P=s("Examples:"),h=c(),$(g.$$.fragment)},l(u){m=n(u,"P",{});var v=o(m);P=r(v,"Examples:"),v.forEach(a),h=f(u),k(g.$$.fragment,u)},m(u,v){d(u,m,v),t(m,P),d(u,h,v),S(g,u,v),b=!0},p:Ba,i(u){b||(x(g.$$.fragment,u),b=!0)},o(u){M(g.$$.fragment,u),b=!1},d(u){u&&a(m),u&&a(h),E(g,u)}}}function Qa(ce){let m,P,h,g,b,u,v,U,L,w,T,I,dt,ct,Oe,fe,ft,Ze,ue,Pe,ut,Ve,y,mt,H,ht,gt,Q,_t,bt,X,vt,wt,je,G,V,ye,K,Pt,De,yt,Fe,C,Dt,me,$t,kt,$e,St,xt,Je,he,Mt,Be,j,Et,ke,Tt,It,Re,ee,Ct,ge,la,We,z,At,Se,Ut,Lt,_e,pa,qe,F,Ye,N,J,xe,te,Gt,Me,zt,He,_,ae,Nt,Ee,Ot,Zt,ie,Vt,be,jt,Ft,Jt,A,ne,Bt,Te,Rt,Wt,B,qt,R,oe,Yt,se,Ht,Ie,Qt,Xt,Kt,W,re,ea,Ce,ta,Qe,O,q,Ae,le,aa,Ue,ia,Xe,Z,pe,na,Le,oa,Ke;return u=new pt({}),K=new pt({}),F=new Ra({props:{$$slots:{default:[Ya]},$$scope:{ctx:ce}}}),te=new pt({}),ae=new Ne({props:{name:"class diffusers.StableDiffusionPanoramaPipeline",anchor:"diffusers.StableDiffusionPanoramaPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDIMScheduler"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionPanoramaPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.20.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.StableDiffusionPanoramaPipeline.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.StableDiffusionPanoramaPipeline.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.StableDiffusionPanoramaPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.20.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.StableDiffusionPanoramaPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.20.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.20.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.20.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.20.0/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionPanoramaPipeline.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.StableDiffusionPanoramaPipeline.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.20.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_panorama.py#L54"}}),ne=new Ne({props:{name:"__call__",anchor:"diffusers.StableDiffusionPanoramaPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"height",val:": typing.Optional[int] = 512"},{name:"width",val:": typing.Optional[int] = 2048"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"view_batch_size",val:": int = 1"},{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:": typing.Optional[int] = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"circular_padding",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.StableDiffusionPanoramaPipeline.__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.StableDiffusionPanoramaPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionPanoramaPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to 2048) &#x2014;
The width in pixels of the generated image. The width is kept high because the pipeline is supposed
generate panorama-like images.`,name:"width"},{anchor:"diffusers.StableDiffusionPanoramaPipeline.__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.StableDiffusionPanoramaPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#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.StableDiffusionPanoramaPipeline.__call__.view_batch_size",description:`<strong>view_batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The batch size to denoise split views. For some GPUs with high performance, higher view batch size can
speedup the generation and increase the VRAM usage.`,name:"view_batch_size"},{anchor:"diffusers.StableDiffusionPanoramaPipeline.__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.StableDiffusionPanoramaPipeline.__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.StableDiffusionPanoramaPipeline.__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.20.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,name:"eta"},{anchor:"diffusers.StableDiffusionPanoramaPipeline.__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.StableDiffusionPanoramaPipeline.__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.StableDiffusionPanoramaPipeline.__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.StableDiffusionPanoramaPipeline.__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.StableDiffusionPanoramaPipeline.__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.StableDiffusionPanoramaPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.20.0/en/api/pipelines/stable_diffusion/upscale#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionPanoramaPipeline.__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.StableDiffusionPanoramaPipeline.__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.StableDiffusionPanoramaPipeline.__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 under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionPanoramaPipeline.__call__.circular_padding",description:`<strong>circular_padding</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If set to <code>True</code>, circular padding is applied to ensure there are no stitching artifacts. Circular
padding allows the model to seamlessly generate a transition from the rightmost part of the image to
the leftmost part, maintaining consistency in a 360-degree sense.`,name:"circular_padding"}],source:"https://github.com/huggingface/diffusers/blob/v0.20.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_panorama.py#L448",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.20.0/en/api/pipelines/stable_diffusion/upscale#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.20.0/en/api/pipelines/stable_diffusion/upscale#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),B=new qa({props:{anchor:"diffusers.StableDiffusionPanoramaPipeline.__call__.example",$$slots:{default:[Ha]},$$scope:{ctx:ce}}}),oe=new Ne({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionPanoramaPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.20.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_panorama.py#L133"}}),re=new Ne({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionPanoramaPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.20.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_panorama.py#L125"}}),le=new pt({}),pe=new Ne({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.20.0/src/diffusers/pipelines/stable_diffusion/__init__.py#L22"}}),{c(){m=i("meta"),P=c(),h=i("h1"),g=i("a"),b=i("span"),$(u.$$.fragment),v=c(),U=i("span"),L=s("MultiDiffusion"),w=c(),T=i("p"),I=i("a"),dt=s("MultiDiffusion: Fusing Diffusion Paths for Controlled Image Generation"),ct=s(" is by Omer Bar-Tal, Lior Yariv, Yaron Lipman, and Tali Dekel."),Oe=c(),fe=i("p"),ft=s("The abstract from the paper is:"),Ze=c(),ue=i("p"),Pe=i("em"),ut=s("Recent advances in text-to-image generation with diffusion models present transformative capabilities in image quality. However, user controllability of the generated image, and fast adaptation to new tasks still remains an open challenge, currently mostly addressed by costly and long re-training and fine-tuning or ad-hoc adaptations to specific image generation tasks. In this work, we present MultiDiffusion, a unified framework that enables versatile and controllable image generation, using a pre-trained text-to-image diffusion model, without any further training or finetuning. At the center of our approach is a new generation process, based on an optimization task that binds together multiple diffusion generation processes with a shared set of parameters or constraints. We show that MultiDiffusion can be readily applied to generate high quality and diverse images that adhere to user-provided controls, such as desired aspect ratio (e.g., panorama), and spatial guiding signals, ranging from tight segmentation masks to bounding boxes."),Ve=c(),y=i("p"),mt=s("You can find additional information about MultiDiffusion on the "),H=i("a"),ht=s("project page"),gt=s(", "),Q=i("a"),_t=s("original codebase"),bt=s(", and try it out in a "),X=i("a"),vt=s("demo"),wt=s("."),je=c(),G=i("h2"),V=i("a"),ye=i("span"),$(K.$$.fragment),Pt=c(),De=i("span"),yt=s("Tips"),Fe=c(),C=i("p"),Dt=s("While calling "),me=i("a"),$t=s("StableDiffusionPanoramaPipeline"),kt=s(", it\u2019s possible to specify the "),$e=i("code"),St=s("view_batch_size"),xt=s(` parameter to be > 1.
For some GPUs with high performance, this can speedup the generation process and increase VRAM usage.`),Je=c(),he=i("p"),Mt=s("To generate panorama-like images make sure you pass the width parameter accordingly. We recommend a width value of 2048 which is the default."),Be=c(),j=i("p"),Et=s(`Circular padding is applied to ensure there are no stitching artifacts when working with
panoramas to ensure a seamless transition from the rightmost part to the leftmost part.
By enabling circular padding (set `),ke=i("code"),Tt=s("circular_padding=True"),It=s(`), the operation applies additional
crops after the rightmost point of the image, allowing the model to \u201Csee\u201D the transition
from the rightmost part to the leftmost part. This helps maintain visual consistency in
a 360-degree sense and creates a proper \u201Cpanorama\u201D that can be viewed using 360-degree
panorama viewers. When decoding latents in Stable Diffusion, circular padding is applied
to ensure that the decoded latents match in the RGB space.`),Re=c(),ee=i("p"),Ct=s(`For example, without circular padding, there is a stitching artifact (default):
`),ge=i("img"),We=c(),z=i("p"),At=s("But with circular padding, the right and the left parts are matching ("),Se=i("code"),Ut=s("circular_padding=True"),Lt=s(`):
`),_e=i("img"),qe=c(),$(F.$$.fragment),Ye=c(),N=i("h2"),J=i("a"),xe=i("span"),$(te.$$.fragment),Gt=c(),Me=i("span"),zt=s("StableDiffusionPanoramaPipeline"),He=c(),_=i("div"),$(ae.$$.fragment),Nt=c(),Ee=i("p"),Ot=s("Pipeline for text-to-image generation using MultiDiffusion."),Zt=c(),ie=i("p"),Vt=s("This model inherits from "),be=i("a"),jt=s("DiffusionPipeline"),Ft=s(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Jt=c(),A=i("div"),$(ne.$$.fragment),Bt=c(),Te=i("p"),Rt=s("The call function to the pipeline for generation."),Wt=c(),$(B.$$.fragment),qt=c(),R=i("div"),$(oe.$$.fragment),Yt=c(),se=i("p"),Ht=s("Disable sliced VAE decoding. If "),Ie=i("code"),Qt=s("enable_vae_slicing"),Xt=s(` was previously enabled, this method will go back to
computing decoding in one step.`),Kt=c(),W=i("div"),$(re.$$.fragment),ea=c(),Ce=i("p"),ta=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.`),Qe=c(),O=i("h2"),q=i("a"),Ae=i("span"),$(le.$$.fragment),aa=c(),Ue=i("span"),ia=s("StableDiffusionPipelineOutput"),Xe=c(),Z=i("div"),$(pe.$$.fragment),na=c(),Le=i("p"),oa=s("Output class for Stable Diffusion pipelines."),this.h()},l(e){const l=Fa('[data-svelte="svelte-1phssyn"]',document.head);m=n(l,"META",{name:!0,content:!0}),l.forEach(a),P=f(e),h=n(e,"H1",{class:!0});var de=o(h);g=n(de,"A",{id:!0,class:!0,href:!0});var Ge=o(g);b=n(Ge,"SPAN",{});var da=o(b);k(u.$$.fragment,da),da.forEach(a),Ge.forEach(a),v=f(de),U=n(de,"SPAN",{});var ca=o(U);L=r(ca,"MultiDiffusion"),ca.forEach(a),de.forEach(a),w=f(e),T=n(e,"P",{});var sa=o(T);I=n(sa,"A",{href:!0,rel:!0});var fa=o(I);dt=r(fa,"MultiDiffusion: Fusing Diffusion Paths for Controlled Image Generation"),fa.forEach(a),ct=r(sa," is by Omer Bar-Tal, Lior Yariv, Yaron Lipman, and Tali Dekel."),sa.forEach(a),Oe=f(e),fe=n(e,"P",{});var ua=o(fe);ft=r(ua,"The abstract from the paper is:"),ua.forEach(a),Ze=f(e),ue=n(e,"P",{});var ma=o(ue);Pe=n(ma,"EM",{});var ha=o(Pe);ut=r(ha,"Recent advances in text-to-image generation with diffusion models present transformative capabilities in image quality. However, user controllability of the generated image, and fast adaptation to new tasks still remains an open challenge, currently mostly addressed by costly and long re-training and fine-tuning or ad-hoc adaptations to specific image generation tasks. In this work, we present MultiDiffusion, a unified framework that enables versatile and controllable image generation, using a pre-trained text-to-image diffusion model, without any further training or finetuning. At the center of our approach is a new generation process, based on an optimization task that binds together multiple diffusion generation processes with a shared set of parameters or constraints. We show that MultiDiffusion can be readily applied to generate high quality and diverse images that adhere to user-provided controls, such as desired aspect ratio (e.g., panorama), and spatial guiding signals, ranging from tight segmentation masks to bounding boxes."),ha.forEach(a),ma.forEach(a),Ve=f(e),y=n(e,"P",{});var Y=o(y);mt=r(Y,"You can find additional information about MultiDiffusion on the "),H=n(Y,"A",{href:!0,rel:!0});var ga=o(H);ht=r(ga,"project page"),ga.forEach(a),gt=r(Y,", "),Q=n(Y,"A",{href:!0,rel:!0});var _a=o(Q);_t=r(_a,"original codebase"),_a.forEach(a),bt=r(Y,", and try it out in a "),X=n(Y,"A",{href:!0,rel:!0});var ba=o(X);vt=r(ba,"demo"),ba.forEach(a),wt=r(Y,"."),Y.forEach(a),je=f(e),G=n(e,"H2",{class:!0});var et=o(G);V=n(et,"A",{id:!0,class:!0,href:!0});var va=o(V);ye=n(va,"SPAN",{});var wa=o(ye);k(K.$$.fragment,wa),wa.forEach(a),va.forEach(a),Pt=f(et),De=n(et,"SPAN",{});var Pa=o(De);yt=r(Pa,"Tips"),Pa.forEach(a),et.forEach(a),Fe=f(e),C=n(e,"P",{});var ve=o(C);Dt=r(ve,"While calling "),me=n(ve,"A",{href:!0});var ya=o(me);$t=r(ya,"StableDiffusionPanoramaPipeline"),ya.forEach(a),kt=r(ve,", it\u2019s possible to specify the "),$e=n(ve,"CODE",{});var Da=o($e);St=r(Da,"view_batch_size"),Da.forEach(a),xt=r(ve,` parameter to be > 1.
For some GPUs with high performance, this can speedup the generation process and increase VRAM usage.`),ve.forEach(a),Je=f(e),he=n(e,"P",{});var $a=o(he);Mt=r($a,"To generate panorama-like images make sure you pass the width parameter accordingly. We recommend a width value of 2048 which is the default."),$a.forEach(a),Be=f(e),j=n(e,"P",{});var tt=o(j);Et=r(tt,`Circular padding is applied to ensure there are no stitching artifacts when working with
panoramas to ensure a seamless transition from the rightmost part to the leftmost part.
By enabling circular padding (set `),ke=n(tt,"CODE",{});var ka=o(ke);Tt=r(ka,"circular_padding=True"),ka.forEach(a),It=r(tt,`), the operation applies additional
crops after the rightmost point of the image, allowing the model to \u201Csee\u201D the transition
from the rightmost part to the leftmost part. This helps maintain visual consistency in
a 360-degree sense and creates a proper \u201Cpanorama\u201D that can be viewed using 360-degree
panorama viewers. When decoding latents in Stable Diffusion, circular padding is applied
to ensure that the decoded latents match in the RGB space.`),tt.forEach(a),Re=f(e),ee=n(e,"P",{});var ra=o(ee);Ct=r(ra,`For example, without circular padding, there is a stitching artifact (default):
`),ge=n(ra,"IMG",{src:!0,alt:!0}),ra.forEach(a),We=f(e),z=n(e,"P",{});var ze=o(z);At=r(ze,"But with circular padding, the right and the left parts are matching ("),Se=n(ze,"CODE",{});var Sa=o(Se);Ut=r(Sa,"circular_padding=True"),Sa.forEach(a),Lt=r(ze,`):
`),_e=n(ze,"IMG",{src:!0,alt:!0}),ze.forEach(a),qe=f(e),k(F.$$.fragment,e),Ye=f(e),N=n(e,"H2",{class:!0});var at=o(N);J=n(at,"A",{id:!0,class:!0,href:!0});var xa=o(J);xe=n(xa,"SPAN",{});var Ma=o(xe);k(te.$$.fragment,Ma),Ma.forEach(a),xa.forEach(a),Gt=f(at),Me=n(at,"SPAN",{});var Ea=o(Me);zt=r(Ea,"StableDiffusionPanoramaPipeline"),Ea.forEach(a),at.forEach(a),He=f(e),_=n(e,"DIV",{class:!0});var D=o(_);k(ae.$$.fragment,D),Nt=f(D),Ee=n(D,"P",{});var Ta=o(Ee);Ot=r(Ta,"Pipeline for text-to-image generation using MultiDiffusion."),Ta.forEach(a),Zt=f(D),ie=n(D,"P",{});var it=o(ie);Vt=r(it,"This model inherits from "),be=n(it,"A",{href:!0});var Ia=o(be);jt=r(Ia,"DiffusionPipeline"),Ia.forEach(a),Ft=r(it,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),it.forEach(a),Jt=f(D),A=n(D,"DIV",{class:!0});var we=o(A);k(ne.$$.fragment,we),Bt=f(we),Te=n(we,"P",{});var Ca=o(Te);Rt=r(Ca,"The call function to the pipeline for generation."),Ca.forEach(a),Wt=f(we),k(B.$$.fragment,we),we.forEach(a),qt=f(D),R=n(D,"DIV",{class:!0});var nt=o(R);k(oe.$$.fragment,nt),Yt=f(nt),se=n(nt,"P",{});var ot=o(se);Ht=r(ot,"Disable sliced VAE decoding. If "),Ie=n(ot,"CODE",{});var Aa=o(Ie);Qt=r(Aa,"enable_vae_slicing"),Aa.forEach(a),Xt=r(ot,` was previously enabled, this method will go back to
computing decoding in one step.`),ot.forEach(a),nt.forEach(a),Kt=f(D),W=n(D,"DIV",{class:!0});var st=o(W);k(re.$$.fragment,st),ea=f(st),Ce=n(st,"P",{});var Ua=o(Ce);ta=r(Ua,`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.`),Ua.forEach(a),st.forEach(a),D.forEach(a),Qe=f(e),O=n(e,"H2",{class:!0});var rt=o(O);q=n(rt,"A",{id:!0,class:!0,href:!0});var La=o(q);Ae=n(La,"SPAN",{});var Ga=o(Ae);k(le.$$.fragment,Ga),Ga.forEach(a),La.forEach(a),aa=f(rt),Ue=n(rt,"SPAN",{});var za=o(Ue);ia=r(za,"StableDiffusionPipelineOutput"),za.forEach(a),rt.forEach(a),Xe=f(e),Z=n(e,"DIV",{class:!0});var lt=o(Z);k(pe.$$.fragment,lt),na=f(lt),Le=n(lt,"P",{});var Na=o(Le);oa=r(Na,"Output class for Stable Diffusion pipelines."),Na.forEach(a),lt.forEach(a),this.h()},h(){p(m,"name","hf:doc:metadata"),p(m,"content",JSON.stringify(Xa)),p(g,"id","multidiffusion"),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","#multidiffusion"),p(h,"class","relative group"),p(I,"href","https://huggingface.co/papers/2302.08113"),p(I,"rel","nofollow"),p(H,"href","https://multidiffusion.github.io/"),p(H,"rel","nofollow"),p(Q,"href","https://github.com/omerbt/MultiDiffusion"),p(Q,"rel","nofollow"),p(X,"href","https://huggingface.co/spaces/weizmannscience/MultiDiffusion"),p(X,"rel","nofollow"),p(V,"id","tips"),p(V,"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(V,"href","#tips"),p(G,"class","relative group"),p(me,"href","/docs/diffusers/v0.20.0/en/api/pipelines/panorama#diffusers.StableDiffusionPanoramaPipeline"),Oa(ge.src,la="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/indoor_%20no_circular_padding.png")||p(ge,"src",la),p(ge,"alt","img"),Oa(_e.src,pa="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/indoor_%20circular_padding.png")||p(_e,"src",pa),p(_e,"alt","img"),p(J,"id","diffusers.StableDiffusionPanoramaPipeline"),p(J,"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(J,"href","#diffusers.StableDiffusionPanoramaPipeline"),p(N,"class","relative group"),p(be,"href","/docs/diffusers/v0.20.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(A,"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(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(_,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(q,"id","diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),p(q,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(q,"href","#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),p(O,"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")},m(e,l){t(document.head,m),d(e,P,l),d(e,h,l),t(h,g),t(g,b),S(u,b,null),t(h,v),t(h,U),t(U,L),d(e,w,l),d(e,T,l),t(T,I),t(I,dt),t(T,ct),d(e,Oe,l),d(e,fe,l),t(fe,ft),d(e,Ze,l),d(e,ue,l),t(ue,Pe),t(Pe,ut),d(e,Ve,l),d(e,y,l),t(y,mt),t(y,H),t(H,ht),t(y,gt),t(y,Q),t(Q,_t),t(y,bt),t(y,X),t(X,vt),t(y,wt),d(e,je,l),d(e,G,l),t(G,V),t(V,ye),S(K,ye,null),t(G,Pt),t(G,De),t(De,yt),d(e,Fe,l),d(e,C,l),t(C,Dt),t(C,me),t(me,$t),t(C,kt),t(C,$e),t($e,St),t(C,xt),d(e,Je,l),d(e,he,l),t(he,Mt),d(e,Be,l),d(e,j,l),t(j,Et),t(j,ke),t(ke,Tt),t(j,It),d(e,Re,l),d(e,ee,l),t(ee,Ct),t(ee,ge),d(e,We,l),d(e,z,l),t(z,At),t(z,Se),t(Se,Ut),t(z,Lt),t(z,_e),d(e,qe,l),S(F,e,l),d(e,Ye,l),d(e,N,l),t(N,J),t(J,xe),S(te,xe,null),t(N,Gt),t(N,Me),t(Me,zt),d(e,He,l),d(e,_,l),S(ae,_,null),t(_,Nt),t(_,Ee),t(Ee,Ot),t(_,Zt),t(_,ie),t(ie,Vt),t(ie,be),t(be,jt),t(ie,Ft),t(_,Jt),t(_,A),S(ne,A,null),t(A,Bt),t(A,Te),t(Te,Rt),t(A,Wt),S(B,A,null),t(_,qt),t(_,R),S(oe,R,null),t(R,Yt),t(R,se),t(se,Ht),t(se,Ie),t(Ie,Qt),t(se,Xt),t(_,Kt),t(_,W),S(re,W,null),t(W,ea),t(W,Ce),t(Ce,ta),d(e,Qe,l),d(e,O,l),t(O,q),t(q,Ae),S(le,Ae,null),t(O,aa),t(O,Ue),t(Ue,ia),d(e,Xe,l),d(e,Z,l),S(pe,Z,null),t(Z,na),t(Z,Le),t(Le,oa),Ke=!0},p(e,[l]){const de={};l&2&&(de.$$scope={dirty:l,ctx:e}),F.$set(de);const Ge={};l&2&&(Ge.$$scope={dirty:l,ctx:e}),B.$set(Ge)},i(e){Ke||(x(u.$$.fragment,e),x(K.$$.fragment,e),x(F.$$.fragment,e),x(te.$$.fragment,e),x(ae.$$.fragment,e),x(ne.$$.fragment,e),x(B.$$.fragment,e),x(oe.$$.fragment,e),x(re.$$.fragment,e),x(le.$$.fragment,e),x(pe.$$.fragment,e),Ke=!0)},o(e){M(u.$$.fragment,e),M(K.$$.fragment,e),M(F.$$.fragment,e),M(te.$$.fragment,e),M(ae.$$.fragment,e),M(ne.$$.fragment,e),M(B.$$.fragment,e),M(oe.$$.fragment,e),M(re.$$.fragment,e),M(le.$$.fragment,e),M(pe.$$.fragment,e),Ke=!1},d(e){a(m),e&&a(P),e&&a(h),E(u),e&&a(w),e&&a(T),e&&a(Oe),e&&a(fe),e&&a(Ze),e&&a(ue),e&&a(Ve),e&&a(y),e&&a(je),e&&a(G),E(K),e&&a(Fe),e&&a(C),e&&a(Je),e&&a(he),e&&a(Be),e&&a(j),e&&a(Re),e&&a(ee),e&&a(We),e&&a(z),e&&a(qe),E(F,e),e&&a(Ye),e&&a(N),E(te),e&&a(He),e&&a(_),E(ae),E(ne),E(B),E(oe),E(re),e&&a(Qe),e&&a(O),E(le),e&&a(Xe),e&&a(Z),E(pe)}}}const Xa={local:"multidiffusion",sections:[{local:"tips",title:"Tips"},{local:"diffusers.StableDiffusionPanoramaPipeline",title:"StableDiffusionPanoramaPipeline"},{local:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",title:"StableDiffusionPipelineOutput"}],title:"MultiDiffusion"};function Ka(ce){return Ja(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class si extends Za{constructor(m){super();Va(this,m,Ka,Qa,ja,{})}}export{si as default,Xa as metadata};
