import{S as df,i as ff,s as cf,e as i,k as l,w as v,t as a,M as pf,c as o,d as t,m as d,a as s,x as b,h as r,b as f,G as e,g as p,y as w,q as y,o as D,B as A,v as uf,L as lf}from"../../../chunks/vendor-hf-doc-builder.js";import{D as T}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as po}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as hi}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as rf}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function mf(at){let I,j,$,P,C;return P=new po({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(){I=i("p"),j=a("Examples:"),$=l(),v(P.$$.fragment)},l(u){I=o(u,"P",{});var k=s(I);j=r(k,"Examples:"),k.forEach(t),$=d(u),b(P.$$.fragment,u)},m(u,k){p(u,I,k),e(I,j),p(u,$,k),w(P,u,k),C=!0},p:lf,i(u){C||(y(P.$$.fragment,u),C=!0)},o(u){D(P.$$.fragment,u),C=!1},d(u){u&&t(I),u&&t($),A(P,u)}}}function hf(at){let I,j,$,P,C;return P=new po({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(){I=i("p"),j=a("Examples:"),$=l(),v(P.$$.fragment)},l(u){I=o(u,"P",{});var k=s(I);j=r(k,"Examples:"),k.forEach(t),$=d(u),b(P.$$.fragment,u)},m(u,k){p(u,I,k),e(I,j),p(u,$,k),w(P,u,k),C=!0},p:lf,i(u){C||(y(P.$$.fragment,u),C=!0)},o(u){D(P.$$.fragment,u),C=!1},d(u){u&&t(I),u&&t($),A(P,u)}}}function gf(at){let I,j,$,P,C,u,k,Kt,uo,gi,ne,mo,ye,ho,go,_i,rt,_o,vi,lt,Yt,vo,bi,De,Zt,bo,wo,wi,ie,Qt,N,Jt,yo,Do,en,Ao,Po,dt,Io,Eo,ft,xo,$o,Ae,q,tn,Pe,ko,Lo,nn,on,Co,To,ct,Mo,So,pt,jo,Oo,U,sn,Ie,No,qo,an,rn,Uo,Go,ut,Fo,Ro,mt,Vo,yi,X,oe,ln,Ee,Bo,dn,zo,Di,se,fn,xe,Wo,ht,Ho,Xo,Ko,cn,pn,un,Yo,Ai,L,Zo,gt,Qo,Jo,_t,es,ts,mn,ns,is,vt,os,ss,bt,as,rs,Pi,wt,hn,gn,ls,Ii,g,ds,yt,fs,cs,_n,ps,us,Dt,ms,hs,At,gs,_s,Pt,vs,bs,It,ws,ys,Et,Ds,As,vn,Ps,Is,bn,Es,xs,xt,$s,ks,Ei,$e,xi,$t,wn,yn,Ls,$i,F,Cs,Dn,Ts,Ms,An,Ss,js,ki,ke,Li,K,ae,Pn,Le,Os,In,Ns,Ci,G,Ce,qs,En,Us,Gs,re,Te,Fs,xn,Rs,Ti,Y,le,$n,Me,Vs,kn,Bs,Mi,m,Se,zs,Ln,Ws,Hs,je,Xs,kt,Ks,Ys,Zs,Cn,Qs,Js,Z,Oe,Tn,ea,ta,Lt,na,ia,Ne,Mn,oa,sa,Ct,aa,ra,qe,Sn,la,da,Tt,fa,ca,jn,pa,ua,On,Ue,Nn,ma,ha,Mt,ga,_a,R,Ge,va,qn,ba,wa,de,ya,fe,Fe,Da,Re,Aa,Un,Pa,Ia,Ea,ce,Ve,xa,Be,$a,Gn,ka,La,Ca,pe,ze,Ta,M,Ma,Fn,Sa,ja,Rn,Oa,Na,Vn,qa,Ua,Bn,Ga,Fa,Ra,ue,We,Va,Q,Ba,zn,za,Wa,Wn,Ha,Xa,Ka,V,He,Ya,Hn,Za,Qa,Xn,Ja,er,B,Xe,tr,Kn,nr,ir,Yn,or,Si,J,me,Zn,Ke,sr,Qn,ar,ji,_,Ye,rr,Jn,lr,dr,Ze,fr,St,cr,pr,ur,ei,mr,hr,ee,Qe,ti,gr,_r,jt,vr,br,Je,ni,wr,yr,Ot,Dr,Ar,et,ii,Pr,Ir,Nt,Er,xr,oi,$r,kr,si,tt,ai,Lr,Cr,qt,Tr,Mr,z,nt,Sr,ri,jr,Or,he,Nr,ge,it,qr,S,Ur,li,Gr,Fr,di,Rr,Vr,fi,Br,zr,ci,Wr,Hr,Xr,_e,ot,Kr,te,Yr,pi,Zr,Qr,ui,Jr,el,Oi;return u=new hi({}),Ee=new hi({}),$e=new po({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)`}}),ke=new po({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>`}}),Le=new hi({}),Ce=new T({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/v0.16.0/src/diffusers/pipelines/alt_diffusion/__init__.py#L13"}}),Te=new T({props:{name:"__call__",anchor:"diffusers.pipelines.alt_diffusion.AltDiffusionPipelineOutput.__call__",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}]}}),Me=new hi({}),Se=new T({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:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.AltDiffusionPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.16.0/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/v0.16.0/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/v0.16.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.16.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.16.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.16.0/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>CLIPImageProcessor</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/v0.16.0/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py#L53"}}),Ge=new T({props:{name:"__call__",anchor:"diffusers.AltDiffusionPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 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:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"}],parametersDescription:[{anchor:"diffusers.AltDiffusionPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,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. 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.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/v0.16.0/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__.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.AltDiffusionPipeline.__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, <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.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"},{anchor:"diffusers.AltDiffusionPipeline.__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/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py#L527",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>
`}}),de=new rf({props:{anchor:"diffusers.AltDiffusionPipeline.__call__.example",$$slots:{default:[mf]},$$scope:{ctx:at}}}),Fe=new T({props:{name:"disable_vae_slicing",anchor:"diffusers.AltDiffusionPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py#L188"}}),Ve=new T({props:{name:"disable_vae_tiling",anchor:"diffusers.AltDiffusionPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py#L204"}}),ze=new T({props:{name:"enable_model_cpu_offload",anchor:"diffusers.AltDiffusionPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py#L236"}}),We=new T({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/v0.16.0/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py#L211"}}),He=new T({props:{name:"enable_vae_slicing",anchor:"diffusers.AltDiffusionPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py#L179"}}),Xe=new T({props:{name:"enable_vae_tiling",anchor:"diffusers.AltDiffusionPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py#L195"}}),Ke=new hi({}),Ye=new T({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:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.AltDiffusionImg2ImgPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.16.0/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/v0.16.0/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/v0.16.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.16.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.16.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.16.0/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>CLIPImageProcessor</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/v0.16.0/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py#L92"}}),nt=new T({props:{name:"__call__",anchor:"diffusers.AltDiffusionImg2ImgPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{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:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"}],parametersDescription:[{anchor:"diffusers.AltDiffusionImg2ImgPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,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. 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.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/v0.16.0/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__.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.AltDiffusionImg2ImgPipeline.__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, <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.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"},{anchor:"diffusers.AltDiffusionImg2ImgPipeline.__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/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py#L570",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>
`}}),he=new rf({props:{anchor:"diffusers.AltDiffusionImg2ImgPipeline.__call__.example",$$slots:{default:[hf]},$$scope:{ctx:at}}}),it=new T({props:{name:"enable_model_cpu_offload",anchor:"diffusers.AltDiffusionImg2ImgPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py#L246"}}),ot=new T({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/v0.16.0/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py#L221"}}),{c(){I=i("meta"),j=l(),$=i("h1"),P=i("a"),C=i("span"),v(u.$$.fragment),k=l(),Kt=i("span"),uo=a("AltDiffusion"),gi=l(),ne=i("p"),mo=a("AltDiffusion was proposed in "),ye=i("a"),ho=a("AltCLIP: Altering the Language Encoder in CLIP for Extended Language Capabilities"),go=a(" by Zhongzhi Chen, Guang Liu, Bo-Wen Zhang, Fulong Ye, Qinghong Yang, Ledell Wu."),_i=l(),rt=i("p"),_o=a("The abstract of the paper is the following:"),vi=l(),lt=i("p"),Yt=i("em"),vo=a("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."),bi=l(),De=i("p"),Zt=i("em"),bo=a("Overview"),wo=a(":"),wi=l(),ie=i("table"),Qt=i("thead"),N=i("tr"),Jt=i("th"),yo=a("Pipeline"),Do=l(),en=i("th"),Ao=a("Tasks"),Po=l(),dt=i("th"),Io=a("Colab"),Eo=l(),ft=i("th"),xo=a("Demo"),$o=l(),Ae=i("tbody"),q=i("tr"),tn=i("td"),Pe=i("a"),ko=a("pipeline_alt_diffusion.py"),Lo=l(),nn=i("td"),on=i("em"),Co=a("Text-to-Image Generation"),To=l(),ct=i("td"),Mo=a("-"),So=l(),pt=i("td"),jo=a("-"),Oo=l(),U=i("tr"),sn=i("td"),Ie=i("a"),No=a("pipeline_alt_diffusion_img2img.py"),qo=l(),an=i("td"),rn=i("em"),Uo=a("Image-to-Image Text-Guided Generation"),Go=l(),ut=i("td"),Fo=a("-"),Ro=l(),mt=i("td"),Vo=a("-"),yi=l(),X=i("h2"),oe=i("a"),ln=i("span"),v(Ee.$$.fragment),Bo=l(),dn=i("span"),zo=a("Tips"),Di=l(),se=i("ul"),fn=i("li"),xe=i("p"),Wo=a("AltDiffusion is conceptually exactly the same as "),ht=i("a"),Ho=a("Stable Diffusion"),Xo=a("."),Ko=l(),cn=i("li"),pn=i("p"),un=i("em"),Yo=a("Run AltDiffusion"),Ai=l(),L=i("p"),Zo=a("AltDiffusion can be tested very easily with the "),gt=i("a"),Qo=a("AltDiffusionPipeline"),Jo=a(", "),_t=i("a"),es=a("AltDiffusionImg2ImgPipeline"),ts=a(" and the "),mn=i("code"),ns=a('"BAAI/AltDiffusion-m9"'),is=a(" checkpoint exactly in the same way it is shown in the "),vt=i("a"),os=a("Conditional Image Generation Guide"),ss=a(" and the "),bt=i("a"),as=a("Image-to-Image Generation Guide"),rs=a("."),Pi=l(),wt=i("ul"),hn=i("li"),gn=i("em"),ls=a("How to load and use different schedulers."),Ii=l(),g=i("p"),ds=a("The alt diffusion pipeline uses "),yt=i("a"),fs=a("DDIMScheduler"),cs=a(" scheduler by default. But "),_n=i("code"),ps=a("diffusers"),us=a(" provides many other schedulers that can be used with the alt diffusion pipeline such as "),Dt=i("a"),ms=a("PNDMScheduler"),hs=a(", "),At=i("a"),gs=a("LMSDiscreteScheduler"),_s=a(", "),Pt=i("a"),vs=a("EulerDiscreteScheduler"),bs=a(", "),It=i("a"),ws=a("EulerAncestralDiscreteScheduler"),ys=a(` etc.
To use a different scheduler, you can either change it via the `),Et=i("a"),Ds=a("ConfigMixin.from_config()"),As=a(" method or pass the "),vn=i("code"),Ps=a("scheduler"),Is=a(" argument to the "),bn=i("code"),Es=a("from_pretrained"),xs=a(" method of the pipeline. For example, to use the "),xt=i("a"),$s=a("EulerDiscreteScheduler"),ks=a(", you can do the following:"),Ei=l(),v($e.$$.fragment),xi=l(),$t=i("ul"),wn=i("li"),yn=i("em"),Ls=a("How to convert all use cases with multiple or single pipeline"),$i=l(),F=i("p"),Cs=a("If you want to use all possible use cases in a single "),Dn=i("code"),Ts=a("DiffusionPipeline"),Ms=a(" we recommend using the "),An=i("code"),Ss=a("components"),js=a(" functionality to instantiate all components in the most memory-efficient way:"),ki=l(),v(ke.$$.fragment),Li=l(),K=i("h2"),ae=i("a"),Pn=i("span"),v(Le.$$.fragment),Os=l(),In=i("span"),Ns=a("AltDiffusionPipelineOutput"),Ci=l(),G=i("div"),v(Ce.$$.fragment),qs=l(),En=i("p"),Us=a("Output class for Alt Diffusion pipelines."),Gs=l(),re=i("div"),v(Te.$$.fragment),Fs=l(),xn=i("p"),Rs=a("Call self as a function."),Ti=l(),Y=i("h2"),le=i("a"),$n=i("span"),v(Me.$$.fragment),Vs=l(),kn=i("span"),Bs=a("AltDiffusionPipeline"),Mi=l(),m=i("div"),v(Se.$$.fragment),zs=l(),Ln=i("p"),Ws=a("Pipeline for text-to-image generation using Alt Diffusion."),Hs=l(),je=i("p"),Xs=a("This model inherits from "),kt=i("a"),Ks=a("DiffusionPipeline"),Ys=a(`. 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.)`),Zs=l(),Cn=i("p"),Qs=a("In addition the pipeline inherits the following loading methods:"),Js=l(),Z=i("ul"),Oe=i("li"),Tn=i("em"),ea=a("Textual-Inversion"),ta=a(": "),Lt=i("a"),na=a("loaders.TextualInversionLoaderMixin.load_textual_inversion()"),ia=l(),Ne=i("li"),Mn=i("em"),oa=a("LoRA"),sa=a(": "),Ct=i("a"),aa=a("loaders.LoraLoaderMixin.load_lora_weights()"),ra=l(),qe=i("li"),Sn=i("em"),la=a("Ckpt"),da=a(": "),Tt=i("a"),fa=a("loaders.FromCkptMixin.from_ckpt()"),ca=l(),jn=i("p"),pa=a("as well as the following saving methods:"),ua=l(),On=i("ul"),Ue=i("li"),Nn=i("em"),ma=a("LoRA"),ha=a(": "),Mt=i("a"),ga=a("loaders.LoraLoaderMixin.save_lora_weights()"),_a=l(),R=i("div"),v(Ge.$$.fragment),va=l(),qn=i("p"),ba=a("Function invoked when calling the pipeline for generation."),wa=l(),v(de.$$.fragment),ya=l(),fe=i("div"),v(Fe.$$.fragment),Da=l(),Re=i("p"),Aa=a("Disable sliced VAE decoding. If "),Un=i("code"),Pa=a("enable_vae_slicing"),Ia=a(` was previously invoked, this method will go back to
computing decoding in one step.`),Ea=l(),ce=i("div"),v(Ve.$$.fragment),xa=l(),Be=i("p"),$a=a("Disable tiled VAE decoding. If "),Gn=i("code"),ka=a("enable_vae_tiling"),La=a(` was previously invoked, this method will go back to
computing decoding in one step.`),Ca=l(),pe=i("div"),v(ze.$$.fragment),Ta=l(),M=i("p"),Ma=a(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Fn=i("code"),Sa=a("enable_sequential_cpu_offload"),ja=a(", this method moves one whole model at a time to the GPU when its "),Rn=i("code"),Oa=a("forward"),Na=a(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Vn=i("code"),qa=a("enable_sequential_cpu_offload"),Ua=a(", but performance is much better due to the iterative execution of the "),Bn=i("code"),Ga=a("unet"),Fa=a("."),Ra=l(),ue=i("div"),v(We.$$.fragment),Va=l(),Q=i("p"),Ba=a(`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
`),zn=i("code"),za=a("torch.device('meta') and loaded to GPU only when their specific submodule has its "),Wa=a("forward"),Wn=i("code"),Ha=a("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),Xa=a("enable_model_cpu_offload`, but performance is lower."),Ka=l(),V=i("div"),v(He.$$.fragment),Ya=l(),Hn=i("p"),Za=a("Enable sliced VAE decoding."),Qa=l(),Xn=i("p"),Ja=a(`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.`),er=l(),B=i("div"),v(Xe.$$.fragment),tr=l(),Kn=i("p"),nr=a("Enable tiled VAE decoding."),ir=l(),Yn=i("p"),or=a(`When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and encoding in
several steps. This is useful to save a large amount of memory and to allow the processing of larger images.`),Si=l(),J=i("h2"),me=i("a"),Zn=i("span"),v(Ke.$$.fragment),sr=l(),Qn=i("span"),ar=a("AltDiffusionImg2ImgPipeline"),ji=l(),_=i("div"),v(Ye.$$.fragment),rr=l(),Jn=i("p"),lr=a("Pipeline for text-guided image to image generation using Alt Diffusion."),dr=l(),Ze=i("p"),fr=a("This model inherits from "),St=i("a"),cr=a("DiffusionPipeline"),pr=a(`. 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.)`),ur=l(),ei=i("p"),mr=a("In addition the pipeline inherits the following loading methods:"),hr=l(),ee=i("ul"),Qe=i("li"),ti=i("em"),gr=a("Textual-Inversion"),_r=a(": "),jt=i("a"),vr=a("loaders.TextualInversionLoaderMixin.load_textual_inversion()"),br=l(),Je=i("li"),ni=i("em"),wr=a("LoRA"),yr=a(": "),Ot=i("a"),Dr=a("loaders.LoraLoaderMixin.load_lora_weights()"),Ar=l(),et=i("li"),ii=i("em"),Pr=a("Ckpt"),Ir=a(": "),Nt=i("a"),Er=a("loaders.FromCkptMixin.from_ckpt()"),xr=l(),oi=i("p"),$r=a("as well as the following saving methods:"),kr=l(),si=i("ul"),tt=i("li"),ai=i("em"),Lr=a("LoRA"),Cr=a(": "),qt=i("a"),Tr=a("loaders.LoraLoaderMixin.save_lora_weights()"),Mr=l(),z=i("div"),v(nt.$$.fragment),Sr=l(),ri=i("p"),jr=a("Function invoked when calling the pipeline for generation."),Or=l(),v(he.$$.fragment),Nr=l(),ge=i("div"),v(it.$$.fragment),qr=l(),S=i("p"),Ur=a(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),li=i("code"),Gr=a("enable_sequential_cpu_offload"),Fr=a(", this method moves one whole model at a time to the GPU when its "),di=i("code"),Rr=a("forward"),Vr=a(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),fi=i("code"),Br=a("enable_sequential_cpu_offload"),zr=a(", but performance is much better due to the iterative execution of the "),ci=i("code"),Wr=a("unet"),Hr=a("."),Xr=l(),_e=i("div"),v(ot.$$.fragment),Kr=l(),te=i("p"),Yr=a(`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
`),pi=i("code"),Zr=a("torch.device('meta') and loaded to GPU only when their specific submodule has its "),Qr=a("forward"),ui=i("code"),Jr=a("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),el=a("enable_model_cpu_offload`, but performance is lower."),this.h()},l(n){const c=pf('[data-svelte="svelte-1phssyn"]',document.head);I=o(c,"META",{name:!0,content:!0}),c.forEach(t),j=d(n),$=o(n,"H1",{class:!0});var st=s($);P=o(st,"A",{id:!0,class:!0,href:!0});var mi=s(P);C=o(mi,"SPAN",{});var nl=s(C);b(u.$$.fragment,nl),nl.forEach(t),mi.forEach(t),k=d(st),Kt=o(st,"SPAN",{});var il=s(Kt);uo=r(il,"AltDiffusion"),il.forEach(t),st.forEach(t),gi=d(n),ne=o(n,"P",{});var Ni=s(ne);mo=r(Ni,"AltDiffusion was proposed in "),ye=o(Ni,"A",{href:!0,rel:!0});var ol=s(ye);ho=r(ol,"AltCLIP: Altering the Language Encoder in CLIP for Extended Language Capabilities"),ol.forEach(t),go=r(Ni," by Zhongzhi Chen, Guang Liu, Bo-Wen Zhang, Fulong Ye, Qinghong Yang, Ledell Wu."),Ni.forEach(t),_i=d(n),rt=o(n,"P",{});var sl=s(rt);_o=r(sl,"The abstract of the paper is the following:"),sl.forEach(t),vi=d(n),lt=o(n,"P",{});var al=s(lt);Yt=o(al,"EM",{});var rl=s(Yt);vo=r(rl,"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."),rl.forEach(t),al.forEach(t),bi=d(n),De=o(n,"P",{});var tl=s(De);Zt=o(tl,"EM",{});var ll=s(Zt);bo=r(ll,"Overview"),ll.forEach(t),wo=r(tl,":"),tl.forEach(t),wi=d(n),ie=o(n,"TABLE",{});var qi=s(ie);Qt=o(qi,"THEAD",{});var dl=s(Qt);N=o(dl,"TR",{});var ve=s(N);Jt=o(ve,"TH",{});var fl=s(Jt);yo=r(fl,"Pipeline"),fl.forEach(t),Do=d(ve),en=o(ve,"TH",{});var cl=s(en);Ao=r(cl,"Tasks"),cl.forEach(t),Po=d(ve),dt=o(ve,"TH",{align:!0});var pl=s(dt);Io=r(pl,"Colab"),pl.forEach(t),Eo=d(ve),ft=o(ve,"TH",{align:!0});var ul=s(ft);xo=r(ul,"Demo"),ul.forEach(t),ve.forEach(t),dl.forEach(t),$o=d(qi),Ae=o(qi,"TBODY",{});var Ui=s(Ae);q=o(Ui,"TR",{});var be=s(q);tn=o(be,"TD",{});var ml=s(tn);Pe=o(ml,"A",{href:!0,rel:!0});var hl=s(Pe);ko=r(hl,"pipeline_alt_diffusion.py"),hl.forEach(t),ml.forEach(t),Lo=d(be),nn=o(be,"TD",{});var gl=s(nn);on=o(gl,"EM",{});var _l=s(on);Co=r(_l,"Text-to-Image Generation"),_l.forEach(t),gl.forEach(t),To=d(be),ct=o(be,"TD",{align:!0});var vl=s(ct);Mo=r(vl,"-"),vl.forEach(t),So=d(be),pt=o(be,"TD",{align:!0});var bl=s(pt);jo=r(bl,"-"),bl.forEach(t),be.forEach(t),Oo=d(Ui),U=o(Ui,"TR",{});var we=s(U);sn=o(we,"TD",{});var wl=s(sn);Ie=o(wl,"A",{href:!0,rel:!0});var yl=s(Ie);No=r(yl,"pipeline_alt_diffusion_img2img.py"),yl.forEach(t),wl.forEach(t),qo=d(we),an=o(we,"TD",{});var Dl=s(an);rn=o(Dl,"EM",{});var Al=s(rn);Uo=r(Al,"Image-to-Image Text-Guided Generation"),Al.forEach(t),Dl.forEach(t),Go=d(we),ut=o(we,"TD",{align:!0});var Pl=s(ut);Fo=r(Pl,"-"),Pl.forEach(t),Ro=d(we),mt=o(we,"TD",{align:!0});var Il=s(mt);Vo=r(Il,"-"),Il.forEach(t),we.forEach(t),Ui.forEach(t),qi.forEach(t),yi=d(n),X=o(n,"H2",{class:!0});var Gi=s(X);oe=o(Gi,"A",{id:!0,class:!0,href:!0});var El=s(oe);ln=o(El,"SPAN",{});var xl=s(ln);b(Ee.$$.fragment,xl),xl.forEach(t),El.forEach(t),Bo=d(Gi),dn=o(Gi,"SPAN",{});var $l=s(dn);zo=r($l,"Tips"),$l.forEach(t),Gi.forEach(t),Di=d(n),se=o(n,"UL",{});var Fi=s(se);fn=o(Fi,"LI",{});var kl=s(fn);xe=o(kl,"P",{});var Ri=s(xe);Wo=r(Ri,"AltDiffusion is conceptually exactly the same as "),ht=o(Ri,"A",{href:!0});var Ll=s(ht);Ho=r(Ll,"Stable Diffusion"),Ll.forEach(t),Xo=r(Ri,"."),Ri.forEach(t),kl.forEach(t),Ko=d(Fi),cn=o(Fi,"LI",{});var Cl=s(cn);pn=o(Cl,"P",{});var Tl=s(pn);un=o(Tl,"EM",{});var Ml=s(un);Yo=r(Ml,"Run AltDiffusion"),Ml.forEach(t),Tl.forEach(t),Cl.forEach(t),Fi.forEach(t),Ai=d(n),L=o(n,"P",{});var O=s(L);Zo=r(O,"AltDiffusion can be tested very easily with the "),gt=o(O,"A",{href:!0});var Sl=s(gt);Qo=r(Sl,"AltDiffusionPipeline"),Sl.forEach(t),Jo=r(O,", "),_t=o(O,"A",{href:!0});var jl=s(_t);es=r(jl,"AltDiffusionImg2ImgPipeline"),jl.forEach(t),ts=r(O," and the "),mn=o(O,"CODE",{});var Ol=s(mn);ns=r(Ol,'"BAAI/AltDiffusion-m9"'),Ol.forEach(t),is=r(O," checkpoint exactly in the same way it is shown in the "),vt=o(O,"A",{href:!0});var Nl=s(vt);os=r(Nl,"Conditional Image Generation Guide"),Nl.forEach(t),ss=r(O," and the "),bt=o(O,"A",{href:!0});var ql=s(bt);as=r(ql,"Image-to-Image Generation Guide"),ql.forEach(t),rs=r(O,"."),O.forEach(t),Pi=d(n),wt=o(n,"UL",{});var Ul=s(wt);hn=o(Ul,"LI",{});var Gl=s(hn);gn=o(Gl,"EM",{});var Fl=s(gn);ls=r(Fl,"How to load and use different schedulers."),Fl.forEach(t),Gl.forEach(t),Ul.forEach(t),Ii=d(n),g=o(n,"P",{});var E=s(g);ds=r(E,"The alt diffusion pipeline uses "),yt=o(E,"A",{href:!0});var Rl=s(yt);fs=r(Rl,"DDIMScheduler"),Rl.forEach(t),cs=r(E," scheduler by default. But "),_n=o(E,"CODE",{});var Vl=s(_n);ps=r(Vl,"diffusers"),Vl.forEach(t),us=r(E," provides many other schedulers that can be used with the alt diffusion pipeline such as "),Dt=o(E,"A",{href:!0});var Bl=s(Dt);ms=r(Bl,"PNDMScheduler"),Bl.forEach(t),hs=r(E,", "),At=o(E,"A",{href:!0});var zl=s(At);gs=r(zl,"LMSDiscreteScheduler"),zl.forEach(t),_s=r(E,", "),Pt=o(E,"A",{href:!0});var Wl=s(Pt);vs=r(Wl,"EulerDiscreteScheduler"),Wl.forEach(t),bs=r(E,", "),It=o(E,"A",{href:!0});var Hl=s(It);ws=r(Hl,"EulerAncestralDiscreteScheduler"),Hl.forEach(t),ys=r(E,` etc.
To use a different scheduler, you can either change it via the `),Et=o(E,"A",{href:!0});var Xl=s(Et);Ds=r(Xl,"ConfigMixin.from_config()"),Xl.forEach(t),As=r(E," method or pass the "),vn=o(E,"CODE",{});var Kl=s(vn);Ps=r(Kl,"scheduler"),Kl.forEach(t),Is=r(E," argument to the "),bn=o(E,"CODE",{});var Yl=s(bn);Es=r(Yl,"from_pretrained"),Yl.forEach(t),xs=r(E," method of the pipeline. For example, to use the "),xt=o(E,"A",{href:!0});var Zl=s(xt);$s=r(Zl,"EulerDiscreteScheduler"),Zl.forEach(t),ks=r(E,", you can do the following:"),E.forEach(t),Ei=d(n),b($e.$$.fragment,n),xi=d(n),$t=o(n,"UL",{});var Ql=s($t);wn=o(Ql,"LI",{});var Jl=s(wn);yn=o(Jl,"EM",{});var ed=s(yn);Ls=r(ed,"How to convert all use cases with multiple or single pipeline"),ed.forEach(t),Jl.forEach(t),Ql.forEach(t),$i=d(n),F=o(n,"P",{});var Ut=s(F);Cs=r(Ut,"If you want to use all possible use cases in a single "),Dn=o(Ut,"CODE",{});var td=s(Dn);Ts=r(td,"DiffusionPipeline"),td.forEach(t),Ms=r(Ut," we recommend using the "),An=o(Ut,"CODE",{});var nd=s(An);Ss=r(nd,"components"),nd.forEach(t),js=r(Ut," functionality to instantiate all components in the most memory-efficient way:"),Ut.forEach(t),ki=d(n),b(ke.$$.fragment,n),Li=d(n),K=o(n,"H2",{class:!0});var Vi=s(K);ae=o(Vi,"A",{id:!0,class:!0,href:!0});var id=s(ae);Pn=o(id,"SPAN",{});var od=s(Pn);b(Le.$$.fragment,od),od.forEach(t),id.forEach(t),Os=d(Vi),In=o(Vi,"SPAN",{});var sd=s(In);Ns=r(sd,"AltDiffusionPipelineOutput"),sd.forEach(t),Vi.forEach(t),Ci=d(n),G=o(n,"DIV",{class:!0});var Gt=s(G);b(Ce.$$.fragment,Gt),qs=d(Gt),En=o(Gt,"P",{});var ad=s(En);Us=r(ad,"Output class for Alt Diffusion pipelines."),ad.forEach(t),Gs=d(Gt),re=o(Gt,"DIV",{class:!0});var Bi=s(re);b(Te.$$.fragment,Bi),Fs=d(Bi),xn=o(Bi,"P",{});var rd=s(xn);Rs=r(rd,"Call self as a function."),rd.forEach(t),Bi.forEach(t),Gt.forEach(t),Ti=d(n),Y=o(n,"H2",{class:!0});var zi=s(Y);le=o(zi,"A",{id:!0,class:!0,href:!0});var ld=s(le);$n=o(ld,"SPAN",{});var dd=s($n);b(Me.$$.fragment,dd),dd.forEach(t),ld.forEach(t),Vs=d(zi),kn=o(zi,"SPAN",{});var fd=s(kn);Bs=r(fd,"AltDiffusionPipeline"),fd.forEach(t),zi.forEach(t),Mi=d(n),m=o(n,"DIV",{class:!0});var h=s(m);b(Se.$$.fragment,h),zs=d(h),Ln=o(h,"P",{});var cd=s(Ln);Ws=r(cd,"Pipeline for text-to-image generation using Alt Diffusion."),cd.forEach(t),Hs=d(h),je=o(h,"P",{});var Wi=s(je);Xs=r(Wi,"This model inherits from "),kt=o(Wi,"A",{href:!0});var pd=s(kt);Ks=r(pd,"DiffusionPipeline"),pd.forEach(t),Ys=r(Wi,`. 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.)`),Wi.forEach(t),Zs=d(h),Cn=o(h,"P",{});var ud=s(Cn);Qs=r(ud,"In addition the pipeline inherits the following loading methods:"),ud.forEach(t),Js=d(h),Z=o(h,"UL",{});var Ft=s(Z);Oe=o(Ft,"LI",{});var Hi=s(Oe);Tn=o(Hi,"EM",{});var md=s(Tn);ea=r(md,"Textual-Inversion"),md.forEach(t),ta=r(Hi,": "),Lt=o(Hi,"A",{href:!0});var hd=s(Lt);na=r(hd,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),hd.forEach(t),Hi.forEach(t),ia=d(Ft),Ne=o(Ft,"LI",{});var Xi=s(Ne);Mn=o(Xi,"EM",{});var gd=s(Mn);oa=r(gd,"LoRA"),gd.forEach(t),sa=r(Xi,": "),Ct=o(Xi,"A",{href:!0});var _d=s(Ct);aa=r(_d,"loaders.LoraLoaderMixin.load_lora_weights()"),_d.forEach(t),Xi.forEach(t),ra=d(Ft),qe=o(Ft,"LI",{});var Ki=s(qe);Sn=o(Ki,"EM",{});var vd=s(Sn);la=r(vd,"Ckpt"),vd.forEach(t),da=r(Ki,": "),Tt=o(Ki,"A",{href:!0});var bd=s(Tt);fa=r(bd,"loaders.FromCkptMixin.from_ckpt()"),bd.forEach(t),Ki.forEach(t),Ft.forEach(t),ca=d(h),jn=o(h,"P",{});var wd=s(jn);pa=r(wd,"as well as the following saving methods:"),wd.forEach(t),ua=d(h),On=o(h,"UL",{});var yd=s(On);Ue=o(yd,"LI",{});var Yi=s(Ue);Nn=o(Yi,"EM",{});var Dd=s(Nn);ma=r(Dd,"LoRA"),Dd.forEach(t),ha=r(Yi,": "),Mt=o(Yi,"A",{href:!0});var Ad=s(Mt);ga=r(Ad,"loaders.LoraLoaderMixin.save_lora_weights()"),Ad.forEach(t),Yi.forEach(t),yd.forEach(t),_a=d(h),R=o(h,"DIV",{class:!0});var Rt=s(R);b(Ge.$$.fragment,Rt),va=d(Rt),qn=o(Rt,"P",{});var Pd=s(qn);ba=r(Pd,"Function invoked when calling the pipeline for generation."),Pd.forEach(t),wa=d(Rt),b(de.$$.fragment,Rt),Rt.forEach(t),ya=d(h),fe=o(h,"DIV",{class:!0});var Zi=s(fe);b(Fe.$$.fragment,Zi),Da=d(Zi),Re=o(Zi,"P",{});var Qi=s(Re);Aa=r(Qi,"Disable sliced VAE decoding. If "),Un=o(Qi,"CODE",{});var Id=s(Un);Pa=r(Id,"enable_vae_slicing"),Id.forEach(t),Ia=r(Qi,` was previously invoked, this method will go back to
computing decoding in one step.`),Qi.forEach(t),Zi.forEach(t),Ea=d(h),ce=o(h,"DIV",{class:!0});var Ji=s(ce);b(Ve.$$.fragment,Ji),xa=d(Ji),Be=o(Ji,"P",{});var eo=s(Be);$a=r(eo,"Disable tiled VAE decoding. If "),Gn=o(eo,"CODE",{});var Ed=s(Gn);ka=r(Ed,"enable_vae_tiling"),Ed.forEach(t),La=r(eo,` was previously invoked, this method will go back to
computing decoding in one step.`),eo.forEach(t),Ji.forEach(t),Ca=d(h),pe=o(h,"DIV",{class:!0});var to=s(pe);b(ze.$$.fragment,to),Ta=d(to),M=o(to,"P",{});var W=s(M);Ma=r(W,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Fn=o(W,"CODE",{});var xd=s(Fn);Sa=r(xd,"enable_sequential_cpu_offload"),xd.forEach(t),ja=r(W,", this method moves one whole model at a time to the GPU when its "),Rn=o(W,"CODE",{});var $d=s(Rn);Oa=r($d,"forward"),$d.forEach(t),Na=r(W,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Vn=o(W,"CODE",{});var kd=s(Vn);qa=r(kd,"enable_sequential_cpu_offload"),kd.forEach(t),Ua=r(W,", but performance is much better due to the iterative execution of the "),Bn=o(W,"CODE",{});var Ld=s(Bn);Ga=r(Ld,"unet"),Ld.forEach(t),Fa=r(W,"."),W.forEach(t),to.forEach(t),Ra=d(h),ue=o(h,"DIV",{class:!0});var no=s(ue);b(We.$$.fragment,no),Va=d(no),Q=o(no,"P",{});var Vt=s(Q);Ba=r(Vt,`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
`),zn=o(Vt,"CODE",{});var Cd=s(zn);za=r(Cd,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),Cd.forEach(t),Wa=r(Vt,"forward"),Wn=o(Vt,"CODE",{});var Td=s(Wn);Ha=r(Td,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),Td.forEach(t),Xa=r(Vt,"enable_model_cpu_offload`, but performance is lower."),Vt.forEach(t),no.forEach(t),Ka=d(h),V=o(h,"DIV",{class:!0});var Bt=s(V);b(He.$$.fragment,Bt),Ya=d(Bt),Hn=o(Bt,"P",{});var Md=s(Hn);Za=r(Md,"Enable sliced VAE decoding."),Md.forEach(t),Qa=d(Bt),Xn=o(Bt,"P",{});var Sd=s(Xn);Ja=r(Sd,`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.`),Sd.forEach(t),Bt.forEach(t),er=d(h),B=o(h,"DIV",{class:!0});var zt=s(B);b(Xe.$$.fragment,zt),tr=d(zt),Kn=o(zt,"P",{});var jd=s(Kn);nr=r(jd,"Enable tiled VAE decoding."),jd.forEach(t),ir=d(zt),Yn=o(zt,"P",{});var Od=s(Yn);or=r(Od,`When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and encoding in
several steps. This is useful to save a large amount of memory and to allow the processing of larger images.`),Od.forEach(t),zt.forEach(t),h.forEach(t),Si=d(n),J=o(n,"H2",{class:!0});var io=s(J);me=o(io,"A",{id:!0,class:!0,href:!0});var Nd=s(me);Zn=o(Nd,"SPAN",{});var qd=s(Zn);b(Ke.$$.fragment,qd),qd.forEach(t),Nd.forEach(t),sr=d(io),Qn=o(io,"SPAN",{});var Ud=s(Qn);ar=r(Ud,"AltDiffusionImg2ImgPipeline"),Ud.forEach(t),io.forEach(t),ji=d(n),_=o(n,"DIV",{class:!0});var x=s(_);b(Ye.$$.fragment,x),rr=d(x),Jn=o(x,"P",{});var Gd=s(Jn);lr=r(Gd,"Pipeline for text-guided image to image generation using Alt Diffusion."),Gd.forEach(t),dr=d(x),Ze=o(x,"P",{});var oo=s(Ze);fr=r(oo,"This model inherits from "),St=o(oo,"A",{href:!0});var Fd=s(St);cr=r(Fd,"DiffusionPipeline"),Fd.forEach(t),pr=r(oo,`. 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.)`),oo.forEach(t),ur=d(x),ei=o(x,"P",{});var Rd=s(ei);mr=r(Rd,"In addition the pipeline inherits the following loading methods:"),Rd.forEach(t),hr=d(x),ee=o(x,"UL",{});var Wt=s(ee);Qe=o(Wt,"LI",{});var so=s(Qe);ti=o(so,"EM",{});var Vd=s(ti);gr=r(Vd,"Textual-Inversion"),Vd.forEach(t),_r=r(so,": "),jt=o(so,"A",{href:!0});var Bd=s(jt);vr=r(Bd,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),Bd.forEach(t),so.forEach(t),br=d(Wt),Je=o(Wt,"LI",{});var ao=s(Je);ni=o(ao,"EM",{});var zd=s(ni);wr=r(zd,"LoRA"),zd.forEach(t),yr=r(ao,": "),Ot=o(ao,"A",{href:!0});var Wd=s(Ot);Dr=r(Wd,"loaders.LoraLoaderMixin.load_lora_weights()"),Wd.forEach(t),ao.forEach(t),Ar=d(Wt),et=o(Wt,"LI",{});var ro=s(et);ii=o(ro,"EM",{});var Hd=s(ii);Pr=r(Hd,"Ckpt"),Hd.forEach(t),Ir=r(ro,": "),Nt=o(ro,"A",{href:!0});var Xd=s(Nt);Er=r(Xd,"loaders.FromCkptMixin.from_ckpt()"),Xd.forEach(t),ro.forEach(t),Wt.forEach(t),xr=d(x),oi=o(x,"P",{});var Kd=s(oi);$r=r(Kd,"as well as the following saving methods:"),Kd.forEach(t),kr=d(x),si=o(x,"UL",{});var Yd=s(si);tt=o(Yd,"LI",{});var lo=s(tt);ai=o(lo,"EM",{});var Zd=s(ai);Lr=r(Zd,"LoRA"),Zd.forEach(t),Cr=r(lo,": "),qt=o(lo,"A",{href:!0});var Qd=s(qt);Tr=r(Qd,"loaders.LoraLoaderMixin.save_lora_weights()"),Qd.forEach(t),lo.forEach(t),Yd.forEach(t),Mr=d(x),z=o(x,"DIV",{class:!0});var Ht=s(z);b(nt.$$.fragment,Ht),Sr=d(Ht),ri=o(Ht,"P",{});var Jd=s(ri);jr=r(Jd,"Function invoked when calling the pipeline for generation."),Jd.forEach(t),Or=d(Ht),b(he.$$.fragment,Ht),Ht.forEach(t),Nr=d(x),ge=o(x,"DIV",{class:!0});var fo=s(ge);b(it.$$.fragment,fo),qr=d(fo),S=o(fo,"P",{});var H=s(S);Ur=r(H,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),li=o(H,"CODE",{});var ef=s(li);Gr=r(ef,"enable_sequential_cpu_offload"),ef.forEach(t),Fr=r(H,", this method moves one whole model at a time to the GPU when its "),di=o(H,"CODE",{});var tf=s(di);Rr=r(tf,"forward"),tf.forEach(t),Vr=r(H,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),fi=o(H,"CODE",{});var nf=s(fi);Br=r(nf,"enable_sequential_cpu_offload"),nf.forEach(t),zr=r(H,", but performance is much better due to the iterative execution of the "),ci=o(H,"CODE",{});var of=s(ci);Wr=r(of,"unet"),of.forEach(t),Hr=r(H,"."),H.forEach(t),fo.forEach(t),Xr=d(x),_e=o(x,"DIV",{class:!0});var co=s(_e);b(ot.$$.fragment,co),Kr=d(co),te=o(co,"P",{});var Xt=s(te);Yr=r(Xt,`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
`),pi=o(Xt,"CODE",{});var sf=s(pi);Zr=r(sf,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),sf.forEach(t),Qr=r(Xt,"forward"),ui=o(Xt,"CODE",{});var af=s(ui);Jr=r(af,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),af.forEach(t),el=r(Xt,"enable_model_cpu_offload`, but performance is lower."),Xt.forEach(t),co.forEach(t),x.forEach(t),this.h()},h(){f(I,"name","hf:doc:metadata"),f(I,"content",JSON.stringify(_f)),f(P,"id","altdiffusion"),f(P,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(P,"href","#altdiffusion"),f($,"class","relative group"),f(ye,"href","https://arxiv.org/abs/2211.06679"),f(ye,"rel","nofollow"),f(dt,"align","center"),f(ft,"align","center"),f(Pe,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py"),f(Pe,"rel","nofollow"),f(ct,"align","center"),f(pt,"align","center"),f(Ie,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py"),f(Ie,"rel","nofollow"),f(ut,"align","center"),f(mt,"align","center"),f(oe,"id","tips"),f(oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(oe,"href","#tips"),f(X,"class","relative group"),f(ht,"href","./stable_diffusion/overview"),f(gt,"href","/docs/diffusers/v0.16.0/en/api/pipelines/alt_diffusion#diffusers.AltDiffusionPipeline"),f(_t,"href","/docs/diffusers/v0.16.0/en/api/pipelines/alt_diffusion#diffusers.AltDiffusionImg2ImgPipeline"),f(vt,"href","../../using-diffusers/conditional_image_generation"),f(bt,"href","../../using-diffusers/img2img"),f(yt,"href","/docs/diffusers/v0.16.0/en/api/schedulers/ddim#diffusers.DDIMScheduler"),f(Dt,"href","/docs/diffusers/v0.16.0/en/api/schedulers/pndm#diffusers.PNDMScheduler"),f(At,"href","/docs/diffusers/v0.16.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler"),f(Pt,"href","/docs/diffusers/v0.16.0/en/api/schedulers/euler#diffusers.EulerDiscreteScheduler"),f(It,"href","/docs/diffusers/v0.16.0/en/api/schedulers/euler_ancestral#diffusers.EulerAncestralDiscreteScheduler"),f(Et,"href","/docs/diffusers/v0.16.0/en/api/configuration#diffusers.ConfigMixin.from_config"),f(xt,"href","/docs/diffusers/v0.16.0/en/api/schedulers/euler#diffusers.EulerDiscreteScheduler"),f(ae,"id","diffusers.pipelines.alt_diffusion.AltDiffusionPipelineOutput"),f(ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(ae,"href","#diffusers.pipelines.alt_diffusion.AltDiffusionPipelineOutput"),f(K,"class","relative group"),f(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(le,"id","diffusers.AltDiffusionPipeline"),f(le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(le,"href","#diffusers.AltDiffusionPipeline"),f(Y,"class","relative group"),f(kt,"href","/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),f(Lt,"href","/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.load_textual_inversion"),f(Ct,"href","/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.load_lora_weights"),f(Tt,"href","/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline.from_ckpt"),f(Mt,"href","/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.save_lora_weights"),f(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(m,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(me,"id","diffusers.AltDiffusionImg2ImgPipeline"),f(me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),f(me,"href","#diffusers.AltDiffusionImg2ImgPipeline"),f(J,"class","relative group"),f(St,"href","/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),f(jt,"href","/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.load_textual_inversion"),f(Ot,"href","/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.load_lora_weights"),f(Nt,"href","/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline.from_ckpt"),f(qt,"href","/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.save_lora_weights"),f(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(n,c){e(document.head,I),p(n,j,c),p(n,$,c),e($,P),e(P,C),w(u,C,null),e($,k),e($,Kt),e(Kt,uo),p(n,gi,c),p(n,ne,c),e(ne,mo),e(ne,ye),e(ye,ho),e(ne,go),p(n,_i,c),p(n,rt,c),e(rt,_o),p(n,vi,c),p(n,lt,c),e(lt,Yt),e(Yt,vo),p(n,bi,c),p(n,De,c),e(De,Zt),e(Zt,bo),e(De,wo),p(n,wi,c),p(n,ie,c),e(ie,Qt),e(Qt,N),e(N,Jt),e(Jt,yo),e(N,Do),e(N,en),e(en,Ao),e(N,Po),e(N,dt),e(dt,Io),e(N,Eo),e(N,ft),e(ft,xo),e(ie,$o),e(ie,Ae),e(Ae,q),e(q,tn),e(tn,Pe),e(Pe,ko),e(q,Lo),e(q,nn),e(nn,on),e(on,Co),e(q,To),e(q,ct),e(ct,Mo),e(q,So),e(q,pt),e(pt,jo),e(Ae,Oo),e(Ae,U),e(U,sn),e(sn,Ie),e(Ie,No),e(U,qo),e(U,an),e(an,rn),e(rn,Uo),e(U,Go),e(U,ut),e(ut,Fo),e(U,Ro),e(U,mt),e(mt,Vo),p(n,yi,c),p(n,X,c),e(X,oe),e(oe,ln),w(Ee,ln,null),e(X,Bo),e(X,dn),e(dn,zo),p(n,Di,c),p(n,se,c),e(se,fn),e(fn,xe),e(xe,Wo),e(xe,ht),e(ht,Ho),e(xe,Xo),e(se,Ko),e(se,cn),e(cn,pn),e(pn,un),e(un,Yo),p(n,Ai,c),p(n,L,c),e(L,Zo),e(L,gt),e(gt,Qo),e(L,Jo),e(L,_t),e(_t,es),e(L,ts),e(L,mn),e(mn,ns),e(L,is),e(L,vt),e(vt,os),e(L,ss),e(L,bt),e(bt,as),e(L,rs),p(n,Pi,c),p(n,wt,c),e(wt,hn),e(hn,gn),e(gn,ls),p(n,Ii,c),p(n,g,c),e(g,ds),e(g,yt),e(yt,fs),e(g,cs),e(g,_n),e(_n,ps),e(g,us),e(g,Dt),e(Dt,ms),e(g,hs),e(g,At),e(At,gs),e(g,_s),e(g,Pt),e(Pt,vs),e(g,bs),e(g,It),e(It,ws),e(g,ys),e(g,Et),e(Et,Ds),e(g,As),e(g,vn),e(vn,Ps),e(g,Is),e(g,bn),e(bn,Es),e(g,xs),e(g,xt),e(xt,$s),e(g,ks),p(n,Ei,c),w($e,n,c),p(n,xi,c),p(n,$t,c),e($t,wn),e(wn,yn),e(yn,Ls),p(n,$i,c),p(n,F,c),e(F,Cs),e(F,Dn),e(Dn,Ts),e(F,Ms),e(F,An),e(An,Ss),e(F,js),p(n,ki,c),w(ke,n,c),p(n,Li,c),p(n,K,c),e(K,ae),e(ae,Pn),w(Le,Pn,null),e(K,Os),e(K,In),e(In,Ns),p(n,Ci,c),p(n,G,c),w(Ce,G,null),e(G,qs),e(G,En),e(En,Us),e(G,Gs),e(G,re),w(Te,re,null),e(re,Fs),e(re,xn),e(xn,Rs),p(n,Ti,c),p(n,Y,c),e(Y,le),e(le,$n),w(Me,$n,null),e(Y,Vs),e(Y,kn),e(kn,Bs),p(n,Mi,c),p(n,m,c),w(Se,m,null),e(m,zs),e(m,Ln),e(Ln,Ws),e(m,Hs),e(m,je),e(je,Xs),e(je,kt),e(kt,Ks),e(je,Ys),e(m,Zs),e(m,Cn),e(Cn,Qs),e(m,Js),e(m,Z),e(Z,Oe),e(Oe,Tn),e(Tn,ea),e(Oe,ta),e(Oe,Lt),e(Lt,na),e(Z,ia),e(Z,Ne),e(Ne,Mn),e(Mn,oa),e(Ne,sa),e(Ne,Ct),e(Ct,aa),e(Z,ra),e(Z,qe),e(qe,Sn),e(Sn,la),e(qe,da),e(qe,Tt),e(Tt,fa),e(m,ca),e(m,jn),e(jn,pa),e(m,ua),e(m,On),e(On,Ue),e(Ue,Nn),e(Nn,ma),e(Ue,ha),e(Ue,Mt),e(Mt,ga),e(m,_a),e(m,R),w(Ge,R,null),e(R,va),e(R,qn),e(qn,ba),e(R,wa),w(de,R,null),e(m,ya),e(m,fe),w(Fe,fe,null),e(fe,Da),e(fe,Re),e(Re,Aa),e(Re,Un),e(Un,Pa),e(Re,Ia),e(m,Ea),e(m,ce),w(Ve,ce,null),e(ce,xa),e(ce,Be),e(Be,$a),e(Be,Gn),e(Gn,ka),e(Be,La),e(m,Ca),e(m,pe),w(ze,pe,null),e(pe,Ta),e(pe,M),e(M,Ma),e(M,Fn),e(Fn,Sa),e(M,ja),e(M,Rn),e(Rn,Oa),e(M,Na),e(M,Vn),e(Vn,qa),e(M,Ua),e(M,Bn),e(Bn,Ga),e(M,Fa),e(m,Ra),e(m,ue),w(We,ue,null),e(ue,Va),e(ue,Q),e(Q,Ba),e(Q,zn),e(zn,za),e(Q,Wa),e(Q,Wn),e(Wn,Ha),e(Q,Xa),e(m,Ka),e(m,V),w(He,V,null),e(V,Ya),e(V,Hn),e(Hn,Za),e(V,Qa),e(V,Xn),e(Xn,Ja),e(m,er),e(m,B),w(Xe,B,null),e(B,tr),e(B,Kn),e(Kn,nr),e(B,ir),e(B,Yn),e(Yn,or),p(n,Si,c),p(n,J,c),e(J,me),e(me,Zn),w(Ke,Zn,null),e(J,sr),e(J,Qn),e(Qn,ar),p(n,ji,c),p(n,_,c),w(Ye,_,null),e(_,rr),e(_,Jn),e(Jn,lr),e(_,dr),e(_,Ze),e(Ze,fr),e(Ze,St),e(St,cr),e(Ze,pr),e(_,ur),e(_,ei),e(ei,mr),e(_,hr),e(_,ee),e(ee,Qe),e(Qe,ti),e(ti,gr),e(Qe,_r),e(Qe,jt),e(jt,vr),e(ee,br),e(ee,Je),e(Je,ni),e(ni,wr),e(Je,yr),e(Je,Ot),e(Ot,Dr),e(ee,Ar),e(ee,et),e(et,ii),e(ii,Pr),e(et,Ir),e(et,Nt),e(Nt,Er),e(_,xr),e(_,oi),e(oi,$r),e(_,kr),e(_,si),e(si,tt),e(tt,ai),e(ai,Lr),e(tt,Cr),e(tt,qt),e(qt,Tr),e(_,Mr),e(_,z),w(nt,z,null),e(z,Sr),e(z,ri),e(ri,jr),e(z,Or),w(he,z,null),e(_,Nr),e(_,ge),w(it,ge,null),e(ge,qr),e(ge,S),e(S,Ur),e(S,li),e(li,Gr),e(S,Fr),e(S,di),e(di,Rr),e(S,Vr),e(S,fi),e(fi,Br),e(S,zr),e(S,ci),e(ci,Wr),e(S,Hr),e(_,Xr),e(_,_e),w(ot,_e,null),e(_e,Kr),e(_e,te),e(te,Yr),e(te,pi),e(pi,Zr),e(te,Qr),e(te,ui),e(ui,Jr),e(te,el),Oi=!0},p(n,[c]){const st={};c&2&&(st.$$scope={dirty:c,ctx:n}),de.$set(st);const mi={};c&2&&(mi.$$scope={dirty:c,ctx:n}),he.$set(mi)},i(n){Oi||(y(u.$$.fragment,n),y(Ee.$$.fragment,n),y($e.$$.fragment,n),y(ke.$$.fragment,n),y(Le.$$.fragment,n),y(Ce.$$.fragment,n),y(Te.$$.fragment,n),y(Me.$$.fragment,n),y(Se.$$.fragment,n),y(Ge.$$.fragment,n),y(de.$$.fragment,n),y(Fe.$$.fragment,n),y(Ve.$$.fragment,n),y(ze.$$.fragment,n),y(We.$$.fragment,n),y(He.$$.fragment,n),y(Xe.$$.fragment,n),y(Ke.$$.fragment,n),y(Ye.$$.fragment,n),y(nt.$$.fragment,n),y(he.$$.fragment,n),y(it.$$.fragment,n),y(ot.$$.fragment,n),Oi=!0)},o(n){D(u.$$.fragment,n),D(Ee.$$.fragment,n),D($e.$$.fragment,n),D(ke.$$.fragment,n),D(Le.$$.fragment,n),D(Ce.$$.fragment,n),D(Te.$$.fragment,n),D(Me.$$.fragment,n),D(Se.$$.fragment,n),D(Ge.$$.fragment,n),D(de.$$.fragment,n),D(Fe.$$.fragment,n),D(Ve.$$.fragment,n),D(ze.$$.fragment,n),D(We.$$.fragment,n),D(He.$$.fragment,n),D(Xe.$$.fragment,n),D(Ke.$$.fragment,n),D(Ye.$$.fragment,n),D(nt.$$.fragment,n),D(he.$$.fragment,n),D(it.$$.fragment,n),D(ot.$$.fragment,n),Oi=!1},d(n){t(I),n&&t(j),n&&t($),A(u),n&&t(gi),n&&t(ne),n&&t(_i),n&&t(rt),n&&t(vi),n&&t(lt),n&&t(bi),n&&t(De),n&&t(wi),n&&t(ie),n&&t(yi),n&&t(X),A(Ee),n&&t(Di),n&&t(se),n&&t(Ai),n&&t(L),n&&t(Pi),n&&t(wt),n&&t(Ii),n&&t(g),n&&t(Ei),A($e,n),n&&t(xi),n&&t($t),n&&t($i),n&&t(F),n&&t(ki),A(ke,n),n&&t(Li),n&&t(K),A(Le),n&&t(Ci),n&&t(G),A(Ce),A(Te),n&&t(Ti),n&&t(Y),A(Me),n&&t(Mi),n&&t(m),A(Se),A(Ge),A(de),A(Fe),A(Ve),A(ze),A(We),A(He),A(Xe),n&&t(Si),n&&t(J),A(Ke),n&&t(ji),n&&t(_),A(Ye),A(nt),A(he),A(it),A(ot)}}}const _f={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 vf(at){return uf(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Pf extends df{constructor(I){super();ff(this,I,vf,gf,cf,{})}}export{Pf as default,_f as metadata};
