import{S as Uo,i as Bo,s as zo,e as n,k as l,w as v,t as o,M as Fo,c as s,d as i,m as f,a,x as b,h as r,b as d,G as e,g as p,y as D,q as y,o as A,B as w,v as Wo,L as Go}from"../../../chunks/vendor-hf-doc-builder.js";import{D as z}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as Ri}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as ai}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as No}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ro(qe){let g,T,P,h,k;return h=new Ri({props:{code:`import torch
from diffusers import AltDiffusionPipeline

pipe = AltDiffusionPipeline.from_pretrained("BAAI/AltDiffusion-m9", torch_dtype=torch.float16)
pipe = pipe.to("cuda")

# "dark elf princess, highly detailed, d & d, fantasy, highly detailed, digital painting, trending on artstation, concept art, sharp focus, illustration, art by artgerm and greg rutkowski and fuji choko and viktoria gavrilenko and hoang lap"
prompt = "\u9ED1\u6697\u7CBE\u7075\u516C\u4E3B\uFF0C\u975E\u5E38\u8BE6\u7EC6\uFF0C\u5E7B\u60F3\uFF0C\u975E\u5E38\u8BE6\u7EC6\uFF0C\u6570\u5B57\u7ED8\u753B\uFF0C\u6982\u5FF5\u827A\u672F\uFF0C\u654F\u9510\u7684\u7126\u70B9\uFF0C\u63D2\u56FE"
image = pipe(prompt).images[0]`,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> AltDiffusionPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = AltDiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;BAAI/AltDiffusion-m9&quot;</span>, torch_dtype=torch.float16)
<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><span class="hljs-comment"># &quot;dark elf princess, highly detailed, d &amp; d, fantasy, highly detailed, digital painting, trending on artstation, concept art, sharp focus, illustration, art by artgerm and greg rutkowski and fuji choko and viktoria gavrilenko and hoang lap&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;\u9ED1\u6697\u7CBE\u7075\u516C\u4E3B\uFF0C\u975E\u5E38\u8BE6\u7EC6\uFF0C\u5E7B\u60F3\uFF0C\u975E\u5E38\u8BE6\u7EC6\uFF0C\u6570\u5B57\u7ED8\u753B\uFF0C\u6982\u5FF5\u827A\u672F\uFF0C\u654F\u9510\u7684\u7126\u70B9\uFF0C\u63D2\u56FE&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`}}),{c(){g=n("p"),T=o("Examples:"),P=l(),v(h.$$.fragment)},l(u){g=s(u,"P",{});var $=a(g);T=r($,"Examples:"),$.forEach(i),P=f(u),b(h.$$.fragment,u)},m(u,$){p(u,g,$),e(g,T),p(u,P,$),D(h,u,$),k=!0},p:Go,i(u){k||(y(h.$$.fragment,u),k=!0)},o(u){A(h.$$.fragment,u),k=!1},d(u){u&&i(g),u&&i(P),w(h,u)}}}function Vo(qe){let g,T,P,h,k;return h=new Ri({props:{code:`import requests
import torch
from PIL import Image
from io import BytesIO

from diffusers import AltDiffusionImg2ImgPipeline

device = "cuda"
model_id_or_path = "BAAI/AltDiffusion-m9"
pipe = AltDiffusionImg2ImgPipeline.from_pretrained(model_id_or_path, torch_dtype=torch.float16)
pipe = pipe.to(device)

url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"

response = requests.get(url)
init_image = Image.open(BytesIO(response.content)).convert("RGB")
init_image = init_image.resize((768, 512))

# "A fantasy landscape, trending on artstation"
prompt = "\u5E7B\u60F3\u98CE\u666F, artstation"

images = pipe(prompt=prompt, image=init_image, strength=0.75, guidance_scale=7.5).images
images[0].save("\u5E7B\u60F3\u98CE\u666F.png")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests
<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> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AltDiffusionImg2ImgPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>device = <span class="hljs-string">&quot;cuda&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model_id_or_path = <span class="hljs-string">&quot;BAAI/AltDiffusion-m9&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = AltDiffusionImg2ImgPipeline.from_pretrained(model_id_or_path, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(device)

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>response = requests.get(url)
<span class="hljs-meta">&gt;&gt;&gt; </span>init_image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>init_image = init_image.resize((<span class="hljs-number">768</span>, <span class="hljs-number">512</span>))

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># &quot;A fantasy landscape, trending on artstation&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;\u5E7B\u60F3\u98CE\u666F, artstation&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipe(prompt=prompt, image=init_image, strength=<span class="hljs-number">0.75</span>, guidance_scale=<span class="hljs-number">7.5</span>).images
<span class="hljs-meta">&gt;&gt;&gt; </span>images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;\u5E7B\u60F3\u98CE\u666F.png&quot;</span>)`}}),{c(){g=n("p"),T=o("Examples:"),P=l(),v(h.$$.fragment)},l(u){g=s(u,"P",{});var $=a(g);T=r($,"Examples:"),$.forEach(i),P=f(u),b(h.$$.fragment,u)},m(u,$){p(u,g,$),e(g,T),p(u,P,$),D(h,u,$),k=!0},p:Go,i(u){k||(y(h.$$.fragment,u),k=!0)},o(u){A(h.$$.fragment,u),k=!1},d(u){u&&i(g),u&&i(P),w(h,u)}}}function Ho(qe){let g,T,P,h,k,u,$,ut,Vi,oi,H,Hi,fe,Xi,Ki,ri,Ne,Yi,li,Ge,mt,Zi,fi,de,ht,Qi,Ji,di,X,gt,S,_t,en,tn,vt,nn,sn,Ue,an,on,Be,rn,ln,ce,j,bt,pe,fn,dn,Dt,yt,cn,pn,ze,un,mn,Fe,hn,gn,M,At,ue,_n,vn,wt,Pt,bn,Dn,We,yn,An,Re,wn,ci,F,K,It,me,Pn,$t,In,pi,Y,Et,he,$n,Ve,En,kn,xn,kt,xt,Ct,Cn,ui,E,Tn,He,Ln,Sn,Xe,jn,Mn,Tt,On,qn,Ke,Nn,Gn,Ye,Un,Bn,mi,Ze,Lt,St,zn,hi,m,Fn,Qe,Wn,Rn,jt,Vn,Hn,Je,Xn,Kn,et,Yn,Zn,tt,Qn,Jn,it,es,ts,nt,is,ns,Mt,ss,as,Ot,os,rs,st,ls,fs,gi,ge,_i,at,qt,Nt,ds,vi,q,cs,Gt,ps,us,Ut,ms,hs,bi,_e,Di,W,Z,Bt,ve,gs,zt,_s,yi,O,be,vs,Ft,bs,Ds,Q,De,ys,Wt,As,Ai,R,J,Rt,ye,ws,Vt,Ps,wi,I,Ae,Is,Ht,$s,Es,we,ks,ot,xs,Cs,Ts,N,Pe,Ls,Xt,Ss,js,ee,Ms,te,Ie,Os,$e,qs,Kt,Ns,Gs,Us,ie,Ee,Bs,ke,zs,Yt,Fs,Ws,Rs,G,xe,Vs,Zt,Hs,Xs,Qt,Ks,Pi,V,ne,Jt,Ce,Ys,ei,Zs,Ii,x,Te,Qs,ti,Js,ea,Le,ta,rt,ia,na,sa,U,Se,aa,ii,oa,ra,se,la,ae,je,fa,Me,da,ni,ca,pa,$i;return u=new ai({}),me=new ai({}),ge=new Ri({props:{code:`from diffusers import AltDiffusionPipeline, EulerDiscreteScheduler

pipeline = AltDiffusionPipeline.from_pretrained("BAAI/AltDiffusion-m9")
pipeline.scheduler = EulerDiscreteScheduler.from_config(pipeline.scheduler.config)

# or
euler_scheduler = EulerDiscreteScheduler.from_pretrained("BAAI/AltDiffusion-m9", subfolder="scheduler")
pipeline = AltDiffusionPipeline.from_pretrained("BAAI/AltDiffusion-m9", scheduler=euler_scheduler)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AltDiffusionPipeline, EulerDiscreteScheduler

<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = AltDiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;BAAI/AltDiffusion-m9&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline.scheduler = EulerDiscreteScheduler.from_config(pipeline.scheduler.config)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># or</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>euler_scheduler = EulerDiscreteScheduler.from_pretrained(<span class="hljs-string">&quot;BAAI/AltDiffusion-m9&quot;</span>, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipeline = AltDiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;BAAI/AltDiffusion-m9&quot;</span>, scheduler=euler_scheduler)`}}),_e=new Ri({props:{code:`from diffusers import (
    AltDiffusionPipeline,
    AltDiffusionImg2ImgPipeline,
)

text2img = AltDiffusionPipeline.from_pretrained("BAAI/AltDiffusion-m9")
img2img = AltDiffusionImg2ImgPipeline(**text2img.components)

# now you can use text2img(...) and img2img(...) just like the call methods of each respective pipeline`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> (
<span class="hljs-meta">... </span>    AltDiffusionPipeline,
<span class="hljs-meta">... </span>    AltDiffusionImg2ImgPipeline,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>text2img = AltDiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;BAAI/AltDiffusion-m9&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>img2img = AltDiffusionImg2ImgPipeline(**text2img.components)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># now you can use text2img(...) and img2img(...) just like the call methods of each respective pipeline</span>`}}),ve=new ai({}),be=new z({props:{name:"class diffusers.pipelines.alt_diffusion.AltDiffusionPipelineOutput",anchor:"diffusers.pipelines.alt_diffusion.AltDiffusionPipelineOutput",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.alt_diffusion.AltDiffusionPipelineOutput.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>. PIL images or numpy array present the denoised images of the diffusion pipeline.`,name:"images"},{anchor:"diffusers.pipelines.alt_diffusion.AltDiffusionPipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) &#x2014;
List of flags denoting whether the corresponding generated image likely represents &#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/main/src/diffusers/pipelines/alt_diffusion/__init__.py#L14"}}),De=new z({props:{name:"__call__",anchor:"diffusers.pipelines.alt_diffusion.AltDiffusionPipelineOutput.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]}}),ye=new ai({}),Ae=new z({props:{name:"class diffusers.AltDiffusionPipeline",anchor:"diffusers.AltDiffusionPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": RobertaSeriesModelWithTransformation"},{name:"tokenizer",val:": XLMRobertaTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPFeatureExtractor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.AltDiffusionPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.AltDiffusionPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>RobertaSeriesModelWithTransformation</code>) &#x2014;
Frozen text-encoder. Alt Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.RobertaSeriesModelWithTransformation" rel="nofollow">CLIP</a>,
specifically the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.AltDiffusionPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>XLMRobertaTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.XLMRobertaTokenizer" rel="nofollow">XLMRobertaTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.AltDiffusionPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.AltDiffusionPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/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/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.AltDiffusionPipeline.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 details.`,name:"safety_checker"},{anchor:"diffusers.AltDiffusionPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPFeatureExtractor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py#L52"}}),Pe=new z({props:{name:"__call__",anchor:"diffusers.AltDiffusionPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{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:"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"}],parametersDescription:[{anchor:"diffusers.AltDiffusionPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.AltDiffusionPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.AltDiffusionPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.AltDiffusionPipeline.__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.AltDiffusionPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.AltDiffusionPipeline.__call__.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. Ignored when not using guidance (i.e., ignored
if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.AltDiffusionPipeline.__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.AltDiffusionPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.AltDiffusionPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.AltDiffusionPipeline.__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 will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.AltDiffusionPipeline.__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 generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.AltDiffusionPipeline.__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 <code>~pipelines.stable_diffusion.AltDiffusionPipelineOutput</code> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.AltDiffusionPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.AltDiffusionPipeline.__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 will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py#L395",returnDescription:`
<p><code>~pipelines.stable_diffusion.AltDiffusionPipelineOutput</code> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><code>~pipelines.stable_diffusion.AltDiffusionPipelineOutput</code> or <code>tuple</code></p>
`}}),ee=new No({props:{anchor:"diffusers.AltDiffusionPipeline.__call__.example",$$slots:{default:[Ro]},$$scope:{ctx:qe}}}),Ie=new z({props:{name:"disable_vae_slicing",anchor:"diffusers.AltDiffusionPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py#L179"}}),Ee=new z({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.AltDiffusionPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py#L186"}}),xe=new z({props:{name:"enable_vae_slicing",anchor:"diffusers.AltDiffusionPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py#L170"}}),Ce=new ai({}),Te=new z({props:{name:"class diffusers.AltDiffusionImg2ImgPipeline",anchor:"diffusers.AltDiffusionImg2ImgPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": RobertaSeriesModelWithTransformation"},{name:"tokenizer",val:": XLMRobertaTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPFeatureExtractor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.AltDiffusionImg2ImgPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.AltDiffusionImg2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>RobertaSeriesModelWithTransformation</code>) &#x2014;
Frozen text-encoder. Alt Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.RobertaSeriesModelWithTransformation" rel="nofollow">CLIP</a>,
specifically the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.AltDiffusionImg2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>XLMRobertaTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.XLMRobertaTokenizer" rel="nofollow">XLMRobertaTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.AltDiffusionImg2ImgPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.AltDiffusionImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/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/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.AltDiffusionImg2ImgPipeline.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 details.`,name:"safety_checker"},{anchor:"diffusers.AltDiffusionImg2ImgPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPFeatureExtractor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py#L90"}}),Se=new z({props:{name:"__call__",anchor:"diffusers.AltDiffusionImg2ImgPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image] = None"},{name:"strength",val:": float = 0.8"},{name:"num_inference_steps",val:": typing.Optional[int] = 50"},{name:"guidance_scale",val:": typing.Optional[float] = 7.5"},{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:": typing.Optional[float] = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = 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:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.AltDiffusionImg2ImgPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.AltDiffusionImg2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code> or <code>PIL.Image.Image</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, that will be used as the starting point for the
process.`,name:"image"},{anchor:"diffusers.AltDiffusionImg2ImgPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
Conceptually, indicates how much to transform the reference <code>image</code>. Must be between 0 and 1. <code>image</code>
will be used as a starting point, adding more noise to it the larger the <code>strength</code>. The number of
denoising steps depends on the amount of noise initially added. When <code>strength</code> is 1, added noise will
be maximum and the denoising process will run for the full number of iterations specified in
<code>num_inference_steps</code>. A value of 1, therefore, essentially ignores <code>image</code>.`,name:"strength"},{anchor:"diffusers.AltDiffusionImg2ImgPipeline.__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. This parameter will be modulated by <code>strength</code>.`,name:"num_inference_steps"},{anchor:"diffusers.AltDiffusionImg2ImgPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.AltDiffusionImg2ImgPipeline.__call__.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. Ignored when not using guidance (i.e., ignored
if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.AltDiffusionImg2ImgPipeline.__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.AltDiffusionImg2ImgPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.AltDiffusionImg2ImgPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.AltDiffusionImg2ImgPipeline.__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 generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.AltDiffusionImg2ImgPipeline.__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 <code>~pipelines.stable_diffusion.AltDiffusionPipelineOutput</code> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.AltDiffusionImg2ImgPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.AltDiffusionImg2ImgPipeline.__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 will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py#L461",returnDescription:`
<p><code>~pipelines.stable_diffusion.AltDiffusionPipelineOutput</code> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><code>~pipelines.stable_diffusion.AltDiffusionPipelineOutput</code> or <code>tuple</code></p>
`}}),se=new No({props:{anchor:"diffusers.AltDiffusionImg2ImgPipeline.__call__.example",$$slots:{default:[Vo]},$$scope:{ctx:qe}}}),je=new z({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.AltDiffusionImg2ImgPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py#L208"}}),{c(){g=n("meta"),T=l(),P=n("h1"),h=n("a"),k=n("span"),v(u.$$.fragment),$=l(),ut=n("span"),Vi=o("AltDiffusion"),oi=l(),H=n("p"),Hi=o("AltDiffusion was proposed in "),fe=n("a"),Xi=o("AltCLIP: Altering the Language Encoder in CLIP for Extended Language Capabilities"),Ki=o(" by Zhongzhi Chen, Guang Liu, Bo-Wen Zhang, Fulong Ye, Qinghong Yang, Ledell Wu"),ri=l(),Ne=n("p"),Yi=o("The abstract of the paper is the following:"),li=l(),Ge=n("p"),mt=n("em"),Zi=o("In this work, we present a conceptually simple and effective method to train a strong bilingual multimodal representation model. Starting from the pretrained multimodal representation model CLIP released by OpenAI, we switched its text encoder with a pretrained multilingual text encoder XLM-R, and aligned both languages and image representations by a two-stage training schema consisting of teacher learning and contrastive learning. We validate our method through evaluations of a wide range of tasks. We set new state-of-the-art performances on a bunch of tasks including ImageNet-CN, Flicker30k- CN, and COCO-CN. Further, we obtain very close performances with CLIP on almost all tasks, suggesting that one can simply alter the text encoder in CLIP for extended capabilities such as multilingual understanding."),fi=l(),de=n("p"),ht=n("em"),Qi=o("Overview"),Ji=o(":"),di=l(),X=n("table"),gt=n("thead"),S=n("tr"),_t=n("th"),en=o("Pipeline"),tn=l(),vt=n("th"),nn=o("Tasks"),sn=l(),Ue=n("th"),an=o("Colab"),on=l(),Be=n("th"),rn=o("Demo"),ln=l(),ce=n("tbody"),j=n("tr"),bt=n("td"),pe=n("a"),fn=o("pipeline_alt_diffusion.py"),dn=l(),Dt=n("td"),yt=n("em"),cn=o("Text-to-Image Generation"),pn=l(),ze=n("td"),un=o("-"),mn=l(),Fe=n("td"),hn=o("-"),gn=l(),M=n("tr"),At=n("td"),ue=n("a"),_n=o("pipeline_alt_diffusion_img2img.py"),vn=l(),wt=n("td"),Pt=n("em"),bn=o("Image-to-Image Text-Guided Generation"),Dn=l(),We=n("td"),yn=o("-"),An=l(),Re=n("td"),wn=o("-"),ci=l(),F=n("h2"),K=n("a"),It=n("span"),v(me.$$.fragment),Pn=l(),$t=n("span"),In=o("Tips"),pi=l(),Y=n("ul"),Et=n("li"),he=n("p"),$n=o("AltDiffusion is conceptually exaclty the same as "),Ve=n("a"),En=o("Stable Diffusion"),kn=o("."),xn=l(),kt=n("li"),xt=n("p"),Ct=n("em"),Cn=o("Run AltDiffusion"),ui=l(),E=n("p"),Tn=o("AltDiffusion can be tested very easily with the "),He=n("a"),Ln=o("AltDiffusionPipeline"),Sn=o(", "),Xe=n("a"),jn=o("AltDiffusionImg2ImgPipeline"),Mn=o(" and the "),Tt=n("code"),On=o('"BAAI/AltDiffusion-m9"'),qn=o(" checkpoint exactly in the same way it is shown in the "),Ke=n("a"),Nn=o("Conditional Image Generation Guide"),Gn=o(" and the "),Ye=n("a"),Un=o("Image-to-Image Generation Guide"),Bn=o("."),mi=l(),Ze=n("ul"),Lt=n("li"),St=n("em"),zn=o("How to load and use different schedulers."),hi=l(),m=n("p"),Fn=o("The alt diffusion pipeline uses "),Qe=n("a"),Wn=o("DDIMScheduler"),Rn=o(" scheduler by default. But "),jt=n("code"),Vn=o("diffusers"),Hn=o(" provides many other schedulers that can be used with the alt diffusion pipeline such as "),Je=n("a"),Xn=o("PNDMScheduler"),Kn=o(", "),et=n("a"),Yn=o("LMSDiscreteScheduler"),Zn=o(", "),tt=n("a"),Qn=o("EulerDiscreteScheduler"),Jn=o(", "),it=n("a"),es=o("EulerAncestralDiscreteScheduler"),ts=o(` etc.
To use a different scheduler, you can either change it via the `),nt=n("a"),is=o("ConfigMixin.from_config()"),ns=o(" method or pass the "),Mt=n("code"),ss=o("scheduler"),as=o(" argument to the "),Ot=n("code"),os=o("from_pretrained"),rs=o(" method of the pipeline. For example, to use the "),st=n("a"),ls=o("EulerDiscreteScheduler"),fs=o(", you can do the following:"),gi=l(),v(ge.$$.fragment),_i=l(),at=n("ul"),qt=n("li"),Nt=n("em"),ds=o("How to convert all use cases with multiple or single pipeline"),vi=l(),q=n("p"),cs=o("If you want to use all possible use cases in a single "),Gt=n("code"),ps=o("DiffusionPipeline"),us=o(" we recommend using the "),Ut=n("code"),ms=o("components"),hs=o(" functionality to instantiate all components in the most memory-efficient way:"),bi=l(),v(_e.$$.fragment),Di=l(),W=n("h2"),Z=n("a"),Bt=n("span"),v(ve.$$.fragment),gs=l(),zt=n("span"),_s=o("AltDiffusionPipelineOutput"),yi=l(),O=n("div"),v(be.$$.fragment),vs=l(),Ft=n("p"),bs=o("Output class for Alt Diffusion pipelines."),Ds=l(),Q=n("div"),v(De.$$.fragment),ys=l(),Wt=n("p"),As=o("Call self as a function."),Ai=l(),R=n("h2"),J=n("a"),Rt=n("span"),v(ye.$$.fragment),ws=l(),Vt=n("span"),Ps=o("AltDiffusionPipeline"),wi=l(),I=n("div"),v(Ae.$$.fragment),Is=l(),Ht=n("p"),$s=o("Pipeline for text-to-image generation using Alt Diffusion."),Es=l(),we=n("p"),ks=o("This model inherits from "),ot=n("a"),xs=o("DiffusionPipeline"),Cs=o(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Ts=l(),N=n("div"),v(Pe.$$.fragment),Ls=l(),Xt=n("p"),Ss=o("Function invoked when calling the pipeline for generation."),js=l(),v(ee.$$.fragment),Ms=l(),te=n("div"),v(Ie.$$.fragment),Os=l(),$e=n("p"),qs=o("Disable sliced VAE decoding. If "),Kt=n("code"),Ns=o("enable_vae_slicing"),Gs=o(` was previously invoked, this method will go back to
computing decoding in one step.`),Us=l(),ie=n("div"),v(Ee.$$.fragment),Bs=l(),ke=n("p"),zs=o(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),Yt=n("code"),Fs=o("torch.device('meta') and loaded to GPU only when their specific submodule has its "),Ws=o("forward` method called."),Rs=l(),G=n("div"),v(xe.$$.fragment),Vs=l(),Zt=n("p"),Hs=o("Enable sliced VAE decoding."),Xs=l(),Qt=n("p"),Ks=o(`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.`),Pi=l(),V=n("h2"),ne=n("a"),Jt=n("span"),v(Ce.$$.fragment),Ys=l(),ei=n("span"),Zs=o("AltDiffusionImg2ImgPipeline"),Ii=l(),x=n("div"),v(Te.$$.fragment),Qs=l(),ti=n("p"),Js=o("Pipeline for text-guided image to image generation using Alt Diffusion."),ea=l(),Le=n("p"),ta=o("This model inherits from "),rt=n("a"),ia=o("DiffusionPipeline"),na=o(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),sa=l(),U=n("div"),v(Se.$$.fragment),aa=l(),ii=n("p"),oa=o("Function invoked when calling the pipeline for generation."),ra=l(),v(se.$$.fragment),la=l(),ae=n("div"),v(je.$$.fragment),fa=l(),Me=n("p"),da=o(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),ni=n("code"),ca=o("torch.device('meta') and loaded to GPU only when their specific submodule has its "),pa=o("forward` method called."),this.h()},l(t){const c=Fo('[data-svelte="svelte-1phssyn"]',document.head);g=s(c,"META",{name:!0,content:!0}),c.forEach(i),T=f(t),P=s(t,"H1",{class:!0});var Oe=a(P);h=s(Oe,"A",{id:!0,class:!0,href:!0});var si=a(h);k=s(si,"SPAN",{});var ma=a(k);b(u.$$.fragment,ma),ma.forEach(i),si.forEach(i),$=f(Oe),ut=s(Oe,"SPAN",{});var ha=a(ut);Vi=r(ha,"AltDiffusion"),ha.forEach(i),Oe.forEach(i),oi=f(t),H=s(t,"P",{});var Ei=a(H);Hi=r(Ei,"AltDiffusion was proposed in "),fe=s(Ei,"A",{href:!0,rel:!0});var ga=a(fe);Xi=r(ga,"AltCLIP: Altering the Language Encoder in CLIP for Extended Language Capabilities"),ga.forEach(i),Ki=r(Ei," by Zhongzhi Chen, Guang Liu, Bo-Wen Zhang, Fulong Ye, Qinghong Yang, Ledell Wu"),Ei.forEach(i),ri=f(t),Ne=s(t,"P",{});var _a=a(Ne);Yi=r(_a,"The abstract of the paper is the following:"),_a.forEach(i),li=f(t),Ge=s(t,"P",{});var va=a(Ge);mt=s(va,"EM",{});var ba=a(mt);Zi=r(ba,"In this work, we present a conceptually simple and effective method to train a strong bilingual multimodal representation model. Starting from the pretrained multimodal representation model CLIP released by OpenAI, we switched its text encoder with a pretrained multilingual text encoder XLM-R, and aligned both languages and image representations by a two-stage training schema consisting of teacher learning and contrastive learning. We validate our method through evaluations of a wide range of tasks. We set new state-of-the-art performances on a bunch of tasks including ImageNet-CN, Flicker30k- CN, and COCO-CN. Further, we obtain very close performances with CLIP on almost all tasks, suggesting that one can simply alter the text encoder in CLIP for extended capabilities such as multilingual understanding."),ba.forEach(i),va.forEach(i),fi=f(t),de=s(t,"P",{});var ua=a(de);ht=s(ua,"EM",{});var Da=a(ht);Qi=r(Da,"Overview"),Da.forEach(i),Ji=r(ua,":"),ua.forEach(i),di=f(t),X=s(t,"TABLE",{});var ki=a(X);gt=s(ki,"THEAD",{});var ya=a(gt);S=s(ya,"TR",{});var oe=a(S);_t=s(oe,"TH",{});var Aa=a(_t);en=r(Aa,"Pipeline"),Aa.forEach(i),tn=f(oe),vt=s(oe,"TH",{});var wa=a(vt);nn=r(wa,"Tasks"),wa.forEach(i),sn=f(oe),Ue=s(oe,"TH",{align:!0});var Pa=a(Ue);an=r(Pa,"Colab"),Pa.forEach(i),on=f(oe),Be=s(oe,"TH",{align:!0});var Ia=a(Be);rn=r(Ia,"Demo"),Ia.forEach(i),oe.forEach(i),ya.forEach(i),ln=f(ki),ce=s(ki,"TBODY",{});var xi=a(ce);j=s(xi,"TR",{});var re=a(j);bt=s(re,"TD",{});var $a=a(bt);pe=s($a,"A",{href:!0,rel:!0});var Ea=a(pe);fn=r(Ea,"pipeline_alt_diffusion.py"),Ea.forEach(i),$a.forEach(i),dn=f(re),Dt=s(re,"TD",{});var ka=a(Dt);yt=s(ka,"EM",{});var xa=a(yt);cn=r(xa,"Text-to-Image Generation"),xa.forEach(i),ka.forEach(i),pn=f(re),ze=s(re,"TD",{align:!0});var Ca=a(ze);un=r(Ca,"-"),Ca.forEach(i),mn=f(re),Fe=s(re,"TD",{align:!0});var Ta=a(Fe);hn=r(Ta,"-"),Ta.forEach(i),re.forEach(i),gn=f(xi),M=s(xi,"TR",{});var le=a(M);At=s(le,"TD",{});var La=a(At);ue=s(La,"A",{href:!0,rel:!0});var Sa=a(ue);_n=r(Sa,"pipeline_alt_diffusion_img2img.py"),Sa.forEach(i),La.forEach(i),vn=f(le),wt=s(le,"TD",{});var ja=a(wt);Pt=s(ja,"EM",{});var Ma=a(Pt);bn=r(Ma,"Image-to-Image Text-Guided Generation"),Ma.forEach(i),ja.forEach(i),Dn=f(le),We=s(le,"TD",{align:!0});var Oa=a(We);yn=r(Oa,"-"),Oa.forEach(i),An=f(le),Re=s(le,"TD",{align:!0});var qa=a(Re);wn=r(qa,"-"),qa.forEach(i),le.forEach(i),xi.forEach(i),ki.forEach(i),ci=f(t),F=s(t,"H2",{class:!0});var Ci=a(F);K=s(Ci,"A",{id:!0,class:!0,href:!0});var Na=a(K);It=s(Na,"SPAN",{});var Ga=a(It);b(me.$$.fragment,Ga),Ga.forEach(i),Na.forEach(i),Pn=f(Ci),$t=s(Ci,"SPAN",{});var Ua=a($t);In=r(Ua,"Tips"),Ua.forEach(i),Ci.forEach(i),pi=f(t),Y=s(t,"UL",{});var Ti=a(Y);Et=s(Ti,"LI",{});var Ba=a(Et);he=s(Ba,"P",{});var Li=a(he);$n=r(Li,"AltDiffusion is conceptually exaclty the same as "),Ve=s(Li,"A",{href:!0});var za=a(Ve);En=r(za,"Stable Diffusion"),za.forEach(i),kn=r(Li,"."),Li.forEach(i),Ba.forEach(i),xn=f(Ti),kt=s(Ti,"LI",{});var Fa=a(kt);xt=s(Fa,"P",{});var Wa=a(xt);Ct=s(Wa,"EM",{});var Ra=a(Ct);Cn=r(Ra,"Run AltDiffusion"),Ra.forEach(i),Wa.forEach(i),Fa.forEach(i),Ti.forEach(i),ui=f(t),E=s(t,"P",{});var L=a(E);Tn=r(L,"AltDiffusion can be tested very easily with the "),He=s(L,"A",{href:!0});var Va=a(He);Ln=r(Va,"AltDiffusionPipeline"),Va.forEach(i),Sn=r(L,", "),Xe=s(L,"A",{href:!0});var Ha=a(Xe);jn=r(Ha,"AltDiffusionImg2ImgPipeline"),Ha.forEach(i),Mn=r(L," and the "),Tt=s(L,"CODE",{});var Xa=a(Tt);On=r(Xa,'"BAAI/AltDiffusion-m9"'),Xa.forEach(i),qn=r(L," checkpoint exactly in the same way it is shown in the "),Ke=s(L,"A",{href:!0});var Ka=a(Ke);Nn=r(Ka,"Conditional Image Generation Guide"),Ka.forEach(i),Gn=r(L," and the "),Ye=s(L,"A",{href:!0});var Ya=a(Ye);Un=r(Ya,"Image-to-Image Generation Guide"),Ya.forEach(i),Bn=r(L,"."),L.forEach(i),mi=f(t),Ze=s(t,"UL",{});var Za=a(Ze);Lt=s(Za,"LI",{});var Qa=a(Lt);St=s(Qa,"EM",{});var Ja=a(St);zn=r(Ja,"How to load and use different schedulers."),Ja.forEach(i),Qa.forEach(i),Za.forEach(i),hi=f(t),m=s(t,"P",{});var _=a(m);Fn=r(_,"The alt diffusion pipeline uses "),Qe=s(_,"A",{href:!0});var eo=a(Qe);Wn=r(eo,"DDIMScheduler"),eo.forEach(i),Rn=r(_," scheduler by default. But "),jt=s(_,"CODE",{});var to=a(jt);Vn=r(to,"diffusers"),to.forEach(i),Hn=r(_," provides many other schedulers that can be used with the alt diffusion pipeline such as "),Je=s(_,"A",{href:!0});var io=a(Je);Xn=r(io,"PNDMScheduler"),io.forEach(i),Kn=r(_,", "),et=s(_,"A",{href:!0});var no=a(et);Yn=r(no,"LMSDiscreteScheduler"),no.forEach(i),Zn=r(_,", "),tt=s(_,"A",{href:!0});var so=a(tt);Qn=r(so,"EulerDiscreteScheduler"),so.forEach(i),Jn=r(_,", "),it=s(_,"A",{href:!0});var ao=a(it);es=r(ao,"EulerAncestralDiscreteScheduler"),ao.forEach(i),ts=r(_,` etc.
To use a different scheduler, you can either change it via the `),nt=s(_,"A",{href:!0});var oo=a(nt);is=r(oo,"ConfigMixin.from_config()"),oo.forEach(i),ns=r(_," method or pass the "),Mt=s(_,"CODE",{});var ro=a(Mt);ss=r(ro,"scheduler"),ro.forEach(i),as=r(_," argument to the "),Ot=s(_,"CODE",{});var lo=a(Ot);os=r(lo,"from_pretrained"),lo.forEach(i),rs=r(_," method of the pipeline. For example, to use the "),st=s(_,"A",{href:!0});var fo=a(st);ls=r(fo,"EulerDiscreteScheduler"),fo.forEach(i),fs=r(_,", you can do the following:"),_.forEach(i),gi=f(t),b(ge.$$.fragment,t),_i=f(t),at=s(t,"UL",{});var co=a(at);qt=s(co,"LI",{});var po=a(qt);Nt=s(po,"EM",{});var uo=a(Nt);ds=r(uo,"How to convert all use cases with multiple or single pipeline"),uo.forEach(i),po.forEach(i),co.forEach(i),vi=f(t),q=s(t,"P",{});var lt=a(q);cs=r(lt,"If you want to use all possible use cases in a single "),Gt=s(lt,"CODE",{});var mo=a(Gt);ps=r(mo,"DiffusionPipeline"),mo.forEach(i),us=r(lt," we recommend using the "),Ut=s(lt,"CODE",{});var ho=a(Ut);ms=r(ho,"components"),ho.forEach(i),hs=r(lt," functionality to instantiate all components in the most memory-efficient way:"),lt.forEach(i),bi=f(t),b(_e.$$.fragment,t),Di=f(t),W=s(t,"H2",{class:!0});var Si=a(W);Z=s(Si,"A",{id:!0,class:!0,href:!0});var go=a(Z);Bt=s(go,"SPAN",{});var _o=a(Bt);b(ve.$$.fragment,_o),_o.forEach(i),go.forEach(i),gs=f(Si),zt=s(Si,"SPAN",{});var vo=a(zt);_s=r(vo,"AltDiffusionPipelineOutput"),vo.forEach(i),Si.forEach(i),yi=f(t),O=s(t,"DIV",{class:!0});var ft=a(O);b(be.$$.fragment,ft),vs=f(ft),Ft=s(ft,"P",{});var bo=a(Ft);bs=r(bo,"Output class for Alt Diffusion pipelines."),bo.forEach(i),Ds=f(ft),Q=s(ft,"DIV",{class:!0});var ji=a(Q);b(De.$$.fragment,ji),ys=f(ji),Wt=s(ji,"P",{});var Do=a(Wt);As=r(Do,"Call self as a function."),Do.forEach(i),ji.forEach(i),ft.forEach(i),Ai=f(t),R=s(t,"H2",{class:!0});var Mi=a(R);J=s(Mi,"A",{id:!0,class:!0,href:!0});var yo=a(J);Rt=s(yo,"SPAN",{});var Ao=a(Rt);b(ye.$$.fragment,Ao),Ao.forEach(i),yo.forEach(i),ws=f(Mi),Vt=s(Mi,"SPAN",{});var wo=a(Vt);Ps=r(wo,"AltDiffusionPipeline"),wo.forEach(i),Mi.forEach(i),wi=f(t),I=s(t,"DIV",{class:!0});var C=a(I);b(Ae.$$.fragment,C),Is=f(C),Ht=s(C,"P",{});var Po=a(Ht);$s=r(Po,"Pipeline for text-to-image generation using Alt Diffusion."),Po.forEach(i),Es=f(C),we=s(C,"P",{});var Oi=a(we);ks=r(Oi,"This model inherits from "),ot=s(Oi,"A",{href:!0});var Io=a(ot);xs=r(Io,"DiffusionPipeline"),Io.forEach(i),Cs=r(Oi,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Oi.forEach(i),Ts=f(C),N=s(C,"DIV",{class:!0});var dt=a(N);b(Pe.$$.fragment,dt),Ls=f(dt),Xt=s(dt,"P",{});var $o=a(Xt);Ss=r($o,"Function invoked when calling the pipeline for generation."),$o.forEach(i),js=f(dt),b(ee.$$.fragment,dt),dt.forEach(i),Ms=f(C),te=s(C,"DIV",{class:!0});var qi=a(te);b(Ie.$$.fragment,qi),Os=f(qi),$e=s(qi,"P",{});var Ni=a($e);qs=r(Ni,"Disable sliced VAE decoding. If "),Kt=s(Ni,"CODE",{});var Eo=a(Kt);Ns=r(Eo,"enable_vae_slicing"),Eo.forEach(i),Gs=r(Ni,` was previously invoked, this method will go back to
computing decoding in one step.`),Ni.forEach(i),qi.forEach(i),Us=f(C),ie=s(C,"DIV",{class:!0});var Gi=a(ie);b(Ee.$$.fragment,Gi),Bs=f(Gi),ke=s(Gi,"P",{});var Ui=a(ke);zs=r(Ui,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),Yt=s(Ui,"CODE",{});var ko=a(Yt);Fs=r(ko,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),ko.forEach(i),Ws=r(Ui,"forward` method called."),Ui.forEach(i),Gi.forEach(i),Rs=f(C),G=s(C,"DIV",{class:!0});var ct=a(G);b(xe.$$.fragment,ct),Vs=f(ct),Zt=s(ct,"P",{});var xo=a(Zt);Hs=r(xo,"Enable sliced VAE decoding."),xo.forEach(i),Xs=f(ct),Qt=s(ct,"P",{});var Co=a(Qt);Ks=r(Co,`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.`),Co.forEach(i),ct.forEach(i),C.forEach(i),Pi=f(t),V=s(t,"H2",{class:!0});var Bi=a(V);ne=s(Bi,"A",{id:!0,class:!0,href:!0});var To=a(ne);Jt=s(To,"SPAN",{});var Lo=a(Jt);b(Ce.$$.fragment,Lo),Lo.forEach(i),To.forEach(i),Ys=f(Bi),ei=s(Bi,"SPAN",{});var So=a(ei);Zs=r(So,"AltDiffusionImg2ImgPipeline"),So.forEach(i),Bi.forEach(i),Ii=f(t),x=s(t,"DIV",{class:!0});var B=a(x);b(Te.$$.fragment,B),Qs=f(B),ti=s(B,"P",{});var jo=a(ti);Js=r(jo,"Pipeline for text-guided image to image generation using Alt Diffusion."),jo.forEach(i),ea=f(B),Le=s(B,"P",{});var zi=a(Le);ta=r(zi,"This model inherits from "),rt=s(zi,"A",{href:!0});var Mo=a(rt);ia=r(Mo,"DiffusionPipeline"),Mo.forEach(i),na=r(zi,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),zi.forEach(i),sa=f(B),U=s(B,"DIV",{class:!0});var pt=a(U);b(Se.$$.fragment,pt),aa=f(pt),ii=s(pt,"P",{});var Oo=a(ii);oa=r(Oo,"Function invoked when calling the pipeline for generation."),Oo.forEach(i),ra=f(pt),b(se.$$.fragment,pt),pt.forEach(i),la=f(B),ae=s(B,"DIV",{class:!0});var Fi=a(ae);b(je.$$.fragment,Fi),fa=f(Fi),Me=s(Fi,"P",{});var Wi=a(Me);da=r(Wi,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),ni=s(Wi,"CODE",{});var qo=a(ni);ca=r(qo,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),qo.forEach(i),pa=r(Wi,"forward` method called."),Wi.forEach(i),Fi.forEach(i),B.forEach(i),this.h()},h(){d(g,"name","hf:doc:metadata"),d(g,"content",JSON.stringify(Xo)),d(h,"id","altdiffusion"),d(h,"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"),d(h,"href","#altdiffusion"),d(P,"class","relative group"),d(fe,"href","https://arxiv.org/abs/2211.06679"),d(fe,"rel","nofollow"),d(Ue,"align","center"),d(Be,"align","center"),d(pe,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py"),d(pe,"rel","nofollow"),d(ze,"align","center"),d(Fe,"align","center"),d(ue,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py"),d(ue,"rel","nofollow"),d(We,"align","center"),d(Re,"align","center"),d(K,"id","tips"),d(K,"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"),d(K,"href","#tips"),d(F,"class","relative group"),d(Ve,"href","./api/pipelines/stable_diffusion/overview"),d(He,"href","/docs/diffusers/main/en/api/pipelines/alt_diffusion#diffusers.AltDiffusionPipeline"),d(Xe,"href","/docs/diffusers/main/en/api/pipelines/alt_diffusion#diffusers.AltDiffusionImg2ImgPipeline"),d(Ke,"href","./using-diffusers/conditional_image_generation"),d(Ye,"href","./using-diffusers/img2img"),d(Qe,"href","/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler"),d(Je,"href","/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler"),d(et,"href","/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler"),d(tt,"href","/docs/diffusers/main/en/api/schedulers/euler#diffusers.EulerDiscreteScheduler"),d(it,"href","/docs/diffusers/main/en/api/schedulers/euler_ancestral#diffusers.EulerAncestralDiscreteScheduler"),d(nt,"href","/docs/diffusers/main/en/api/configuration#diffusers.ConfigMixin.from_config"),d(st,"href","/docs/diffusers/main/en/api/schedulers/euler#diffusers.EulerDiscreteScheduler"),d(Z,"id","diffusers.pipelines.alt_diffusion.AltDiffusionPipelineOutput"),d(Z,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Z,"href","#diffusers.pipelines.alt_diffusion.AltDiffusionPipelineOutput"),d(W,"class","relative group"),d(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(J,"id","diffusers.AltDiffusionPipeline"),d(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"),d(J,"href","#diffusers.AltDiffusionPipeline"),d(R,"class","relative group"),d(ot,"href","/docs/diffusers/main/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),d(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ne,"id","diffusers.AltDiffusionImg2ImgPipeline"),d(ne,"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"),d(ne,"href","#diffusers.AltDiffusionImg2ImgPipeline"),d(V,"class","relative group"),d(rt,"href","/docs/diffusers/main/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),d(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(x,"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,c){e(document.head,g),p(t,T,c),p(t,P,c),e(P,h),e(h,k),D(u,k,null),e(P,$),e(P,ut),e(ut,Vi),p(t,oi,c),p(t,H,c),e(H,Hi),e(H,fe),e(fe,Xi),e(H,Ki),p(t,ri,c),p(t,Ne,c),e(Ne,Yi),p(t,li,c),p(t,Ge,c),e(Ge,mt),e(mt,Zi),p(t,fi,c),p(t,de,c),e(de,ht),e(ht,Qi),e(de,Ji),p(t,di,c),p(t,X,c),e(X,gt),e(gt,S),e(S,_t),e(_t,en),e(S,tn),e(S,vt),e(vt,nn),e(S,sn),e(S,Ue),e(Ue,an),e(S,on),e(S,Be),e(Be,rn),e(X,ln),e(X,ce),e(ce,j),e(j,bt),e(bt,pe),e(pe,fn),e(j,dn),e(j,Dt),e(Dt,yt),e(yt,cn),e(j,pn),e(j,ze),e(ze,un),e(j,mn),e(j,Fe),e(Fe,hn),e(ce,gn),e(ce,M),e(M,At),e(At,ue),e(ue,_n),e(M,vn),e(M,wt),e(wt,Pt),e(Pt,bn),e(M,Dn),e(M,We),e(We,yn),e(M,An),e(M,Re),e(Re,wn),p(t,ci,c),p(t,F,c),e(F,K),e(K,It),D(me,It,null),e(F,Pn),e(F,$t),e($t,In),p(t,pi,c),p(t,Y,c),e(Y,Et),e(Et,he),e(he,$n),e(he,Ve),e(Ve,En),e(he,kn),e(Y,xn),e(Y,kt),e(kt,xt),e(xt,Ct),e(Ct,Cn),p(t,ui,c),p(t,E,c),e(E,Tn),e(E,He),e(He,Ln),e(E,Sn),e(E,Xe),e(Xe,jn),e(E,Mn),e(E,Tt),e(Tt,On),e(E,qn),e(E,Ke),e(Ke,Nn),e(E,Gn),e(E,Ye),e(Ye,Un),e(E,Bn),p(t,mi,c),p(t,Ze,c),e(Ze,Lt),e(Lt,St),e(St,zn),p(t,hi,c),p(t,m,c),e(m,Fn),e(m,Qe),e(Qe,Wn),e(m,Rn),e(m,jt),e(jt,Vn),e(m,Hn),e(m,Je),e(Je,Xn),e(m,Kn),e(m,et),e(et,Yn),e(m,Zn),e(m,tt),e(tt,Qn),e(m,Jn),e(m,it),e(it,es),e(m,ts),e(m,nt),e(nt,is),e(m,ns),e(m,Mt),e(Mt,ss),e(m,as),e(m,Ot),e(Ot,os),e(m,rs),e(m,st),e(st,ls),e(m,fs),p(t,gi,c),D(ge,t,c),p(t,_i,c),p(t,at,c),e(at,qt),e(qt,Nt),e(Nt,ds),p(t,vi,c),p(t,q,c),e(q,cs),e(q,Gt),e(Gt,ps),e(q,us),e(q,Ut),e(Ut,ms),e(q,hs),p(t,bi,c),D(_e,t,c),p(t,Di,c),p(t,W,c),e(W,Z),e(Z,Bt),D(ve,Bt,null),e(W,gs),e(W,zt),e(zt,_s),p(t,yi,c),p(t,O,c),D(be,O,null),e(O,vs),e(O,Ft),e(Ft,bs),e(O,Ds),e(O,Q),D(De,Q,null),e(Q,ys),e(Q,Wt),e(Wt,As),p(t,Ai,c),p(t,R,c),e(R,J),e(J,Rt),D(ye,Rt,null),e(R,ws),e(R,Vt),e(Vt,Ps),p(t,wi,c),p(t,I,c),D(Ae,I,null),e(I,Is),e(I,Ht),e(Ht,$s),e(I,Es),e(I,we),e(we,ks),e(we,ot),e(ot,xs),e(we,Cs),e(I,Ts),e(I,N),D(Pe,N,null),e(N,Ls),e(N,Xt),e(Xt,Ss),e(N,js),D(ee,N,null),e(I,Ms),e(I,te),D(Ie,te,null),e(te,Os),e(te,$e),e($e,qs),e($e,Kt),e(Kt,Ns),e($e,Gs),e(I,Us),e(I,ie),D(Ee,ie,null),e(ie,Bs),e(ie,ke),e(ke,zs),e(ke,Yt),e(Yt,Fs),e(ke,Ws),e(I,Rs),e(I,G),D(xe,G,null),e(G,Vs),e(G,Zt),e(Zt,Hs),e(G,Xs),e(G,Qt),e(Qt,Ks),p(t,Pi,c),p(t,V,c),e(V,ne),e(ne,Jt),D(Ce,Jt,null),e(V,Ys),e(V,ei),e(ei,Zs),p(t,Ii,c),p(t,x,c),D(Te,x,null),e(x,Qs),e(x,ti),e(ti,Js),e(x,ea),e(x,Le),e(Le,ta),e(Le,rt),e(rt,ia),e(Le,na),e(x,sa),e(x,U),D(Se,U,null),e(U,aa),e(U,ii),e(ii,oa),e(U,ra),D(se,U,null),e(x,la),e(x,ae),D(je,ae,null),e(ae,fa),e(ae,Me),e(Me,da),e(Me,ni),e(ni,ca),e(Me,pa),$i=!0},p(t,[c]){const Oe={};c&2&&(Oe.$$scope={dirty:c,ctx:t}),ee.$set(Oe);const si={};c&2&&(si.$$scope={dirty:c,ctx:t}),se.$set(si)},i(t){$i||(y(u.$$.fragment,t),y(me.$$.fragment,t),y(ge.$$.fragment,t),y(_e.$$.fragment,t),y(ve.$$.fragment,t),y(be.$$.fragment,t),y(De.$$.fragment,t),y(ye.$$.fragment,t),y(Ae.$$.fragment,t),y(Pe.$$.fragment,t),y(ee.$$.fragment,t),y(Ie.$$.fragment,t),y(Ee.$$.fragment,t),y(xe.$$.fragment,t),y(Ce.$$.fragment,t),y(Te.$$.fragment,t),y(Se.$$.fragment,t),y(se.$$.fragment,t),y(je.$$.fragment,t),$i=!0)},o(t){A(u.$$.fragment,t),A(me.$$.fragment,t),A(ge.$$.fragment,t),A(_e.$$.fragment,t),A(ve.$$.fragment,t),A(be.$$.fragment,t),A(De.$$.fragment,t),A(ye.$$.fragment,t),A(Ae.$$.fragment,t),A(Pe.$$.fragment,t),A(ee.$$.fragment,t),A(Ie.$$.fragment,t),A(Ee.$$.fragment,t),A(xe.$$.fragment,t),A(Ce.$$.fragment,t),A(Te.$$.fragment,t),A(Se.$$.fragment,t),A(se.$$.fragment,t),A(je.$$.fragment,t),$i=!1},d(t){i(g),t&&i(T),t&&i(P),w(u),t&&i(oi),t&&i(H),t&&i(ri),t&&i(Ne),t&&i(li),t&&i(Ge),t&&i(fi),t&&i(de),t&&i(di),t&&i(X),t&&i(ci),t&&i(F),w(me),t&&i(pi),t&&i(Y),t&&i(ui),t&&i(E),t&&i(mi),t&&i(Ze),t&&i(hi),t&&i(m),t&&i(gi),w(ge,t),t&&i(_i),t&&i(at),t&&i(vi),t&&i(q),t&&i(bi),w(_e,t),t&&i(Di),t&&i(W),w(ve),t&&i(yi),t&&i(O),w(be),w(De),t&&i(Ai),t&&i(R),w(ye),t&&i(wi),t&&i(I),w(Ae),w(Pe),w(ee),w(Ie),w(Ee),w(xe),t&&i(Pi),t&&i(V),w(Ce),t&&i(Ii),t&&i(x),w(Te),w(Se),w(se),w(je)}}}const Xo={local:"altdiffusion",sections:[{local:"tips",title:"Tips"},{local:"diffusers.pipelines.alt_diffusion.AltDiffusionPipelineOutput",title:"AltDiffusionPipelineOutput"},{local:"diffusers.AltDiffusionPipeline",title:"AltDiffusionPipeline"},{local:"diffusers.AltDiffusionImg2ImgPipeline",title:"AltDiffusionImg2ImgPipeline"}],title:"AltDiffusion"};function Ko(qe){return Wo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class tr extends Uo{constructor(g){super();Bo(this,g,Ko,Ho,zo,{})}}export{tr as default,Xo as metadata};
