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