import{S as zp,i as Np,s as Mp,e as i,k as l,w as h,t as s,M as Vp,c as o,d as n,m as p,a,x as _,h as r,b as c,G as e,g as f,y as b,q as v,o as P,B as I,v as Fp,L as wo}from"../../../chunks/vendor-hf-doc-builder.js";import{T as Gp}from"../../../chunks/Tip-hf-doc-builder.js";import{D as S}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as ce}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as qe}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as $o}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Wp(N){let g,k,y,u,x,d,$,ee;return{c(){g=i("p"),k=s("For text-to-image we use "),y=i("code"),u=s("stabilityai/stable-diffusion-2-1-unclip-small"),x=s(" as it was trained on CLIP ViT-L/14 embedding, the same as the Karlo model prior. "),d=i("a"),$=s("stabilityai/stable-diffusion-2-1-unclip"),ee=s(" was trained on OpenCLIP ViT-H, so we don\u2019t recommend its use."),this.h()},l(te){g=o(te,"P",{});var q=a(g);k=r(q,"For text-to-image we use "),y=o(q,"CODE",{});var F=a(y);u=r(F,"stabilityai/stable-diffusion-2-1-unclip-small"),F.forEach(n),x=r(q," as it was trained on CLIP ViT-L/14 embedding, the same as the Karlo model prior. "),d=o(q,"A",{href:!0,rel:!0});var Ot=a(d);$=r(Ot,"stabilityai/stable-diffusion-2-1-unclip"),Ot.forEach(n),ee=r(q," was trained on OpenCLIP ViT-H, so we don\u2019t recommend its use."),q.forEach(n),this.h()},h(){c(d,"href","https://hf.co/stabilityai/stable-diffusion-2-1-unclip"),c(d,"rel","nofollow")},m(te,q){f(te,g,q),e(g,k),e(g,y),e(y,u),e(g,x),e(g,d),e(d,$),e(g,ee)},d(te){te&&n(g)}}}function Kp(N){let g,k,y,u,x;return u=new ce({props:{code:`import torch
from diffusers import StableUnCLIPPipeline

pipe = StableUnCLIPPipeline.from_pretrained(
    "fusing/stable-unclip-2-1-l", torch_dtype=torch.float16
)  # TODO update model path
pipe = pipe.to("cuda")

prompt = "a photo of an astronaut riding a horse on mars"
images = pipe(prompt).images
images[0].save("astronaut_horse.png")`,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> StableUnCLIPPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableUnCLIPPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;fusing/stable-unclip-2-1-l&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)  <span class="hljs-comment"># TODO update model path</span>
<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>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipe(prompt).images
<span class="hljs-meta">&gt;&gt;&gt; </span>images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;astronaut_horse.png&quot;</span>)`}}),{c(){g=i("p"),k=s("Examples:"),y=l(),h(u.$$.fragment)},l(d){g=o(d,"P",{});var $=a(g);k=r($,"Examples:"),$.forEach(n),y=p(d),_(u.$$.fragment,d)},m(d,$){f(d,g,$),e(g,k),f(d,y,$),b(u,d,$),x=!0},p:wo,i(d){x||(v(u.$$.fragment,d),x=!0)},o(d){P(u.$$.fragment,d),x=!1},d(d){d&&n(g),d&&n(y),I(u,d)}}}function Bp(N){let g,k,y,u,x;return u=new ce({props:{code:`import torch
from diffusers import DiffusionPipeline
from xformers.ops import MemoryEfficientAttentionFlashAttentionOp

pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1", torch_dtype=torch.float16)
pipe = pipe.to("cuda")
pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
# Workaround for not accepting attention shape using VAE for Flash Attention
pipe.vae.enable_xformers_memory_efficient_attention(attention_op=None)`,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> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&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>pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Workaround for not accepting attention shape using VAE for Flash Attention</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_xformers_memory_efficient_attention(attention_op=<span class="hljs-literal">None</span>)`}}),{c(){g=i("p"),k=s("Examples:"),y=l(),h(u.$$.fragment)},l(d){g=o(d,"P",{});var $=a(g);k=r($,"Examples:"),$.forEach(n),y=p(d),_(u.$$.fragment,d)},m(d,$){f(d,g,$),e(g,k),f(d,y,$),b(u,d,$),x=!0},p:wo,i(d){x||(v(u.$$.fragment,d),x=!0)},o(d){P(u.$$.fragment,d),x=!1},d(d){d&&n(g),d&&n(y),I(u,d)}}}function Hp(N){let g,k,y,u,x;return u=new ce({props:{code:`import requests
import torch
from PIL import Image
from io import BytesIO

from diffusers import StableUnCLIPImg2ImgPipeline

pipe = StableUnCLIPImg2ImgPipeline.from_pretrained(
    "fusing/stable-unclip-2-1-l-img2img", torch_dtype=torch.float16
)  # TODO update model path
pipe = pipe.to("cuda")

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))

prompt = "A fantasy landscape, trending on artstation"

images = pipe(prompt, init_image).images
images[0].save("fantasy_landscape.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> StableUnCLIPImg2ImgPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableUnCLIPImg2ImgPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;fusing/stable-unclip-2-1-l-img2img&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)  <span class="hljs-comment"># TODO update model path</span>
<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>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>prompt = <span class="hljs-string">&quot;A fantasy landscape, trending on artstation&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipe(prompt, init_image).images
<span class="hljs-meta">&gt;&gt;&gt; </span>images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;fantasy_landscape.png&quot;</span>)`}}),{c(){g=i("p"),k=s("Examples:"),y=l(),h(u.$$.fragment)},l(d){g=o(d,"P",{});var $=a(g);k=r($,"Examples:"),$.forEach(n),y=p(d),_(u.$$.fragment,d)},m(d,$){f(d,g,$),e(g,k),f(d,y,$),b(u,d,$),x=!0},p:wo,i(d){x||(v(u.$$.fragment,d),x=!0)},o(d){P(u.$$.fragment,d),x=!1},d(d){d&&n(g),d&&n(y),I(u,d)}}}function Rp(N){let g,k,y,u,x;return u=new ce({props:{code:`import torch
from diffusers import DiffusionPipeline
from xformers.ops import MemoryEfficientAttentionFlashAttentionOp

pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1", torch_dtype=torch.float16)
pipe = pipe.to("cuda")
pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
# Workaround for not accepting attention shape using VAE for Flash Attention
pipe.vae.enable_xformers_memory_efficient_attention(attention_op=None)`,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> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&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>pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Workaround for not accepting attention shape using VAE for Flash Attention</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_xformers_memory_efficient_attention(attention_op=<span class="hljs-literal">None</span>)`}}),{c(){g=i("p"),k=s("Examples:"),y=l(),h(u.$$.fragment)},l(d){g=o(d,"P",{});var $=a(g);k=r($,"Examples:"),$.forEach(n),y=p(d),_(u.$$.fragment,d)},m(d,$){f(d,g,$),e(g,k),f(d,y,$),b(u,d,$),x=!0},p:wo,i(d){x||(v(u.$$.fragment,d),x=!0)},o(d){P(u.$$.fragment,d),x=!1},d(d){d&&n(g),d&&n(y),I(u,d)}}}function Jp(N){let g,k,y,u,x,d,$,ee,te,q,F,Ot,zt,Co,xo,Ii,Nt,Lo,yi,Oe,ze,Eo,ko,$i,ne,me,en,Ne,So,tn,Uo,wi,j,To,nn,jo,Do,on,Ao,qo,an,Oo,zo,sn,No,Mo,Ci,ie,fe,rn,Me,Vo,ln,Fo,xi,ge,Mt,Go,Ve,pn,Fe,Wo,Ko,dn,Ge,Bo,Ho,Vt,Ro,cn,mn,We,Jo,Li,oe,ue,fn,Ke,Qo,gn,Xo,Ei,Be,ki,he,Si,ae,_e,un,He,Yo,hn,Zo,Ui,Re,Ti,be,ea,_n,ta,na,ji,Je,Di,se,ve,bn,Qe,ia,vn,oa,Ai,Ft,aa,qi,Xe,Oi,Gt,sa,zi,Ye,Ni,re,Pe,Pn,Ze,ra,In,la,Mi,w,et,pa,yn,da,ca,tt,ma,Wt,fa,ga,ua,G,nt,ha,$n,_a,ba,Ie,va,W,it,Pa,wn,Ia,ya,Cn,$a,wa,ye,ot,Ca,at,xa,xn,La,Ea,ka,K,st,Sa,Ln,Ua,Ta,En,ja,Da,$e,rt,Aa,lt,qa,kn,Oa,za,Na,D,pt,Ma,Sn,Va,Fa,Un,Ga,Wa,Tn,Ka,Ba,we,Ha,Ce,dt,Ra,jn,Ja,Qa,xe,ct,Xa,O,Ya,Dn,Za,es,An,ts,ns,qn,is,os,On,as,ss,rs,Le,mt,ls,ft,ps,zn,ds,cs,ms,U,gt,fs,le,gs,Nn,us,hs,Mn,_s,bs,vs,Vn,Ps,Is,ut,Fn,ys,$s,Gn,ws,Cs,ht,xs,Wn,Ls,Es,ks,Kn,Ss,Vi,pe,Ee,Bn,_t,Us,Hn,Ts,Fi,C,bt,js,Rn,Ds,As,vt,qs,Kt,Os,zs,Ns,B,Pt,Ms,Jn,Vs,Fs,ke,Gs,H,It,Ws,Qn,Ks,Bs,Xn,Hs,Rs,Se,yt,Js,$t,Qs,Yn,Xs,Ys,Zs,R,wt,er,Zn,tr,nr,ei,ir,or,Ue,Ct,ar,xt,sr,ti,rr,lr,pr,A,Lt,dr,ni,cr,mr,ii,fr,gr,oi,ur,hr,Te,_r,je,Et,br,ai,vr,Pr,De,kt,Ir,z,yr,si,$r,wr,ri,Cr,xr,li,Lr,Er,pi,kr,Sr,Ur,Ae,St,Tr,Ut,jr,di,Dr,Ar,qr,T,Tt,Or,de,zr,ci,Nr,Mr,mi,Vr,Fr,Gr,fi,Wr,Kr,jt,gi,Br,Hr,ui,Rr,Jr,Dt,Qr,hi,Xr,Yr,Zr,_i,el,Gi;return d=new qe({}),Ne=new qe({}),Me=new qe({}),Ke=new qe({}),Be=new ce({props:{code:`import torch
from diffusers import UnCLIPScheduler, DDPMScheduler, StableUnCLIPPipeline
from diffusers.models import PriorTransformer
from transformers import CLIPTokenizer, CLIPTextModelWithProjection

prior_model_id = "kakaobrain/karlo-v1-alpha"
data_type = torch.float16
prior = PriorTransformer.from_pretrained(prior_model_id, subfolder="prior", torch_dtype=data_type)

prior_text_model_id = "openai/clip-vit-large-patch14"
prior_tokenizer = CLIPTokenizer.from_pretrained(prior_text_model_id)
prior_text_model = CLIPTextModelWithProjection.from_pretrained(prior_text_model_id, torch_dtype=data_type)
prior_scheduler = UnCLIPScheduler.from_pretrained(prior_model_id, subfolder="prior_scheduler")
prior_scheduler = DDPMScheduler.from_config(prior_scheduler.config)

stable_unclip_model_id = "stabilityai/stable-diffusion-2-1-unclip-small"

pipe = StableUnCLIPPipeline.from_pretrained(
    stable_unclip_model_id,
    torch_dtype=data_type,
    variant="fp16",
    prior_tokenizer=prior_tokenizer,
    prior_text_encoder=prior_text_model,
    prior=prior,
    prior_scheduler=prior_scheduler,
)

pipe = pipe.to("cuda")
wave_prompt = "dramatic wave, the Oceans roar, Strong wave spiral across the oceans as the waves unfurl into roaring crests; perfect wave form; perfect wave shape; dramatic wave shape; wave shape unbelievable; wave; wave shape spectacular"

images = pipe(prompt=wave_prompt).images
images[0].save("waves.png")`,highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UnCLIPScheduler, DDPMScheduler, StableUnCLIPPipeline
<span class="hljs-keyword">from</span> diffusers.models <span class="hljs-keyword">import</span> PriorTransformer
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> CLIPTokenizer, CLIPTextModelWithProjection

prior_model_id = <span class="hljs-string">&quot;kakaobrain/karlo-v1-alpha&quot;</span>
data_type = torch.float16
prior = PriorTransformer.from_pretrained(prior_model_id, subfolder=<span class="hljs-string">&quot;prior&quot;</span>, torch_dtype=data_type)

prior_text_model_id = <span class="hljs-string">&quot;openai/clip-vit-large-patch14&quot;</span>
prior_tokenizer = CLIPTokenizer.from_pretrained(prior_text_model_id)
prior_text_model = CLIPTextModelWithProjection.from_pretrained(prior_text_model_id, torch_dtype=data_type)
prior_scheduler = UnCLIPScheduler.from_pretrained(prior_model_id, subfolder=<span class="hljs-string">&quot;prior_scheduler&quot;</span>)
prior_scheduler = DDPMScheduler.from_config(prior_scheduler.config)

stable_unclip_model_id = <span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1-unclip-small&quot;</span>

pipe = StableUnCLIPPipeline.from_pretrained(
    stable_unclip_model_id,
    torch_dtype=data_type,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
    prior_tokenizer=prior_tokenizer,
    prior_text_encoder=prior_text_model,
    prior=prior,
    prior_scheduler=prior_scheduler,
)

pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
wave_prompt = <span class="hljs-string">&quot;dramatic wave, the Oceans roar, Strong wave spiral across the oceans as the waves unfurl into roaring crests; perfect wave form; perfect wave shape; dramatic wave shape; wave shape unbelievable; wave; wave shape spectacular&quot;</span>

images = pipe(prompt=wave_prompt).images
images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;waves.png&quot;</span>)`}}),he=new Gp({props:{warning:!0,$$slots:{default:[Wp]},$$scope:{ctx:N}}}),He=new qe({}),Re=new ce({props:{code:`from diffusers import StableUnCLIPImg2ImgPipeline
from diffusers.utils import load_image
import torch

pipe = StableUnCLIPImg2ImgPipeline.from_pretrained(
    "stabilityai/stable-diffusion-2-1-unclip", torch_dtype=torch.float16, variation="fp16"
)
pipe = pipe.to("cuda")

url = "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/stable_unclip/tarsila_do_amaral.png"
init_image = load_image(url)

images = pipe(init_image).images
images[0].save("variation_image.png")`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableUnCLIPImg2ImgPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">import</span> torch

pipe = StableUnCLIPImg2ImgPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1-unclip&quot;</span>, torch_dtype=torch.float16, variation=<span class="hljs-string">&quot;fp16&quot;</span>
)
pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

url = <span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/stable_unclip/tarsila_do_amaral.png&quot;</span>
init_image = load_image(url)

images = pipe(init_image).images
images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;variation_image.png&quot;</span>)`}}),Je=new ce({props:{code:`prompt = "A fantasy landscape, trending on artstation"

images = pipe(init_image, prompt=prompt).images
images[0].save("variation_image_two.png")`,highlighted:`prompt = <span class="hljs-string">&quot;A fantasy landscape, trending on artstation&quot;</span>

images = pipe(init_image, prompt=prompt).images
images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;variation_image_two.png&quot;</span>)`}}),Qe=new qe({}),Xe=new ce({props:{code:`from diffusers import StableUnCLIPImg2ImgPipeline
from diffusers.utils import load_image
import torch

pipe = StableUnCLIPImg2ImgPipeline.from_pretrained(
    "stabilityai/stable-diffusion-2-1-unclip", torch_dtype=torch.float16, variation="fp16"
)
# Offload to CPU.
pipe.enable_model_cpu_offload()

url = "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/stable_unclip/tarsila_do_amaral.png"
init_image = load_image(url)

images = pipe(init_image).images
images[0]`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableUnCLIPImg2ImgPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">import</span> torch

pipe = StableUnCLIPImg2ImgPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1-unclip&quot;</span>, torch_dtype=torch.float16, variation=<span class="hljs-string">&quot;fp16&quot;</span>
)
<span class="hljs-comment"># Offload to CPU.</span>
pipe.enable_model_cpu_offload()

url = <span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/stable_unclip/tarsila_do_amaral.png&quot;</span>
init_image = load_image(url)

images = pipe(init_image).images
images[<span class="hljs-number">0</span>]`}}),Ye=new ce({props:{code:`from diffusers import StableUnCLIPImg2ImgPipeline
from diffusers.utils import load_image
import torch

pipe = StableUnCLIPImg2ImgPipeline.from_pretrained(
    "stabilityai/stable-diffusion-2-1-unclip", torch_dtype=torch.float16, variation="fp16"
)
pipe.enable_model_cpu_offload()
pipe.enable_vae_slicing()

url = "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/stable_unclip/tarsila_do_amaral.png"
init_image = load_image(url)

images = pipe(init_image).images
images[0]`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableUnCLIPImg2ImgPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">import</span> torch

pipe = StableUnCLIPImg2ImgPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1-unclip&quot;</span>, torch_dtype=torch.float16, variation=<span class="hljs-string">&quot;fp16&quot;</span>
)
pipe.enable_model_cpu_offload()
pipe.enable_vae_slicing()

url = <span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/stable_unclip/tarsila_do_amaral.png&quot;</span>
init_image = load_image(url)

images = pipe(init_image).images
images[<span class="hljs-number">0</span>]`}}),Ze=new qe({}),et=new S({props:{name:"class diffusers.StableUnCLIPPipeline",anchor:"diffusers.StableUnCLIPPipeline",parameters:[{name:"prior_tokenizer",val:": CLIPTokenizer"},{name:"prior_text_encoder",val:": CLIPTextModelWithProjection"},{name:"prior",val:": PriorTransformer"},{name:"prior_scheduler",val:": KarrasDiffusionSchedulers"},{name:"image_normalizer",val:": StableUnCLIPImageNormalizer"},{name:"image_noising_scheduler",val:": KarrasDiffusionSchedulers"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"text_encoder",val:": CLIPTextModelWithProjection"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"vae",val:": AutoencoderKL"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPPipeline.prior_tokenizer",description:`<strong>prior_tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"prior_tokenizer"},{anchor:"diffusers.StableUnCLIPPipeline.prior_text_encoder",description:`<strong>prior_text_encoder</strong> (<code>CLIPTextModelWithProjection</code>) &#x2014;
Frozen text-encoder.`,name:"prior_text_encoder"},{anchor:"diffusers.StableUnCLIPPipeline.prior",description:`<strong>prior</strong> (<a href="/docs/diffusers/v0.16.0/en/api/models#diffusers.PriorTransformer">PriorTransformer</a>) &#x2014;
The canonincal unCLIP prior to approximate the image embedding from the text embedding.`,name:"prior"},{anchor:"diffusers.StableUnCLIPPipeline.prior_scheduler",description:`<strong>prior_scheduler</strong> (<code>KarrasDiffusionSchedulers</code>) &#x2014;
Scheduler used in the prior denoising process.`,name:"prior_scheduler"},{anchor:"diffusers.StableUnCLIPPipeline.image_normalizer",description:`<strong>image_normalizer</strong> (<code>StableUnCLIPImageNormalizer</code>) &#x2014;
Used to normalize the predicted image embeddings before the noise is applied and un-normalize the image
embeddings after the noise has been applied.`,name:"image_normalizer"},{anchor:"diffusers.StableUnCLIPPipeline.image_noising_scheduler",description:`<strong>image_noising_scheduler</strong> (<code>KarrasDiffusionSchedulers</code>) &#x2014;
Noise schedule for adding noise to the predicted image embeddings. The amount of noise to add is determined
by <code>noise_level</code> in <code>StableUnCLIPPipeline.__call__</code>.`,name:"image_noising_scheduler"},{anchor:"diffusers.StableUnCLIPPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableUnCLIPPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder.`,name:"text_encoder"},{anchor:"diffusers.StableUnCLIPPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.16.0/en/api/models#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableUnCLIPPipeline.scheduler",description:`<strong>scheduler</strong> (<code>KarrasDiffusionSchedulers</code>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents.`,name:"scheduler"},{anchor:"diffusers.StableUnCLIPPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.16.0/en/api/models#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L51"}}),nt=new S({props:{name:"__call__",anchor:"diffusers.StableUnCLIPPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 20"},{name:"guidance_scale",val:": float = 10.0"},{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.Optional[torch._C.Generator] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"noise_level",val:": int = 0"},{name:"prior_num_inference_steps",val:": int = 25"},{name:"prior_guidance_scale",val:": float = 4.0"},{name:"prior_latents",val:": typing.Optional[torch.FloatTensor] = None"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 20) &#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.StableUnCLIPPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 10.0) &#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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.16.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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 <a href="/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__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.StableUnCLIPPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableUnCLIPPipeline.__call__.noise_level",description:`<strong>noise_level</strong> (<code>int</code>, <em>optional</em>, defaults to <code>0</code>) &#x2014;
The amount of noise to add to the image embeddings. A higher <code>noise_level</code> increases the variance in
the final un-noised images. See <code>StableUnCLIPPipeline.noise_image_embeddings</code> for details.`,name:"noise_level"},{anchor:"diffusers.StableUnCLIPPipeline.__call__.prior_num_inference_steps",description:`<strong>prior_num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 25) &#x2014;
The number of denoising steps in the prior denoising process. More denoising steps usually lead to a
higher quality image at the expense of slower inference.`,name:"prior_num_inference_steps"},{anchor:"diffusers.StableUnCLIPPipeline.__call__.prior_guidance_scale",description:`<strong>prior_guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Guidance scale for the prior denoising process as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion
Guidance</a>. <code>prior_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:"prior_guidance_scale"},{anchor:"diffusers.StableUnCLIPPipeline.__call__.prior_latents",description:`<strong>prior_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
embedding generation in the prior denoising process. 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:"prior_latents"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L638",returnDescription:`
<p><code>~ pipeline_utils.ImagePipelineOutput</code> if <code>return_dict</code> is
True, otherwise a <code>tuple</code>. When returning a tuple, the first element is a list with the generated images.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Ie=new $o({props:{anchor:"diffusers.StableUnCLIPPipeline.__call__.example",$$slots:{default:[Kp]},$$scope:{ctx:N}}}),it=new S({props:{name:"enable_attention_slicing",anchor:"diffusers.StableUnCLIPPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/pipeline_utils.py#L1476"}}),ot=new S({props:{name:"disable_attention_slicing",anchor:"diffusers.StableUnCLIPPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/pipeline_utils.py#L1492"}}),st=new S({props:{name:"enable_vae_slicing",anchor:"diffusers.StableUnCLIPPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L141"}}),rt=new S({props:{name:"disable_vae_slicing",anchor:"diffusers.StableUnCLIPPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L151"}}),pt=new S({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableUnCLIPPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/pipeline_utils.py#L1418"}}),we=new $o({props:{anchor:"diffusers.StableUnCLIPPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[Bp]},$$scope:{ctx:N}}}),dt=new S({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableUnCLIPPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/pipeline_utils.py#L1450"}}),ct=new S({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableUnCLIPPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L182"}}),mt=new S({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.StableUnCLIPPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L158"}}),gt=new S({props:{name:"noise_image_embeddings",anchor:"diffusers.StableUnCLIPPipeline.noise_image_embeddings",parameters:[{name:"image_embeds",val:": Tensor"},{name:"noise_level",val:": int"},{name:"noise",val:": typing.Optional[torch.FloatTensor] = None"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip.py#L592"}}),_t=new qe({}),bt=new S({props:{name:"class diffusers.StableUnCLIPImg2ImgPipeline",anchor:"diffusers.StableUnCLIPImg2ImgPipeline",parameters:[{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"image_encoder",val:": CLIPVisionModelWithProjection"},{name:"image_normalizer",val:": StableUnCLIPImageNormalizer"},{name:"image_noising_scheduler",val:": KarrasDiffusionSchedulers"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"text_encoder",val:": CLIPTextModel"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"vae",val:": AutoencoderKL"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Feature extractor for image pre-processing before being encoded.`,name:"feature_extractor"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.image_encoder",description:`<strong>image_encoder</strong> (<code>CLIPVisionModelWithProjection</code>) &#x2014;
CLIP vision model for encoding images.`,name:"image_encoder"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.image_normalizer",description:`<strong>image_normalizer</strong> (<code>StableUnCLIPImageNormalizer</code>) &#x2014;
Used to normalize the predicted image embeddings before the noise is applied and un-normalize the image
embeddings after the noise has been applied.`,name:"image_normalizer"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.image_noising_scheduler",description:`<strong>image_noising_scheduler</strong> (<code>KarrasDiffusionSchedulers</code>) &#x2014;
Noise schedule for adding noise to the predicted image embeddings. The amount of noise to add is determined
by <code>noise_level</code> in <code>StableUnCLIPPipeline.__call__</code>.`,name:"image_noising_scheduler"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder.`,name:"text_encoder"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.16.0/en/api/models#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<code>KarrasDiffusionSchedulers</code>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents.`,name:"scheduler"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.16.0/en/api/models#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L64"}}),Pt=new S({props:{name:"__call__",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__",parameters:[{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image] = None"},{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 = 20"},{name:"guidance_scale",val:": float = 10"},{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.Optional[torch._C.Generator] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"noise_level",val:": int = 0"},{name:"image_embeds",val:": typing.Optional[torch.FloatTensor] = None"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__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, either <code>prompt_embeds</code> will be
used or prompt is initialized to <code>&quot;&quot;</code>.`,name:"prompt"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__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. The image will be encoded to its CLIP embedding which
the unet will be conditioned on. Note that the image is <em>not</em> encoded by the vae and then used as the
latents in the denoising process such as in the standard stable diffusion text guided image variation
process.`,name:"image"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 20) &#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.StableUnCLIPImg2ImgPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 10.0) &#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.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.16.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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 <a href="/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__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.StableUnCLIPImg2ImgPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__.noise_level",description:`<strong>noise_level</strong> (<code>int</code>, <em>optional</em>, defaults to <code>0</code>) &#x2014;
The amount of noise to add to the image embeddings. A higher <code>noise_level</code> increases the variance in
the final un-noised images. See <code>StableUnCLIPPipeline.noise_image_embeddings</code> for details.`,name:"noise_level"},{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__.image_embeds",description:`<strong>image_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated CLIP embeddings to condition the unet on. Note that these are not latents to be used in
the denoising process. If you want to provide pre-generated latents, pass them to <code>__call__</code> as
<code>latents</code>.`,name:"image_embeds"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L605",returnDescription:`
<p><code>~ pipeline_utils.ImagePipelineOutput</code> if <code>return_dict</code> is
True, otherwise a <code>tuple</code>. When returning a tuple, the first element is a list with the generated images.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),ke=new $o({props:{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.__call__.example",$$slots:{default:[Hp]},$$scope:{ctx:N}}}),It=new S({props:{name:"enable_attention_slicing",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/pipeline_utils.py#L1476"}}),yt=new S({props:{name:"disable_attention_slicing",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/pipeline_utils.py#L1492"}}),wt=new S({props:{name:"enable_vae_slicing",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L143"}}),Ct=new S({props:{name:"disable_vae_slicing",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L153"}}),Lt=new S({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/pipeline_utils.py#L1418"}}),Te=new $o({props:{anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[Rp]},$$scope:{ctx:N}}}),Et=new S({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/pipeline_utils.py#L1450"}}),kt=new S({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L184"}}),St=new S({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L160"}}),Tt=new S({props:{name:"noise_image_embeddings",anchor:"diffusers.StableUnCLIPImg2ImgPipeline.noise_image_embeddings",parameters:[{name:"image_embeds",val:": Tensor"},{name:"noise_level",val:": int"},{name:"noise",val:": typing.Optional[torch.FloatTensor] = None"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_unclip_img2img.py#L559"}}),{c(){g=i("meta"),k=l(),y=i("h1"),u=i("a"),x=i("span"),h(d.$$.fragment),$=l(),ee=i("span"),te=s("Stable unCLIP"),q=l(),F=i("p"),Ot=s("Stable unCLIP checkpoints are finetuned from "),zt=i("a"),Co=s("stable diffusion 2.1"),xo=s(` checkpoints to condition on CLIP image embeddings.
Stable unCLIP also still conditions on text embeddings. Given the two separate conditionings, stable unCLIP can be used
for text guided image variation. When combined with an unCLIP prior, it can also be used for full text to image generation.`),Ii=l(),Nt=i("p"),Lo=s("To know more about the unCLIP process, check out the following paper:"),yi=l(),Oe=i("p"),ze=i("a"),Eo=s("Hierarchical Text-Conditional Image Generation with CLIP Latents"),ko=s(" by Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, Mark Chen."),$i=l(),ne=i("h2"),me=i("a"),en=i("span"),h(Ne.$$.fragment),So=l(),tn=i("span"),Uo=s("Tips"),wi=l(),j=i("p"),To=s("Stable unCLIP takes a "),nn=i("code"),jo=s("noise_level"),Do=s(" as input during inference. "),on=i("code"),Ao=s("noise_level"),qo=s(` determines how much noise is added
to the image embeddings. A higher `),an=i("code"),Oo=s("noise_level"),zo=s(` increases variation in the final un-noised images. By default,
we do not add any additional noise to the image embeddings i.e. `),sn=i("code"),No=s("noise_level = 0"),Mo=s("."),Ci=l(),ie=i("h3"),fe=i("a"),rn=i("span"),h(Me.$$.fragment),Vo=l(),ln=i("span"),Fo=s("Available checkpoints:"),xi=l(),ge=i("ul"),Mt=i("li"),Go=s("Image variation"),Ve=i("ul"),pn=i("li"),Fe=i("a"),Wo=s("stabilityai/stable-diffusion-2-1-unclip"),Ko=l(),dn=i("li"),Ge=i("a"),Bo=s("stabilityai/stable-diffusion-2-1-unclip-small"),Ho=l(),Vt=i("li"),Ro=s("Text-to-image "),cn=i("ul"),mn=i("li"),We=i("a"),Jo=s("stabilityai/stable-diffusion-2-1-unclip-small"),Li=l(),oe=i("h3"),ue=i("a"),fn=i("span"),h(Ke.$$.fragment),Qo=l(),gn=i("span"),Xo=s("Text-to-Image Generation"),Ei=s(`

Stable unCLIP can be leveraged for text-to-image generation by pipelining it with the prior model of KakaoBrain's open source DALL-E 2 replication [Karlo](https://huggingface.co/kakaobrain/karlo-v1-alpha)

	`),h(Be.$$.fragment),ki=l(),h(he.$$.fragment),Si=l(),ae=i("h3"),_e=i("a"),un=i("span"),h(He.$$.fragment),Yo=l(),hn=i("span"),Zo=s("Text guided Image-to-Image Variation"),Ui=l(),h(Re.$$.fragment),Ti=l(),be=i("p"),ea=s("Optionally, you can also pass a prompt to "),_n=i("code"),ta=s("pipe"),na=s(" such as:"),ji=l(),h(Je.$$.fragment),Di=l(),se=i("h3"),ve=i("a"),bn=i("span"),h(Qe.$$.fragment),ia=l(),vn=i("span"),oa=s("Memory optimization"),Ai=l(),Ft=i("p"),aa=s(`If you are short on GPU memory, you can enable smart CPU offloading so that models that are not needed
immediately for a computation can be offloaded to CPU:`),qi=l(),h(Xe.$$.fragment),Oi=l(),Gt=i("p"),sa=s("Further memory optimizations are possible by enabling VAE slicing on the pipeline:"),zi=l(),h(Ye.$$.fragment),Ni=l(),re=i("h3"),Pe=i("a"),Pn=i("span"),h(Ze.$$.fragment),ra=l(),In=i("span"),la=s("StableUnCLIPPipeline"),Mi=l(),w=i("div"),h(et.$$.fragment),pa=l(),yn=i("p"),da=s("Pipeline for text-to-image generation using stable unCLIP."),ca=l(),tt=i("p"),ma=s("This model inherits from "),Wt=i("a"),fa=s("DiffusionPipeline"),ga=s(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),ua=l(),G=i("div"),h(nt.$$.fragment),ha=l(),$n=i("p"),_a=s("Function invoked when calling the pipeline for generation."),ba=l(),h(Ie.$$.fragment),va=l(),W=i("div"),h(it.$$.fragment),Pa=l(),wn=i("p"),Ia=s("Enable sliced attention computation."),ya=l(),Cn=i("p"),$a=s(`When this option is enabled, the attention module will split the input tensor in slices, to compute attention
in several steps. This is useful to save some memory in exchange for a small speed decrease.`),wa=l(),ye=i("div"),h(ot.$$.fragment),Ca=l(),at=i("p"),xa=s("Disable sliced attention computation. If "),xn=i("code"),La=s("enable_attention_slicing"),Ea=s(` was previously invoked, this method will go
back to computing attention in one step.`),ka=l(),K=i("div"),h(st.$$.fragment),Sa=l(),Ln=i("p"),Ua=s("Enable sliced VAE decoding."),Ta=l(),En=i("p"),ja=s(`When this option is enabled, the VAE will split the input tensor in slices to compute decoding in several
steps. This is useful to save some memory and allow larger batch sizes.`),Da=l(),$e=i("div"),h(rt.$$.fragment),Aa=l(),lt=i("p"),qa=s("Disable sliced VAE decoding. If "),kn=i("code"),Oa=s("enable_vae_slicing"),za=s(` was previously invoked, this method will go back to
computing decoding in one step.`),Na=l(),D=i("div"),h(pt.$$.fragment),Ma=l(),Sn=i("p"),Va=s("Enable memory efficient attention as implemented in xformers."),Fa=l(),Un=i("p"),Ga=s(`When this option is enabled, you should observe lower GPU memory usage and a potential speed up at inference
time. Speed up at training time is not guaranteed.`),Wa=l(),Tn=i("p"),Ka=s(`Warning: When Memory Efficient Attention and Sliced attention are both enabled, the Memory Efficient Attention
is used.`),Ba=l(),h(we.$$.fragment),Ha=l(),Ce=i("div"),h(dt.$$.fragment),Ra=l(),jn=i("p"),Ja=s("Disable memory efficient attention as implemented in xformers."),Qa=l(),xe=i("div"),h(ct.$$.fragment),Xa=l(),O=i("p"),Ya=s(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Dn=i("code"),Za=s("enable_sequential_cpu_offload"),es=s(", this method moves one whole model at a time to the GPU when its "),An=i("code"),ts=s("forward"),ns=s(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),qn=i("code"),is=s("enable_sequential_cpu_offload"),os=s(", but performance is much better due to the iterative execution of the "),On=i("code"),as=s("unet"),ss=s("."),rs=l(),Le=i("div"),h(mt.$$.fragment),ls=l(),ft=i("p"),ps=s(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),zn=i("code"),ds=s("torch.device('meta') and loaded to GPU only when their specific submodule has its "),cs=s("forward` method called."),ms=l(),U=i("div"),h(gt.$$.fragment),fs=l(),le=i("p"),gs=s("Add noise to the image embeddings. The amount of noise is controlled by a "),Nn=i("code"),us=s("noise_level"),hs=s(` input. A higher
`),Mn=i("code"),_s=s("noise_level"),bs=s(" increases the variance in the final un-noised images."),vs=l(),Vn=i("p"),Ps=s("The noise is applied in two ways"),Is=l(),ut=i("ol"),Fn=i("li"),ys=s("A noise schedule is applied directly to the embeddings"),$s=l(),Gn=i("li"),ws=s("A vector of sinusoidal time embeddings are appended to the output."),Cs=l(),ht=i("p"),xs=s("In both cases, the amount of noise is controlled by the same "),Wn=i("code"),Ls=s("noise_level"),Es=s("."),ks=l(),Kn=i("p"),Ss=s("The embeddings are normalized before the noise is applied and un-normalized after the noise is applied."),Vi=l(),pe=i("h3"),Ee=i("a"),Bn=i("span"),h(_t.$$.fragment),Us=l(),Hn=i("span"),Ts=s("StableUnCLIPImg2ImgPipeline"),Fi=l(),C=i("div"),h(bt.$$.fragment),js=l(),Rn=i("p"),Ds=s("Pipeline for text-guided image to image generation using stable unCLIP."),As=l(),vt=i("p"),qs=s("This model inherits from "),Kt=i("a"),Os=s("DiffusionPipeline"),zs=s(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Ns=l(),B=i("div"),h(Pt.$$.fragment),Ms=l(),Jn=i("p"),Vs=s("Function invoked when calling the pipeline for generation."),Fs=l(),h(ke.$$.fragment),Gs=l(),H=i("div"),h(It.$$.fragment),Ws=l(),Qn=i("p"),Ks=s("Enable sliced attention computation."),Bs=l(),Xn=i("p"),Hs=s(`When this option is enabled, the attention module will split the input tensor in slices, to compute attention
in several steps. This is useful to save some memory in exchange for a small speed decrease.`),Rs=l(),Se=i("div"),h(yt.$$.fragment),Js=l(),$t=i("p"),Qs=s("Disable sliced attention computation. If "),Yn=i("code"),Xs=s("enable_attention_slicing"),Ys=s(` was previously invoked, this method will go
back to computing attention in one step.`),Zs=l(),R=i("div"),h(wt.$$.fragment),er=l(),Zn=i("p"),tr=s("Enable sliced VAE decoding."),nr=l(),ei=i("p"),ir=s(`When this option is enabled, the VAE will split the input tensor in slices to compute decoding in several
steps. This is useful to save some memory and allow larger batch sizes.`),or=l(),Ue=i("div"),h(Ct.$$.fragment),ar=l(),xt=i("p"),sr=s("Disable sliced VAE decoding. If "),ti=i("code"),rr=s("enable_vae_slicing"),lr=s(` was previously invoked, this method will go back to
computing decoding in one step.`),pr=l(),A=i("div"),h(Lt.$$.fragment),dr=l(),ni=i("p"),cr=s("Enable memory efficient attention as implemented in xformers."),mr=l(),ii=i("p"),fr=s(`When this option is enabled, you should observe lower GPU memory usage and a potential speed up at inference
time. Speed up at training time is not guaranteed.`),gr=l(),oi=i("p"),ur=s(`Warning: When Memory Efficient Attention and Sliced attention are both enabled, the Memory Efficient Attention
is used.`),hr=l(),h(Te.$$.fragment),_r=l(),je=i("div"),h(Et.$$.fragment),br=l(),ai=i("p"),vr=s("Disable memory efficient attention as implemented in xformers."),Pr=l(),De=i("div"),h(kt.$$.fragment),Ir=l(),z=i("p"),yr=s(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),si=i("code"),$r=s("enable_sequential_cpu_offload"),wr=s(", this method moves one whole model at a time to the GPU when its "),ri=i("code"),Cr=s("forward"),xr=s(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),li=i("code"),Lr=s("enable_sequential_cpu_offload"),Er=s(", but performance is much better due to the iterative execution of the "),pi=i("code"),kr=s("unet"),Sr=s("."),Ur=l(),Ae=i("div"),h(St.$$.fragment),Tr=l(),Ut=i("p"),jr=s(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),di=i("code"),Dr=s("torch.device('meta') and loaded to GPU only when their specific submodule has its "),Ar=s("forward` method called."),qr=l(),T=i("div"),h(Tt.$$.fragment),Or=l(),de=i("p"),zr=s("Add noise to the image embeddings. The amount of noise is controlled by a "),ci=i("code"),Nr=s("noise_level"),Mr=s(` input. A higher
`),mi=i("code"),Vr=s("noise_level"),Fr=s(" increases the variance in the final un-noised images."),Gr=l(),fi=i("p"),Wr=s("The noise is applied in two ways"),Kr=l(),jt=i("ol"),gi=i("li"),Br=s("A noise schedule is applied directly to the embeddings"),Hr=l(),ui=i("li"),Rr=s("A vector of sinusoidal time embeddings are appended to the output."),Jr=l(),Dt=i("p"),Qr=s("In both cases, the amount of noise is controlled by the same "),hi=i("code"),Xr=s("noise_level"),Yr=s("."),Zr=l(),_i=i("p"),el=s("The embeddings are normalized before the noise is applied and un-normalized after the noise is applied."),this.h()},l(t){const m=Vp('[data-svelte="svelte-1phssyn"]',document.head);g=o(m,"META",{name:!0,content:!0}),m.forEach(n),k=p(t),y=o(t,"H1",{class:!0});var At=a(y);u=o(At,"A",{id:!0,class:!0,href:!0});var bi=a(u);x=o(bi,"SPAN",{});var vi=a(x);_(d.$$.fragment,vi),vi.forEach(n),bi.forEach(n),$=p(At),ee=o(At,"SPAN",{});var Pi=a(ee);te=r(Pi,"Stable unCLIP"),Pi.forEach(n),At.forEach(n),q=p(t),F=o(t,"P",{});var qt=a(F);Ot=r(qt,"Stable unCLIP checkpoints are finetuned from "),zt=o(qt,"A",{href:!0});var ol=a(zt);Co=r(ol,"stable diffusion 2.1"),ol.forEach(n),xo=r(qt,` checkpoints to condition on CLIP image embeddings.
Stable unCLIP also still conditions on text embeddings. Given the two separate conditionings, stable unCLIP can be used
for text guided image variation. When combined with an unCLIP prior, it can also be used for full text to image generation.`),qt.forEach(n),Ii=p(t),Nt=o(t,"P",{});var al=a(Nt);Lo=r(al,"To know more about the unCLIP process, check out the following paper:"),al.forEach(n),yi=p(t),Oe=o(t,"P",{});var tl=a(Oe);ze=o(tl,"A",{href:!0,rel:!0});var sl=a(ze);Eo=r(sl,"Hierarchical Text-Conditional Image Generation with CLIP Latents"),sl.forEach(n),ko=r(tl," by Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, Mark Chen."),tl.forEach(n),$i=p(t),ne=o(t,"H2",{class:!0});var Wi=a(ne);me=o(Wi,"A",{id:!0,class:!0,href:!0});var rl=a(me);en=o(rl,"SPAN",{});var ll=a(en);_(Ne.$$.fragment,ll),ll.forEach(n),rl.forEach(n),So=p(Wi),tn=o(Wi,"SPAN",{});var pl=a(tn);Uo=r(pl,"Tips"),pl.forEach(n),Wi.forEach(n),wi=p(t),j=o(t,"P",{});var J=a(j);To=r(J,"Stable unCLIP takes a "),nn=o(J,"CODE",{});var dl=a(nn);jo=r(dl,"noise_level"),dl.forEach(n),Do=r(J," as input during inference. "),on=o(J,"CODE",{});var cl=a(on);Ao=r(cl,"noise_level"),cl.forEach(n),qo=r(J,` determines how much noise is added
to the image embeddings. A higher `),an=o(J,"CODE",{});var ml=a(an);Oo=r(ml,"noise_level"),ml.forEach(n),zo=r(J,` increases variation in the final un-noised images. By default,
we do not add any additional noise to the image embeddings i.e. `),sn=o(J,"CODE",{});var fl=a(sn);No=r(fl,"noise_level = 0"),fl.forEach(n),Mo=r(J,"."),J.forEach(n),Ci=p(t),ie=o(t,"H3",{class:!0});var Ki=a(ie);fe=o(Ki,"A",{id:!0,class:!0,href:!0});var gl=a(fe);rn=o(gl,"SPAN",{});var ul=a(rn);_(Me.$$.fragment,ul),ul.forEach(n),gl.forEach(n),Vo=p(Ki),ln=o(Ki,"SPAN",{});var hl=a(ln);Fo=r(hl,"Available checkpoints:"),hl.forEach(n),Ki.forEach(n),xi=p(t),ge=o(t,"UL",{});var Bi=a(ge);Mt=o(Bi,"LI",{});var nl=a(Mt);Go=r(nl,"Image variation"),Ve=o(nl,"UL",{});var Hi=a(Ve);pn=o(Hi,"LI",{});var _l=a(pn);Fe=o(_l,"A",{href:!0,rel:!0});var bl=a(Fe);Wo=r(bl,"stabilityai/stable-diffusion-2-1-unclip"),bl.forEach(n),_l.forEach(n),Ko=p(Hi),dn=o(Hi,"LI",{});var vl=a(dn);Ge=o(vl,"A",{href:!0,rel:!0});var Pl=a(Ge);Bo=r(Pl,"stabilityai/stable-diffusion-2-1-unclip-small"),Pl.forEach(n),vl.forEach(n),Hi.forEach(n),nl.forEach(n),Ho=p(Bi),Vt=o(Bi,"LI",{});var il=a(Vt);Ro=r(il,"Text-to-image "),cn=o(il,"UL",{});var Il=a(cn);mn=o(Il,"LI",{});var yl=a(mn);We=o(yl,"A",{href:!0,rel:!0});var $l=a(We);Jo=r($l,"stabilityai/stable-diffusion-2-1-unclip-small"),$l.forEach(n),yl.forEach(n),Il.forEach(n),il.forEach(n),Bi.forEach(n),Li=p(t),oe=o(t,"H3",{class:!0});var Ri=a(oe);ue=o(Ri,"A",{id:!0,class:!0,href:!0});var wl=a(ue);fn=o(wl,"SPAN",{});var Cl=a(fn);_(Ke.$$.fragment,Cl),Cl.forEach(n),wl.forEach(n),Qo=p(Ri),gn=o(Ri,"SPAN",{});var xl=a(gn);Xo=r(xl,"Text-to-Image Generation"),xl.forEach(n),Ri.forEach(n),Ei=r(t,`

Stable unCLIP can be leveraged for text-to-image generation by pipelining it with the prior model of KakaoBrain's open source DALL-E 2 replication [Karlo](https://huggingface.co/kakaobrain/karlo-v1-alpha)

	`),_(Be.$$.fragment,t),ki=p(t),_(he.$$.fragment,t),Si=p(t),ae=o(t,"H3",{class:!0});var Ji=a(ae);_e=o(Ji,"A",{id:!0,class:!0,href:!0});var Ll=a(_e);un=o(Ll,"SPAN",{});var El=a(un);_(He.$$.fragment,El),El.forEach(n),Ll.forEach(n),Yo=p(Ji),hn=o(Ji,"SPAN",{});var kl=a(hn);Zo=r(kl,"Text guided Image-to-Image Variation"),kl.forEach(n),Ji.forEach(n),Ui=p(t),_(Re.$$.fragment,t),Ti=p(t),be=o(t,"P",{});var Qi=a(be);ea=r(Qi,"Optionally, you can also pass a prompt to "),_n=o(Qi,"CODE",{});var Sl=a(_n);ta=r(Sl,"pipe"),Sl.forEach(n),na=r(Qi," such as:"),Qi.forEach(n),ji=p(t),_(Je.$$.fragment,t),Di=p(t),se=o(t,"H3",{class:!0});var Xi=a(se);ve=o(Xi,"A",{id:!0,class:!0,href:!0});var Ul=a(ve);bn=o(Ul,"SPAN",{});var Tl=a(bn);_(Qe.$$.fragment,Tl),Tl.forEach(n),Ul.forEach(n),ia=p(Xi),vn=o(Xi,"SPAN",{});var jl=a(vn);oa=r(jl,"Memory optimization"),jl.forEach(n),Xi.forEach(n),Ai=p(t),Ft=o(t,"P",{});var Dl=a(Ft);aa=r(Dl,`If you are short on GPU memory, you can enable smart CPU offloading so that models that are not needed
immediately for a computation can be offloaded to CPU:`),Dl.forEach(n),qi=p(t),_(Xe.$$.fragment,t),Oi=p(t),Gt=o(t,"P",{});var Al=a(Gt);sa=r(Al,"Further memory optimizations are possible by enabling VAE slicing on the pipeline:"),Al.forEach(n),zi=p(t),_(Ye.$$.fragment,t),Ni=p(t),re=o(t,"H3",{class:!0});var Yi=a(re);Pe=o(Yi,"A",{id:!0,class:!0,href:!0});var ql=a(Pe);Pn=o(ql,"SPAN",{});var Ol=a(Pn);_(Ze.$$.fragment,Ol),Ol.forEach(n),ql.forEach(n),ra=p(Yi),In=o(Yi,"SPAN",{});var zl=a(In);la=r(zl,"StableUnCLIPPipeline"),zl.forEach(n),Yi.forEach(n),Mi=p(t),w=o(t,"DIV",{class:!0});var L=a(w);_(et.$$.fragment,L),pa=p(L),yn=o(L,"P",{});var Nl=a(yn);da=r(Nl,"Pipeline for text-to-image generation using stable unCLIP."),Nl.forEach(n),ca=p(L),tt=o(L,"P",{});var Zi=a(tt);ma=r(Zi,"This model inherits from "),Wt=o(Zi,"A",{href:!0});var Ml=a(Wt);fa=r(Ml,"DiffusionPipeline"),Ml.forEach(n),ga=r(Zi,`. 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.)`),Zi.forEach(n),ua=p(L),G=o(L,"DIV",{class:!0});var Bt=a(G);_(nt.$$.fragment,Bt),ha=p(Bt),$n=o(Bt,"P",{});var Vl=a($n);_a=r(Vl,"Function invoked when calling the pipeline for generation."),Vl.forEach(n),ba=p(Bt),_(Ie.$$.fragment,Bt),Bt.forEach(n),va=p(L),W=o(L,"DIV",{class:!0});var Ht=a(W);_(it.$$.fragment,Ht),Pa=p(Ht),wn=o(Ht,"P",{});var Fl=a(wn);Ia=r(Fl,"Enable sliced attention computation."),Fl.forEach(n),ya=p(Ht),Cn=o(Ht,"P",{});var Gl=a(Cn);$a=r(Gl,`When this option is enabled, the attention module will split the input tensor in slices, to compute attention
in several steps. This is useful to save some memory in exchange for a small speed decrease.`),Gl.forEach(n),Ht.forEach(n),wa=p(L),ye=o(L,"DIV",{class:!0});var eo=a(ye);_(ot.$$.fragment,eo),Ca=p(eo),at=o(eo,"P",{});var to=a(at);xa=r(to,"Disable sliced attention computation. If "),xn=o(to,"CODE",{});var Wl=a(xn);La=r(Wl,"enable_attention_slicing"),Wl.forEach(n),Ea=r(to,` was previously invoked, this method will go
back to computing attention in one step.`),to.forEach(n),eo.forEach(n),ka=p(L),K=o(L,"DIV",{class:!0});var Rt=a(K);_(st.$$.fragment,Rt),Sa=p(Rt),Ln=o(Rt,"P",{});var Kl=a(Ln);Ua=r(Kl,"Enable sliced VAE decoding."),Kl.forEach(n),Ta=p(Rt),En=o(Rt,"P",{});var Bl=a(En);ja=r(Bl,`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.`),Bl.forEach(n),Rt.forEach(n),Da=p(L),$e=o(L,"DIV",{class:!0});var no=a($e);_(rt.$$.fragment,no),Aa=p(no),lt=o(no,"P",{});var io=a(lt);qa=r(io,"Disable sliced VAE decoding. If "),kn=o(io,"CODE",{});var Hl=a(kn);Oa=r(Hl,"enable_vae_slicing"),Hl.forEach(n),za=r(io,` was previously invoked, this method will go back to
computing decoding in one step.`),io.forEach(n),no.forEach(n),Na=p(L),D=o(L,"DIV",{class:!0});var Q=a(D);_(pt.$$.fragment,Q),Ma=p(Q),Sn=o(Q,"P",{});var Rl=a(Sn);Va=r(Rl,"Enable memory efficient attention as implemented in xformers."),Rl.forEach(n),Fa=p(Q),Un=o(Q,"P",{});var Jl=a(Un);Ga=r(Jl,`When this option is enabled, you should observe lower GPU memory usage and a potential speed up at inference
time. Speed up at training time is not guaranteed.`),Jl.forEach(n),Wa=p(Q),Tn=o(Q,"P",{});var Ql=a(Tn);Ka=r(Ql,`Warning: When Memory Efficient Attention and Sliced attention are both enabled, the Memory Efficient Attention
is used.`),Ql.forEach(n),Ba=p(Q),_(we.$$.fragment,Q),Q.forEach(n),Ha=p(L),Ce=o(L,"DIV",{class:!0});var oo=a(Ce);_(dt.$$.fragment,oo),Ra=p(oo),jn=o(oo,"P",{});var Xl=a(jn);Ja=r(Xl,"Disable memory efficient attention as implemented in xformers."),Xl.forEach(n),oo.forEach(n),Qa=p(L),xe=o(L,"DIV",{class:!0});var ao=a(xe);_(ct.$$.fragment,ao),Xa=p(ao),O=o(ao,"P",{});var X=a(O);Ya=r(X,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Dn=o(X,"CODE",{});var Yl=a(Dn);Za=r(Yl,"enable_sequential_cpu_offload"),Yl.forEach(n),es=r(X,", this method moves one whole model at a time to the GPU when its "),An=o(X,"CODE",{});var Zl=a(An);ts=r(Zl,"forward"),Zl.forEach(n),ns=r(X,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),qn=o(X,"CODE",{});var ep=a(qn);is=r(ep,"enable_sequential_cpu_offload"),ep.forEach(n),os=r(X,", but performance is much better due to the iterative execution of the "),On=o(X,"CODE",{});var tp=a(On);as=r(tp,"unet"),tp.forEach(n),ss=r(X,"."),X.forEach(n),ao.forEach(n),rs=p(L),Le=o(L,"DIV",{class:!0});var so=a(Le);_(mt.$$.fragment,so),ls=p(so),ft=o(so,"P",{});var ro=a(ft);ps=r(ro,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),zn=o(ro,"CODE",{});var np=a(zn);ds=r(np,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),np.forEach(n),cs=r(ro,"forward` method called."),ro.forEach(n),so.forEach(n),ms=p(L),U=o(L,"DIV",{class:!0});var M=a(U);_(gt.$$.fragment,M),fs=p(M),le=o(M,"P",{});var Jt=a(le);gs=r(Jt,"Add noise to the image embeddings. The amount of noise is controlled by a "),Nn=o(Jt,"CODE",{});var ip=a(Nn);us=r(ip,"noise_level"),ip.forEach(n),hs=r(Jt,` input. A higher
`),Mn=o(Jt,"CODE",{});var op=a(Mn);_s=r(op,"noise_level"),op.forEach(n),bs=r(Jt," increases the variance in the final un-noised images."),Jt.forEach(n),vs=p(M),Vn=o(M,"P",{});var ap=a(Vn);Ps=r(ap,"The noise is applied in two ways"),ap.forEach(n),Is=p(M),ut=o(M,"OL",{});var lo=a(ut);Fn=o(lo,"LI",{});var sp=a(Fn);ys=r(sp,"A noise schedule is applied directly to the embeddings"),sp.forEach(n),$s=p(lo),Gn=o(lo,"LI",{});var rp=a(Gn);ws=r(rp,"A vector of sinusoidal time embeddings are appended to the output."),rp.forEach(n),lo.forEach(n),Cs=p(M),ht=o(M,"P",{});var po=a(ht);xs=r(po,"In both cases, the amount of noise is controlled by the same "),Wn=o(po,"CODE",{});var lp=a(Wn);Ls=r(lp,"noise_level"),lp.forEach(n),Es=r(po,"."),po.forEach(n),ks=p(M),Kn=o(M,"P",{});var pp=a(Kn);Ss=r(pp,"The embeddings are normalized before the noise is applied and un-normalized after the noise is applied."),pp.forEach(n),M.forEach(n),L.forEach(n),Vi=p(t),pe=o(t,"H3",{class:!0});var co=a(pe);Ee=o(co,"A",{id:!0,class:!0,href:!0});var dp=a(Ee);Bn=o(dp,"SPAN",{});var cp=a(Bn);_(_t.$$.fragment,cp),cp.forEach(n),dp.forEach(n),Us=p(co),Hn=o(co,"SPAN",{});var mp=a(Hn);Ts=r(mp,"StableUnCLIPImg2ImgPipeline"),mp.forEach(n),co.forEach(n),Fi=p(t),C=o(t,"DIV",{class:!0});var E=a(C);_(bt.$$.fragment,E),js=p(E),Rn=o(E,"P",{});var fp=a(Rn);Ds=r(fp,"Pipeline for text-guided image to image generation using stable unCLIP."),fp.forEach(n),As=p(E),vt=o(E,"P",{});var mo=a(vt);qs=r(mo,"This model inherits from "),Kt=o(mo,"A",{href:!0});var gp=a(Kt);Os=r(gp,"DiffusionPipeline"),gp.forEach(n),zs=r(mo,`. 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.)`),mo.forEach(n),Ns=p(E),B=o(E,"DIV",{class:!0});var Qt=a(B);_(Pt.$$.fragment,Qt),Ms=p(Qt),Jn=o(Qt,"P",{});var up=a(Jn);Vs=r(up,"Function invoked when calling the pipeline for generation."),up.forEach(n),Fs=p(Qt),_(ke.$$.fragment,Qt),Qt.forEach(n),Gs=p(E),H=o(E,"DIV",{class:!0});var Xt=a(H);_(It.$$.fragment,Xt),Ws=p(Xt),Qn=o(Xt,"P",{});var hp=a(Qn);Ks=r(hp,"Enable sliced attention computation."),hp.forEach(n),Bs=p(Xt),Xn=o(Xt,"P",{});var _p=a(Xn);Hs=r(_p,`When this option is enabled, the attention module will split the input tensor in slices, to compute attention
in several steps. This is useful to save some memory in exchange for a small speed decrease.`),_p.forEach(n),Xt.forEach(n),Rs=p(E),Se=o(E,"DIV",{class:!0});var fo=a(Se);_(yt.$$.fragment,fo),Js=p(fo),$t=o(fo,"P",{});var go=a($t);Qs=r(go,"Disable sliced attention computation. If "),Yn=o(go,"CODE",{});var bp=a(Yn);Xs=r(bp,"enable_attention_slicing"),bp.forEach(n),Ys=r(go,` was previously invoked, this method will go
back to computing attention in one step.`),go.forEach(n),fo.forEach(n),Zs=p(E),R=o(E,"DIV",{class:!0});var Yt=a(R);_(wt.$$.fragment,Yt),er=p(Yt),Zn=o(Yt,"P",{});var vp=a(Zn);tr=r(vp,"Enable sliced VAE decoding."),vp.forEach(n),nr=p(Yt),ei=o(Yt,"P",{});var Pp=a(ei);ir=r(Pp,`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.`),Pp.forEach(n),Yt.forEach(n),or=p(E),Ue=o(E,"DIV",{class:!0});var uo=a(Ue);_(Ct.$$.fragment,uo),ar=p(uo),xt=o(uo,"P",{});var ho=a(xt);sr=r(ho,"Disable sliced VAE decoding. If "),ti=o(ho,"CODE",{});var Ip=a(ti);rr=r(Ip,"enable_vae_slicing"),Ip.forEach(n),lr=r(ho,` was previously invoked, this method will go back to
computing decoding in one step.`),ho.forEach(n),uo.forEach(n),pr=p(E),A=o(E,"DIV",{class:!0});var Y=a(A);_(Lt.$$.fragment,Y),dr=p(Y),ni=o(Y,"P",{});var yp=a(ni);cr=r(yp,"Enable memory efficient attention as implemented in xformers."),yp.forEach(n),mr=p(Y),ii=o(Y,"P",{});var $p=a(ii);fr=r($p,`When this option is enabled, you should observe lower GPU memory usage and a potential speed up at inference
time. Speed up at training time is not guaranteed.`),$p.forEach(n),gr=p(Y),oi=o(Y,"P",{});var wp=a(oi);ur=r(wp,`Warning: When Memory Efficient Attention and Sliced attention are both enabled, the Memory Efficient Attention
is used.`),wp.forEach(n),hr=p(Y),_(Te.$$.fragment,Y),Y.forEach(n),_r=p(E),je=o(E,"DIV",{class:!0});var _o=a(je);_(Et.$$.fragment,_o),br=p(_o),ai=o(_o,"P",{});var Cp=a(ai);vr=r(Cp,"Disable memory efficient attention as implemented in xformers."),Cp.forEach(n),_o.forEach(n),Pr=p(E),De=o(E,"DIV",{class:!0});var bo=a(De);_(kt.$$.fragment,bo),Ir=p(bo),z=o(bo,"P",{});var Z=a(z);yr=r(Z,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),si=o(Z,"CODE",{});var xp=a(si);$r=r(xp,"enable_sequential_cpu_offload"),xp.forEach(n),wr=r(Z,", this method moves one whole model at a time to the GPU when its "),ri=o(Z,"CODE",{});var Lp=a(ri);Cr=r(Lp,"forward"),Lp.forEach(n),xr=r(Z,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),li=o(Z,"CODE",{});var Ep=a(li);Lr=r(Ep,"enable_sequential_cpu_offload"),Ep.forEach(n),Er=r(Z,", but performance is much better due to the iterative execution of the "),pi=o(Z,"CODE",{});var kp=a(pi);kr=r(kp,"unet"),kp.forEach(n),Sr=r(Z,"."),Z.forEach(n),bo.forEach(n),Ur=p(E),Ae=o(E,"DIV",{class:!0});var vo=a(Ae);_(St.$$.fragment,vo),Tr=p(vo),Ut=o(vo,"P",{});var Po=a(Ut);jr=r(Po,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, the pipeline\u2019s
models have their state dicts saved to CPU and then are moved to a `),di=o(Po,"CODE",{});var Sp=a(di);Dr=r(Sp,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),Sp.forEach(n),Ar=r(Po,"forward` method called."),Po.forEach(n),vo.forEach(n),qr=p(E),T=o(E,"DIV",{class:!0});var V=a(T);_(Tt.$$.fragment,V),Or=p(V),de=o(V,"P",{});var Zt=a(de);zr=r(Zt,"Add noise to the image embeddings. The amount of noise is controlled by a "),ci=o(Zt,"CODE",{});var Up=a(ci);Nr=r(Up,"noise_level"),Up.forEach(n),Mr=r(Zt,` input. A higher
`),mi=o(Zt,"CODE",{});var Tp=a(mi);Vr=r(Tp,"noise_level"),Tp.forEach(n),Fr=r(Zt," increases the variance in the final un-noised images."),Zt.forEach(n),Gr=p(V),fi=o(V,"P",{});var jp=a(fi);Wr=r(jp,"The noise is applied in two ways"),jp.forEach(n),Kr=p(V),jt=o(V,"OL",{});var Io=a(jt);gi=o(Io,"LI",{});var Dp=a(gi);Br=r(Dp,"A noise schedule is applied directly to the embeddings"),Dp.forEach(n),Hr=p(Io),ui=o(Io,"LI",{});var Ap=a(ui);Rr=r(Ap,"A vector of sinusoidal time embeddings are appended to the output."),Ap.forEach(n),Io.forEach(n),Jr=p(V),Dt=o(V,"P",{});var yo=a(Dt);Qr=r(yo,"In both cases, the amount of noise is controlled by the same "),hi=o(yo,"CODE",{});var qp=a(hi);Xr=r(qp,"noise_level"),qp.forEach(n),Yr=r(yo,"."),yo.forEach(n),Zr=p(V),_i=o(V,"P",{});var Op=a(_i);el=r(Op,"The embeddings are normalized before the noise is applied and un-normalized after the noise is applied."),Op.forEach(n),V.forEach(n),E.forEach(n),this.h()},h(){c(g,"name","hf:doc:metadata"),c(g,"content",JSON.stringify(Qp)),c(u,"id","stable-unclip"),c(u,"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"),c(u,"href","#stable-unclip"),c(y,"class","relative group"),c(zt,"href","./stable_diffusion_2"),c(ze,"href","https://arxiv.org/abs/2204.06125"),c(ze,"rel","nofollow"),c(me,"id","tips"),c(me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(me,"href","#tips"),c(ne,"class","relative group"),c(fe,"id","available-checkpoints"),c(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"),c(fe,"href","#available-checkpoints"),c(ie,"class","relative group"),c(Fe,"href","https://hf.co/stabilityai/stable-diffusion-2-1-unclip"),c(Fe,"rel","nofollow"),c(Ge,"href","https://hf.co/stabilityai/stable-diffusion-2-1-unclip-small"),c(Ge,"rel","nofollow"),c(We,"href","https://hf.co/stabilityai/stable-diffusion-2-1-unclip-small"),c(We,"rel","nofollow"),c(ue,"id","texttoimage-generation"),c(ue,"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"),c(ue,"href","#texttoimage-generation"),c(oe,"class","relative group"),c(_e,"id","text-guided-imagetoimage-variation"),c(_e,"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"),c(_e,"href","#text-guided-imagetoimage-variation"),c(ae,"class","relative group"),c(ve,"id","memory-optimization"),c(ve,"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"),c(ve,"href","#memory-optimization"),c(se,"class","relative group"),c(Pe,"id","diffusers.StableUnCLIPPipeline"),c(Pe,"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"),c(Pe,"href","#diffusers.StableUnCLIPPipeline"),c(re,"class","relative group"),c(Wt,"href","/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),c(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ee,"id","diffusers.StableUnCLIPImg2ImgPipeline"),c(Ee,"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"),c(Ee,"href","#diffusers.StableUnCLIPImg2ImgPipeline"),c(pe,"class","relative group"),c(Kt,"href","/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),c(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(C,"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,m){e(document.head,g),f(t,k,m),f(t,y,m),e(y,u),e(u,x),b(d,x,null),e(y,$),e(y,ee),e(ee,te),f(t,q,m),f(t,F,m),e(F,Ot),e(F,zt),e(zt,Co),e(F,xo),f(t,Ii,m),f(t,Nt,m),e(Nt,Lo),f(t,yi,m),f(t,Oe,m),e(Oe,ze),e(ze,Eo),e(Oe,ko),f(t,$i,m),f(t,ne,m),e(ne,me),e(me,en),b(Ne,en,null),e(ne,So),e(ne,tn),e(tn,Uo),f(t,wi,m),f(t,j,m),e(j,To),e(j,nn),e(nn,jo),e(j,Do),e(j,on),e(on,Ao),e(j,qo),e(j,an),e(an,Oo),e(j,zo),e(j,sn),e(sn,No),e(j,Mo),f(t,Ci,m),f(t,ie,m),e(ie,fe),e(fe,rn),b(Me,rn,null),e(ie,Vo),e(ie,ln),e(ln,Fo),f(t,xi,m),f(t,ge,m),e(ge,Mt),e(Mt,Go),e(Mt,Ve),e(Ve,pn),e(pn,Fe),e(Fe,Wo),e(Ve,Ko),e(Ve,dn),e(dn,Ge),e(Ge,Bo),e(ge,Ho),e(ge,Vt),e(Vt,Ro),e(Vt,cn),e(cn,mn),e(mn,We),e(We,Jo),f(t,Li,m),f(t,oe,m),e(oe,ue),e(ue,fn),b(Ke,fn,null),e(oe,Qo),e(oe,gn),e(gn,Xo),f(t,Ei,m),b(Be,t,m),f(t,ki,m),b(he,t,m),f(t,Si,m),f(t,ae,m),e(ae,_e),e(_e,un),b(He,un,null),e(ae,Yo),e(ae,hn),e(hn,Zo),f(t,Ui,m),b(Re,t,m),f(t,Ti,m),f(t,be,m),e(be,ea),e(be,_n),e(_n,ta),e(be,na),f(t,ji,m),b(Je,t,m),f(t,Di,m),f(t,se,m),e(se,ve),e(ve,bn),b(Qe,bn,null),e(se,ia),e(se,vn),e(vn,oa),f(t,Ai,m),f(t,Ft,m),e(Ft,aa),f(t,qi,m),b(Xe,t,m),f(t,Oi,m),f(t,Gt,m),e(Gt,sa),f(t,zi,m),b(Ye,t,m),f(t,Ni,m),f(t,re,m),e(re,Pe),e(Pe,Pn),b(Ze,Pn,null),e(re,ra),e(re,In),e(In,la),f(t,Mi,m),f(t,w,m),b(et,w,null),e(w,pa),e(w,yn),e(yn,da),e(w,ca),e(w,tt),e(tt,ma),e(tt,Wt),e(Wt,fa),e(tt,ga),e(w,ua),e(w,G),b(nt,G,null),e(G,ha),e(G,$n),e($n,_a),e(G,ba),b(Ie,G,null),e(w,va),e(w,W),b(it,W,null),e(W,Pa),e(W,wn),e(wn,Ia),e(W,ya),e(W,Cn),e(Cn,$a),e(w,wa),e(w,ye),b(ot,ye,null),e(ye,Ca),e(ye,at),e(at,xa),e(at,xn),e(xn,La),e(at,Ea),e(w,ka),e(w,K),b(st,K,null),e(K,Sa),e(K,Ln),e(Ln,Ua),e(K,Ta),e(K,En),e(En,ja),e(w,Da),e(w,$e),b(rt,$e,null),e($e,Aa),e($e,lt),e(lt,qa),e(lt,kn),e(kn,Oa),e(lt,za),e(w,Na),e(w,D),b(pt,D,null),e(D,Ma),e(D,Sn),e(Sn,Va),e(D,Fa),e(D,Un),e(Un,Ga),e(D,Wa),e(D,Tn),e(Tn,Ka),e(D,Ba),b(we,D,null),e(w,Ha),e(w,Ce),b(dt,Ce,null),e(Ce,Ra),e(Ce,jn),e(jn,Ja),e(w,Qa),e(w,xe),b(ct,xe,null),e(xe,Xa),e(xe,O),e(O,Ya),e(O,Dn),e(Dn,Za),e(O,es),e(O,An),e(An,ts),e(O,ns),e(O,qn),e(qn,is),e(O,os),e(O,On),e(On,as),e(O,ss),e(w,rs),e(w,Le),b(mt,Le,null),e(Le,ls),e(Le,ft),e(ft,ps),e(ft,zn),e(zn,ds),e(ft,cs),e(w,ms),e(w,U),b(gt,U,null),e(U,fs),e(U,le),e(le,gs),e(le,Nn),e(Nn,us),e(le,hs),e(le,Mn),e(Mn,_s),e(le,bs),e(U,vs),e(U,Vn),e(Vn,Ps),e(U,Is),e(U,ut),e(ut,Fn),e(Fn,ys),e(ut,$s),e(ut,Gn),e(Gn,ws),e(U,Cs),e(U,ht),e(ht,xs),e(ht,Wn),e(Wn,Ls),e(ht,Es),e(U,ks),e(U,Kn),e(Kn,Ss),f(t,Vi,m),f(t,pe,m),e(pe,Ee),e(Ee,Bn),b(_t,Bn,null),e(pe,Us),e(pe,Hn),e(Hn,Ts),f(t,Fi,m),f(t,C,m),b(bt,C,null),e(C,js),e(C,Rn),e(Rn,Ds),e(C,As),e(C,vt),e(vt,qs),e(vt,Kt),e(Kt,Os),e(vt,zs),e(C,Ns),e(C,B),b(Pt,B,null),e(B,Ms),e(B,Jn),e(Jn,Vs),e(B,Fs),b(ke,B,null),e(C,Gs),e(C,H),b(It,H,null),e(H,Ws),e(H,Qn),e(Qn,Ks),e(H,Bs),e(H,Xn),e(Xn,Hs),e(C,Rs),e(C,Se),b(yt,Se,null),e(Se,Js),e(Se,$t),e($t,Qs),e($t,Yn),e(Yn,Xs),e($t,Ys),e(C,Zs),e(C,R),b(wt,R,null),e(R,er),e(R,Zn),e(Zn,tr),e(R,nr),e(R,ei),e(ei,ir),e(C,or),e(C,Ue),b(Ct,Ue,null),e(Ue,ar),e(Ue,xt),e(xt,sr),e(xt,ti),e(ti,rr),e(xt,lr),e(C,pr),e(C,A),b(Lt,A,null),e(A,dr),e(A,ni),e(ni,cr),e(A,mr),e(A,ii),e(ii,fr),e(A,gr),e(A,oi),e(oi,ur),e(A,hr),b(Te,A,null),e(C,_r),e(C,je),b(Et,je,null),e(je,br),e(je,ai),e(ai,vr),e(C,Pr),e(C,De),b(kt,De,null),e(De,Ir),e(De,z),e(z,yr),e(z,si),e(si,$r),e(z,wr),e(z,ri),e(ri,Cr),e(z,xr),e(z,li),e(li,Lr),e(z,Er),e(z,pi),e(pi,kr),e(z,Sr),e(C,Ur),e(C,Ae),b(St,Ae,null),e(Ae,Tr),e(Ae,Ut),e(Ut,jr),e(Ut,di),e(di,Dr),e(Ut,Ar),e(C,qr),e(C,T),b(Tt,T,null),e(T,Or),e(T,de),e(de,zr),e(de,ci),e(ci,Nr),e(de,Mr),e(de,mi),e(mi,Vr),e(de,Fr),e(T,Gr),e(T,fi),e(fi,Wr),e(T,Kr),e(T,jt),e(jt,gi),e(gi,Br),e(jt,Hr),e(jt,ui),e(ui,Rr),e(T,Jr),e(T,Dt),e(Dt,Qr),e(Dt,hi),e(hi,Xr),e(Dt,Yr),e(T,Zr),e(T,_i),e(_i,el),Gi=!0},p(t,[m]){const At={};m&2&&(At.$$scope={dirty:m,ctx:t}),he.$set(At);const bi={};m&2&&(bi.$$scope={dirty:m,ctx:t}),Ie.$set(bi);const vi={};m&2&&(vi.$$scope={dirty:m,ctx:t}),we.$set(vi);const Pi={};m&2&&(Pi.$$scope={dirty:m,ctx:t}),ke.$set(Pi);const qt={};m&2&&(qt.$$scope={dirty:m,ctx:t}),Te.$set(qt)},i(t){Gi||(v(d.$$.fragment,t),v(Ne.$$.fragment,t),v(Me.$$.fragment,t),v(Ke.$$.fragment,t),v(Be.$$.fragment,t),v(he.$$.fragment,t),v(He.$$.fragment,t),v(Re.$$.fragment,t),v(Je.$$.fragment,t),v(Qe.$$.fragment,t),v(Xe.$$.fragment,t),v(Ye.$$.fragment,t),v(Ze.$$.fragment,t),v(et.$$.fragment,t),v(nt.$$.fragment,t),v(Ie.$$.fragment,t),v(it.$$.fragment,t),v(ot.$$.fragment,t),v(st.$$.fragment,t),v(rt.$$.fragment,t),v(pt.$$.fragment,t),v(we.$$.fragment,t),v(dt.$$.fragment,t),v(ct.$$.fragment,t),v(mt.$$.fragment,t),v(gt.$$.fragment,t),v(_t.$$.fragment,t),v(bt.$$.fragment,t),v(Pt.$$.fragment,t),v(ke.$$.fragment,t),v(It.$$.fragment,t),v(yt.$$.fragment,t),v(wt.$$.fragment,t),v(Ct.$$.fragment,t),v(Lt.$$.fragment,t),v(Te.$$.fragment,t),v(Et.$$.fragment,t),v(kt.$$.fragment,t),v(St.$$.fragment,t),v(Tt.$$.fragment,t),Gi=!0)},o(t){P(d.$$.fragment,t),P(Ne.$$.fragment,t),P(Me.$$.fragment,t),P(Ke.$$.fragment,t),P(Be.$$.fragment,t),P(he.$$.fragment,t),P(He.$$.fragment,t),P(Re.$$.fragment,t),P(Je.$$.fragment,t),P(Qe.$$.fragment,t),P(Xe.$$.fragment,t),P(Ye.$$.fragment,t),P(Ze.$$.fragment,t),P(et.$$.fragment,t),P(nt.$$.fragment,t),P(Ie.$$.fragment,t),P(it.$$.fragment,t),P(ot.$$.fragment,t),P(st.$$.fragment,t),P(rt.$$.fragment,t),P(pt.$$.fragment,t),P(we.$$.fragment,t),P(dt.$$.fragment,t),P(ct.$$.fragment,t),P(mt.$$.fragment,t),P(gt.$$.fragment,t),P(_t.$$.fragment,t),P(bt.$$.fragment,t),P(Pt.$$.fragment,t),P(ke.$$.fragment,t),P(It.$$.fragment,t),P(yt.$$.fragment,t),P(wt.$$.fragment,t),P(Ct.$$.fragment,t),P(Lt.$$.fragment,t),P(Te.$$.fragment,t),P(Et.$$.fragment,t),P(kt.$$.fragment,t),P(St.$$.fragment,t),P(Tt.$$.fragment,t),Gi=!1},d(t){n(g),t&&n(k),t&&n(y),I(d),t&&n(q),t&&n(F),t&&n(Ii),t&&n(Nt),t&&n(yi),t&&n(Oe),t&&n($i),t&&n(ne),I(Ne),t&&n(wi),t&&n(j),t&&n(Ci),t&&n(ie),I(Me),t&&n(xi),t&&n(ge),t&&n(Li),t&&n(oe),I(Ke),t&&n(Ei),I(Be,t),t&&n(ki),I(he,t),t&&n(Si),t&&n(ae),I(He),t&&n(Ui),I(Re,t),t&&n(Ti),t&&n(be),t&&n(ji),I(Je,t),t&&n(Di),t&&n(se),I(Qe),t&&n(Ai),t&&n(Ft),t&&n(qi),I(Xe,t),t&&n(Oi),t&&n(Gt),t&&n(zi),I(Ye,t),t&&n(Ni),t&&n(re),I(Ze),t&&n(Mi),t&&n(w),I(et),I(nt),I(Ie),I(it),I(ot),I(st),I(rt),I(pt),I(we),I(dt),I(ct),I(mt),I(gt),t&&n(Vi),t&&n(pe),I(_t),t&&n(Fi),t&&n(C),I(bt),I(Pt),I(ke),I(It),I(yt),I(wt),I(Ct),I(Lt),I(Te),I(Et),I(kt),I(St),I(Tt)}}}const Qp={local:"stable-unclip",sections:[{local:"tips",sections:[{local:"available-checkpoints",title:"Available checkpoints:"},{local:"texttoimage-generation",title:"Text-to-Image Generation"},{local:"text-guided-imagetoimage-variation",title:"Text guided Image-to-Image Variation"},{local:"memory-optimization",title:"Memory optimization"},{local:"diffusers.StableUnCLIPPipeline",title:"StableUnCLIPPipeline"},{local:"diffusers.StableUnCLIPImg2ImgPipeline",title:"StableUnCLIPImg2ImgPipeline"}],title:"Tips"}],title:"Stable unCLIP"};function Xp(N){return Fp(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class od extends zp{constructor(g){super();Np(this,g,Xp,Jp,Mp,{})}}export{od as default,Qp as metadata};
