import{S as qa,i as Ya,s as Ha,e as n,k as c,w as y,t as s,M as Qa,c as i,d as a,m as f,a as o,x as D,h as r,b as p,N as Wa,G as t,g as d,y as $,q as S,o as k,B as x,v as Xa,L as Ka}from"../../../chunks/vendor-hf-doc-builder.js";import{T as en}from"../../../chunks/Tip-hf-doc-builder.js";import{D as De}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as tn}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as ut}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as an}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function nn(ue){let m,E,h,g,b,u,v,L;return{c(){m=n("p"),E=s("Make sure to check out the Schedulers "),h=n("a"),g=s("guide"),b=s(" to learn how to explore the tradeoff between scheduler speed and quality, and see the "),u=n("a"),v=s("reuse components across pipelines"),L=s(" section to learn how to efficiently load the same components into multiple pipelines."),this.h()},l(U){m=i(U,"P",{});var P=o(m);E=r(P,"Make sure to check out the Schedulers "),h=i(P,"A",{href:!0});var T=o(h);g=r(T,"guide"),T.forEach(a),b=r(P," to learn how to explore the tradeoff between scheduler speed and quality, and see the "),u=i(P,"A",{href:!0});var I=o(u);v=r(I,"reuse components across pipelines"),I.forEach(a),L=r(P," section to learn how to efficiently load the same components into multiple pipelines."),P.forEach(a),this.h()},h(){p(h,"href","/using-diffusers/schedulers"),p(u,"href","/using-diffusers/loading#reuse-components-across-pipelines")},m(U,P){d(U,m,P),t(m,E),t(m,h),t(h,g),t(m,b),t(m,u),t(u,v),t(m,L)},d(U){U&&a(m)}}}function on(ue){let m,E,h,g,b;return g=new tn({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=n("p"),E=s("Examples:"),h=c(),y(g.$$.fragment)},l(u){m=i(u,"P",{});var v=o(m);E=r(v,"Examples:"),v.forEach(a),h=f(u),D(g.$$.fragment,u)},m(u,v){d(u,m,v),t(m,E),d(u,h,v),$(g,u,v),b=!0},p:Ka,i(u){b||(S(g.$$.fragment,u),b=!0)},o(u){k(g.$$.fragment,u),b=!1},d(u){u&&a(m),u&&a(h),x(g,u)}}}function sn(ue){let m,E,h,g,b,u,v,L,U,P,T,I,mt,ht,Ze,me,gt,je,he,$e,_t,Je,M,bt,Q,vt,wt,X,Pt,yt,K,Dt,$t,Re,N,V,Se,ee,St,ke,kt,Be,C,xt,ge,Et,Mt,xe,Tt,It,We,_e,Ct,qe,Z,At,Ee,Lt,Ut,Ye,te,Nt,be,ha,He,G,Gt,Me,zt,Ot,ve,ga,Qe,j,Xe,z,J,Te,ae,Ft,Ie,Vt,Ke,_,ne,Zt,Ce,jt,Jt,ie,Rt,we,Bt,Wt,qt,A,oe,Yt,Ae,Ht,Qt,R,Xt,B,se,Kt,re,ea,Le,ta,aa,na,W,le,ia,Ue,oa,sa,q,pe,ra,Ne,la,et,O,Y,Ge,de,pa,ze,da,tt,F,ce,ca,Oe,fa,at;return u=new ut({}),ee=new ut({}),j=new en({props:{$$slots:{default:[nn]},$$scope:{ctx:ue}}}),ae=new ut({}),ne=new De({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.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.StableDiffusionPanoramaPipeline.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.StableDiffusionPanoramaPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionPanoramaPipeline.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.StableDiffusionPanoramaPipeline.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.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> (<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_panorama.py#L55"}}),oe=new De({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[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:": 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.21.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.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.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.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_panorama.py#L478",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>
`}}),R=new an({props:{anchor:"diffusers.StableDiffusionPanoramaPipeline.__call__.example",$$slots:{default:[on]},$$scope:{ctx:ue}}}),se=new De({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionPanoramaPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_panorama.py#L136"}}),le=new De({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionPanoramaPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_panorama.py#L128"}}),pe=new De({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionPanoramaPipeline.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.StableDiffusionPanoramaPipeline.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.StableDiffusionPanoramaPipeline.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.StableDiffusionPanoramaPipeline.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.StableDiffusionPanoramaPipeline.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.StableDiffusionPanoramaPipeline.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.StableDiffusionPanoramaPipeline.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.StableDiffusionPanoramaPipeline.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_panorama.py#L175"}}),de=new ut({}),ce=new De({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.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_output.py#L15"}}),{c(){m=n("meta"),E=c(),h=n("h1"),g=n("a"),b=n("span"),y(u.$$.fragment),v=c(),L=n("span"),U=s("MultiDiffusion"),P=c(),T=n("p"),I=n("a"),mt=s("MultiDiffusion: Fusing Diffusion Paths for Controlled Image Generation"),ht=s(" is by Omer Bar-Tal, Lior Yariv, Yaron Lipman, and Tali Dekel."),Ze=c(),me=n("p"),gt=s("The abstract from the paper is:"),je=c(),he=n("p"),$e=n("em"),_t=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."),Je=c(),M=n("p"),bt=s("You can find additional information about MultiDiffusion on the "),Q=n("a"),vt=s("project page"),wt=s(", "),X=n("a"),Pt=s("original codebase"),yt=s(", and try it out in a "),K=n("a"),Dt=s("demo"),$t=s("."),Re=c(),N=n("h2"),V=n("a"),Se=n("span"),y(ee.$$.fragment),St=c(),ke=n("span"),kt=s("Tips"),Be=c(),C=n("p"),xt=s("While calling "),ge=n("a"),Et=s("StableDiffusionPanoramaPipeline"),Mt=s(", it\u2019s possible to specify the "),xe=n("code"),Tt=s("view_batch_size"),It=s(` parameter to be > 1.
For some GPUs with high performance, this can speedup the generation process and increase VRAM usage.`),We=c(),_e=n("p"),Ct=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."),qe=c(),Z=n("p"),At=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 `),Ee=n("code"),Lt=s("circular_padding=True"),Ut=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.`),Ye=c(),te=n("p"),Nt=s(`For example, without circular padding, there is a stitching artifact (default):
`),be=n("img"),He=c(),G=n("p"),Gt=s("But with circular padding, the right and the left parts are matching ("),Me=n("code"),zt=s("circular_padding=True"),Ot=s(`):
`),ve=n("img"),Qe=c(),y(j.$$.fragment),Xe=c(),z=n("h2"),J=n("a"),Te=n("span"),y(ae.$$.fragment),Ft=c(),Ie=n("span"),Vt=s("StableDiffusionPanoramaPipeline"),Ke=c(),_=n("div"),y(ne.$$.fragment),Zt=c(),Ce=n("p"),jt=s("Pipeline for text-to-image generation using MultiDiffusion."),Jt=c(),ie=n("p"),Rt=s("This model inherits from "),we=n("a"),Bt=s("DiffusionPipeline"),Wt=s(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),qt=c(),A=n("div"),y(oe.$$.fragment),Yt=c(),Ae=n("p"),Ht=s("The call function to the pipeline for generation."),Qt=c(),y(R.$$.fragment),Xt=c(),B=n("div"),y(se.$$.fragment),Kt=c(),re=n("p"),ea=s("Disable sliced VAE decoding. If "),Le=n("code"),ta=s("enable_vae_slicing"),aa=s(` was previously enabled, this method will go back to
computing decoding in one step.`),na=c(),W=n("div"),y(le.$$.fragment),ia=c(),Ue=n("p"),oa=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.`),sa=c(),q=n("div"),y(pe.$$.fragment),ra=c(),Ne=n("p"),la=s("Encodes the prompt into text encoder hidden states."),et=c(),O=n("h2"),Y=n("a"),Ge=n("span"),y(de.$$.fragment),pa=c(),ze=n("span"),da=s("StableDiffusionPipelineOutput"),tt=c(),F=n("div"),y(ce.$$.fragment),ca=c(),Oe=n("p"),fa=s("Output class for Stable Diffusion pipelines."),this.h()},l(e){const l=Qa('[data-svelte="svelte-1phssyn"]',document.head);m=i(l,"META",{name:!0,content:!0}),l.forEach(a),E=f(e),h=i(e,"H1",{class:!0});var fe=o(h);g=i(fe,"A",{id:!0,class:!0,href:!0});var Fe=o(g);b=i(Fe,"SPAN",{});var _a=o(b);D(u.$$.fragment,_a),_a.forEach(a),Fe.forEach(a),v=f(fe),L=i(fe,"SPAN",{});var ba=o(L);U=r(ba,"MultiDiffusion"),ba.forEach(a),fe.forEach(a),P=f(e),T=i(e,"P",{});var ua=o(T);I=i(ua,"A",{href:!0,rel:!0});var va=o(I);mt=r(va,"MultiDiffusion: Fusing Diffusion Paths for Controlled Image Generation"),va.forEach(a),ht=r(ua," is by Omer Bar-Tal, Lior Yariv, Yaron Lipman, and Tali Dekel."),ua.forEach(a),Ze=f(e),me=i(e,"P",{});var wa=o(me);gt=r(wa,"The abstract from the paper is:"),wa.forEach(a),je=f(e),he=i(e,"P",{});var Pa=o(he);$e=i(Pa,"EM",{});var ya=o($e);_t=r(ya,"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."),ya.forEach(a),Pa.forEach(a),Je=f(e),M=i(e,"P",{});var H=o(M);bt=r(H,"You can find additional information about MultiDiffusion on the "),Q=i(H,"A",{href:!0,rel:!0});var Da=o(Q);vt=r(Da,"project page"),Da.forEach(a),wt=r(H,", "),X=i(H,"A",{href:!0,rel:!0});var $a=o(X);Pt=r($a,"original codebase"),$a.forEach(a),yt=r(H,", and try it out in a "),K=i(H,"A",{href:!0,rel:!0});var Sa=o(K);Dt=r(Sa,"demo"),Sa.forEach(a),$t=r(H,"."),H.forEach(a),Re=f(e),N=i(e,"H2",{class:!0});var nt=o(N);V=i(nt,"A",{id:!0,class:!0,href:!0});var ka=o(V);Se=i(ka,"SPAN",{});var xa=o(Se);D(ee.$$.fragment,xa),xa.forEach(a),ka.forEach(a),St=f(nt),ke=i(nt,"SPAN",{});var Ea=o(ke);kt=r(Ea,"Tips"),Ea.forEach(a),nt.forEach(a),Be=f(e),C=i(e,"P",{});var Pe=o(C);xt=r(Pe,"While calling "),ge=i(Pe,"A",{href:!0});var Ma=o(ge);Et=r(Ma,"StableDiffusionPanoramaPipeline"),Ma.forEach(a),Mt=r(Pe,", it\u2019s possible to specify the "),xe=i(Pe,"CODE",{});var Ta=o(xe);Tt=r(Ta,"view_batch_size"),Ta.forEach(a),It=r(Pe,` parameter to be > 1.
For some GPUs with high performance, this can speedup the generation process and increase VRAM usage.`),Pe.forEach(a),We=f(e),_e=i(e,"P",{});var Ia=o(_e);Ct=r(Ia,"To generate panorama-like images make sure you pass the width parameter accordingly. We recommend a width value of 2048 which is the default."),Ia.forEach(a),qe=f(e),Z=i(e,"P",{});var it=o(Z);At=r(it,`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 `),Ee=i(it,"CODE",{});var Ca=o(Ee);Lt=r(Ca,"circular_padding=True"),Ca.forEach(a),Ut=r(it,`), 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.`),it.forEach(a),Ye=f(e),te=i(e,"P",{});var ma=o(te);Nt=r(ma,`For example, without circular padding, there is a stitching artifact (default):
`),be=i(ma,"IMG",{src:!0,alt:!0}),ma.forEach(a),He=f(e),G=i(e,"P",{});var Ve=o(G);Gt=r(Ve,"But with circular padding, the right and the left parts are matching ("),Me=i(Ve,"CODE",{});var Aa=o(Me);zt=r(Aa,"circular_padding=True"),Aa.forEach(a),Ot=r(Ve,`):
`),ve=i(Ve,"IMG",{src:!0,alt:!0}),Ve.forEach(a),Qe=f(e),D(j.$$.fragment,e),Xe=f(e),z=i(e,"H2",{class:!0});var ot=o(z);J=i(ot,"A",{id:!0,class:!0,href:!0});var La=o(J);Te=i(La,"SPAN",{});var Ua=o(Te);D(ae.$$.fragment,Ua),Ua.forEach(a),La.forEach(a),Ft=f(ot),Ie=i(ot,"SPAN",{});var Na=o(Ie);Vt=r(Na,"StableDiffusionPanoramaPipeline"),Na.forEach(a),ot.forEach(a),Ke=f(e),_=i(e,"DIV",{class:!0});var w=o(_);D(ne.$$.fragment,w),Zt=f(w),Ce=i(w,"P",{});var Ga=o(Ce);jt=r(Ga,"Pipeline for text-to-image generation using MultiDiffusion."),Ga.forEach(a),Jt=f(w),ie=i(w,"P",{});var st=o(ie);Rt=r(st,"This model inherits from "),we=i(st,"A",{href:!0});var za=o(we);Bt=r(za,"DiffusionPipeline"),za.forEach(a),Wt=r(st,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),st.forEach(a),qt=f(w),A=i(w,"DIV",{class:!0});var ye=o(A);D(oe.$$.fragment,ye),Yt=f(ye),Ae=i(ye,"P",{});var Oa=o(Ae);Ht=r(Oa,"The call function to the pipeline for generation."),Oa.forEach(a),Qt=f(ye),D(R.$$.fragment,ye),ye.forEach(a),Xt=f(w),B=i(w,"DIV",{class:!0});var rt=o(B);D(se.$$.fragment,rt),Kt=f(rt),re=i(rt,"P",{});var lt=o(re);ea=r(lt,"Disable sliced VAE decoding. If "),Le=i(lt,"CODE",{});var Fa=o(Le);ta=r(Fa,"enable_vae_slicing"),Fa.forEach(a),aa=r(lt,` was previously enabled, this method will go back to
computing decoding in one step.`),lt.forEach(a),rt.forEach(a),na=f(w),W=i(w,"DIV",{class:!0});var pt=o(W);D(le.$$.fragment,pt),ia=f(pt),Ue=i(pt,"P",{});var Va=o(Ue);oa=r(Va,`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.`),Va.forEach(a),pt.forEach(a),sa=f(w),q=i(w,"DIV",{class:!0});var dt=o(q);D(pe.$$.fragment,dt),ra=f(dt),Ne=i(dt,"P",{});var Za=o(Ne);la=r(Za,"Encodes the prompt into text encoder hidden states."),Za.forEach(a),dt.forEach(a),w.forEach(a),et=f(e),O=i(e,"H2",{class:!0});var ct=o(O);Y=i(ct,"A",{id:!0,class:!0,href:!0});var ja=o(Y);Ge=i(ja,"SPAN",{});var Ja=o(Ge);D(de.$$.fragment,Ja),Ja.forEach(a),ja.forEach(a),pa=f(ct),ze=i(ct,"SPAN",{});var Ra=o(ze);da=r(Ra,"StableDiffusionPipelineOutput"),Ra.forEach(a),ct.forEach(a),tt=f(e),F=i(e,"DIV",{class:!0});var ft=o(F);D(ce.$$.fragment,ft),ca=f(ft),Oe=i(ft,"P",{});var Ba=o(Oe);fa=r(Ba,"Output class for Stable Diffusion pipelines."),Ba.forEach(a),ft.forEach(a),this.h()},h(){p(m,"name","hf:doc:metadata"),p(m,"content",JSON.stringify(rn)),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(Q,"href","https://multidiffusion.github.io/"),p(Q,"rel","nofollow"),p(X,"href","https://github.com/omerbt/MultiDiffusion"),p(X,"rel","nofollow"),p(K,"href","https://huggingface.co/spaces/weizmannscience/MultiDiffusion"),p(K,"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(N,"class","relative group"),p(ge,"href","/docs/diffusers/v0.21.0/en/api/pipelines/panorama#diffusers.StableDiffusionPanoramaPipeline"),Wa(be.src,ha="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/indoor_%20no_circular_padding.png")||p(be,"src",ha),p(be,"alt","img"),Wa(ve.src,ga="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/indoor_%20circular_padding.png")||p(ve,"src",ga),p(ve,"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(z,"class","relative group"),p(we,"href","/docs/diffusers/v0.21.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(B,"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(q,"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(Y,"id","diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),p(Y,"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(Y,"href","#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),p(O,"class","relative group"),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")},m(e,l){t(document.head,m),d(e,E,l),d(e,h,l),t(h,g),t(g,b),$(u,b,null),t(h,v),t(h,L),t(L,U),d(e,P,l),d(e,T,l),t(T,I),t(I,mt),t(T,ht),d(e,Ze,l),d(e,me,l),t(me,gt),d(e,je,l),d(e,he,l),t(he,$e),t($e,_t),d(e,Je,l),d(e,M,l),t(M,bt),t(M,Q),t(Q,vt),t(M,wt),t(M,X),t(X,Pt),t(M,yt),t(M,K),t(K,Dt),t(M,$t),d(e,Re,l),d(e,N,l),t(N,V),t(V,Se),$(ee,Se,null),t(N,St),t(N,ke),t(ke,kt),d(e,Be,l),d(e,C,l),t(C,xt),t(C,ge),t(ge,Et),t(C,Mt),t(C,xe),t(xe,Tt),t(C,It),d(e,We,l),d(e,_e,l),t(_e,Ct),d(e,qe,l),d(e,Z,l),t(Z,At),t(Z,Ee),t(Ee,Lt),t(Z,Ut),d(e,Ye,l),d(e,te,l),t(te,Nt),t(te,be),d(e,He,l),d(e,G,l),t(G,Gt),t(G,Me),t(Me,zt),t(G,Ot),t(G,ve),d(e,Qe,l),$(j,e,l),d(e,Xe,l),d(e,z,l),t(z,J),t(J,Te),$(ae,Te,null),t(z,Ft),t(z,Ie),t(Ie,Vt),d(e,Ke,l),d(e,_,l),$(ne,_,null),t(_,Zt),t(_,Ce),t(Ce,jt),t(_,Jt),t(_,ie),t(ie,Rt),t(ie,we),t(we,Bt),t(ie,Wt),t(_,qt),t(_,A),$(oe,A,null),t(A,Yt),t(A,Ae),t(Ae,Ht),t(A,Qt),$(R,A,null),t(_,Xt),t(_,B),$(se,B,null),t(B,Kt),t(B,re),t(re,ea),t(re,Le),t(Le,ta),t(re,aa),t(_,na),t(_,W),$(le,W,null),t(W,ia),t(W,Ue),t(Ue,oa),t(_,sa),t(_,q),$(pe,q,null),t(q,ra),t(q,Ne),t(Ne,la),d(e,et,l),d(e,O,l),t(O,Y),t(Y,Ge),$(de,Ge,null),t(O,pa),t(O,ze),t(ze,da),d(e,tt,l),d(e,F,l),$(ce,F,null),t(F,ca),t(F,Oe),t(Oe,fa),at=!0},p(e,[l]){const fe={};l&2&&(fe.$$scope={dirty:l,ctx:e}),j.$set(fe);const Fe={};l&2&&(Fe.$$scope={dirty:l,ctx:e}),R.$set(Fe)},i(e){at||(S(u.$$.fragment,e),S(ee.$$.fragment,e),S(j.$$.fragment,e),S(ae.$$.fragment,e),S(ne.$$.fragment,e),S(oe.$$.fragment,e),S(R.$$.fragment,e),S(se.$$.fragment,e),S(le.$$.fragment,e),S(pe.$$.fragment,e),S(de.$$.fragment,e),S(ce.$$.fragment,e),at=!0)},o(e){k(u.$$.fragment,e),k(ee.$$.fragment,e),k(j.$$.fragment,e),k(ae.$$.fragment,e),k(ne.$$.fragment,e),k(oe.$$.fragment,e),k(R.$$.fragment,e),k(se.$$.fragment,e),k(le.$$.fragment,e),k(pe.$$.fragment,e),k(de.$$.fragment,e),k(ce.$$.fragment,e),at=!1},d(e){a(m),e&&a(E),e&&a(h),x(u),e&&a(P),e&&a(T),e&&a(Ze),e&&a(me),e&&a(je),e&&a(he),e&&a(Je),e&&a(M),e&&a(Re),e&&a(N),x(ee),e&&a(Be),e&&a(C),e&&a(We),e&&a(_e),e&&a(qe),e&&a(Z),e&&a(Ye),e&&a(te),e&&a(He),e&&a(G),e&&a(Qe),x(j,e),e&&a(Xe),e&&a(z),x(ae),e&&a(Ke),e&&a(_),x(ne),x(oe),x(R),x(se),x(le),x(pe),e&&a(et),e&&a(O),x(de),e&&a(tt),e&&a(F),x(ce)}}}const rn={local:"multidiffusion",sections:[{local:"tips",title:"Tips"},{local:"diffusers.StableDiffusionPanoramaPipeline",title:"StableDiffusionPanoramaPipeline"},{local:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",title:"StableDiffusionPipelineOutput"}],title:"MultiDiffusion"};function ln(ue){return Xa(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class hn extends qa{constructor(m){super();Ya(this,m,ln,sn,Ha,{})}}export{hn as default,rn as metadata};
