import{S as Br,i as zr,s as Wr,e as i,k as l,w as _,t as a,M as Rr,c as o,d as n,m as d,a as s,x as v,h as r,b as f,G as e,g as p,y as b,q as w,o as y,B as D,v as Vr,L as Fr}from"../../../chunks/vendor-hf-doc-builder.js";import{D as O}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as pi}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as $n}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ur}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Hr(Re){let g,S,I,h,C;return h=new pi({props:{code:`import torch
from diffusers import AltDiffusionPipeline

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

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

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

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

from diffusers import AltDiffusionImg2ImgPipeline

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

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

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

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipe(prompt=prompt, image=init_image, strength=<span class="hljs-number">0.75</span>, guidance_scale=<span class="hljs-number">7.5</span>).images
<span class="hljs-meta">&gt;&gt;&gt; </span>images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;\u5E7B\u60F3\u98CE\u666F.png&quot;</span>)`}}),{c(){g=i("p"),S=a("Examples:"),I=l(),_(h.$$.fragment)},l(u){g=o(u,"P",{});var $=s(g);S=r($,"Examples:"),$.forEach(n),I=d(u),v(h.$$.fragment,u)},m(u,$){p(u,g,$),e(g,S),p(u,I,$),b(h,u,$),C=!0},p:Fr,i(u){C||(w(h.$$.fragment,u),C=!0)},o(u){y(h.$$.fragment,u),C=!1},d(u){u&&n(g),u&&n(I),D(h,u)}}}function Kr(Re){let g,S,I,h,C,u,$,At,ui,En,J,mi,_e,hi,gi,xn,Ve,_i,kn,He,Pt,vi,Cn,ve,It,bi,wi,Tn,ee,$t,q,Et,yi,Di,xt,Ai,Pi,Xe,Ii,$i,Ke,Ei,xi,be,N,kt,we,ki,Ci,Ct,Tt,Ti,Li,Ye,Si,ji,Ze,Mi,Oi,G,Lt,ye,qi,Ni,St,jt,Gi,Ui,Qe,Fi,Bi,Je,zi,Ln,H,te,Mt,De,Wi,Ot,Ri,Sn,ne,qt,Ae,Vi,et,Hi,Xi,Ki,Nt,Gt,Ut,Yi,jn,x,Zi,tt,Qi,Ji,nt,eo,to,Ft,no,io,it,oo,so,ot,ao,ro,Mn,st,Bt,zt,lo,On,m,fo,at,co,po,Wt,uo,mo,rt,ho,go,lt,_o,vo,dt,bo,wo,ft,yo,Do,ct,Ao,Po,Rt,Io,$o,Vt,Eo,xo,pt,ko,Co,qn,Pe,Nn,ut,Ht,Xt,To,Gn,F,Lo,Kt,So,jo,Yt,Mo,Oo,Un,Ie,Fn,X,ie,Zt,$e,qo,Qt,No,Bn,U,Ee,Go,Jt,Uo,Fo,oe,xe,Bo,en,zo,zn,K,se,tn,ke,Wo,nn,Ro,Wn,P,Ce,Vo,on,Ho,Xo,Te,Ko,mt,Yo,Zo,Qo,B,Le,Jo,sn,es,ts,ae,ns,re,Se,is,je,os,an,ss,as,rs,le,Me,ls,T,ds,rn,fs,cs,ln,ps,us,dn,ms,hs,fn,gs,_s,vs,de,Oe,bs,Y,ws,cn,ys,Ds,pn,As,Ps,Is,z,qe,$s,un,Es,xs,mn,ks,Rn,Z,fe,hn,Ne,Cs,gn,Ts,Vn,E,Ge,Ls,_n,Ss,js,Ue,Ms,ht,Os,qs,Ns,W,Fe,Gs,vn,Us,Fs,ce,Bs,pe,Be,zs,L,Ws,bn,Rs,Vs,wn,Hs,Xs,yn,Ks,Ys,Dn,Zs,Qs,Js,ue,ze,ea,Q,ta,An,na,ia,Pn,oa,sa,Hn;return u=new $n({}),De=new $n({}),Pe=new pi({props:{code:`from diffusers import AltDiffusionPipeline, EulerDiscreteScheduler

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

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

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

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

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

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

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

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