import{S as Fa,i as Ua,s as Ba,e as i,k as l,w as v,t as a,M as za,c as s,d as n,m as d,a as o,x as b,h as r,b as f,G as e,g as p,y,q as D,o as w,B as A,v as Wa,L as Ga}from"../../../chunks/vendor-hf-doc-builder.js";import{D as B}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as Vn}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as an}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as qa}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ra(Ne){let h,C,P,g,E;return g=new Vn({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(){h=i("p"),C=a("Examples:"),P=l(),v(g.$$.fragment)},l(u){h=s(u,"P",{});var $=o(h);C=r($,"Examples:"),$.forEach(n),P=d(u),b(g.$$.fragment,u)},m(u,$){p(u,h,$),e(h,C),p(u,P,$),y(g,u,$),E=!0},p:Ga,i(u){E||(D(g.$$.fragment,u),E=!0)},o(u){w(g.$$.fragment,u),E=!1},d(u){u&&n(h),u&&n(P),A(g,u)}}}function Va(Ne){let h,C,P,g,E;return g=new Vn({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(){h=i("p"),C=a("Examples:"),P=l(),v(g.$$.fragment)},l(u){h=s(u,"P",{});var $=o(h);C=r($,"Examples:"),$.forEach(n),P=d(u),b(g.$$.fragment,u)},m(u,$){p(u,h,$),e(h,C),p(u,P,$),y(g,u,$),E=!0},p:Ga,i(u){E||(D(g.$$.fragment,u),E=!0)},o(u){w(g.$$.fragment,u),E=!1},d(u){u&&n(h),u&&n(P),A(g,u)}}}function Ha(Ne){let h,C,P,g,E,u,$,ut,Hn,rn,H,Xn,de,Kn,Yn,ln,qe,Zn,dn,Ge,mt,Qn,fn,fe,gt,Jn,ei,cn,X,ht,S,_t,ti,ni,vt,ii,si,Fe,oi,ai,Ue,ri,li,ce,j,bt,pe,di,fi,yt,Dt,ci,pi,Be,ui,mi,ze,gi,hi,M,wt,ue,_i,vi,At,Pt,bi,yi,We,Di,wi,Re,Ai,pn,z,K,It,me,Pi,$t,Ii,un,Y,xt,ge,$i,Ve,xi,Ei,ki,Et,kt,Tt,Ti,mn,x,Ci,He,Li,Si,Xe,ji,Mi,Ct,Oi,Ni,Ke,qi,Gi,Ye,Fi,Ui,gn,Ze,Lt,St,Bi,hn,m,zi,Qe,Wi,Ri,jt,Vi,Hi,Je,Xi,Ki,et,Yi,Zi,tt,Qi,Ji,nt,es,ts,it,ns,is,Mt,ss,os,Ot,as,rs,st,ls,ds,_n,he,vn,ot,Nt,qt,fs,bn,N,cs,Gt,ps,us,Ft,ms,gs,yn,_e,Dn,W,Z,Ut,ve,hs,Bt,_s,wn,O,be,vs,zt,bs,ys,Q,ye,Ds,Wt,ws,An,R,J,Rt,De,As,Vt,Ps,Pn,I,we,Is,Ht,$s,xs,Ae,Es,at,ks,Ts,Cs,q,Pe,Ls,Xt,Ss,js,ee,Ms,te,Ie,Os,$e,Ns,Kt,qs,Gs,Fs,ne,xe,Us,Ee,Bs,Yt,zs,Ws,Rs,G,ke,Vs,Zt,Hs,Xs,Qt,Ks,In,V,ie,Jt,Te,Ys,en,Zs,$n,k,Ce,Qs,tn,Js,eo,Le,to,rt,no,io,so,F,Se,oo,nn,ao,ro,se,lo,oe,je,fo,Me,co,sn,po,uo,xn;return u=new an({}),me=new an({}),he=new Vn({props:{code:`from diffusers import AltDiffusionPipeline, EulerDiscreteScheduler

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

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

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

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

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

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

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

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