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