Buckets:
hf-doc-build/doc / diffusers /v0.10.2 /en /_app /pages /api /pipelines /versatile_diffusion.mdx-hf-doc-builder.js
| import{S as Pr,i as $r,s as Vr,e as s,k as p,w as v,t as r,M as Ir,c as n,d as i,m as d,a,x as b,h as l,b as c,G as e,g,y as D,q as w,o as y,B as x,v as kr,L as At}from"../../../chunks/vendor-hf-doc-builder.js";import{D as T}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as lt}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as xe}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as zt}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Tr(S){let m,$,_,u,P;return u=new lt({props:{code:`from diffusers import VersatileDiffusionPipeline | |
| import torch | |
| import requests | |
| from io import BytesIO | |
| from PIL import Image | |
| # let's download an initial image | |
| url = "https://huggingface.co/datasets/diffusers/images/resolve/main/benz.jpg" | |
| response = requests.get(url) | |
| image = Image.open(BytesIO(response.content)).convert("RGB") | |
| text = "a red car in the sun" | |
| pipe = VersatileDiffusionPipeline.from_pretrained( | |
| "shi-labs/versatile-diffusion", torch_dtype=torch.float16 | |
| ) | |
| pipe = pipe.to("cuda") | |
| generator = torch.Generator(device="cuda").manual_seed(0) | |
| text_to_image_strength = 0.75 | |
| image = pipe.dual_guided( | |
| prompt=text, image=image, text_to_image_strength=text_to_image_strength, generator=generator | |
| ).images[0] | |
| image.save("./car_variation.png")`,highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> VersatileDiffusionPipeline | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> requests | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># let's download an initial image</span> | |
| <span class="hljs-meta">>>> </span>url = <span class="hljs-string">"https://huggingface.co/datasets/diffusers/images/resolve/main/benz.jpg"</span> | |
| <span class="hljs-meta">>>> </span>response = requests.get(url) | |
| <span class="hljs-meta">>>> </span>image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">"RGB"</span>) | |
| <span class="hljs-meta">>>> </span>text = <span class="hljs-string">"a red car in the sun"</span> | |
| <span class="hljs-meta">>>> </span>pipe = VersatileDiffusionPipeline.from_pretrained( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"shi-labs/versatile-diffusion"</span>, torch_dtype=torch.float16 | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>pipe = pipe.to(<span class="hljs-string">"cuda"</span>) | |
| <span class="hljs-meta">>>> </span>generator = torch.Generator(device=<span class="hljs-string">"cuda"</span>).manual_seed(<span class="hljs-number">0</span>) | |
| <span class="hljs-meta">>>> </span>text_to_image_strength = <span class="hljs-number">0.75</span> | |
| <span class="hljs-meta">>>> </span>image = pipe.dual_guided( | |
| <span class="hljs-meta">... </span> prompt=text, image=image, text_to_image_strength=text_to_image_strength, generator=generator | |
| <span class="hljs-meta">... </span>).images[<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image.save(<span class="hljs-string">"./car_variation.png"</span>)`}}),{c(){m=s("p"),$=r("Examples:"),_=p(),v(u.$$.fragment)},l(o){m=n(o,"P",{});var h=a(m);$=l(h,"Examples:"),h.forEach(i),_=d(o),b(u.$$.fragment,o)},m(o,h){g(o,m,h),e(m,$),g(o,_,h),D(u,o,h),P=!0},p:At,i(o){P||(w(u.$$.fragment,o),P=!0)},o(o){y(u.$$.fragment,o),P=!1},d(o){o&&i(m),o&&i(_),x(u,o)}}}function jr(S){let m,$,_,u,P;return u=new lt({props:{code:`from diffusers import VersatileDiffusionPipeline | |
| import torch | |
| import requests | |
| from io import BytesIO | |
| from PIL import Image | |
| # let's download an initial image | |
| url = "https://huggingface.co/datasets/diffusers/images/resolve/main/benz.jpg" | |
| response = requests.get(url) | |
| image = Image.open(BytesIO(response.content)).convert("RGB") | |
| pipe = VersatileDiffusionPipeline.from_pretrained( | |
| "shi-labs/versatile-diffusion", torch_dtype=torch.float16 | |
| ) | |
| pipe = pipe.to("cuda") | |
| generator = torch.Generator(device="cuda").manual_seed(0) | |
| image = pipe.image_variation(image, generator=generator).images[0] | |
| image.save("./car_variation.png")`,highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> VersatileDiffusionPipeline | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> requests | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># let's download an initial image</span> | |
| <span class="hljs-meta">>>> </span>url = <span class="hljs-string">"https://huggingface.co/datasets/diffusers/images/resolve/main/benz.jpg"</span> | |
| <span class="hljs-meta">>>> </span>response = requests.get(url) | |
| <span class="hljs-meta">>>> </span>image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">"RGB"</span>) | |
| <span class="hljs-meta">>>> </span>pipe = VersatileDiffusionPipeline.from_pretrained( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"shi-labs/versatile-diffusion"</span>, torch_dtype=torch.float16 | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>pipe = pipe.to(<span class="hljs-string">"cuda"</span>) | |
| <span class="hljs-meta">>>> </span>generator = torch.Generator(device=<span class="hljs-string">"cuda"</span>).manual_seed(<span class="hljs-number">0</span>) | |
| <span class="hljs-meta">>>> </span>image = pipe.image_variation(image, generator=generator).images[<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image.save(<span class="hljs-string">"./car_variation.png"</span>)`}}),{c(){m=s("p"),$=r("Examples:"),_=p(),v(u.$$.fragment)},l(o){m=n(o,"P",{});var h=a(m);$=l(h,"Examples:"),h.forEach(i),_=d(o),b(u.$$.fragment,o)},m(o,h){g(o,m,h),e(m,$),g(o,_,h),D(u,o,h),P=!0},p:At,i(o){P||(w(u.$$.fragment,o),P=!0)},o(o){y(u.$$.fragment,o),P=!1},d(o){o&&i(m),o&&i(_),x(u,o)}}}function Er(S){let m,$,_,u,P;return u=new lt({props:{code:`from diffusers import VersatileDiffusionPipeline | |
| import torch | |
| pipe = VersatileDiffusionPipeline.from_pretrained( | |
| "shi-labs/versatile-diffusion", torch_dtype=torch.float16 | |
| ) | |
| pipe = pipe.to("cuda") | |
| generator = torch.Generator(device="cuda").manual_seed(0) | |
| image = pipe.text_to_image("an astronaut riding on a horse on mars", generator=generator).images[0] | |
| image.save("./astronaut.png")`,highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> VersatileDiffusionPipeline | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span>pipe = VersatileDiffusionPipeline.from_pretrained( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"shi-labs/versatile-diffusion"</span>, torch_dtype=torch.float16 | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>pipe = pipe.to(<span class="hljs-string">"cuda"</span>) | |
| <span class="hljs-meta">>>> </span>generator = torch.Generator(device=<span class="hljs-string">"cuda"</span>).manual_seed(<span class="hljs-number">0</span>) | |
| <span class="hljs-meta">>>> </span>image = pipe.text_to_image(<span class="hljs-string">"an astronaut riding on a horse on mars"</span>, generator=generator).images[<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image.save(<span class="hljs-string">"./astronaut.png"</span>)`}}),{c(){m=s("p"),$=r("Examples:"),_=p(),v(u.$$.fragment)},l(o){m=n(o,"P",{});var h=a(m);$=l(h,"Examples:"),h.forEach(i),_=d(o),b(u.$$.fragment,o)},m(o,h){g(o,m,h),e(m,$),g(o,_,h),D(u,o,h),P=!0},p:At,i(o){P||(w(u.$$.fragment,o),P=!0)},o(o){y(u.$$.fragment,o),P=!1},d(o){o&&i(m),o&&i(_),x(u,o)}}}function qr(S){let m,$,_,u,P;return u=new lt({props:{code:`from diffusers import VersatileDiffusionTextToImagePipeline | |
| import torch | |
| pipe = VersatileDiffusionTextToImagePipeline.from_pretrained( | |
| "shi-labs/versatile-diffusion", torch_dtype=torch.float16 | |
| ) | |
| pipe.remove_unused_weights() | |
| pipe = pipe.to("cuda") | |
| generator = torch.Generator(device="cuda").manual_seed(0) | |
| image = pipe("an astronaut riding on a horse on mars", generator=generator).images[0] | |
| image.save("./astronaut.png")`,highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> VersatileDiffusionTextToImagePipeline | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span>pipe = VersatileDiffusionTextToImagePipeline.from_pretrained( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"shi-labs/versatile-diffusion"</span>, torch_dtype=torch.float16 | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>pipe.remove_unused_weights() | |
| <span class="hljs-meta">>>> </span>pipe = pipe.to(<span class="hljs-string">"cuda"</span>) | |
| <span class="hljs-meta">>>> </span>generator = torch.Generator(device=<span class="hljs-string">"cuda"</span>).manual_seed(<span class="hljs-number">0</span>) | |
| <span class="hljs-meta">>>> </span>image = pipe(<span class="hljs-string">"an astronaut riding on a horse on mars"</span>, generator=generator).images[<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image.save(<span class="hljs-string">"./astronaut.png"</span>)`}}),{c(){m=s("p"),$=r("Examples:"),_=p(),v(u.$$.fragment)},l(o){m=n(o,"P",{});var h=a(m);$=l(h,"Examples:"),h.forEach(i),_=d(o),b(u.$$.fragment,o)},m(o,h){g(o,m,h),e(m,$),g(o,_,h),D(u,o,h),P=!0},p:At,i(o){P||(w(u.$$.fragment,o),P=!0)},o(o){y(u.$$.fragment,o),P=!1},d(o){o&&i(m),o&&i(_),x(u,o)}}}function Sr(S){let m,$,_,u,P;return u=new lt({props:{code:`from diffusers import VersatileDiffusionImageVariationPipeline | |
| import torch | |
| import requests | |
| from io import BytesIO | |
| from PIL import Image | |
| # let's download an initial image | |
| url = "https://huggingface.co/datasets/diffusers/images/resolve/main/benz.jpg" | |
| response = requests.get(url) | |
| image = Image.open(BytesIO(response.content)).convert("RGB") | |
| pipe = VersatileDiffusionImageVariationPipeline.from_pretrained( | |
| "shi-labs/versatile-diffusion", torch_dtype=torch.float16 | |
| ) | |
| pipe = pipe.to("cuda") | |
| generator = torch.Generator(device="cuda").manual_seed(0) | |
| image = pipe(image, generator=generator).images[0] | |
| image.save("./car_variation.png")`,highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> VersatileDiffusionImageVariationPipeline | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> requests | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># let's download an initial image</span> | |
| <span class="hljs-meta">>>> </span>url = <span class="hljs-string">"https://huggingface.co/datasets/diffusers/images/resolve/main/benz.jpg"</span> | |
| <span class="hljs-meta">>>> </span>response = requests.get(url) | |
| <span class="hljs-meta">>>> </span>image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">"RGB"</span>) | |
| <span class="hljs-meta">>>> </span>pipe = VersatileDiffusionImageVariationPipeline.from_pretrained( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"shi-labs/versatile-diffusion"</span>, torch_dtype=torch.float16 | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>pipe = pipe.to(<span class="hljs-string">"cuda"</span>) | |
| <span class="hljs-meta">>>> </span>generator = torch.Generator(device=<span class="hljs-string">"cuda"</span>).manual_seed(<span class="hljs-number">0</span>) | |
| <span class="hljs-meta">>>> </span>image = pipe(image, generator=generator).images[<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image.save(<span class="hljs-string">"./car_variation.png"</span>)`}}),{c(){m=s("p"),$=r("Examples:"),_=p(),v(u.$$.fragment)},l(o){m=n(o,"P",{});var h=a(m);$=l(h,"Examples:"),h.forEach(i),_=d(o),b(u.$$.fragment,o)},m(o,h){g(o,m,h),e(m,$),g(o,_,h),D(u,o,h),P=!0},p:At,i(o){P||(w(u.$$.fragment,o),P=!0)},o(o){y(u.$$.fragment,o),P=!1},d(o){o&&i(m),o&&i(_),x(u,o)}}}function Mr(S){let m,$,_,u,P;return u=new lt({props:{code:`from diffusers import VersatileDiffusionDualGuidedPipeline | |
| import torch | |
| import requests | |
| from io import BytesIO | |
| from PIL import Image | |
| # let's download an initial image | |
| url = "https://huggingface.co/datasets/diffusers/images/resolve/main/benz.jpg" | |
| response = requests.get(url) | |
| image = Image.open(BytesIO(response.content)).convert("RGB") | |
| text = "a red car in the sun" | |
| pipe = VersatileDiffusionDualGuidedPipeline.from_pretrained( | |
| "shi-labs/versatile-diffusion", torch_dtype=torch.float16 | |
| ) | |
| pipe.remove_unused_weights() | |
| pipe = pipe.to("cuda") | |
| generator = torch.Generator(device="cuda").manual_seed(0) | |
| text_to_image_strength = 0.75 | |
| image = pipe( | |
| prompt=text, image=image, text_to_image_strength=text_to_image_strength, generator=generator | |
| ).images[0] | |
| image.save("./car_variation.png")`,highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> VersatileDiffusionDualGuidedPipeline | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> requests | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># let's download an initial image</span> | |
| <span class="hljs-meta">>>> </span>url = <span class="hljs-string">"https://huggingface.co/datasets/diffusers/images/resolve/main/benz.jpg"</span> | |
| <span class="hljs-meta">>>> </span>response = requests.get(url) | |
| <span class="hljs-meta">>>> </span>image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">"RGB"</span>) | |
| <span class="hljs-meta">>>> </span>text = <span class="hljs-string">"a red car in the sun"</span> | |
| <span class="hljs-meta">>>> </span>pipe = VersatileDiffusionDualGuidedPipeline.from_pretrained( | |
| <span class="hljs-meta">... </span> <span class="hljs-string">"shi-labs/versatile-diffusion"</span>, torch_dtype=torch.float16 | |
| <span class="hljs-meta">... </span>) | |
| <span class="hljs-meta">>>> </span>pipe.remove_unused_weights() | |
| <span class="hljs-meta">>>> </span>pipe = pipe.to(<span class="hljs-string">"cuda"</span>) | |
| <span class="hljs-meta">>>> </span>generator = torch.Generator(device=<span class="hljs-string">"cuda"</span>).manual_seed(<span class="hljs-number">0</span>) | |
| <span class="hljs-meta">>>> </span>text_to_image_strength = <span class="hljs-number">0.75</span> | |
| <span class="hljs-meta">>>> </span>image = pipe( | |
| <span class="hljs-meta">... </span> prompt=text, image=image, text_to_image_strength=text_to_image_strength, generator=generator | |
| <span class="hljs-meta">... </span>).images[<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image.save(<span class="hljs-string">"./car_variation.png"</span>)`}}),{c(){m=s("p"),$=r("Examples:"),_=p(),v(u.$$.fragment)},l(o){m=n(o,"P",{});var h=a(m);$=l(h,"Examples:"),h.forEach(i),_=d(o),b(u.$$.fragment,o)},m(o,h){g(o,m,h),e(m,$),g(o,_,h),D(u,o,h),P=!0},p:At,i(o){P||(w(u.$$.fragment,o),P=!0)},o(o){y(u.$$.fragment,o),P=!1},d(o){o&&i(m),o&&i(_),x(u,o)}}}function Lr(S){let m,$,_,u,P,o,h,Ft,Vs,Mi,se,Is,Pe,ks,Ts,Li,pt,js,Gi,dt,Bt,Es,Oi,K,ne,Ut,$e,qs,Wt,Ss,Ci,ct,Ve,Ms,ft,Ls,Gs,Ni,X,ae,Ht,Ie,Os,Rt,Cs,zi,M,Ns,ut,zs,As,gt,Fs,Bs,mt,Us,Ws,ht,Hs,Ai,_t,Qt,Rs,Fi,vt,Qs,Bi,G,ke,Kt,Ks,Xs,oe,Ys,Xt,Zs,Js,en,Te,Yt,tn,sn,re,nn,Zt,an,on,rn,je,Jt,ln,pn,le,dn,ei,cn,fn,Ui,Y,pe,ti,Ee,un,ii,gn,Wi,V,mn,bt,hn,_n,si,vn,bn,Dt,Dn,wn,wt,yn,xn,yt,Pn,$n,xt,Vn,In,Pt,kn,Tn,ni,jn,En,ai,qn,Sn,$t,Mn,Ln,Hi,qe,Ri,Z,de,oi,Se,Gn,ri,On,Qi,k,Me,Cn,li,Nn,zn,Le,An,Vt,Fn,Bn,Un,O,Ge,Wn,pi,Hn,Rn,ce,Qn,C,Oe,Kn,di,Xn,Yn,fe,Zn,N,Ce,Jn,ci,ea,ta,ue,Ki,J,ge,fi,Ne,ia,ui,sa,Xi,j,ze,na,Ae,aa,It,oa,ra,la,z,Fe,pa,gi,da,ca,me,fa,A,Be,ua,mi,ga,ma,hi,ha,_a,he,Ue,va,We,ba,_i,Da,wa,Yi,ee,_e,vi,He,ya,bi,xa,Zi,E,Re,Pa,Qe,$a,kt,Va,Ia,ka,F,Ke,Ta,Di,ja,Ea,ve,qa,B,Xe,Sa,wi,Ma,La,yi,Ga,Oa,be,Ye,Ca,Ze,Na,xi,za,Aa,Ji,te,De,Pi,Je,Fa,$i,Ba,es,q,et,Ua,tt,Wa,Tt,Ha,Ra,Qa,U,it,Ka,Vi,Xa,Ya,we,Za,W,st,Ja,Ii,eo,to,ki,io,so,ye,nt,no,at,ao,Ti,oo,ro,ts;return o=new xe({}),$e=new xe({}),Ie=new xe({}),Ee=new xe({}),qe=new lt({props:{code:`from diffusers import VersatileDiffusionPipeline, EulerDiscreteScheduler | |
| pipeline = VersatileDiffusionPipeline.from_pretrained("shi-labs/versatile-diffusion") | |
| pipeline.scheduler = EulerDiscreteScheduler.from_config(pipeline.scheduler.config) | |
| # or | |
| euler_scheduler = EulerDiscreteScheduler.from_pretrained("shi-labs/versatile-diffusion", subfolder="scheduler") | |
| pipeline = VersatileDiffusionPipeline.from_pretrained("shi-labs/versatile-diffusion", scheduler=euler_scheduler)`,highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> VersatileDiffusionPipeline, EulerDiscreteScheduler | |
| <span class="hljs-meta">>>> </span>pipeline = VersatileDiffusionPipeline.from_pretrained(<span class="hljs-string">"shi-labs/versatile-diffusion"</span>) | |
| <span class="hljs-meta">>>> </span>pipeline.scheduler = EulerDiscreteScheduler.from_config(pipeline.scheduler.config) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># or</span> | |
| <span class="hljs-meta">>>> </span>euler_scheduler = EulerDiscreteScheduler.from_pretrained(<span class="hljs-string">"shi-labs/versatile-diffusion"</span>, subfolder=<span class="hljs-string">"scheduler"</span>) | |
| <span class="hljs-meta">>>> </span>pipeline = VersatileDiffusionPipeline.from_pretrained(<span class="hljs-string">"shi-labs/versatile-diffusion"</span>, scheduler=euler_scheduler)`}}),Se=new xe({}),Me=new T({props:{name:"class diffusers.VersatileDiffusionPipeline",anchor:"diffusers.VersatileDiffusionPipeline",parameters:[{name:"tokenizer",val:": CLIPTokenizer"},{name:"image_feature_extractor",val:": CLIPFeatureExtractor"},{name:"text_encoder",val:": CLIPTextModel"},{name:"image_encoder",val:": CLIPVisionModel"},{name:"image_unet",val:": UNet2DConditionModel"},{name:"text_unet",val:": UNet2DConditionModel"},{name:"vae",val:": AutoencoderKL"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim.DDIMScheduler, diffusers.schedulers.scheduling_pndm.PNDMScheduler, diffusers.schedulers.scheduling_lms_discrete.LMSDiscreteScheduler]"}],parametersDescription:[{anchor:"diffusers.VersatileDiffusionPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.10.2/en/api/models#diffusers.AutoencoderKL">AutoencoderKL</a>) — | |
| Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.VersatileDiffusionPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) — | |
| Frozen text-encoder. Stable Diffusion uses the text portion of | |
| <a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically | |
| the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.VersatileDiffusionPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) — | |
| 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.VersatileDiffusionPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.10.2/en/api/models#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) — Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.VersatileDiffusionPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.SchedulerMixin">SchedulerMixin</a>) — | |
| A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of | |
| <a href="/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.VersatileDiffusionPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionMegaSafetyChecker</code>) — | |
| Classification module that estimates whether generated images could be considered offensive or harmful. | |
| Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.VersatileDiffusionPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPFeatureExtractor</code>) — | |
| Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.10.2/src/diffusers/pipelines/versatile_diffusion/pipeline_versatile_diffusion.py#L21"}}),Ge=new T({props:{name:"dual_guided",anchor:"diffusers.VersatileDiffusionPipeline.dual_guided",parameters:[{name:"prompt",val:": typing.Union[PIL.Image.Image, typing.List[PIL.Image.Image]]"},{name:"image",val:": typing.Union[str, typing.List[str]]"},{name:"text_to_image_strength",val:": float = 0.5"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"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:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": typing.Optional[int] = 1"}],parametersDescription:[{anchor:"diffusers.VersatileDiffusionPipeline.dual_guided.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) — | |
| The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.VersatileDiffusionPipeline.dual_guided.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.image_unet.config.sample_size * self.vae_scale_factor) — | |
| The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.VersatileDiffusionPipeline.dual_guided.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.image_unet.config.sample_size * self.vae_scale_factor) — | |
| The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.VersatileDiffusionPipeline.dual_guided.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) — | |
| 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.VersatileDiffusionPipeline.dual_guided.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) — | |
| 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 > 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.VersatileDiffusionPipeline.dual_guided.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| The prompt or prompts not to guide the image generation. Ignored when not using guidance (i.e., ignored | |
| if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.VersatileDiffusionPipeline.dual_guided.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.VersatileDiffusionPipeline.dual_guided.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| Corresponds to parameter eta (η) 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.10.2/en/api/schedulers#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.VersatileDiffusionPipeline.dual_guided.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) — | |
| A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator</a> to make generation | |
| deterministic.`,name:"generator"},{anchor:"diffusers.VersatileDiffusionPipeline.dual_guided.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| 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.VersatileDiffusionPipeline.dual_guided.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"pil"</code>) — | |
| 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.VersatileDiffusionPipeline.dual_guided.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <a href="/docs/diffusers/v0.10.2/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a | |
| plain tuple.`,name:"return_dict"},{anchor:"diffusers.VersatileDiffusionPipeline.dual_guided.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) — | |
| 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.VersatileDiffusionPipeline.dual_guided.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be | |
| called at every step.`,name:"callback_steps"}],source:"https://github.com/huggingface/diffusers/blob/v0.10.2/src/diffusers/pipelines/versatile_diffusion/pipeline_versatile_diffusion.py#L311",returnDescription:` | |
| <p><code>~pipelines.stable_diffusion.ImagePipelineOutput</code> if <code>return_dict</code> is True, otherwise a \`tuple. When | |
| returning a tuple, the first element is a list with the generated images.</p> | |
| `,returnType:` | |
| <p><code>~pipelines.stable_diffusion.ImagePipelineOutput</code> or <code>tuple</code></p> | |
| `}}),ce=new zt({props:{anchor:"diffusers.VersatileDiffusionPipeline.dual_guided.example",$$slots:{default:[Tr]},$$scope:{ctx:S}}}),Oe=new T({props:{name:"image_variation",anchor:"diffusers.VersatileDiffusionPipeline.image_variation",parameters:[{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image]"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": typing.Optional[int] = 1"}],parametersDescription:[{anchor:"diffusers.VersatileDiffusionPipeline.image_variation.image",description:`<strong>image</strong> (<code>PIL.Image.Image</code>, <code>List[PIL.Image.Image]</code> or <code>torch.Tensor</code>) — | |
| The image prompt or prompts to guide the image generation.`,name:"image"},{anchor:"diffusers.VersatileDiffusionPipeline.image_variation.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.image_unet.config.sample_size * self.vae_scale_factor) — | |
| The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.VersatileDiffusionPipeline.image_variation.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.image_unet.config.sample_size * self.vae_scale_factor) — | |
| The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.VersatileDiffusionPipeline.image_variation.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) — | |
| 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.VersatileDiffusionPipeline.image_variation.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) — | |
| 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 > 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.VersatileDiffusionPipeline.image_variation.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| The prompt or prompts not to guide the image generation. Ignored when not using guidance (i.e., ignored | |
| if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.VersatileDiffusionPipeline.image_variation.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.VersatileDiffusionPipeline.image_variation.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| Corresponds to parameter eta (η) 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.10.2/en/api/schedulers#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.VersatileDiffusionPipeline.image_variation.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) — | |
| A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator</a> to make generation | |
| deterministic.`,name:"generator"},{anchor:"diffusers.VersatileDiffusionPipeline.image_variation.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| 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.VersatileDiffusionPipeline.image_variation.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"pil"</code>) — | |
| 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.VersatileDiffusionPipeline.image_variation.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <a href="/docs/diffusers/v0.10.2/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a | |
| plain tuple.`,name:"return_dict"},{anchor:"diffusers.VersatileDiffusionPipeline.image_variation.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) — | |
| 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.VersatileDiffusionPipeline.image_variation.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be | |
| called at every step.`,name:"callback_steps"}],source:"https://github.com/huggingface/diffusers/blob/v0.10.2/src/diffusers/pipelines/versatile_diffusion/pipeline_versatile_diffusion.py#L83",returnDescription:` | |
| <p><a | |
| href="/docs/diffusers/v0.10.2/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput" | |
| >StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p> | |
| `,returnType:` | |
| <p><a | |
| href="/docs/diffusers/v0.10.2/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput" | |
| >StableDiffusionPipelineOutput</a> or <code>tuple</code></p> | |
| `}}),fe=new zt({props:{anchor:"diffusers.VersatileDiffusionPipeline.image_variation.example",$$slots:{default:[jr]},$$scope:{ctx:S}}}),Ce=new T({props:{name:"text_to_image",anchor:"diffusers.VersatileDiffusionPipeline.text_to_image",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": typing.Optional[int] = 1"}],parametersDescription:[{anchor:"diffusers.VersatileDiffusionPipeline.text_to_image.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) — | |
| The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.VersatileDiffusionPipeline.text_to_image.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.image_unet.config.sample_size * self.vae_scale_factor) — | |
| The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.VersatileDiffusionPipeline.text_to_image.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.image_unet.config.sample_size * self.vae_scale_factor) — | |
| The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.VersatileDiffusionPipeline.text_to_image.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) — | |
| 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.VersatileDiffusionPipeline.text_to_image.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) — | |
| 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 > 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.VersatileDiffusionPipeline.text_to_image.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| The prompt or prompts not to guide the image generation. Ignored when not using guidance (i.e., ignored | |
| if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.VersatileDiffusionPipeline.text_to_image.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.VersatileDiffusionPipeline.text_to_image.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| Corresponds to parameter eta (η) 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.10.2/en/api/schedulers#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.VersatileDiffusionPipeline.text_to_image.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) — | |
| A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator</a> to make generation | |
| deterministic.`,name:"generator"},{anchor:"diffusers.VersatileDiffusionPipeline.text_to_image.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| 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.VersatileDiffusionPipeline.text_to_image.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"pil"</code>) — | |
| 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.VersatileDiffusionPipeline.text_to_image.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <a href="/docs/diffusers/v0.10.2/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a | |
| plain tuple.`,name:"return_dict"},{anchor:"diffusers.VersatileDiffusionPipeline.text_to_image.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) — | |
| 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.VersatileDiffusionPipeline.text_to_image.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be | |
| called at every step.`,name:"callback_steps"}],source:"https://github.com/huggingface/diffusers/blob/v0.10.2/src/diffusers/pipelines/versatile_diffusion/pipeline_versatile_diffusion.py#L199",returnDescription:` | |
| <p><a | |
| href="/docs/diffusers/v0.10.2/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput" | |
| >StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p> | |
| `,returnType:` | |
| <p><a | |
| href="/docs/diffusers/v0.10.2/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput" | |
| >StableDiffusionPipelineOutput</a> or <code>tuple</code></p> | |
| `}}),ue=new zt({props:{anchor:"diffusers.VersatileDiffusionPipeline.text_to_image.example",$$slots:{default:[Er]},$$scope:{ctx:S}}}),Ne=new xe({}),ze=new T({props:{name:"class diffusers.VersatileDiffusionTextToImagePipeline",anchor:"diffusers.VersatileDiffusionTextToImagePipeline",parameters:[{name:"tokenizer",val:": CLIPTokenizer"},{name:"text_encoder",val:": CLIPTextModelWithProjection"},{name:"image_unet",val:": UNet2DConditionModel"},{name:"text_unet",val:": UNetFlatConditionModel"},{name:"vae",val:": AutoencoderKL"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim.DDIMScheduler, diffusers.schedulers.scheduling_pndm.PNDMScheduler, diffusers.schedulers.scheduling_lms_discrete.LMSDiscreteScheduler]"}],parametersDescription:[{anchor:"diffusers.VersatileDiffusionTextToImagePipeline.vqvae",description:`<strong>vqvae</strong> (<a href="/docs/diffusers/v0.10.2/en/api/models#diffusers.VQModel">VQModel</a>) — | |
| Vector-quantized (VQ) Model to encode and decode images to and from latent representations.`,name:"vqvae"},{anchor:"diffusers.VersatileDiffusionTextToImagePipeline.bert",description:`<strong>bert</strong> (<code>LDMBertModel</code>) — | |
| Text-encoder model based on <a href="https://huggingface.co/docs/transformers/model_doc/bert" rel="nofollow">BERT</a> architecture.`,name:"bert"},{anchor:"diffusers.VersatileDiffusionTextToImagePipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>transformers.BertTokenizer</code>) — | |
| Tokenizer of class | |
| <a href="https://huggingface.co/docs/transformers/model_doc/bert#transformers.BertTokenizer" rel="nofollow">BertTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.VersatileDiffusionTextToImagePipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.10.2/en/api/models#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) — Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.VersatileDiffusionTextToImagePipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.SchedulerMixin">SchedulerMixin</a>) — | |
| A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of | |
| <a href="/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/v0.10.2/src/diffusers/pipelines/versatile_diffusion/pipeline_versatile_diffusion_text_to_image.py#L34"}}),Fe=new T({props:{name:"__call__",anchor:"diffusers.VersatileDiffusionTextToImagePipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": typing.Optional[int] = 1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.VersatileDiffusionTextToImagePipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) — | |
| The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.VersatileDiffusionTextToImagePipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.image_unet.config.sample_size * self.vae_scale_factor) — | |
| The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.VersatileDiffusionTextToImagePipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.image_unet.config.sample_size * self.vae_scale_factor) — | |
| The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.VersatileDiffusionTextToImagePipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) — | |
| 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.VersatileDiffusionTextToImagePipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) — | |
| 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 > 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.VersatileDiffusionTextToImagePipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| The prompt or prompts not to guide the image generation. Ignored when not using guidance (i.e., ignored | |
| if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.VersatileDiffusionTextToImagePipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.VersatileDiffusionTextToImagePipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| Corresponds to parameter eta (η) 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.10.2/en/api/schedulers#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.VersatileDiffusionTextToImagePipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) — | |
| A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator</a> to make generation | |
| deterministic.`,name:"generator"},{anchor:"diffusers.VersatileDiffusionTextToImagePipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| 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.VersatileDiffusionTextToImagePipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"pil"</code>) — | |
| 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.VersatileDiffusionTextToImagePipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <a href="/docs/diffusers/v0.10.2/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a | |
| plain tuple.`,name:"return_dict"},{anchor:"diffusers.VersatileDiffusionTextToImagePipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) — | |
| 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.VersatileDiffusionTextToImagePipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be | |
| called at every step.`,name:"callback_steps"}],source:"https://github.com/huggingface/diffusers/blob/v0.10.2/src/diffusers/pipelines/versatile_diffusion/pipeline_versatile_diffusion_text_to_image.py#L310",returnDescription:` | |
| <p><a | |
| href="/docs/diffusers/v0.10.2/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput" | |
| >StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p> | |
| `,returnType:` | |
| <p><a | |
| href="/docs/diffusers/v0.10.2/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput" | |
| >StableDiffusionPipelineOutput</a> or <code>tuple</code></p> | |
| `}}),me=new zt({props:{anchor:"diffusers.VersatileDiffusionTextToImagePipeline.__call__.example",$$slots:{default:[qr]},$$scope:{ctx:S}}}),Be=new T({props:{name:"enable_attention_slicing",anchor:"diffusers.VersatileDiffusionTextToImagePipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.VersatileDiffusionTextToImagePipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>"auto"</code>) — | |
| When <code>"auto"</code>, halves the input to the attention heads, so attention will be computed in two steps. If | |
| <code>"max"</code>, maxium 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.10.2/src/diffusers/pipeline_utils.py#L850"}}),Ue=new T({props:{name:"disable_attention_slicing",anchor:"diffusers.VersatileDiffusionTextToImagePipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.10.2/src/diffusers/pipeline_utils.py#L866"}}),He=new xe({}),Re=new T({props:{name:"class diffusers.VersatileDiffusionImageVariationPipeline",anchor:"diffusers.VersatileDiffusionImageVariationPipeline",parameters:[{name:"image_feature_extractor",val:": CLIPFeatureExtractor"},{name:"image_encoder",val:": CLIPVisionModelWithProjection"},{name:"image_unet",val:": UNet2DConditionModel"},{name:"vae",val:": AutoencoderKL"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim.DDIMScheduler, diffusers.schedulers.scheduling_pndm.PNDMScheduler, diffusers.schedulers.scheduling_lms_discrete.LMSDiscreteScheduler]"}],parametersDescription:[{anchor:"diffusers.VersatileDiffusionImageVariationPipeline.vqvae",description:`<strong>vqvae</strong> (<a href="/docs/diffusers/v0.10.2/en/api/models#diffusers.VQModel">VQModel</a>) — | |
| Vector-quantized (VQ) Model to encode and decode images to and from latent representations.`,name:"vqvae"},{anchor:"diffusers.VersatileDiffusionImageVariationPipeline.bert",description:`<strong>bert</strong> (<code>LDMBertModel</code>) — | |
| Text-encoder model based on <a href="https://huggingface.co/docs/transformers/model_doc/bert" rel="nofollow">BERT</a> architecture.`,name:"bert"},{anchor:"diffusers.VersatileDiffusionImageVariationPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>transformers.BertTokenizer</code>) — | |
| Tokenizer of class | |
| <a href="https://huggingface.co/docs/transformers/model_doc/bert#transformers.BertTokenizer" rel="nofollow">BertTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.VersatileDiffusionImageVariationPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.10.2/en/api/models#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) — Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.VersatileDiffusionImageVariationPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.SchedulerMixin">SchedulerMixin</a>) — | |
| A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of | |
| <a href="/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/v0.10.2/src/diffusers/pipelines/versatile_diffusion/pipeline_versatile_diffusion_image_variation.py#L34"}}),Ke=new T({props:{name:"__call__",anchor:"diffusers.VersatileDiffusionImageVariationPipeline.__call__",parameters:[{name:"image",val:": typing.Union[PIL.Image.Image, typing.List[PIL.Image.Image], torch.Tensor]"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Optional[torch._C.Generator] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": typing.Optional[int] = 1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.VersatileDiffusionImageVariationPipeline.__call__.image",description:`<strong>image</strong> (<code>PIL.Image.Image</code>, <code>List[PIL.Image.Image]</code> or <code>torch.Tensor</code>) — | |
| The image prompt or prompts to guide the image generation.`,name:"image"},{anchor:"diffusers.VersatileDiffusionImageVariationPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.image_unet.config.sample_size * self.vae_scale_factor) — | |
| The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.VersatileDiffusionImageVariationPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.image_unet.config.sample_size * self.vae_scale_factor) — | |
| The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.VersatileDiffusionImageVariationPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) — | |
| 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.VersatileDiffusionImageVariationPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) — | |
| 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 > 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.VersatileDiffusionImageVariationPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| The prompt or prompts not to guide the image generation. Ignored when not using guidance (i.e., ignored | |
| if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.VersatileDiffusionImageVariationPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.VersatileDiffusionImageVariationPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| Corresponds to parameter eta (η) 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.10.2/en/api/schedulers#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.VersatileDiffusionImageVariationPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) — | |
| A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator</a> to make generation | |
| deterministic.`,name:"generator"},{anchor:"diffusers.VersatileDiffusionImageVariationPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| 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.VersatileDiffusionImageVariationPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"pil"</code>) — | |
| 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.VersatileDiffusionImageVariationPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <a href="/docs/diffusers/v0.10.2/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a | |
| plain tuple.`,name:"return_dict"},{anchor:"diffusers.VersatileDiffusionImageVariationPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) — | |
| 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.VersatileDiffusionImageVariationPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be | |
| called at every step.`,name:"callback_steps"}],source:"https://github.com/huggingface/diffusers/blob/v0.10.2/src/diffusers/pipelines/versatile_diffusion/pipeline_versatile_diffusion_image_variation.py#L259",returnDescription:` | |
| <p><a | |
| href="/docs/diffusers/v0.10.2/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput" | |
| >StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p> | |
| `,returnType:` | |
| <p><a | |
| href="/docs/diffusers/v0.10.2/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput" | |
| >StableDiffusionPipelineOutput</a> or <code>tuple</code></p> | |
| `}}),ve=new zt({props:{anchor:"diffusers.VersatileDiffusionImageVariationPipeline.__call__.example",$$slots:{default:[Sr]},$$scope:{ctx:S}}}),Xe=new T({props:{name:"enable_attention_slicing",anchor:"diffusers.VersatileDiffusionImageVariationPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.VersatileDiffusionImageVariationPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>"auto"</code>) — | |
| When <code>"auto"</code>, halves the input to the attention heads, so attention will be computed in two steps. If | |
| <code>"max"</code>, maxium 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.10.2/src/diffusers/pipeline_utils.py#L850"}}),Ye=new T({props:{name:"disable_attention_slicing",anchor:"diffusers.VersatileDiffusionImageVariationPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.10.2/src/diffusers/pipeline_utils.py#L866"}}),Je=new xe({}),et=new T({props:{name:"class diffusers.VersatileDiffusionDualGuidedPipeline",anchor:"diffusers.VersatileDiffusionDualGuidedPipeline",parameters:[{name:"tokenizer",val:": CLIPTokenizer"},{name:"image_feature_extractor",val:": CLIPFeatureExtractor"},{name:"text_encoder",val:": CLIPTextModelWithProjection"},{name:"image_encoder",val:": CLIPVisionModelWithProjection"},{name:"image_unet",val:": UNet2DConditionModel"},{name:"text_unet",val:": UNetFlatConditionModel"},{name:"vae",val:": AutoencoderKL"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim.DDIMScheduler, diffusers.schedulers.scheduling_pndm.PNDMScheduler, diffusers.schedulers.scheduling_lms_discrete.LMSDiscreteScheduler]"}],parametersDescription:[{anchor:"diffusers.VersatileDiffusionDualGuidedPipeline.vqvae",description:`<strong>vqvae</strong> (<a href="/docs/diffusers/v0.10.2/en/api/models#diffusers.VQModel">VQModel</a>) — | |
| Vector-quantized (VQ) Model to encode and decode images to and from latent representations.`,name:"vqvae"},{anchor:"diffusers.VersatileDiffusionDualGuidedPipeline.bert",description:`<strong>bert</strong> (<code>LDMBertModel</code>) — | |
| Text-encoder model based on <a href="https://huggingface.co/docs/transformers/model_doc/bert" rel="nofollow">BERT</a> architecture.`,name:"bert"},{anchor:"diffusers.VersatileDiffusionDualGuidedPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>transformers.BertTokenizer</code>) — | |
| Tokenizer of class | |
| <a href="https://huggingface.co/docs/transformers/model_doc/bert#transformers.BertTokenizer" rel="nofollow">BertTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.VersatileDiffusionDualGuidedPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.10.2/en/api/models#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) — Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.VersatileDiffusionDualGuidedPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.SchedulerMixin">SchedulerMixin</a>) — | |
| A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of | |
| <a href="/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/v0.10.2/src/diffusers/pipelines/versatile_diffusion/pipeline_versatile_diffusion_dual_guided.py#L41"}}),it=new T({props:{name:"__call__",anchor:"diffusers.VersatileDiffusionDualGuidedPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[PIL.Image.Image, typing.List[PIL.Image.Image]]"},{name:"image",val:": typing.Union[str, typing.List[str]]"},{name:"text_to_image_strength",val:": float = 0.5"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"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:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": typing.Optional[int] = 1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.VersatileDiffusionDualGuidedPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) — | |
| The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.VersatileDiffusionDualGuidedPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.image_unet.config.sample_size * self.vae_scale_factor) — | |
| The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.VersatileDiffusionDualGuidedPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.image_unet.config.sample_size * self.vae_scale_factor) — | |
| The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.VersatileDiffusionDualGuidedPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) — | |
| 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.VersatileDiffusionDualGuidedPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) — | |
| 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 > 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.VersatileDiffusionDualGuidedPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) — | |
| The prompt or prompts not to guide the image generation. Ignored when not using guidance (i.e., ignored | |
| if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.VersatileDiffusionDualGuidedPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.VersatileDiffusionDualGuidedPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) — | |
| Corresponds to parameter eta (η) 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.10.2/en/api/schedulers#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.VersatileDiffusionDualGuidedPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code>, <em>optional</em>) — | |
| A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator</a> to make generation | |
| deterministic.`,name:"generator"},{anchor:"diffusers.VersatileDiffusionDualGuidedPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) — | |
| 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.VersatileDiffusionDualGuidedPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>"pil"</code>) — | |
| 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.VersatileDiffusionDualGuidedPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether or not to return a <a href="/docs/diffusers/v0.10.2/en/api/pipelines/stable_diffusion#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a | |
| plain tuple.`,name:"return_dict"},{anchor:"diffusers.VersatileDiffusionDualGuidedPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) — | |
| 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.VersatileDiffusionDualGuidedPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be | |
| called at every step.`,name:"callback_steps"}],source:"https://github.com/huggingface/diffusers/blob/v0.10.2/src/diffusers/pipelines/versatile_diffusion/pipeline_versatile_diffusion_dual_guided.py#L407",returnDescription:` | |
| <p><code>~pipelines.stable_diffusion.ImagePipelineOutput</code> if <code>return_dict</code> is True, otherwise a \`tuple. When | |
| returning a tuple, the first element is a list with the generated images.</p> | |
| `,returnType:` | |
| <p><code>~pipelines.stable_diffusion.ImagePipelineOutput</code> or <code>tuple</code></p> | |
| `}}),we=new zt({props:{anchor:"diffusers.VersatileDiffusionDualGuidedPipeline.__call__.example",$$slots:{default:[Mr]},$$scope:{ctx:S}}}),st=new T({props:{name:"enable_attention_slicing",anchor:"diffusers.VersatileDiffusionDualGuidedPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.VersatileDiffusionDualGuidedPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>"auto"</code>) — | |
| When <code>"auto"</code>, halves the input to the attention heads, so attention will be computed in two steps. If | |
| <code>"max"</code>, maxium 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.10.2/src/diffusers/pipeline_utils.py#L850"}}),nt=new T({props:{name:"disable_attention_slicing",anchor:"diffusers.VersatileDiffusionDualGuidedPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.10.2/src/diffusers/pipeline_utils.py#L866"}}),{c(){m=s("meta"),$=p(),_=s("h1"),u=s("a"),P=s("span"),v(o.$$.fragment),h=p(),Ft=s("span"),Vs=r("VersatileDiffusion"),Mi=p(),se=s("p"),Is=r("VersatileDiffusion was proposed in "),Pe=s("a"),ks=r("Versatile Diffusion: Text, Images and Variations All in One Diffusion Model"),Ts=r(" by Xingqian Xu, Zhangyang Wang, Eric Zhang, Kai Wang, Humphrey Shi ."),Li=p(),pt=s("p"),js=r("The abstract of the paper is the following:"),Gi=p(),dt=s("p"),Bt=s("em"),Es=r("The recent advances in diffusion models have set an impressive milestone in many generation tasks. Trending works such as DALL-E2, Imagen, and Stable Diffusion have attracted great interest in academia and industry. Despite the rapid landscape changes, recent new approaches focus on extensions and performance rather than capacity, thus requiring separate models for separate tasks. In this work, we expand the existing single-flow diffusion pipeline into a multi-flow network, dubbed Versatile Diffusion (VD), that handles text-to-image, image-to-text, image-variation, and text-variation in one unified model. Moreover, we generalize VD to a unified multi-flow multimodal diffusion framework with grouped layers, swappable streams, and other propositions that can process modalities beyond images and text. Through our experiments, we demonstrate that VD and its underlying framework have the following merits: a) VD handles all subtasks with competitive quality; b) VD initiates novel extensions and applications such as disentanglement of style and semantic, image-text dual-guided generation, etc.; c) Through these experiments and applications, VD provides more semantic insights of the generated outputs."),Oi=p(),K=s("h2"),ne=s("a"),Ut=s("span"),v($e.$$.fragment),qs=p(),Wt=s("span"),Ss=r("Tips"),Ci=p(),ct=s("ul"),Ve=s("li"),Ms=r("VersatileDiffusion is conceptually very similar as "),ft=s("a"),Ls=r("Stable Diffusion"),Gs=r(", but instead of providing just a image data stream conditioned on text, VersatileDiffusion provides both a image and text data stream and can be conditioned on both text and image."),Ni=p(),X=s("h3"),ae=s("a"),Ht=s("span"),v(Ie.$$.fragment),Os=p(),Rt=s("span"),Cs=r("*Run VersatileDiffusion*"),zi=p(),M=s("p"),Ns=r("You can both load the memory intensive \u201Call-in-one\u201D "),ut=s("a"),zs=r("VersatileDiffusionPipeline"),As=r(` that can run all tasks | |
| with the same class as shown in `),gt=s("a"),Fs=r("VersatileDiffusionPipeline.text_to_image()"),Bs=r(", "),mt=s("a"),Us=r("VersatileDiffusionPipeline.image_variation()"),Ws=r(", and "),ht=s("a"),Hs=r("VersatileDiffusionPipeline.dual_guided()"),Ai=p(),_t=s("p"),Qt=s("strong"),Rs=r("or"),Fi=p(),vt=s("p"),Qs=r("You can run the individual pipelines which are much more memory efficient:"),Bi=p(),G=s("ul"),ke=s("li"),Kt=s("em"),Ks=r("Text-to-Image"),Xs=r(": "),oe=s("a"),Ys=r("VersatileDiffusionTextToImagePipeline."),Xt=s("strong"),Zs=r("call"),Js=r("()"),en=p(),Te=s("li"),Yt=s("em"),tn=r("Image Variation"),sn=r(": "),re=s("a"),nn=r("VersatileDiffusionImageVariationPipeline."),Zt=s("strong"),an=r("call"),on=r("()"),rn=p(),je=s("li"),Jt=s("em"),ln=r("Dual Text and Image Guided Generation"),pn=r(": "),le=s("a"),dn=r("VersatileDiffusionDualGuidedPipeline."),ei=s("strong"),cn=r("call"),fn=r("()"),Ui=p(),Y=s("h3"),pe=s("a"),ti=s("span"),v(Ee.$$.fragment),un=p(),ii=s("span"),gn=r("*How to load and use different schedulers.*"),Wi=p(),V=s("p"),mn=r("The versatile diffusion pipelines uses "),bt=s("a"),hn=r("DDIMScheduler"),_n=r(" scheduler by default. But "),si=s("code"),vn=r("diffusers"),bn=r(" provides many other schedulers that can be used with the alt diffusion pipeline such as "),Dt=s("a"),Dn=r("PNDMScheduler"),wn=r(", "),wt=s("a"),yn=r("LMSDiscreteScheduler"),xn=r(", "),yt=s("a"),Pn=r("EulerDiscreteScheduler"),$n=r(", "),xt=s("a"),Vn=r("EulerAncestralDiscreteScheduler"),In=r(` etc. | |
| To use a different scheduler, you can either change it via the `),Pt=s("a"),kn=r("ConfigMixin.from_config()"),Tn=r(" method or pass the "),ni=s("code"),jn=r("scheduler"),En=r(" argument to the "),ai=s("code"),qn=r("from_pretrained"),Sn=r(" method of the pipeline. For example, to use the "),$t=s("a"),Mn=r("EulerDiscreteScheduler"),Ln=r(", you can do the following:"),Hi=p(),v(qe.$$.fragment),Ri=p(),Z=s("h2"),de=s("a"),oi=s("span"),v(Se.$$.fragment),Gn=p(),ri=s("span"),On=r("VersatileDiffusionPipeline"),Qi=p(),k=s("div"),v(Me.$$.fragment),Cn=p(),li=s("p"),Nn=r("Pipeline for text-to-image generation using Stable Diffusion."),zn=p(),Le=s("p"),An=r("This model inherits from "),Vt=s("a"),Fn=r("DiffusionPipeline"),Bn=r(`. 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.)`),Un=p(),O=s("div"),v(Ge.$$.fragment),Wn=p(),pi=s("p"),Hn=r("Function invoked when calling the pipeline for generation."),Rn=p(),v(ce.$$.fragment),Qn=p(),C=s("div"),v(Oe.$$.fragment),Kn=p(),di=s("p"),Xn=r("Function invoked when calling the pipeline for generation."),Yn=p(),v(fe.$$.fragment),Zn=p(),N=s("div"),v(Ce.$$.fragment),Jn=p(),ci=s("p"),ea=r("Function invoked when calling the pipeline for generation."),ta=p(),v(ue.$$.fragment),Ki=p(),J=s("h2"),ge=s("a"),fi=s("span"),v(Ne.$$.fragment),ia=p(),ui=s("span"),sa=r("VersatileDiffusionTextToImagePipeline"),Xi=p(),j=s("div"),v(ze.$$.fragment),na=p(),Ae=s("p"),aa=r("This model inherits from "),It=s("a"),oa=r("DiffusionPipeline"),ra=r(`. 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.)`),la=p(),z=s("div"),v(Fe.$$.fragment),pa=p(),gi=s("p"),da=r("Function invoked when calling the pipeline for generation."),ca=p(),v(me.$$.fragment),fa=p(),A=s("div"),v(Be.$$.fragment),ua=p(),mi=s("p"),ga=r("Enable sliced attention computation."),ma=p(),hi=s("p"),ha=r(`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.`),_a=p(),he=s("div"),v(Ue.$$.fragment),va=p(),We=s("p"),ba=r("Disable sliced attention computation. If "),_i=s("code"),Da=r("enable_attention_slicing"),wa=r(` was previously invoked, this method will go | |
| back to computing attention in one step.`),Yi=p(),ee=s("h2"),_e=s("a"),vi=s("span"),v(He.$$.fragment),ya=p(),bi=s("span"),xa=r("VersatileDiffusionImageVariationPipeline"),Zi=p(),E=s("div"),v(Re.$$.fragment),Pa=p(),Qe=s("p"),$a=r("This model inherits from "),kt=s("a"),Va=r("DiffusionPipeline"),Ia=r(`. 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.)`),ka=p(),F=s("div"),v(Ke.$$.fragment),Ta=p(),Di=s("p"),ja=r("Function invoked when calling the pipeline for generation."),Ea=p(),v(ve.$$.fragment),qa=p(),B=s("div"),v(Xe.$$.fragment),Sa=p(),wi=s("p"),Ma=r("Enable sliced attention computation."),La=p(),yi=s("p"),Ga=r(`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.`),Oa=p(),be=s("div"),v(Ye.$$.fragment),Ca=p(),Ze=s("p"),Na=r("Disable sliced attention computation. If "),xi=s("code"),za=r("enable_attention_slicing"),Aa=r(` was previously invoked, this method will go | |
| back to computing attention in one step.`),Ji=p(),te=s("h2"),De=s("a"),Pi=s("span"),v(Je.$$.fragment),Fa=p(),$i=s("span"),Ba=r("VersatileDiffusionDualGuidedPipeline"),es=p(),q=s("div"),v(et.$$.fragment),Ua=p(),tt=s("p"),Wa=r("This model inherits from "),Tt=s("a"),Ha=r("DiffusionPipeline"),Ra=r(`. 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.)`),Qa=p(),U=s("div"),v(it.$$.fragment),Ka=p(),Vi=s("p"),Xa=r("Function invoked when calling the pipeline for generation."),Ya=p(),v(we.$$.fragment),Za=p(),W=s("div"),v(st.$$.fragment),Ja=p(),Ii=s("p"),eo=r("Enable sliced attention computation."),to=p(),ki=s("p"),io=r(`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.`),so=p(),ye=s("div"),v(nt.$$.fragment),no=p(),at=s("p"),ao=r("Disable sliced attention computation. If "),Ti=s("code"),oo=r("enable_attention_slicing"),ro=r(` was previously invoked, this method will go | |
| back to computing attention in one step.`),this.h()},l(t){const f=Ir('[data-svelte="svelte-1phssyn"]',document.head);m=n(f,"META",{name:!0,content:!0}),f.forEach(i),$=d(t),_=n(t,"H1",{class:!0});var ot=a(_);u=n(ot,"A",{id:!0,class:!0,href:!0});var ji=a(u);P=n(ji,"SPAN",{});var Ei=a(P);b(o.$$.fragment,Ei),Ei.forEach(i),ji.forEach(i),h=d(ot),Ft=n(ot,"SPAN",{});var qi=a(Ft);Vs=l(qi,"VersatileDiffusion"),qi.forEach(i),ot.forEach(i),Mi=d(t),se=n(t,"P",{});var rt=a(se);Is=l(rt,"VersatileDiffusion was proposed in "),Pe=n(rt,"A",{href:!0,rel:!0});var Si=a(Pe);ks=l(Si,"Versatile Diffusion: Text, Images and Variations All in One Diffusion Model"),Si.forEach(i),Ts=l(rt," by Xingqian Xu, Zhangyang Wang, Eric Zhang, Kai Wang, Humphrey Shi ."),rt.forEach(i),Li=d(t),pt=n(t,"P",{});var lo=a(pt);js=l(lo,"The abstract of the paper is the following:"),lo.forEach(i),Gi=d(t),dt=n(t,"P",{});var po=a(dt);Bt=n(po,"EM",{});var co=a(Bt);Es=l(co,"The recent advances in diffusion models have set an impressive milestone in many generation tasks. Trending works such as DALL-E2, Imagen, and Stable Diffusion have attracted great interest in academia and industry. Despite the rapid landscape changes, recent new approaches focus on extensions and performance rather than capacity, thus requiring separate models for separate tasks. In this work, we expand the existing single-flow diffusion pipeline into a multi-flow network, dubbed Versatile Diffusion (VD), that handles text-to-image, image-to-text, image-variation, and text-variation in one unified model. Moreover, we generalize VD to a unified multi-flow multimodal diffusion framework with grouped layers, swappable streams, and other propositions that can process modalities beyond images and text. Through our experiments, we demonstrate that VD and its underlying framework have the following merits: a) VD handles all subtasks with competitive quality; b) VD initiates novel extensions and applications such as disentanglement of style and semantic, image-text dual-guided generation, etc.; c) Through these experiments and applications, VD provides more semantic insights of the generated outputs."),co.forEach(i),po.forEach(i),Oi=d(t),K=n(t,"H2",{class:!0});var is=a(K);ne=n(is,"A",{id:!0,class:!0,href:!0});var fo=a(ne);Ut=n(fo,"SPAN",{});var uo=a(Ut);b($e.$$.fragment,uo),uo.forEach(i),fo.forEach(i),qs=d(is),Wt=n(is,"SPAN",{});var go=a(Wt);Ss=l(go,"Tips"),go.forEach(i),is.forEach(i),Ci=d(t),ct=n(t,"UL",{});var mo=a(ct);Ve=n(mo,"LI",{});var ss=a(Ve);Ms=l(ss,"VersatileDiffusion is conceptually very similar as "),ft=n(ss,"A",{href:!0});var ho=a(ft);Ls=l(ho,"Stable Diffusion"),ho.forEach(i),Gs=l(ss,", but instead of providing just a image data stream conditioned on text, VersatileDiffusion provides both a image and text data stream and can be conditioned on both text and image."),ss.forEach(i),mo.forEach(i),Ni=d(t),X=n(t,"H3",{class:!0});var ns=a(X);ae=n(ns,"A",{id:!0,class:!0,href:!0});var _o=a(ae);Ht=n(_o,"SPAN",{});var vo=a(Ht);b(Ie.$$.fragment,vo),vo.forEach(i),_o.forEach(i),Os=d(ns),Rt=n(ns,"SPAN",{});var bo=a(Rt);Cs=l(bo,"*Run VersatileDiffusion*"),bo.forEach(i),ns.forEach(i),zi=d(t),M=n(t,"P",{});var ie=a(M);Ns=l(ie,"You can both load the memory intensive \u201Call-in-one\u201D "),ut=n(ie,"A",{href:!0});var Do=a(ut);zs=l(Do,"VersatileDiffusionPipeline"),Do.forEach(i),As=l(ie,` that can run all tasks | |
| with the same class as shown in `),gt=n(ie,"A",{href:!0});var wo=a(gt);Fs=l(wo,"VersatileDiffusionPipeline.text_to_image()"),wo.forEach(i),Bs=l(ie,", "),mt=n(ie,"A",{href:!0});var yo=a(mt);Us=l(yo,"VersatileDiffusionPipeline.image_variation()"),yo.forEach(i),Ws=l(ie,", and "),ht=n(ie,"A",{href:!0});var xo=a(ht);Hs=l(xo,"VersatileDiffusionPipeline.dual_guided()"),xo.forEach(i),ie.forEach(i),Ai=d(t),_t=n(t,"P",{});var Po=a(_t);Qt=n(Po,"STRONG",{});var $o=a(Qt);Rs=l($o,"or"),$o.forEach(i),Po.forEach(i),Fi=d(t),vt=n(t,"P",{});var Vo=a(vt);Qs=l(Vo,"You can run the individual pipelines which are much more memory efficient:"),Vo.forEach(i),Bi=d(t),G=n(t,"UL",{});var jt=a(G);ke=n(jt,"LI",{});var as=a(ke);Kt=n(as,"EM",{});var Io=a(Kt);Ks=l(Io,"Text-to-Image"),Io.forEach(i),Xs=l(as,": "),oe=n(as,"A",{href:!0});var os=a(oe);Ys=l(os,"VersatileDiffusionTextToImagePipeline."),Xt=n(os,"STRONG",{});var ko=a(Xt);Zs=l(ko,"call"),ko.forEach(i),Js=l(os,"()"),os.forEach(i),as.forEach(i),en=d(jt),Te=n(jt,"LI",{});var rs=a(Te);Yt=n(rs,"EM",{});var To=a(Yt);tn=l(To,"Image Variation"),To.forEach(i),sn=l(rs,": "),re=n(rs,"A",{href:!0});var ls=a(re);nn=l(ls,"VersatileDiffusionImageVariationPipeline."),Zt=n(ls,"STRONG",{});var jo=a(Zt);an=l(jo,"call"),jo.forEach(i),on=l(ls,"()"),ls.forEach(i),rs.forEach(i),rn=d(jt),je=n(jt,"LI",{});var ps=a(je);Jt=n(ps,"EM",{});var Eo=a(Jt);ln=l(Eo,"Dual Text and Image Guided Generation"),Eo.forEach(i),pn=l(ps,": "),le=n(ps,"A",{href:!0});var ds=a(le);dn=l(ds,"VersatileDiffusionDualGuidedPipeline."),ei=n(ds,"STRONG",{});var qo=a(ei);cn=l(qo,"call"),qo.forEach(i),fn=l(ds,"()"),ds.forEach(i),ps.forEach(i),jt.forEach(i),Ui=d(t),Y=n(t,"H3",{class:!0});var cs=a(Y);pe=n(cs,"A",{id:!0,class:!0,href:!0});var So=a(pe);ti=n(So,"SPAN",{});var Mo=a(ti);b(Ee.$$.fragment,Mo),Mo.forEach(i),So.forEach(i),un=d(cs),ii=n(cs,"SPAN",{});var Lo=a(ii);gn=l(Lo,"*How to load and use different schedulers.*"),Lo.forEach(i),cs.forEach(i),Wi=d(t),V=n(t,"P",{});var I=a(V);mn=l(I,"The versatile diffusion pipelines uses "),bt=n(I,"A",{href:!0});var Go=a(bt);hn=l(Go,"DDIMScheduler"),Go.forEach(i),_n=l(I," scheduler by default. But "),si=n(I,"CODE",{});var Oo=a(si);vn=l(Oo,"diffusers"),Oo.forEach(i),bn=l(I," provides many other schedulers that can be used with the alt diffusion pipeline such as "),Dt=n(I,"A",{href:!0});var Co=a(Dt);Dn=l(Co,"PNDMScheduler"),Co.forEach(i),wn=l(I,", "),wt=n(I,"A",{href:!0});var No=a(wt);yn=l(No,"LMSDiscreteScheduler"),No.forEach(i),xn=l(I,", "),yt=n(I,"A",{href:!0});var zo=a(yt);Pn=l(zo,"EulerDiscreteScheduler"),zo.forEach(i),$n=l(I,", "),xt=n(I,"A",{href:!0});var Ao=a(xt);Vn=l(Ao,"EulerAncestralDiscreteScheduler"),Ao.forEach(i),In=l(I,` etc. | |
| To use a different scheduler, you can either change it via the `),Pt=n(I,"A",{href:!0});var Fo=a(Pt);kn=l(Fo,"ConfigMixin.from_config()"),Fo.forEach(i),Tn=l(I," method or pass the "),ni=n(I,"CODE",{});var Bo=a(ni);jn=l(Bo,"scheduler"),Bo.forEach(i),En=l(I," argument to the "),ai=n(I,"CODE",{});var Uo=a(ai);qn=l(Uo,"from_pretrained"),Uo.forEach(i),Sn=l(I," method of the pipeline. For example, to use the "),$t=n(I,"A",{href:!0});var Wo=a($t);Mn=l(Wo,"EulerDiscreteScheduler"),Wo.forEach(i),Ln=l(I,", you can do the following:"),I.forEach(i),Hi=d(t),b(qe.$$.fragment,t),Ri=d(t),Z=n(t,"H2",{class:!0});var fs=a(Z);de=n(fs,"A",{id:!0,class:!0,href:!0});var Ho=a(de);oi=n(Ho,"SPAN",{});var Ro=a(oi);b(Se.$$.fragment,Ro),Ro.forEach(i),Ho.forEach(i),Gn=d(fs),ri=n(fs,"SPAN",{});var Qo=a(ri);On=l(Qo,"VersatileDiffusionPipeline"),Qo.forEach(i),fs.forEach(i),Qi=d(t),k=n(t,"DIV",{class:!0});var L=a(k);b(Me.$$.fragment,L),Cn=d(L),li=n(L,"P",{});var Ko=a(li);Nn=l(Ko,"Pipeline for text-to-image generation using Stable Diffusion."),Ko.forEach(i),zn=d(L),Le=n(L,"P",{});var us=a(Le);An=l(us,"This model inherits from "),Vt=n(us,"A",{href:!0});var Xo=a(Vt);Fn=l(Xo,"DiffusionPipeline"),Xo.forEach(i),Bn=l(us,`. 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.)`),us.forEach(i),Un=d(L),O=n(L,"DIV",{class:!0});var Et=a(O);b(Ge.$$.fragment,Et),Wn=d(Et),pi=n(Et,"P",{});var Yo=a(pi);Hn=l(Yo,"Function invoked when calling the pipeline for generation."),Yo.forEach(i),Rn=d(Et),b(ce.$$.fragment,Et),Et.forEach(i),Qn=d(L),C=n(L,"DIV",{class:!0});var qt=a(C);b(Oe.$$.fragment,qt),Kn=d(qt),di=n(qt,"P",{});var Zo=a(di);Xn=l(Zo,"Function invoked when calling the pipeline for generation."),Zo.forEach(i),Yn=d(qt),b(fe.$$.fragment,qt),qt.forEach(i),Zn=d(L),N=n(L,"DIV",{class:!0});var St=a(N);b(Ce.$$.fragment,St),Jn=d(St),ci=n(St,"P",{});var Jo=a(ci);ea=l(Jo,"Function invoked when calling the pipeline for generation."),Jo.forEach(i),ta=d(St),b(ue.$$.fragment,St),St.forEach(i),L.forEach(i),Ki=d(t),J=n(t,"H2",{class:!0});var gs=a(J);ge=n(gs,"A",{id:!0,class:!0,href:!0});var er=a(ge);fi=n(er,"SPAN",{});var tr=a(fi);b(Ne.$$.fragment,tr),tr.forEach(i),er.forEach(i),ia=d(gs),ui=n(gs,"SPAN",{});var ir=a(ui);sa=l(ir,"VersatileDiffusionTextToImagePipeline"),ir.forEach(i),gs.forEach(i),Xi=d(t),j=n(t,"DIV",{class:!0});var H=a(j);b(ze.$$.fragment,H),na=d(H),Ae=n(H,"P",{});var ms=a(Ae);aa=l(ms,"This model inherits from "),It=n(ms,"A",{href:!0});var sr=a(It);oa=l(sr,"DiffusionPipeline"),sr.forEach(i),ra=l(ms,`. 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.)`),ms.forEach(i),la=d(H),z=n(H,"DIV",{class:!0});var Mt=a(z);b(Fe.$$.fragment,Mt),pa=d(Mt),gi=n(Mt,"P",{});var nr=a(gi);da=l(nr,"Function invoked when calling the pipeline for generation."),nr.forEach(i),ca=d(Mt),b(me.$$.fragment,Mt),Mt.forEach(i),fa=d(H),A=n(H,"DIV",{class:!0});var Lt=a(A);b(Be.$$.fragment,Lt),ua=d(Lt),mi=n(Lt,"P",{});var ar=a(mi);ga=l(ar,"Enable sliced attention computation."),ar.forEach(i),ma=d(Lt),hi=n(Lt,"P",{});var or=a(hi);ha=l(or,`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.`),or.forEach(i),Lt.forEach(i),_a=d(H),he=n(H,"DIV",{class:!0});var hs=a(he);b(Ue.$$.fragment,hs),va=d(hs),We=n(hs,"P",{});var _s=a(We);ba=l(_s,"Disable sliced attention computation. If "),_i=n(_s,"CODE",{});var rr=a(_i);Da=l(rr,"enable_attention_slicing"),rr.forEach(i),wa=l(_s,` was previously invoked, this method will go | |
| back to computing attention in one step.`),_s.forEach(i),hs.forEach(i),H.forEach(i),Yi=d(t),ee=n(t,"H2",{class:!0});var vs=a(ee);_e=n(vs,"A",{id:!0,class:!0,href:!0});var lr=a(_e);vi=n(lr,"SPAN",{});var pr=a(vi);b(He.$$.fragment,pr),pr.forEach(i),lr.forEach(i),ya=d(vs),bi=n(vs,"SPAN",{});var dr=a(bi);xa=l(dr,"VersatileDiffusionImageVariationPipeline"),dr.forEach(i),vs.forEach(i),Zi=d(t),E=n(t,"DIV",{class:!0});var R=a(E);b(Re.$$.fragment,R),Pa=d(R),Qe=n(R,"P",{});var bs=a(Qe);$a=l(bs,"This model inherits from "),kt=n(bs,"A",{href:!0});var cr=a(kt);Va=l(cr,"DiffusionPipeline"),cr.forEach(i),Ia=l(bs,`. 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.)`),bs.forEach(i),ka=d(R),F=n(R,"DIV",{class:!0});var Gt=a(F);b(Ke.$$.fragment,Gt),Ta=d(Gt),Di=n(Gt,"P",{});var fr=a(Di);ja=l(fr,"Function invoked when calling the pipeline for generation."),fr.forEach(i),Ea=d(Gt),b(ve.$$.fragment,Gt),Gt.forEach(i),qa=d(R),B=n(R,"DIV",{class:!0});var Ot=a(B);b(Xe.$$.fragment,Ot),Sa=d(Ot),wi=n(Ot,"P",{});var ur=a(wi);Ma=l(ur,"Enable sliced attention computation."),ur.forEach(i),La=d(Ot),yi=n(Ot,"P",{});var gr=a(yi);Ga=l(gr,`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.`),gr.forEach(i),Ot.forEach(i),Oa=d(R),be=n(R,"DIV",{class:!0});var Ds=a(be);b(Ye.$$.fragment,Ds),Ca=d(Ds),Ze=n(Ds,"P",{});var ws=a(Ze);Na=l(ws,"Disable sliced attention computation. If "),xi=n(ws,"CODE",{});var mr=a(xi);za=l(mr,"enable_attention_slicing"),mr.forEach(i),Aa=l(ws,` was previously invoked, this method will go | |
| back to computing attention in one step.`),ws.forEach(i),Ds.forEach(i),R.forEach(i),Ji=d(t),te=n(t,"H2",{class:!0});var ys=a(te);De=n(ys,"A",{id:!0,class:!0,href:!0});var hr=a(De);Pi=n(hr,"SPAN",{});var _r=a(Pi);b(Je.$$.fragment,_r),_r.forEach(i),hr.forEach(i),Fa=d(ys),$i=n(ys,"SPAN",{});var vr=a($i);Ba=l(vr,"VersatileDiffusionDualGuidedPipeline"),vr.forEach(i),ys.forEach(i),es=d(t),q=n(t,"DIV",{class:!0});var Q=a(q);b(et.$$.fragment,Q),Ua=d(Q),tt=n(Q,"P",{});var xs=a(tt);Wa=l(xs,"This model inherits from "),Tt=n(xs,"A",{href:!0});var br=a(Tt);Ha=l(br,"DiffusionPipeline"),br.forEach(i),Ra=l(xs,`. 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.)`),xs.forEach(i),Qa=d(Q),U=n(Q,"DIV",{class:!0});var Ct=a(U);b(it.$$.fragment,Ct),Ka=d(Ct),Vi=n(Ct,"P",{});var Dr=a(Vi);Xa=l(Dr,"Function invoked when calling the pipeline for generation."),Dr.forEach(i),Ya=d(Ct),b(we.$$.fragment,Ct),Ct.forEach(i),Za=d(Q),W=n(Q,"DIV",{class:!0});var Nt=a(W);b(st.$$.fragment,Nt),Ja=d(Nt),Ii=n(Nt,"P",{});var wr=a(Ii);eo=l(wr,"Enable sliced attention computation."),wr.forEach(i),to=d(Nt),ki=n(Nt,"P",{});var yr=a(ki);io=l(yr,`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.`),yr.forEach(i),Nt.forEach(i),so=d(Q),ye=n(Q,"DIV",{class:!0});var Ps=a(ye);b(nt.$$.fragment,Ps),no=d(Ps),at=n(Ps,"P",{});var $s=a(at);ao=l($s,"Disable sliced attention computation. If "),Ti=n($s,"CODE",{});var xr=a(Ti);oo=l(xr,"enable_attention_slicing"),xr.forEach(i),ro=l($s,` was previously invoked, this method will go | |
| back to computing attention in one step.`),$s.forEach(i),Ps.forEach(i),Q.forEach(i),this.h()},h(){c(m,"name","hf:doc:metadata"),c(m,"content",JSON.stringify(Gr)),c(u,"id","versatilediffusion"),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","#versatilediffusion"),c(_,"class","relative group"),c(Pe,"href","https://arxiv.org/abs/2211.08332"),c(Pe,"rel","nofollow"),c(ne,"id","tips"),c(ne,"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(ne,"href","#tips"),c(K,"class","relative group"),c(ft,"href","./api/pipelines/stable_diffusion"),c(ae,"id","run-versatilediffusion"),c(ae,"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(ae,"href","#run-versatilediffusion"),c(X,"class","relative group"),c(ut,"href","/docs/diffusers/v0.10.2/en/api/pipelines/versatile_diffusion#diffusers.VersatileDiffusionPipeline"),c(gt,"href","/docs/diffusers/v0.10.2/en/api/pipelines/versatile_diffusion#diffusers.VersatileDiffusionPipeline.text_to_image"),c(mt,"href","/docs/diffusers/v0.10.2/en/api/pipelines/versatile_diffusion#diffusers.VersatileDiffusionPipeline.image_variation"),c(ht,"href","/docs/diffusers/v0.10.2/en/api/pipelines/versatile_diffusion#diffusers.VersatileDiffusionPipeline.dual_guided"),c(oe,"href","/docs/diffusers/v0.10.2/en/api/pipelines/versatile_diffusion#diffusers.VersatileDiffusionTextToImagePipeline.__call__"),c(re,"href","/docs/diffusers/v0.10.2/en/api/pipelines/versatile_diffusion#diffusers.VersatileDiffusionImageVariationPipeline.__call__"),c(le,"href","/docs/diffusers/v0.10.2/en/api/pipelines/versatile_diffusion#diffusers.VersatileDiffusionDualGuidedPipeline.__call__"),c(pe,"id","how-to-load-and-use-different-schedulers"),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","#how-to-load-and-use-different-schedulers"),c(Y,"class","relative group"),c(bt,"href","/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.DDIMScheduler"),c(Dt,"href","/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.PNDMScheduler"),c(wt,"href","/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.LMSDiscreteScheduler"),c(yt,"href","/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.EulerDiscreteScheduler"),c(xt,"href","/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.EulerAncestralDiscreteScheduler"),c(Pt,"href","/docs/diffusers/v0.10.2/en/using-diffusers/configuration#diffusers.ConfigMixin.from_config"),c($t,"href","/docs/diffusers/v0.10.2/en/api/schedulers#diffusers.EulerDiscreteScheduler"),c(de,"id","diffusers.VersatileDiffusionPipeline"),c(de,"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(de,"href","#diffusers.VersatileDiffusionPipeline"),c(Z,"class","relative group"),c(Vt,"href","/docs/diffusers/v0.10.2/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),c(O,"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"),c(N,"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(ge,"id","diffusers.VersatileDiffusionTextToImagePipeline"),c(ge,"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(ge,"href","#diffusers.VersatileDiffusionTextToImagePipeline"),c(J,"class","relative group"),c(It,"href","/docs/diffusers/v0.10.2/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),c(z,"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(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(j,"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,"id","diffusers.VersatileDiffusionImageVariationPipeline"),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","#diffusers.VersatileDiffusionImageVariationPipeline"),c(ee,"class","relative group"),c(kt,"href","/docs/diffusers/v0.10.2/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),c(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),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(be,"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(De,"id","diffusers.VersatileDiffusionDualGuidedPipeline"),c(De,"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(De,"href","#diffusers.VersatileDiffusionDualGuidedPipeline"),c(te,"class","relative group"),c(Tt,"href","/docs/diffusers/v0.10.2/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),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(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(q,"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,f){e(document.head,m),g(t,$,f),g(t,_,f),e(_,u),e(u,P),D(o,P,null),e(_,h),e(_,Ft),e(Ft,Vs),g(t,Mi,f),g(t,se,f),e(se,Is),e(se,Pe),e(Pe,ks),e(se,Ts),g(t,Li,f),g(t,pt,f),e(pt,js),g(t,Gi,f),g(t,dt,f),e(dt,Bt),e(Bt,Es),g(t,Oi,f),g(t,K,f),e(K,ne),e(ne,Ut),D($e,Ut,null),e(K,qs),e(K,Wt),e(Wt,Ss),g(t,Ci,f),g(t,ct,f),e(ct,Ve),e(Ve,Ms),e(Ve,ft),e(ft,Ls),e(Ve,Gs),g(t,Ni,f),g(t,X,f),e(X,ae),e(ae,Ht),D(Ie,Ht,null),e(X,Os),e(X,Rt),e(Rt,Cs),g(t,zi,f),g(t,M,f),e(M,Ns),e(M,ut),e(ut,zs),e(M,As),e(M,gt),e(gt,Fs),e(M,Bs),e(M,mt),e(mt,Us),e(M,Ws),e(M,ht),e(ht,Hs),g(t,Ai,f),g(t,_t,f),e(_t,Qt),e(Qt,Rs),g(t,Fi,f),g(t,vt,f),e(vt,Qs),g(t,Bi,f),g(t,G,f),e(G,ke),e(ke,Kt),e(Kt,Ks),e(ke,Xs),e(ke,oe),e(oe,Ys),e(oe,Xt),e(Xt,Zs),e(oe,Js),e(G,en),e(G,Te),e(Te,Yt),e(Yt,tn),e(Te,sn),e(Te,re),e(re,nn),e(re,Zt),e(Zt,an),e(re,on),e(G,rn),e(G,je),e(je,Jt),e(Jt,ln),e(je,pn),e(je,le),e(le,dn),e(le,ei),e(ei,cn),e(le,fn),g(t,Ui,f),g(t,Y,f),e(Y,pe),e(pe,ti),D(Ee,ti,null),e(Y,un),e(Y,ii),e(ii,gn),g(t,Wi,f),g(t,V,f),e(V,mn),e(V,bt),e(bt,hn),e(V,_n),e(V,si),e(si,vn),e(V,bn),e(V,Dt),e(Dt,Dn),e(V,wn),e(V,wt),e(wt,yn),e(V,xn),e(V,yt),e(yt,Pn),e(V,$n),e(V,xt),e(xt,Vn),e(V,In),e(V,Pt),e(Pt,kn),e(V,Tn),e(V,ni),e(ni,jn),e(V,En),e(V,ai),e(ai,qn),e(V,Sn),e(V,$t),e($t,Mn),e(V,Ln),g(t,Hi,f),D(qe,t,f),g(t,Ri,f),g(t,Z,f),e(Z,de),e(de,oi),D(Se,oi,null),e(Z,Gn),e(Z,ri),e(ri,On),g(t,Qi,f),g(t,k,f),D(Me,k,null),e(k,Cn),e(k,li),e(li,Nn),e(k,zn),e(k,Le),e(Le,An),e(Le,Vt),e(Vt,Fn),e(Le,Bn),e(k,Un),e(k,O),D(Ge,O,null),e(O,Wn),e(O,pi),e(pi,Hn),e(O,Rn),D(ce,O,null),e(k,Qn),e(k,C),D(Oe,C,null),e(C,Kn),e(C,di),e(di,Xn),e(C,Yn),D(fe,C,null),e(k,Zn),e(k,N),D(Ce,N,null),e(N,Jn),e(N,ci),e(ci,ea),e(N,ta),D(ue,N,null),g(t,Ki,f),g(t,J,f),e(J,ge),e(ge,fi),D(Ne,fi,null),e(J,ia),e(J,ui),e(ui,sa),g(t,Xi,f),g(t,j,f),D(ze,j,null),e(j,na),e(j,Ae),e(Ae,aa),e(Ae,It),e(It,oa),e(Ae,ra),e(j,la),e(j,z),D(Fe,z,null),e(z,pa),e(z,gi),e(gi,da),e(z,ca),D(me,z,null),e(j,fa),e(j,A),D(Be,A,null),e(A,ua),e(A,mi),e(mi,ga),e(A,ma),e(A,hi),e(hi,ha),e(j,_a),e(j,he),D(Ue,he,null),e(he,va),e(he,We),e(We,ba),e(We,_i),e(_i,Da),e(We,wa),g(t,Yi,f),g(t,ee,f),e(ee,_e),e(_e,vi),D(He,vi,null),e(ee,ya),e(ee,bi),e(bi,xa),g(t,Zi,f),g(t,E,f),D(Re,E,null),e(E,Pa),e(E,Qe),e(Qe,$a),e(Qe,kt),e(kt,Va),e(Qe,Ia),e(E,ka),e(E,F),D(Ke,F,null),e(F,Ta),e(F,Di),e(Di,ja),e(F,Ea),D(ve,F,null),e(E,qa),e(E,B),D(Xe,B,null),e(B,Sa),e(B,wi),e(wi,Ma),e(B,La),e(B,yi),e(yi,Ga),e(E,Oa),e(E,be),D(Ye,be,null),e(be,Ca),e(be,Ze),e(Ze,Na),e(Ze,xi),e(xi,za),e(Ze,Aa),g(t,Ji,f),g(t,te,f),e(te,De),e(De,Pi),D(Je,Pi,null),e(te,Fa),e(te,$i),e($i,Ba),g(t,es,f),g(t,q,f),D(et,q,null),e(q,Ua),e(q,tt),e(tt,Wa),e(tt,Tt),e(Tt,Ha),e(tt,Ra),e(q,Qa),e(q,U),D(it,U,null),e(U,Ka),e(U,Vi),e(Vi,Xa),e(U,Ya),D(we,U,null),e(q,Za),e(q,W),D(st,W,null),e(W,Ja),e(W,Ii),e(Ii,eo),e(W,to),e(W,ki),e(ki,io),e(q,so),e(q,ye),D(nt,ye,null),e(ye,no),e(ye,at),e(at,ao),e(at,Ti),e(Ti,oo),e(at,ro),ts=!0},p(t,[f]){const ot={};f&2&&(ot.$$scope={dirty:f,ctx:t}),ce.$set(ot);const ji={};f&2&&(ji.$$scope={dirty:f,ctx:t}),fe.$set(ji);const Ei={};f&2&&(Ei.$$scope={dirty:f,ctx:t}),ue.$set(Ei);const qi={};f&2&&(qi.$$scope={dirty:f,ctx:t}),me.$set(qi);const rt={};f&2&&(rt.$$scope={dirty:f,ctx:t}),ve.$set(rt);const Si={};f&2&&(Si.$$scope={dirty:f,ctx:t}),we.$set(Si)},i(t){ts||(w(o.$$.fragment,t),w($e.$$.fragment,t),w(Ie.$$.fragment,t),w(Ee.$$.fragment,t),w(qe.$$.fragment,t),w(Se.$$.fragment,t),w(Me.$$.fragment,t),w(Ge.$$.fragment,t),w(ce.$$.fragment,t),w(Oe.$$.fragment,t),w(fe.$$.fragment,t),w(Ce.$$.fragment,t),w(ue.$$.fragment,t),w(Ne.$$.fragment,t),w(ze.$$.fragment,t),w(Fe.$$.fragment,t),w(me.$$.fragment,t),w(Be.$$.fragment,t),w(Ue.$$.fragment,t),w(He.$$.fragment,t),w(Re.$$.fragment,t),w(Ke.$$.fragment,t),w(ve.$$.fragment,t),w(Xe.$$.fragment,t),w(Ye.$$.fragment,t),w(Je.$$.fragment,t),w(et.$$.fragment,t),w(it.$$.fragment,t),w(we.$$.fragment,t),w(st.$$.fragment,t),w(nt.$$.fragment,t),ts=!0)},o(t){y(o.$$.fragment,t),y($e.$$.fragment,t),y(Ie.$$.fragment,t),y(Ee.$$.fragment,t),y(qe.$$.fragment,t),y(Se.$$.fragment,t),y(Me.$$.fragment,t),y(Ge.$$.fragment,t),y(ce.$$.fragment,t),y(Oe.$$.fragment,t),y(fe.$$.fragment,t),y(Ce.$$.fragment,t),y(ue.$$.fragment,t),y(Ne.$$.fragment,t),y(ze.$$.fragment,t),y(Fe.$$.fragment,t),y(me.$$.fragment,t),y(Be.$$.fragment,t),y(Ue.$$.fragment,t),y(He.$$.fragment,t),y(Re.$$.fragment,t),y(Ke.$$.fragment,t),y(ve.$$.fragment,t),y(Xe.$$.fragment,t),y(Ye.$$.fragment,t),y(Je.$$.fragment,t),y(et.$$.fragment,t),y(it.$$.fragment,t),y(we.$$.fragment,t),y(st.$$.fragment,t),y(nt.$$.fragment,t),ts=!1},d(t){i(m),t&&i($),t&&i(_),x(o),t&&i(Mi),t&&i(se),t&&i(Li),t&&i(pt),t&&i(Gi),t&&i(dt),t&&i(Oi),t&&i(K),x($e),t&&i(Ci),t&&i(ct),t&&i(Ni),t&&i(X),x(Ie),t&&i(zi),t&&i(M),t&&i(Ai),t&&i(_t),t&&i(Fi),t&&i(vt),t&&i(Bi),t&&i(G),t&&i(Ui),t&&i(Y),x(Ee),t&&i(Wi),t&&i(V),t&&i(Hi),x(qe,t),t&&i(Ri),t&&i(Z),x(Se),t&&i(Qi),t&&i(k),x(Me),x(Ge),x(ce),x(Oe),x(fe),x(Ce),x(ue),t&&i(Ki),t&&i(J),x(Ne),t&&i(Xi),t&&i(j),x(ze),x(Fe),x(me),x(Be),x(Ue),t&&i(Yi),t&&i(ee),x(He),t&&i(Zi),t&&i(E),x(Re),x(Ke),x(ve),x(Xe),x(Ye),t&&i(Ji),t&&i(te),x(Je),t&&i(es),t&&i(q),x(et),x(it),x(we),x(st),x(nt)}}}const Gr={local:"versatilediffusion",sections:[{local:"tips",sections:[{local:"run-versatilediffusion",title:"*Run VersatileDiffusion*"},{local:"how-to-load-and-use-different-schedulers",title:"*How to load and use different schedulers.*"}],title:"Tips"},{local:"diffusers.VersatileDiffusionPipeline",title:"VersatileDiffusionPipeline"},{local:"diffusers.VersatileDiffusionTextToImagePipeline",title:"VersatileDiffusionTextToImagePipeline"},{local:"diffusers.VersatileDiffusionImageVariationPipeline",title:"VersatileDiffusionImageVariationPipeline"},{local:"diffusers.VersatileDiffusionDualGuidedPipeline",title:"VersatileDiffusionDualGuidedPipeline"}],title:"VersatileDiffusion"};function Or(S){return kr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Br extends Pr{constructor(m){super();$r(this,m,Or,Lr,Vr,{})}}export{Br as default,Gr as metadata}; | |
Xet Storage Details
- Size:
- 114 kB
- Xet hash:
- c31277bce276e1c9ac62fc1b596a2817e91905e04db07d093a345d1412fb6bcb
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.