import{S as ku,i as wu,s as vu,e as a,k as l,w as h,t as s,M as Mu,c as i,d as t,m as p,a as o,x as y,h as r,b as g,N as nl,G as n,g as m,y as _,q as b,o as k,B as w,v as Tu,L as Wn}from"../../../chunks/vendor-hf-doc-builder.js";import{T as Iu}from"../../../chunks/Tip-hf-doc-builder.js";import{D as J}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as P}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as $}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Gn}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ju(V){let f,I,M,u,T,c,v,ke,S,qe,j,Y,we,En,D,ve,xn,L,Me,$n,z,Qe,A;return{c(){f=a("p"),I=s("To generate images directly from a single pipeline, you can use "),M=a("a"),u=s("KandinskyV22CombinedPipeline"),T=s(", "),c=a("a"),v=s("KandinskyV22Img2ImgCombinedPipeline"),ke=s(", "),S=a("a"),qe=s("KandinskyV22InpaintCombinedPipeline"),j=s(`.
These combined pipelines wrap the `),Y=a("a"),we=s("KandinskyV22PriorPipeline"),En=s(" and "),D=a("a"),ve=s("KandinskyV22Pipeline"),xn=s(", "),L=a("a"),Me=s("KandinskyV22Img2ImgPipeline"),$n=s(", "),z=a("a"),Qe=s("KandinskyV22InpaintPipeline"),A=s(` respectively into a single
pipeline for a simpler user experience`),this.h()},l(Te){f=i(Te,"P",{});var U=o(f);I=r(U,"To generate images directly from a single pipeline, you can use "),M=i(U,"A",{href:!0});var H=o(M);u=r(H,"KandinskyV22CombinedPipeline"),H.forEach(t),T=r(U,", "),c=i(U,"A",{href:!0});var Bn=o(c);v=r(Bn,"KandinskyV22Img2ImgCombinedPipeline"),Bn.forEach(t),ke=r(U,", "),S=i(U,"A",{href:!0});var Ie=o(S);qe=r(Ie,"KandinskyV22InpaintCombinedPipeline"),Ie.forEach(t),j=r(U,`.
These combined pipelines wrap the `),Y=i(U,"A",{href:!0});var ma=o(Y);we=r(ma,"KandinskyV22PriorPipeline"),ma.forEach(t),En=r(U," and "),D=i(U,"A",{href:!0});var Kn=o(D);ve=r(Kn,"KandinskyV22Pipeline"),Kn.forEach(t),xn=r(U,", "),L=i(U,"A",{href:!0});var Je=o(L);Me=r(Je,"KandinskyV22Img2ImgPipeline"),Je.forEach(t),$n=r(U,", "),z=i(U,"A",{href:!0});var ga=o(z);Qe=r(ga,"KandinskyV22InpaintPipeline"),ga.forEach(t),A=r(U,` respectively into a single
pipeline for a simpler user experience`),U.forEach(t),this.h()},h(){g(M,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22CombinedPipeline"),g(c,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22Img2ImgCombinedPipeline"),g(S,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22InpaintCombinedPipeline"),g(Y,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22PriorPipeline"),g(D,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22Pipeline"),g(L,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22Img2ImgPipeline"),g(z,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22InpaintPipeline")},m(Te,U){m(Te,f,U),n(f,I),n(f,M),n(M,u),n(f,T),n(f,c),n(c,v),n(f,ke),n(f,S),n(S,qe),n(f,j),n(f,Y),n(Y,we),n(f,En),n(f,D),n(D,ve),n(f,xn),n(f,L),n(L,Me),n(f,$n),n(f,z),n(z,Qe),n(f,A)},d(Te){Te&&t(f)}}}function Uu(V){let f,I,M,u,T;return u=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMlBpcGVsaW5lJTJDJTIwS2FuZGluc2t5VjIyUHJpb3JQaXBlbGluZSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLXByaW9yJTIyKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEFwcm9tcHQlMjAlM0QlMjAlMjJyZWQlMjBjYXQlMkMlMjA0ayUyMHBob3RvJTIyJTBBb3V0JTIwJTNEJTIwcGlwZV9wcmlvcihwcm9tcHQpJTBBaW1hZ2VfZW1iJTIwJTNEJTIwb3V0LmltYWdlX2VtYmVkcyUwQXplcm9faW1hZ2VfZW1iJTIwJTNEJTIwb3V0Lm5lZ2F0aXZlX2ltYWdlX2VtYmVkcyUwQXBpcGUlMjAlM0QlMjBLYW5kaW5za3lWMjJQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTItZGVjb2RlciUyMiklMEFwaXBlLnRvKCUyMmN1ZGElMjIpJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMGltYWdlX2VtYmVkcyUzRGltYWdlX2VtYiUyQyUwQSUyMCUyMCUyMCUyMG5lZ2F0aXZlX2ltYWdlX2VtYmVkcyUzRHplcm9faW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTAlMkMlMEEpLmltYWdlcyUwQWltYWdlJTVCMCU1RC5zYXZlKCUyMmNhdC5wbmclMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22Pipeline, KandinskyV22PriorPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe_prior = KandinskyV22PriorPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-prior&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe_prior.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;red cat, 4k photo&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>out = pipe_prior(prompt)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_emb = out.image_embeds
<span class="hljs-meta">&gt;&gt;&gt; </span>zero_image_emb = out.negative_image_embeds
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = KandinskyV22Pipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(
<span class="hljs-meta">... </span>    image_embeds=image_emb,
<span class="hljs-meta">... </span>    negative_image_embeds=zero_image_emb,
<span class="hljs-meta">... </span>    height=<span class="hljs-number">768</span>,
<span class="hljs-meta">... </span>    width=<span class="hljs-number">768</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">50</span>,
<span class="hljs-meta">... </span>).images
<span class="hljs-meta">&gt;&gt;&gt; </span>image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;cat.png&quot;</span>)`}}),{c(){f=a("p"),I=s("Examples:"),M=l(),h(u.$$.fragment)},l(c){f=i(c,"P",{});var v=o(f);I=r(v,"Examples:"),v.forEach(t),M=p(c),y(u.$$.fragment,c)},m(c,v){m(c,f,v),n(f,I),m(c,M,v),_(u,c,v),T=!0},p:Wn,i(c){T||(b(u.$$.fragment,c),T=!0)},o(c){k(u.$$.fragment,c),T=!1},d(c){c&&t(f),c&&t(M),w(u,c)}}}function Pu(V){let f,I,M,u,T;return u=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMlBpcGVsaW5lJTJDJTIwS2FuZGluc2t5VjIyUHJpb3JQaXBlbGluZSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLXByaW9yJTIyKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEFwcm9tcHQlMjAlM0QlMjAlMjJyZWQlMjBjYXQlMkMlMjA0ayUyMHBob3RvJTIyJTBBaW1hZ2VfZW1iJTJDJTIwbmVnYXRpdmVfaW1hZ2VfZW1iJTIwJTNEJTIwcGlwZV9wcmlvcihwcm9tcHQpLnRvX3R1cGxlKCklMEElMEFwaXBlJTIwJTNEJTIwS2FuZGluc2t5VjIyUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLWRlY29kZXIlMjIpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQWltYWdlJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWIlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0RuZWdhdGl2ZV9pbWFnZV9lbWIlMkMlMEElMjAlMjAlMjAlMjBoZWlnaHQlM0Q3NjglMkMlMEElMjAlMjAlMjAlMjB3aWR0aCUzRDc2OCUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q1MCUyQyUwQSkuaW1hZ2VzJTBBaW1hZ2UlNUIwJTVELnNhdmUoJTIyY2F0LnBuZyUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22Pipeline, KandinskyV22PriorPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe_prior = KandinskyV22PriorPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-prior&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe_prior.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;red cat, 4k photo&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_emb, negative_image_emb = pipe_prior(prompt).to_tuple()

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = KandinskyV22Pipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(
<span class="hljs-meta">... </span>    image_embeds=image_emb,
<span class="hljs-meta">... </span>    negative_image_embeds=negative_image_emb,
<span class="hljs-meta">... </span>    height=<span class="hljs-number">768</span>,
<span class="hljs-meta">... </span>    width=<span class="hljs-number">768</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">50</span>,
<span class="hljs-meta">... </span>).images
<span class="hljs-meta">&gt;&gt;&gt; </span>image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;cat.png&quot;</span>)`}}),{c(){f=a("p"),I=s("Examples:"),M=l(),h(u.$$.fragment)},l(c){f=i(c,"P",{});var v=o(f);I=r(v,"Examples:"),v.forEach(t),M=p(c),y(u.$$.fragment,c)},m(c,v){m(c,f,v),n(f,I),m(c,M,v),_(u,c,v),T=!0},p:Wn,i(c){T||(b(u.$$.fragment,c),T=!0)},o(c){k(u.$$.fragment,c),T=!1},d(c){c&&t(f),c&&t(M),w(u,c)}}}function Vu(V){let f,I,M,u,T;return u=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUlMkMlMjBLYW5kaW5za3lWMjJQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBaW1wb3J0JTIwUElMJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdG9yY2h2aXNpb24lMjBpbXBvcnQlMjB0cmFuc2Zvcm1zJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEFpbWcxJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZoZi1pbnRlcm5hbC10ZXN0aW5nJTJGZGlmZnVzZXJzLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTIyJTBBJTIwJTIwJTIwJTIwJTIyJTJGa2FuZGluc2t5JTJGY2F0LnBuZyUyMiUwQSklMEFpbWcyJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZoZi1pbnRlcm5hbC10ZXN0aW5nJTJGZGlmZnVzZXJzLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTIyJTBBJTIwJTIwJTIwJTIwJTIyJTJGa2FuZGluc2t5JTJGc3RhcnJ5X25pZ2h0LmpwZWclMjIlMEEpJTBBaW1hZ2VzX3RleHRzJTIwJTNEJTIwJTVCJTIyYSUyMGNhdCUyMiUyQyUyMGltZzElMkMlMjBpbWcyJTVEJTBBd2VpZ2h0cyUyMCUzRCUyMCU1QjAuMyUyQyUyMDAuMyUyQyUyMDAuNCU1RCUwQW91dCUyMCUzRCUyMHBpcGVfcHJpb3IuaW50ZXJwb2xhdGUoaW1hZ2VzX3RleHRzJTJDJTIwd2VpZ2h0cyklMEFwaXBlJTIwJTNEJTIwS2FuZGluc2t5VjIyUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLWRlY29kZXIlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQWltYWdlJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBpbWFnZV9lbWJlZHMlM0RvdXQuaW1hZ2VfZW1iZWRzJTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfaW1hZ2VfZW1iZWRzJTNEb3V0Lm5lZ2F0aXZlX2ltYWdlX2VtYmVkcyUyQyUwQSUyMCUyMCUyMCUyMGhlaWdodCUzRDc2OCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTBBKS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2Uuc2F2ZSglMjJzdGFycnlfY2F0LnBuZyUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22PriorPipeline, KandinskyV22Pipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> PIL
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> torchvision <span class="hljs-keyword">import</span> transforms

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe_prior = KandinskyV22PriorPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-prior&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe_prior.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>img1 = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main&quot;</span>
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;/kandinsky/cat.png&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>img2 = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main&quot;</span>
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;/kandinsky/starry_night.jpeg&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>images_texts = [<span class="hljs-string">&quot;a cat&quot;</span>, img1, img2]
<span class="hljs-meta">&gt;&gt;&gt; </span>weights = [<span class="hljs-number">0.3</span>, <span class="hljs-number">0.3</span>, <span class="hljs-number">0.4</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>out = pipe_prior.interpolate(images_texts, weights)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = KandinskyV22Pipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(
<span class="hljs-meta">... </span>    image_embeds=out.image_embeds,
<span class="hljs-meta">... </span>    negative_image_embeds=out.negative_image_embeds,
<span class="hljs-meta">... </span>    height=<span class="hljs-number">768</span>,
<span class="hljs-meta">... </span>    width=<span class="hljs-number">768</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">50</span>,
<span class="hljs-meta">... </span>).images[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>image.save(<span class="hljs-string">&quot;starry_cat.png&quot;</span>)`}}),{c(){f=a("p"),I=s("Examples:"),M=l(),h(u.$$.fragment)},l(c){f=i(c,"P",{});var v=o(f);I=r(v,"Examples:"),v.forEach(t),M=p(c),y(u.$$.fragment,c)},m(c,v){m(c,f,v),n(f,I),m(c,M,v),_(u,c,v),T=!0},p:Wn,i(c){T||(b(u.$$.fragment,c),T=!0)},o(c){k(u.$$.fragment,c),T=!1},d(c){c&&t(f),c&&t(M),w(u,c)}}}function ju(V){let f,I,M,u,T;return u=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMlBpcGVsaW5lJTJDJTIwS2FuZGluc2t5VjIyUHJpb3JFbWIyRW1iUGlwZWxpbmUlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXBpcGVfcHJpb3IlMjAlM0QlMjBLYW5kaW5za3lQcmlvclBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMi1wcmlvciUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFwaXBlX3ByaW9yLnRvKCUyMmN1ZGElMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIycmVkJTIwY2F0JTJDJTIwNGslMjBwaG90byUyMiUwQWltZyUyMCUzRCUyMGxvYWRfaW1hZ2UoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGaGYtaW50ZXJuYWwtdGVzdGluZyUyRmRpZmZ1c2Vycy1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyMiUwQSUyMCUyMCUyMCUyMCUyMiUyRmthbmRpbnNreSUyRmNhdC5wbmclMjIlMEEpJTBBaW1hZ2VfZW1iJTJDJTIwbmFnYXRpdmVfaW1hZ2VfZW1iJTIwJTNEJTIwcGlwZV9wcmlvcihwcm9tcHQlMkMlMjBpbWFnZSUzRGltZyUyQyUyMHN0cmVuZ3RoJTNEMC4yKS50b190dXBsZSgpJTBBJTBBcGlwZSUyMCUzRCUyMEthbmRpbnNreVBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMi1kZWNvZGVyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTIyJTBBKSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwaW1hZ2VfZW1iZWRzJTNEaW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfaW1hZ2VfZW1iZWRzJTNEbmVnYXRpdmVfaW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMTAwJTJDJTBBKS5pbWFnZXMlMEElMEFpbWFnZSU1QjAlNUQuc2F2ZSglMjJjYXQucG5nJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22Pipeline, KandinskyV22PriorEmb2EmbPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe_prior = KandinskyPriorPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-prior&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe_prior.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;red cat, 4k photo&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>img = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main&quot;</span>
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;/kandinsky/cat.png&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_emb, nagative_image_emb = pipe_prior(prompt, image=img, strength=<span class="hljs-number">0.2</span>).to_tuple()

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = KandinskyPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder, torch_dtype=torch.float16&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(
<span class="hljs-meta">... </span>    image_embeds=image_emb,
<span class="hljs-meta">... </span>    negative_image_embeds=negative_image_emb,
<span class="hljs-meta">... </span>    height=<span class="hljs-number">768</span>,
<span class="hljs-meta">... </span>    width=<span class="hljs-number">768</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">100</span>,
<span class="hljs-meta">... </span>).images

<span class="hljs-meta">&gt;&gt;&gt; </span>image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;cat.png&quot;</span>)`}}),{c(){f=a("p"),I=s("Examples:"),M=l(),h(u.$$.fragment)},l(c){f=i(c,"P",{});var v=o(f);I=r(v,"Examples:"),v.forEach(t),M=p(c),y(u.$$.fragment,c)},m(c,v){m(c,f,v),n(f,I),m(c,M,v),_(u,c,v),T=!0},p:Wn,i(c){T||(b(u.$$.fragment,c),T=!0)},o(c){k(u.$$.fragment,c),T=!1},d(c){c&&t(f),c&&t(M),w(u,c)}}}function Cu(V){let f,I,M,u,T;return u=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMlByaW9yRW1iMkVtYlBpcGVsaW5lJTJDJTIwS2FuZGluc2t5VjIyUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQWltcG9ydCUyMFBJTCUwQSUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMHRvcmNodmlzaW9uJTIwaW1wb3J0JTIwdHJhbnNmb3JtcyUwQSUwQXBpcGVfcHJpb3IlMjAlM0QlMjBLYW5kaW5za3lWMjJQcmlvclBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMi1wcmlvciUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFwaXBlX3ByaW9yLnRvKCUyMmN1ZGElMjIpJTBBJTBBaW1nMSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGaGYtaW50ZXJuYWwtdGVzdGluZyUyRmRpZmZ1c2Vycy1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyMiUwQSUyMCUyMCUyMCUyMCUyMiUyRmthbmRpbnNreSUyRmNhdC5wbmclMjIlMEEpJTBBJTBBaW1nMiUyMCUzRCUyMGxvYWRfaW1hZ2UoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGaGYtaW50ZXJuYWwtdGVzdGluZyUyRmRpZmZ1c2Vycy1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyMiUwQSUyMCUyMCUyMCUyMCUyMiUyRmthbmRpbnNreSUyRnN0YXJyeV9uaWdodC5qcGVnJTIyJTBBKSUwQSUwQWltYWdlc190ZXh0cyUyMCUzRCUyMCU1QiUyMmElMjBjYXQlMjIlMkMlMjBpbWcxJTJDJTIwaW1nMiU1RCUwQXdlaWdodHMlMjAlM0QlMjAlNUIwLjMlMkMlMjAwLjMlMkMlMjAwLjQlNUQlMEFpbWFnZV9lbWIlMkMlMjB6ZXJvX2ltYWdlX2VtYiUyMCUzRCUyMHBpcGVfcHJpb3IuaW50ZXJwb2xhdGUoaW1hZ2VzX3RleHRzJTJDJTIwd2VpZ2h0cyklMEElMEFwaXBlJTIwJTNEJTIwS2FuZGluc2t5VjIyUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLWRlY29kZXIlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWIlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0R6ZXJvX2ltYWdlX2VtYiUyQyUwQSUyMCUyMCUyMCUyMGhlaWdodCUzRDc2OCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDE1MCUyQyUwQSkuaW1hZ2VzJTVCMCU1RCUwQSUwQWltYWdlLnNhdmUoJTIyc3RhcnJ5X2NhdC5wbmclMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22PriorEmb2EmbPipeline, KandinskyV22Pipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> PIL

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> torchvision <span class="hljs-keyword">import</span> transforms

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe_prior = KandinskyV22PriorPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-prior&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe_prior.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>img1 = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main&quot;</span>
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;/kandinsky/cat.png&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>img2 = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main&quot;</span>
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;/kandinsky/starry_night.jpeg&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>images_texts = [<span class="hljs-string">&quot;a cat&quot;</span>, img1, img2]
<span class="hljs-meta">&gt;&gt;&gt; </span>weights = [<span class="hljs-number">0.3</span>, <span class="hljs-number">0.3</span>, <span class="hljs-number">0.4</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>image_emb, zero_image_emb = pipe_prior.interpolate(images_texts, weights)

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = KandinskyV22Pipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(
<span class="hljs-meta">... </span>    image_embeds=image_emb,
<span class="hljs-meta">... </span>    negative_image_embeds=zero_image_emb,
<span class="hljs-meta">... </span>    height=<span class="hljs-number">768</span>,
<span class="hljs-meta">... </span>    width=<span class="hljs-number">768</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">150</span>,
<span class="hljs-meta">... </span>).images[<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image.save(<span class="hljs-string">&quot;starry_cat.png&quot;</span>)`}}),{c(){f=a("p"),I=s("Examples:"),M=l(),h(u.$$.fragment)},l(c){f=i(c,"P",{});var v=o(f);I=r(v,"Examples:"),v.forEach(t),M=p(c),y(u.$$.fragment,c)},m(c,v){m(c,f,v),n(f,I),m(c,M,v),_(u,c,v),T=!0},p:Wn,i(c){T||(b(u.$$.fragment,c),T=!0)},o(c){k(u.$$.fragment,c),T=!1},d(c){c&&t(f),c&&t(M),w(u,c)}}}function Zu(V){let f,I,M,u,T;return u=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvclRleHQySW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXBpcGUlMjAlM0QlMjBBdXRvUGlwZWxpbmVGb3JUZXh0MkltYWdlLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMi1kZWNvZGVyJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwbGlvbiUyMGluJTIwZ2FsYXhpZXMlMkMlMjBzcGlyYWxzJTJDJTIwbmVidWxhZSUyQyUyMHN0YXJzJTJDJTIwc21va2UlMkMlMjBpcmlkZXNjZW50JTJDJTIwaW50cmljYXRlJTIwZGV0YWlsJTJDJTIwb2N0YW5lJTIwcmVuZGVyJTJDJTIwOGslMjIlMEElMEFpbWFnZSUyMCUzRCUyMHBpcGUocHJvbXB0JTNEcHJvbXB0JTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDI1KS5pbWFnZXMlNUIwJTVE",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForText2Image
<span class="hljs-keyword">import</span> torch

pipe = AutoPipelineForText2Image.from_pretrained(
    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder&quot;</span>, torch_dtype=torch.float16
)
pipe.enable_model_cpu_offload()

prompt = <span class="hljs-string">&quot;A lion in galaxies, spirals, nebulae, stars, smoke, iridescent, intricate detail, octane render, 8k&quot;</span>

image = pipe(prompt=prompt, num_inference_steps=<span class="hljs-number">25</span>).images[<span class="hljs-number">0</span>]`}}),{c(){f=a("p"),I=s("Examples:"),M=l(),h(u.$$.fragment)},l(c){f=i(c,"P",{});var v=o(f);I=r(v,"Examples:"),v.forEach(t),M=p(c),y(u.$$.fragment,c)},m(c,v){m(c,f,v),n(f,I),m(c,M,v),_(u,c,v),T=!0},p:Wn,i(c){T||(b(u.$$.fragment,c),T=!0)},o(c){k(u.$$.fragment,c),T=!1},d(c){c&&t(f),c&&t(M),w(u,c)}}}function Gu(V){let f,I,M,u,T;return u=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvckltYWdlMkltYWdlJTBBaW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjBvcyUwQSUwQXBpcGUlMjAlM0QlMjBBdXRvUGlwZWxpbmVGb3JJbWFnZTJJbWFnZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTItZGVjb2RlciUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMGZhbnRhc3klMjBsYW5kc2NhcGUlMkMlMjBDaW5lbWF0aWMlMjBsaWdodGluZyUyMiUwQW5lZ2F0aXZlX3Byb21wdCUyMCUzRCUyMCUyMmxvdyUyMHF1YWxpdHklMkMlMjBiYWQlMjBxdWFsaXR5JTIyJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZyYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tJTJGQ29tcFZpcyUyRnN0YWJsZS1kaWZmdXNpb24lMkZtYWluJTJGYXNzZXRzJTJGc3RhYmxlLXNhbXBsZXMlMkZpbWcyaW1nJTJGc2tldGNoLW1vdW50YWlucy1pbnB1dC5qcGclMjIlMEElMEFyZXNwb25zZSUyMCUzRCUyMHJlcXVlc3RzLmdldCh1cmwpJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKEJ5dGVzSU8ocmVzcG9uc2UuY29udGVudCkpLmNvbnZlcnQoJTIyUkdCJTIyKSUwQWltYWdlLnRodW1ibmFpbCgoNzY4JTJDJTIwNzY4KSklMEElMEFpbWFnZSUyMCUzRCUyMHBpcGUocHJvbXB0JTNEcHJvbXB0JTJDJTIwaW1hZ2UlM0RvcmlnaW5hbF9pbWFnZSUyQyUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QyNSkuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForImage2Image
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> requests
<span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> os

pipe = AutoPipelineForImage2Image.from_pretrained(
    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder&quot;</span>, torch_dtype=torch.float16
)
pipe.enable_model_cpu_offload()

prompt = <span class="hljs-string">&quot;A fantasy landscape, Cinematic lighting&quot;</span>
negative_prompt = <span class="hljs-string">&quot;low quality, bad quality&quot;</span>

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

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

image = pipe(prompt=prompt, image=original_image, num_inference_steps=<span class="hljs-number">25</span>).images[<span class="hljs-number">0</span>]`}}),{c(){f=a("p"),I=s("Examples:"),M=l(),h(u.$$.fragment)},l(c){f=i(c,"P",{});var v=o(f);I=r(v,"Examples:"),v.forEach(t),M=p(c),y(u.$$.fragment,c)},m(c,v){m(c,f,v),n(f,I),m(c,M,v),_(u,c,v),T=!0},p:Wn,i(c){T||(b(u.$$.fragment,c),T=!0)},o(c){k(u.$$.fragment,c),T=!1},d(c){c&&t(f),c&&t(M),w(u,c)}}}function Wu(V){let f,I,M,u,T;return u=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvcklucGFpbnRpbmclMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQWltcG9ydCUyMHRvcmNoJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBcGlwZSUyMCUzRCUyMEF1dG9QaXBlbGluZUZvcklucGFpbnRpbmcuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLWRlY29kZXItaW5wYWludCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMGZhbnRhc3klMjBsYW5kc2NhcGUlMkMlMjBDaW5lbWF0aWMlMjBsaWdodGluZyUyMiUwQW5lZ2F0aXZlX3Byb21wdCUyMCUzRCUyMCUyMmxvdyUyMHF1YWxpdHklMkMlMjBiYWQlMjBxdWFsaXR5JTIyJTBBJTBBb3JpZ2luYWxfaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmhmLWludGVybmFsLXRlc3RpbmclMkZkaWZmdXNlcnMtaW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMjIlMjAlMjIlMkZrYW5kaW5za3klMkZjYXQucG5nJTIyJTBBKSUwQSUwQW1hc2slMjAlM0QlMjBucC56ZXJvcygoNzY4JTJDJTIwNzY4KSUyQyUyMGR0eXBlJTNEbnAuZmxvYXQzMiklMEElMjMlMjBMZXQncyUyMG1hc2slMjBvdXQlMjBhbiUyMGFyZWElMjBhYm92ZSUyMHRoZSUyMGNhdCdzJTIwaGVhZCUwQW1hc2slNUIlM0EyNTAlMkMlMjAyNTAlM0EtMjUwJTVEJTIwJTNEJTIwMSUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlM0Rwcm9tcHQlMkMlMjBpbWFnZSUzRG9yaWdpbmFsX2ltYWdlJTJDJTIwbWFza19pbWFnZSUzRG1hc2slMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMjUpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForInpainting
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

pipe = AutoPipelineForInpainting.from_pretrained(
    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder-inpaint&quot;</span>, torch_dtype=torch.float16
)
pipe.enable_model_cpu_offload()

prompt = <span class="hljs-string">&quot;A fantasy landscape, Cinematic lighting&quot;</span>
negative_prompt = <span class="hljs-string">&quot;low quality, bad quality&quot;</span>

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

mask = np.zeros((<span class="hljs-number">768</span>, <span class="hljs-number">768</span>), dtype=np.float32)
<span class="hljs-comment"># Let&#x27;s mask out an area above the cat&#x27;s head</span>
mask[:<span class="hljs-number">250</span>, <span class="hljs-number">250</span>:-<span class="hljs-number">250</span>] = <span class="hljs-number">1</span>

image = pipe(prompt=prompt, image=original_image, mask_image=mask, num_inference_steps=<span class="hljs-number">25</span>).images[<span class="hljs-number">0</span>]`}}),{c(){f=a("p"),I=s("Examples:"),M=l(),h(u.$$.fragment)},l(c){f=i(c,"P",{});var v=o(f);I=r(v,"Examples:"),v.forEach(t),M=p(c),y(u.$$.fragment,c)},m(c,v){m(c,f,v),n(f,I),m(c,M,v),_(u,c,v),T=!0},p:Wn,i(c){T||(b(u.$$.fragment,c),T=!0)},o(c){k(u.$$.fragment,c),T=!1},d(c){c&&t(f),c&&t(M),w(u,c)}}}function Eu(V){let f,I,M,u,T,c,v,ke,S,qe,j,Y,we,En,D,ve,xn,L,Me,$n,z,Qe,A,Te,U,H,Bn,Ie,ma,Kn,Je,ga,ns,Fn,ts,Se,tl,ci,al,il,as,Nn,is,Ye,ol,mi,sl,rl,os,Rn,ss,fa,ua,Gm,rs,ha,ll,ls,Ue,De,gi,Xn,pl,fi,dl,ps,Le,cl,ya,ml,gl,ds,_a,fl,cs,qn,ms,ba,ka,Wm,gs,ze,ul,ui,hl,yl,fs,Qn,us,wa,_l,hs,Sn,ys,va,bl,_s,Yn,bs,Ae,kl,hi,wl,vl,ks,Dn,ws,Ln,Ml,Ma,Em,vs,Pe,He,yi,zn,Tl,_i,Il,Ms,O,Jl,Ta,Ul,Pl,Ia,Vl,jl,Ts,Ja,Cl,Is,Ua,Zl,Js,An,Us,Pa,Gl,Ps,Va,ja,xm,Vs,Ve,Oe,bi,Hn,Wl,ki,El,js,B,xl,Ca,$l,Bl,Za,Kl,Fl,Ga,Nl,Rl,Wa,Xl,ql,Cs,Ea,Ql,Zs,en,Sl,On,wi,Yl,Dl,Gs,et,Ws,nn,Ll,nt,zl,Al,Es,xa,Hl,xs,tt,$s,ee,Ol,vi,ep,np,Mi,tp,ap,Bs,at,Ks,ne,ip,Ti,op,sp,Ii,rp,lp,Fs,it,Ns,tn,pp,ot,dp,cp,Rs,an,Xs,je,on,Ji,st,mp,Ui,gp,qs,sn,Pi,rt,Vi,fp,up,ji,hp,yp,C,lt,Ci,pt,_p,bp,Zi,Gi,kp,wp,dt,Wi,ct,vp,Mp,Ei,xi,Tp,Ip,mt,$i,gt,Jp,Up,Bi,Ki,Pp,Vp,ft,Fi,ut,jp,Cp,Ni,Ri,Zp,Gp,ht,Xi,yt,Wp,Ep,qi,Qi,xp,$p,_t,Si,bt,Bp,Kp,Yi,Di,Fp,Qs,Ce,rn,Li,kt,Np,zi,Rp,Ss,K,wt,Xp,Ai,qp,Qp,vt,Sp,$a,Yp,Dp,Lp,te,Mt,zp,Hi,Ap,Hp,ln,Ys,Ze,pn,Oi,Tt,Op,eo,ed,Ds,F,It,nd,no,td,ad,Jt,id,Ba,od,sd,rd,ae,Ut,ld,to,pd,dd,ao,cd,Ls,Ge,dn,io,Pt,md,oo,gd,zs,N,Vt,fd,so,ud,hd,jt,yd,Ka,_d,bd,kd,ie,Ct,wd,ro,vd,Md,lo,Td,As,We,cn,po,Zt,Id,co,Jd,Hs,R,Gt,Ud,mo,Pd,Vd,Wt,jd,Fa,Cd,Zd,Gd,oe,Et,Wd,go,Ed,xd,fo,$d,Os,Ee,mn,uo,xt,Bd,ho,Kd,er,X,$t,Fd,yo,Nd,Rd,Bt,Xd,Na,qd,Qd,Sd,se,Kt,Yd,_o,Dd,Ld,bo,zd,nr,xe,gn,ko,Ft,Ad,wo,Hd,tr,Z,Nt,Od,vo,ec,nc,Rt,tc,Ra,ac,ic,oc,re,Xt,sc,Mo,rc,lc,fn,pc,le,qt,dc,To,cc,mc,un,ar,$e,hn,Io,Qt,gc,Jo,fc,ir,G,St,uc,Uo,hc,yc,Yt,_c,Xa,bc,kc,wc,pe,Dt,vc,Po,Mc,Tc,yn,Ic,de,Lt,Jc,Vo,Uc,Pc,_n,or,Be,bn,jo,zt,Vc,Co,jc,sr,W,At,Cc,Zo,Zc,Gc,Ht,Wc,qa,Ec,xc,$c,ce,Ot,Bc,Go,Kc,Fc,kn,Nc,wn,ea,Rc,Ke,Xc,Wo,qc,Qc,Eo,Sc,Yc,rr,Fe,vn,xo,na,Dc,$o,Lc,lr,E,ta,zc,Bo,Ac,Hc,aa,Oc,Qa,em,nm,tm,me,ia,am,Ko,im,om,Mn,sm,Tn,oa,rm,Ne,lm,Fo,pm,dm,No,cm,mm,pr,Re,In,Ro,sa,gm,Xo,fm,dr,x,ra,um,qo,hm,ym,la,_m,Sa,bm,km,wm,ge,pa,vm,Qo,Mm,Tm,Jn,Im,Un,da,Jm,Xe,Um,So,Pm,Vm,Yo,jm,Cm,cr;return c=new $({}),H=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvclRleHQySW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXBpcGUlMjAlM0QlMjBBdXRvUGlwZWxpbmVGb3JUZXh0MkltYWdlLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMi1kZWNvZGVyJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXBpcGUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwYWxpZW4lMjBjaGVlc2VidXJnZXIlMjBjcmVhdHVyZSUyMGVhdGluZyUyMGl0c2VsZiUyQyUyMGNsYXltYXRpb24lMkMlMjBjaW5lbWF0aWMlMkMlMjBtb29keSUyMGxpZ2h0aW5nJTIyJTBBbmVnYXRpdmVfcHJvbXB0JTIwJTNEJTIwJTIybG93JTIwcXVhbGl0eSUyQyUyMGJhZCUyMHF1YWxpdHklMjIlMEElMEFpbWFnZSUyMCUzRCUyMHBpcGUocHJvbXB0JTNEcHJvbXB0JTJDJTIwbmVnYXRpdmVfcHJvbXB0JTNEbmVnYXRpdmVfcHJvbXB0JTJDJTIwcHJpb3JfZ3VpZGFuY2Vfc2NhbGUlMjAlM0QxLjAlMkMlMjBoZWlnaHQlM0Q3NjglMkMlMjB3aWR0aCUzRDc2OCkuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForText2Image
<span class="hljs-keyword">import</span> torch

pipe = AutoPipelineForText2Image.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder&quot;</span>, torch_dtype=torch.float16)
pipe.enable_model_cpu_offload()

prompt = <span class="hljs-string">&quot;A alien cheeseburger creature eating itself, claymation, cinematic, moody lighting&quot;</span>
negative_prompt = <span class="hljs-string">&quot;low quality, bad quality&quot;</span>

image = pipe(prompt=prompt, negative_prompt=negative_prompt, prior_guidance_scale =<span class="hljs-number">1.0</span>, height=<span class="hljs-number">768</span>, width=<span class="hljs-number">768</span>).images[<span class="hljs-number">0</span>]`}}),Fn=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlX3ByaW9yJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEF0MmlfcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMi1kZWNvZGVyJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXQyaV9waXBlLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">import</span> torch

pipe_prior = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-prior&quot;</span>, torch_dtype=torch.float16)
pipe_prior.to(<span class="hljs-string">&quot;cuda&quot;</span>)

t2i_pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder&quot;</span>, torch_dtype=torch.float16)
t2i_pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),Nn=new P({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIycG9ydHJhaXQlMjBvZiUyMGElMjB3b21lbiUyQyUyMGJsdWUlMjBleWVzJTJDJTIwY2luZW1hdGljJTIyJTBBbmVnYXRpdmVfcHJvbXB0JTIwJTNEJTIwJTIybG93JTIwcXVhbGl0eSUyQyUyMGJhZCUyMHF1YWxpdHklMjIlMEElMEFpbWFnZV9lbWJlZHMlMkMlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlMjAlM0QlMjBwaXBlX3ByaW9yKHByb21wdCUyQyUyMGd1aWRhbmNlX3NjYWxlJTNEMS4wKS50b190dXBsZSgp",highlighted:`prompt = <span class="hljs-string">&quot;portrait of a women, blue eyes, cinematic&quot;</span>
negative_prompt = <span class="hljs-string">&quot;low quality, bad quality&quot;</span>

image_embeds, negative_image_embeds = pipe_prior(prompt, guidance_scale=<span class="hljs-number">1.0</span>).to_tuple()`}}),Rn=new P({props:{code:"aW1hZ2UlMjAlM0QlMjB0MmlfcGlwZShpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWJlZHMlMkMlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0RuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlMkMlMjBoZWlnaHQlM0Q3NjglMkMlMjB3aWR0aCUzRDc2OCkuaW1hZ2VzJTVCJTBBJTIwJTIwJTIwJTIwMCUwQSU1RCUwQWltYWdlLnNhdmUoJTIycG9ydHJhaXQucG5nJTIyKQ==",highlighted:`image = t2i_pipe(<span class="hljs-attribute">image_embeds</span>=image_embeds, <span class="hljs-attribute">negative_image_embeds</span>=negative_image_embeds, <span class="hljs-attribute">height</span>=768, <span class="hljs-attribute">width</span>=768).images[
    0
]
image.save(<span class="hljs-string">&quot;portrait.png&quot;</span>)`}}),Xn=new $({}),qn=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEElMEFpbWclMjAlM0QlMjBsb2FkX2ltYWdlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmhmLWludGVybmFsLXRlc3RpbmclMkZkaWZmdXNlcnMtaW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZrYW5kaW5za3l2MjIlMkZjYXQucG5nJTIyJTBBKS5yZXNpemUoKDc2OCUyQyUyMDc2OCkp",highlighted:`<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

img = load_image(
    <span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinskyv22/cat.png&quot;</span>
).resize((<span class="hljs-number">768</span>, <span class="hljs-number">768</span>))`}}),Qn=new P({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEElMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwcGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQSUwQSUwQWRlZiUyMG1ha2VfaGludChpbWFnZSUyQyUyMGRlcHRoX2VzdGltYXRvciklM0ElMEElMjAlMjAlMjAlMjBpbWFnZSUyMCUzRCUyMGRlcHRoX2VzdGltYXRvcihpbWFnZSklNUIlMjJkZXB0aCUyMiU1RCUwQSUyMCUyMCUyMCUyMGltYWdlJTIwJTNEJTIwbnAuYXJyYXkoaW1hZ2UpJTBBJTIwJTIwJTIwJTIwaW1hZ2UlMjAlM0QlMjBpbWFnZSU1QiUzQSUyQyUyMCUzQSUyQyUyME5vbmUlNUQlMEElMjAlMjAlMjAlMjBpbWFnZSUyMCUzRCUyMG5wLmNvbmNhdGVuYXRlKCU1QmltYWdlJTJDJTIwaW1hZ2UlMkMlMjBpbWFnZSU1RCUyQyUyMGF4aXMlM0QyKSUwQSUyMCUyMCUyMCUyMGRldGVjdGVkX21hcCUyMCUzRCUyMHRvcmNoLmZyb21fbnVtcHkoaW1hZ2UpLmZsb2F0KCklMjAlMkYlMjAyNTUuMCUwQSUyMCUyMCUyMCUyMGhpbnQlMjAlM0QlMjBkZXRlY3RlZF9tYXAucGVybXV0ZSgyJTJDJTIwMCUyQyUyMDEpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwaGludCUwQSUwQSUwQWRlcHRoX2VzdGltYXRvciUyMCUzRCUyMHBpcGVsaW5lKCUyMmRlcHRoLWVzdGltYXRpb24lMjIpJTBBaGludCUyMCUzRCUyMG1ha2VfaGludChpbWclMkMlMjBkZXB0aF9lc3RpbWF0b3IpLnVuc3F1ZWV6ZSgwKS5oYWxmKCkudG8oJTIyY3VkYSUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image


<span class="hljs-keyword">def</span> <span class="hljs-title function_">make_hint</span>(<span class="hljs-params">image, depth_estimator</span>):
    image = depth_estimator(image)[<span class="hljs-string">&quot;depth&quot;</span>]
    image = np.array(image)
    image = image[:, :, <span class="hljs-literal">None</span>]
    image = np.concatenate([image, image, image], axis=<span class="hljs-number">2</span>)
    detected_map = torch.from_numpy(image).<span class="hljs-built_in">float</span>() / <span class="hljs-number">255.0</span>
    hint = detected_map.permute(<span class="hljs-number">2</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>)
    <span class="hljs-keyword">return</span> hint


depth_estimator = pipeline(<span class="hljs-string">&quot;depth-estimation&quot;</span>)
hint = make_hint(img, depth_estimator).unsqueeze(<span class="hljs-number">0</span>).half().to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),Sn=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUlMkMlMjBLYW5kaW5za3lWMjJDb250cm9sbmV0UGlwZWxpbmUlMEElMEFwaXBlX3ByaW9yJTIwJTNEJTIwS2FuZGluc2t5VjIyUHJpb3JQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTItcHJpb3IlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTBBcGlwZV9wcmlvciUyMCUzRCUyMHBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlJTIwJTNEJTIwS2FuZGluc2t5VjIyQ29udHJvbG5ldFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMi1jb250cm9sbmV0LWRlcHRoJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGUlMjAlM0QlMjBwaXBlLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22PriorPipeline, KandinskyV22ControlnetPipeline

pipe_prior = KandinskyV22PriorPipeline.from_pretrained(
    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-prior&quot;</span>, torch_dtype=torch.float16
)
pipe_prior = pipe_prior.to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipe = KandinskyV22ControlnetPipeline.from_pretrained(
    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-controlnet-depth&quot;</span>, torch_dtype=torch.float16
)
pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),Yn=new P({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMHJvYm90JTJDJTIwNGslMjBwaG90byUyMiUwQSUwQW5lZ2F0aXZlX3ByaW9yX3Byb21wdCUyMCUzRCUyMCUyMmxvd3JlcyUyQyUyMHRleHQlMkMlMjBlcnJvciUyQyUyMGNyb3BwZWQlMkMlMjB3b3JzdCUyMHF1YWxpdHklMkMlMjBsb3clMjBxdWFsaXR5JTJDJTIwanBlZyUyMGFydGlmYWN0cyUyQyUyMHVnbHklMkMlMjBkdXBsaWNhdGUlMkMlMjBtb3JiaWQlMkMlMjBtdXRpbGF0ZWQlMkMlMjBvdXQlMjBvZiUyMGZyYW1lJTJDJTIwZXh0cmElMjBmaW5nZXJzJTJDJTIwbXV0YXRlZCUyMGhhbmRzJTJDJTIwcG9vcmx5JTIwZHJhd24lMjBoYW5kcyUyQyUyMHBvb3JseSUyMGRyYXduJTIwZmFjZSUyQyUyMG11dGF0aW9uJTJDJTIwZGVmb3JtZWQlMkMlMjBibHVycnklMkMlMjBkZWh5ZHJhdGVkJTJDJTIwYmFkJTIwYW5hdG9teSUyQyUyMGJhZCUyMHByb3BvcnRpb25zJTJDJTIwZXh0cmElMjBsaW1icyUyQyUyMGNsb25lZCUyMGZhY2UlMkMlMjBkaXNmaWd1cmVkJTJDJTIwZ3Jvc3MlMjBwcm9wb3J0aW9ucyUyQyUyMG1hbGZvcm1lZCUyMGxpbWJzJTJDJTIwbWlzc2luZyUyMGFybXMlMkMlMjBtaXNzaW5nJTIwbGVncyUyQyUyMGV4dHJhJTIwYXJtcyUyQyUyMGV4dHJhJTIwbGVncyUyQyUyMGZ1c2VkJTIwZmluZ2VycyUyQyUyMHRvbyUyMG1hbnklMjBmaW5nZXJzJTJDJTIwbG9uZyUyMG5lY2slMkMlMjB1c2VybmFtZSUyQyUyMHdhdGVybWFyayUyQyUyMHNpZ25hdHVyZSUyMiUwQSUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLkdlbmVyYXRvcihkZXZpY2UlM0QlMjJjdWRhJTIyKS5tYW51YWxfc2VlZCg0MyklMEFpbWFnZV9lbWIlMkMlMjB6ZXJvX2ltYWdlX2VtYiUyMCUzRCUyMHBpcGVfcHJpb3IoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTIwbmVnYXRpdmVfcHJvbXB0JTNEbmVnYXRpdmVfcHJpb3JfcHJvbXB0JTJDJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTBBKS50b190dXBsZSgp",highlighted:`prompt = <span class="hljs-string">&quot;A robot, 4k photo&quot;</span>

negative_prior_prompt = <span class="hljs-string">&quot;lowres, text, error, cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, username, watermark, signature&quot;</span>

generator = torch.Generator(device=<span class="hljs-string">&quot;cuda&quot;</span>).manual_seed(<span class="hljs-number">43</span>)
image_emb, zero_image_emb = pipe_prior(
    prompt=prompt, negative_prompt=negative_prior_prompt, generator=generator
).to_tuple()`}}),Dn=new P({props:{code:"aW1hZ2VzJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWIlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0R6ZXJvX2ltYWdlX2VtYiUyQyUwQSUyMCUyMCUyMCUyMGhpbnQlM0RoaW50JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEEpLmltYWdlcyUwQSUwQWltYWdlcyU1QjAlNUQuc2F2ZSglMjJyb2JvdF9jYXQucG5nJTIyKQ==",highlighted:`images = pipe(
    image_embeds=image_emb,
    negative_image_embeds=zero_image_emb,
    hint=hint,
    num_inference_steps=<span class="hljs-number">50</span>,
    generator=generator,
    height=<span class="hljs-number">768</span>,
    width=<span class="hljs-number">768</span>,
).images

images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;robot_cat.png&quot;</span>)`}}),zn=new $({}),An=new P({props:{code:" ",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22PriorEmb2EmbPipeline, KandinskyV22ControlnetImg2ImgPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

img = load_image(
    <span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main&quot;</span> <span class="hljs-string">&quot;/kandinskyv22/cat.png&quot;</span>
).resize((<span class="hljs-number">768</span>, <span class="hljs-number">768</span>))


<span class="hljs-keyword">def</span> <span class="hljs-title function_">make_hint</span>(<span class="hljs-params">image, depth_estimator</span>):
    image = depth_estimator(image)[<span class="hljs-string">&quot;depth&quot;</span>]
    image = np.array(image)
    image = image[:, :, <span class="hljs-literal">None</span>]
    image = np.concatenate([image, image, image], axis=<span class="hljs-number">2</span>)
    detected_map = torch.from_numpy(image).<span class="hljs-built_in">float</span>() / <span class="hljs-number">255.0</span>
    hint = detected_map.permute(<span class="hljs-number">2</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>)
    <span class="hljs-keyword">return</span> hint


depth_estimator = pipeline(<span class="hljs-string">&quot;depth-estimation&quot;</span>)
hint = make_hint(img, depth_estimator).unsqueeze(<span class="hljs-number">0</span>).half().to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipe_prior = KandinskyV22PriorEmb2EmbPipeline.from_pretrained(
    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-prior&quot;</span>, torch_dtype=torch.float16
)
pipe_prior = pipe_prior.to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipe = KandinskyV22ControlnetImg2ImgPipeline.from_pretrained(
    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-controlnet-depth&quot;</span>, torch_dtype=torch.float16
)
pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;A robot, 4k photo&quot;</span>
negative_prior_prompt = <span class="hljs-string">&quot;lowres, text, error, cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, username, watermark, signature&quot;</span>

generator = torch.Generator(device=<span class="hljs-string">&quot;cuda&quot;</span>).manual_seed(<span class="hljs-number">43</span>)

<span class="hljs-comment"># run prior pipeline</span>

img_emb = pipe_prior(prompt=prompt, image=img, strength=<span class="hljs-number">0.85</span>, generator=generator)
negative_emb = pipe_prior(prompt=negative_prior_prompt, image=img, strength=<span class="hljs-number">1</span>, generator=generator)

<span class="hljs-comment"># run controlnet img2img pipeline</span>
images = pipe(
    image=img,
    strength=<span class="hljs-number">0.5</span>,
    image_embeds=img_emb.image_embeds,
    negative_image_embeds=negative_emb.image_embeds,
    hint=hint,
    num_inference_steps=<span class="hljs-number">50</span>,
    generator=generator,
    height=<span class="hljs-number">768</span>,
    width=<span class="hljs-number">768</span>,
).images

images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;robot_cat.png&quot;</span>)`}}),Hn=new $({}),et=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0MmlfcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEF0MmlfcGlwZS5lbmFibGVfeGZvcm1lcnNfbWVtb3J5X2VmZmljaWVudF9hdHRlbnRpb24oKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">import</span> torch

t2i_pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1&quot;</span>, torch_dtype=torch.float16)
t2i_pipe.enable_xformers_memory_efficient_attention()`}}),tt=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy5tb2RlbHMuYXR0ZW50aW9uX3Byb2Nlc3NvciUyMGltcG9ydCUyMEF0dG5BZGRlZEtWUHJvY2Vzc29yMl8wJTBBJTBBdDJpX3BpcGUudW5ldC5zZXRfYXR0bl9wcm9jZXNzb3IoQXR0bkFkZGVkS1ZQcm9jZXNzb3IyXzAoKSk=",highlighted:`<span class="hljs-keyword">from</span> diffusers.models.attention_processor <span class="hljs-keyword">import</span> AttnAddedKVProcessor2_0

t2i_pipe.unet.set_attn_processor(AttnAddedKVProcessor2_0())`}}),at=new P({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy5tb2RlbHMuYXR0ZW50aW9uX3Byb2Nlc3NvciUyMGltcG9ydCUyMEF0dG5BZGRlZEtWUHJvY2Vzc29yJTBBJTBBdDJpX3BpcGUudW5ldC5zZXRfYXR0bl9wcm9jZXNzb3IoQXR0bkFkZGVkS1ZQcm9jZXNzb3IoKSk=",highlighted:`<span class="hljs-keyword">from</span> diffusers.models.attention_processor <span class="hljs-keyword">import</span> AttnAddedKVProcessor

t2i_pipe.unet.set_attn_processor(AttnAddedKVProcessor())`}}),it=new P({props:{code:"dDJpX3BpcGUudW5ldC50byhtZW1vcnlfZm9ybWF0JTNEdG9yY2guY2hhbm5lbHNfbGFzdCklMEF0MmlfcGlwZS51bmV0JTIwJTNEJTIwdG9yY2guY29tcGlsZSh0MmlfcGlwZS51bmV0JTJDJTIwbW9kZSUzRCUyMnJlZHVjZS1vdmVyaGVhZCUyMiUyQyUyMGZ1bGxncmFwaCUzRFRydWUp",highlighted:`t2i_pipe.unet.to(memory_format=torch.channels_last)
t2i_pipe.unet = torch.<span class="hljs-built_in">compile</span>(t2i_pipe.unet, mode=<span class="hljs-string">&quot;reduce-overhead&quot;</span>, fullgraph=<span class="hljs-literal">True</span>)`}}),an=new Iu({props:{$$slots:{default:[Ju]},$$scope:{ctx:V}}}),st=new $({}),kt=new $({}),wt=new J({props:{name:"class diffusers.KandinskyV22Pipeline",anchor:"diffusers.KandinskyV22Pipeline",parameters:[{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"movq",val:": VQModel"}],parametersDescription:[{anchor:"diffusers.KandinskyV22Pipeline.scheduler",description:`<strong>scheduler</strong> (Union[<code>DDIMScheduler</code>,<code>DDPMScheduler</code>]) &#x2014;
A scheduler to be used in combination with <code>unet</code> to generate image latents.`,name:"scheduler"},{anchor:"diffusers.KandinskyV22Pipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyV22Pipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ Decoder to generate the image from the latents.`,name:"movq"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2.py#L67"}}),Mt=new J({props:{name:"__call__",anchor:"diffusers.KandinskyV22Pipeline.__call__",parameters:[{name:"image_embeds",val:": typing.Union[torch.FloatTensor, typing.List[torch.FloatTensor]]"},{name:"negative_image_embeds",val:": typing.Union[torch.FloatTensor, typing.List[torch.FloatTensor]]"},{name:"height",val:": int = 512"},{name:"width",val:": int = 512"},{name:"num_inference_steps",val:": int = 100"},{name:"guidance_scale",val:": float = 4.0"},{name:"num_images_per_prompt",val:": int = 1"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.KandinskyV22Pipeline.__call__.image_embeds",description:`<strong>image_embeds</strong> (<code>torch.FloatTensor</code> or <code>List[torch.FloatTensor]</code>) &#x2014;
The clip image embeddings for text prompt, that will be used to condition the image generation.`,name:"image_embeds"},{anchor:"diffusers.KandinskyV22Pipeline.__call__.negative_image_embeds",description:`<strong>negative_image_embeds</strong> (<code>torch.FloatTensor</code> or <code>List[torch.FloatTensor]</code>) &#x2014;
The clip image embeddings for negative text prompt, will be used to condition the image generation.`,name:"negative_image_embeds"},{anchor:"diffusers.KandinskyV22Pipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.KandinskyV22Pipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.KandinskyV22Pipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.KandinskyV22Pipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.KandinskyV22Pipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.KandinskyV22Pipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.KandinskyV22Pipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.KandinskyV22Pipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between: <code>&quot;pil&quot;</code> (<code>PIL.Image.Image</code>), <code>&quot;np&quot;</code>
(<code>np.array</code>) or <code>&quot;pt&quot;</code> (<code>torch.Tensor</code>).`,name:"output_type"},{anchor:"diffusers.KandinskyV22Pipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is called with the
following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.KandinskyV22Pipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function is called. If not specified, the callback is called at
every step.`,name:"callback_steps"},{anchor:"diffusers.KandinskyV22Pipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2.py#L112",returnType:`
<p><a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),ln=new Gn({props:{anchor:"diffusers.KandinskyV22Pipeline.__call__.example",$$slots:{default:[Uu]},$$scope:{ctx:V}}}),Tt=new $({}),It=new J({props:{name:"class diffusers.KandinskyV22ControlnetPipeline",anchor:"diffusers.KandinskyV22ControlnetPipeline",parameters:[{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"movq",val:": VQModel"}],parametersDescription:[{anchor:"diffusers.KandinskyV22ControlnetPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to generate image latents.`,name:"scheduler"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ Decoder to generate the image from the latents.`,name:"movq"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet.py#L106"}}),Ut=new J({props:{name:"__call__",anchor:"diffusers.KandinskyV22ControlnetPipeline.__call__",parameters:[{name:"image_embeds",val:": typing.Union[torch.FloatTensor, typing.List[torch.FloatTensor]]"},{name:"negative_image_embeds",val:": typing.Union[torch.FloatTensor, typing.List[torch.FloatTensor]]"},{name:"hint",val:": FloatTensor"},{name:"height",val:": int = 512"},{name:"width",val:": int = 512"},{name:"num_inference_steps",val:": int = 100"},{name:"guidance_scale",val:": float = 4.0"},{name:"num_images_per_prompt",val:": int = 1"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.KandinskyV22ControlnetPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.__call__.hint",description:`<strong>hint</strong> (<code>torch.FloatTensor</code>) &#x2014;
The controlnet condition.`,name:"hint"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.__call__.image_embeds",description:`<strong>image_embeds</strong> (<code>torch.FloatTensor</code> or <code>List[torch.FloatTensor]</code>) &#x2014;
The clip image embeddings for text prompt, that will be used to condition the image generation.`,name:"image_embeds"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.__call__.negative_image_embeds",description:`<strong>negative_image_embeds</strong> (<code>torch.FloatTensor</code> or <code>List[torch.FloatTensor]</code>) &#x2014;
The clip image embeddings for negative text prompt, will be used to condition the image generation.`,name:"negative_image_embeds"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. Ignored when not using guidance (i.e., ignored
if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between: <code>&quot;pil&quot;</code> (<code>PIL.Image.Image</code>), <code>&quot;np&quot;</code>
(<code>np.array</code>) or <code>&quot;pt&quot;</code> (<code>torch.Tensor</code>).`,name:"output_type"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is called with the
following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function is called. If not specified, the callback is called at
every step.`,name:"callback_steps"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet.py#L151",returnType:`
<p><a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Pt=new $({}),Vt=new J({props:{name:"class diffusers.KandinskyV22ControlnetImg2ImgPipeline",anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline",parameters:[{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"movq",val:": VQModel"}],parametersDescription:[{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to generate image latents.`,name:"scheduler"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ Decoder to generate the image from the latents.`,name:"movq"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet_img2img.py#L120"}}),Ct=new J({props:{name:"__call__",anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__call__",parameters:[{name:"image_embeds",val:": typing.Union[torch.FloatTensor, typing.List[torch.FloatTensor]]"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image]]"},{name:"negative_image_embeds",val:": typing.Union[torch.FloatTensor, typing.List[torch.FloatTensor]]"},{name:"hint",val:": FloatTensor"},{name:"height",val:": int = 512"},{name:"width",val:": int = 512"},{name:"num_inference_steps",val:": int = 100"},{name:"guidance_scale",val:": float = 4.0"},{name:"strength",val:": float = 0.3"},{name:"num_images_per_prompt",val:": int = 1"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__call__.image_embeds",description:`<strong>image_embeds</strong> (<code>torch.FloatTensor</code> or <code>List[torch.FloatTensor]</code>) &#x2014;
The clip image embeddings for text prompt, that will be used to condition the image generation.`,name:"image_embeds"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, or <code>List[np.ndarray]</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, that will be used as the starting point for the
process. Can also accept image latents as <code>image</code>, if passing latents directly, it will not be encoded
again.`,name:"image"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
Conceptually, indicates how much to transform the reference <code>image</code>. Must be between 0 and 1. <code>image</code>
will be used as a starting point, adding more noise to it the larger the <code>strength</code>. The number of
denoising steps depends on the amount of noise initially added. When <code>strength</code> is 1, added noise will
be maximum and the denoising process will run for the full number of iterations specified in
<code>num_inference_steps</code>. A value of 1, therefore, essentially ignores <code>image</code>.`,name:"strength"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__call__.hint",description:`<strong>hint</strong> (<code>torch.FloatTensor</code>) &#x2014;
The controlnet condition.`,name:"hint"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__call__.negative_image_embeds",description:`<strong>negative_image_embeds</strong> (<code>torch.FloatTensor</code> or <code>List[torch.FloatTensor]</code>) &#x2014;
The clip image embeddings for negative text prompt, will be used to condition the image generation.`,name:"negative_image_embeds"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between: <code>&quot;pil&quot;</code> (<code>PIL.Image.Image</code>), <code>&quot;np&quot;</code>
(<code>np.array</code>) or <code>&quot;pt&quot;</code> (<code>torch.Tensor</code>).`,name:"output_type"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is called with the
following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function is called. If not specified, the callback is called at
every step.`,name:"callback_steps"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet_img2img.py#L206",returnType:`
<p><a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Zt=new $({}),Gt=new J({props:{name:"class diffusers.KandinskyV22Img2ImgPipeline",anchor:"diffusers.KandinskyV22Img2ImgPipeline",parameters:[{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"movq",val:": VQModel"}],parametersDescription:[{anchor:"diffusers.KandinskyV22Img2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to generate image latents.`,name:"scheduler"},{anchor:"diffusers.KandinskyV22Img2ImgPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyV22Img2ImgPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ Decoder to generate the image from the latents.`,name:"movq"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_img2img.py#L94"}}),Et=new J({props:{name:"__call__",anchor:"diffusers.KandinskyV22Img2ImgPipeline.__call__",parameters:[{name:"image_embeds",val:": typing.Union[torch.FloatTensor, typing.List[torch.FloatTensor]]"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image]]"},{name:"negative_image_embeds",val:": typing.Union[torch.FloatTensor, typing.List[torch.FloatTensor]]"},{name:"height",val:": int = 512"},{name:"width",val:": int = 512"},{name:"num_inference_steps",val:": int = 100"},{name:"guidance_scale",val:": float = 4.0"},{name:"strength",val:": float = 0.3"},{name:"num_images_per_prompt",val:": int = 1"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.KandinskyV22Img2ImgPipeline.__call__.image_embeds",description:`<strong>image_embeds</strong> (<code>torch.FloatTensor</code> or <code>List[torch.FloatTensor]</code>) &#x2014;
The clip image embeddings for text prompt, that will be used to condition the image generation.`,name:"image_embeds"},{anchor:"diffusers.KandinskyV22Img2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, or <code>List[np.ndarray]</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, that will be used as the starting point for the
process. Can also accept image latents as <code>image</code>, if passing latents directly, it will not be encoded
again.`,name:"image"},{anchor:"diffusers.KandinskyV22Img2ImgPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
Conceptually, indicates how much to transform the reference <code>image</code>. Must be between 0 and 1. <code>image</code>
will be used as a starting point, adding more noise to it the larger the <code>strength</code>. The number of
denoising steps depends on the amount of noise initially added. When <code>strength</code> is 1, added noise will
be maximum and the denoising process will run for the full number of iterations specified in
<code>num_inference_steps</code>. A value of 1, therefore, essentially ignores <code>image</code>.`,name:"strength"},{anchor:"diffusers.KandinskyV22Img2ImgPipeline.__call__.negative_image_embeds",description:`<strong>negative_image_embeds</strong> (<code>torch.FloatTensor</code> or <code>List[torch.FloatTensor]</code>) &#x2014;
The clip image embeddings for negative text prompt, will be used to condition the image generation.`,name:"negative_image_embeds"},{anchor:"diffusers.KandinskyV22Img2ImgPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.KandinskyV22Img2ImgPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.KandinskyV22Img2ImgPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.KandinskyV22Img2ImgPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.KandinskyV22Img2ImgPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.KandinskyV22Img2ImgPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.KandinskyV22Img2ImgPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between: <code>&quot;pil&quot;</code> (<code>PIL.Image.Image</code>), <code>&quot;np&quot;</code>
(<code>np.array</code>) or <code>&quot;pt&quot;</code> (<code>torch.Tensor</code>).`,name:"output_type"},{anchor:"diffusers.KandinskyV22Img2ImgPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is called with the
following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.KandinskyV22Img2ImgPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function is called. If not specified, the callback is called at
every step.`,name:"callback_steps"},{anchor:"diffusers.KandinskyV22Img2ImgPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_img2img.py#L179",returnType:`
<p><a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),xt=new $({}),$t=new J({props:{name:"class diffusers.KandinskyV22InpaintPipeline",anchor:"diffusers.KandinskyV22InpaintPipeline",parameters:[{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"movq",val:": VQModel"}],parametersDescription:[{anchor:"diffusers.KandinskyV22InpaintPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to generate image latents.`,name:"scheduler"},{anchor:"diffusers.KandinskyV22InpaintPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyV22InpaintPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ Decoder to generate the image from the latents.`,name:"movq"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_inpainting.py#L237"}}),Kt=new J({props:{name:"__call__",anchor:"diffusers.KandinskyV22InpaintPipeline.__call__",parameters:[{name:"image_embeds",val:": typing.Union[torch.FloatTensor, typing.List[torch.FloatTensor]]"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image]"},{name:"mask_image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, numpy.ndarray]"},{name:"negative_image_embeds",val:": typing.Union[torch.FloatTensor, typing.List[torch.FloatTensor]]"},{name:"height",val:": int = 512"},{name:"width",val:": int = 512"},{name:"num_inference_steps",val:": int = 100"},{name:"guidance_scale",val:": float = 4.0"},{name:"num_images_per_prompt",val:": int = 1"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.KandinskyV22InpaintPipeline.__call__.image_embeds",description:`<strong>image_embeds</strong> (<code>torch.FloatTensor</code> or <code>List[torch.FloatTensor]</code>) &#x2014;
The clip image embeddings for text prompt, that will be used to condition the image generation.`,name:"image_embeds"},{anchor:"diffusers.KandinskyV22InpaintPipeline.__call__.image",description:`<strong>image</strong> (<code>PIL.Image.Image</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch which will be inpainted, <em>i.e.</em> parts of the image will
be masked out with <code>mask_image</code> and repainted according to <code>prompt</code>.`,name:"image"},{anchor:"diffusers.KandinskyV22InpaintPipeline.__call__.mask_image",description:`<strong>mask_image</strong> (<code>np.array</code>) &#x2014;
Tensor representing an image batch, to mask <code>image</code>. White pixels in the mask will be repainted, while
black pixels will be preserved. If <code>mask_image</code> is a PIL image, it will be converted to a single
channel (luminance) before use. If it&#x2019;s a tensor, it should contain one color channel (L) instead of 3,
so the expected shape would be <code>(B, H, W, 1)</code>.`,name:"mask_image"},{anchor:"diffusers.KandinskyV22InpaintPipeline.__call__.negative_image_embeds",description:`<strong>negative_image_embeds</strong> (<code>torch.FloatTensor</code> or <code>List[torch.FloatTensor]</code>) &#x2014;
The clip image embeddings for negative text prompt, will be used to condition the image generation.`,name:"negative_image_embeds"},{anchor:"diffusers.KandinskyV22InpaintPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.KandinskyV22InpaintPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.KandinskyV22InpaintPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.KandinskyV22InpaintPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.KandinskyV22InpaintPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.KandinskyV22InpaintPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.KandinskyV22InpaintPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.KandinskyV22InpaintPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between: <code>&quot;pil&quot;</code> (<code>PIL.Image.Image</code>), <code>&quot;np&quot;</code>
(<code>np.array</code>) or <code>&quot;pt&quot;</code> (<code>torch.Tensor</code>).`,name:"output_type"},{anchor:"diffusers.KandinskyV22InpaintPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is called with the
following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.KandinskyV22InpaintPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function is called. If not specified, the callback is called at
every step.`,name:"callback_steps"},{anchor:"diffusers.KandinskyV22InpaintPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_inpainting.py#L283",returnType:`
<p><a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Ft=new $({}),Nt=new J({props:{name:"class diffusers.KandinskyV22PriorPipeline",anchor:"diffusers.KandinskyV22PriorPipeline",parameters:[{name:"prior",val:": PriorTransformer"},{name:"image_encoder",val:": CLIPVisionModelWithProjection"},{name:"text_encoder",val:": CLIPTextModelWithProjection"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"scheduler",val:": UnCLIPScheduler"},{name:"image_processor",val:": CLIPImageProcessor"}],parametersDescription:[{anchor:"diffusers.KandinskyV22PriorPipeline.prior",description:`<strong>prior</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/prior_transformer#diffusers.PriorTransformer">PriorTransformer</a>) &#x2014;
The canonincal unCLIP prior to approximate the image embedding from the text embedding.`,name:"prior"},{anchor:"diffusers.KandinskyV22PriorPipeline.image_encoder",description:`<strong>image_encoder</strong> (<code>CLIPVisionModelWithProjection</code>) &#x2014;
Frozen image-encoder.`,name:"image_encoder"},{anchor:"diffusers.KandinskyV22PriorPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModelWithProjection</code>) &#x2014;
Frozen text-encoder.`,name:"text_encoder"},{anchor:"diffusers.KandinskyV22PriorPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.KandinskyV22PriorPipeline.scheduler",description:`<strong>scheduler</strong> (<code>UnCLIPScheduler</code>) &#x2014;
A scheduler to be used in combination with <code>prior</code> to generate image embedding.`,name:"scheduler"},{anchor:"diffusers.KandinskyV22PriorPipeline.image_processor",description:`<strong>image_processor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
A image_processor to be used to preprocess image from clip.`,name:"image_processor"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior.py#L84"}}),Xt=new J({props:{name:"__call__",anchor:"diffusers.KandinskyV22PriorPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": int = 1"},{name:"num_inference_steps",val:": int = 25"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"guidance_scale",val:": float = 4.0"},{name:"output_type",val:": typing.Optional[str] = 'pt'"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.KandinskyV22PriorPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.KandinskyV22PriorPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. Ignored when not using guidance (i.e., ignored
if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.KandinskyV22PriorPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.KandinskyV22PriorPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.KandinskyV22PriorPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.KandinskyV22PriorPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.KandinskyV22PriorPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.KandinskyV22PriorPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pt&quot;</code>) &#x2014;
The output format of the generate image. Choose between: <code>&quot;np&quot;</code> (<code>np.array</code>) or <code>&quot;pt&quot;</code>
(<code>torch.Tensor</code>).`,name:"output_type"},{anchor:"diffusers.KandinskyV22PriorPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior.py#L357",returnType:`
<p><code>KandinskyPriorPipelineOutput</code> or <code>tuple</code></p>
`}}),fn=new Gn({props:{anchor:"diffusers.KandinskyV22PriorPipeline.__call__.example",$$slots:{default:[Pu]},$$scope:{ctx:V}}}),qt=new J({props:{name:"interpolate",anchor:"diffusers.KandinskyV22PriorPipeline.interpolate",parameters:[{name:"images_and_prompts",val:": typing.List[typing.Union[str, PIL.Image.Image, torch.FloatTensor]]"},{name:"weights",val:": typing.List[float]"},{name:"num_images_per_prompt",val:": int = 1"},{name:"num_inference_steps",val:": int = 25"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prior_prompt",val:": typing.Optional[str] = None"},{name:"negative_prompt",val:": str = ''"},{name:"guidance_scale",val:": float = 4.0"},{name:"device",val:" = None"}],parametersDescription:[{anchor:"diffusers.KandinskyV22PriorPipeline.interpolate.images_and_prompts",description:`<strong>images_and_prompts</strong> (<code>List[Union[str, PIL.Image.Image, torch.FloatTensor]]</code>) &#x2014;
list of prompts and images to guide the image generation.
weights &#x2014; (<code>List[float]</code>):
list of weights for each condition in <code>images_and_prompts</code>`,name:"images_and_prompts"},{anchor:"diffusers.KandinskyV22PriorPipeline.interpolate.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.KandinskyV22PriorPipeline.interpolate.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.KandinskyV22PriorPipeline.interpolate.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.KandinskyV22PriorPipeline.interpolate.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.KandinskyV22PriorPipeline.interpolate.negative_prior_prompt",description:`<strong>negative_prior_prompt</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The prompt not to guide the prior diffusion process. Ignored when not using guidance (i.e., ignored if
<code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prior_prompt"},{anchor:"diffusers.KandinskyV22PriorPipeline.interpolate.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt 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.KandinskyV22PriorPipeline.interpolate.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior.py#L130",returnType:`
<p><code>KandinskyPriorPipelineOutput</code> or <code>tuple</code></p>
`}}),un=new Gn({props:{anchor:"diffusers.KandinskyV22PriorPipeline.interpolate.example",$$slots:{default:[Vu]},$$scope:{ctx:V}}}),Qt=new $({}),St=new J({props:{name:"class diffusers.KandinskyV22PriorEmb2EmbPipeline",anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline",parameters:[{name:"prior",val:": PriorTransformer"},{name:"image_encoder",val:": CLIPVisionModelWithProjection"},{name:"text_encoder",val:": CLIPTextModelWithProjection"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"scheduler",val:": UnCLIPScheduler"},{name:"image_processor",val:": CLIPImageProcessor"}],parametersDescription:[{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.prior",description:`<strong>prior</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/prior_transformer#diffusers.PriorTransformer">PriorTransformer</a>) &#x2014;
The canonincal unCLIP prior to approximate the image embedding from the text embedding.`,name:"prior"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.image_encoder",description:`<strong>image_encoder</strong> (<code>CLIPVisionModelWithProjection</code>) &#x2014;
Frozen image-encoder.`,name:"image_encoder"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModelWithProjection</code>) &#x2014;
Frozen text-encoder.`,name:"text_encoder"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.scheduler",description:`<strong>scheduler</strong> (<code>UnCLIPScheduler</code>) &#x2014;
A scheduler to be used in combination with <code>prior</code> to generate image embedding.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior_emb2emb.py#L102"}}),Dt=new J({props:{name:"__call__",anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"image",val:": typing.Union[torch.Tensor, typing.List[torch.Tensor], PIL.Image.Image, typing.List[PIL.Image.Image]]"},{name:"strength",val:": float = 0.3"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": int = 1"},{name:"num_inference_steps",val:": int = 25"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"guidance_scale",val:": float = 4.0"},{name:"output_type",val:": typing.Optional[str] = 'pt'"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
Conceptually, indicates how much to transform the reference <code>emb</code>. Must be between 0 and 1. <code>image</code>
will be used as a starting point, adding more noise to it the larger the <code>strength</code>. The number of
denoising steps depends on the amount of noise initially added.`,name:"strength"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.__call__.emb",description:`<strong>emb</strong> (<code>torch.FloatTensor</code>) &#x2014;
The image embedding.`,name:"emb"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. Ignored when not using guidance (i.e., ignored
if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pt&quot;</code>) &#x2014;
The output format of the generate image. Choose between: <code>&quot;np&quot;</code> (<code>np.array</code>) or <code>&quot;pt&quot;</code>
(<code>torch.Tensor</code>).`,name:"output_type"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior_emb2emb.py#L396",returnType:`
<p><code>KandinskyPriorPipelineOutput</code> or <code>tuple</code></p>
`}}),yn=new Gn({props:{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.__call__.example",$$slots:{default:[ju]},$$scope:{ctx:V}}}),Lt=new J({props:{name:"interpolate",anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.interpolate",parameters:[{name:"images_and_prompts",val:": typing.List[typing.Union[str, PIL.Image.Image, torch.FloatTensor]]"},{name:"weights",val:": typing.List[float]"},{name:"num_images_per_prompt",val:": int = 1"},{name:"num_inference_steps",val:": int = 25"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prior_prompt",val:": typing.Optional[str] = None"},{name:"negative_prompt",val:": str = ''"},{name:"guidance_scale",val:": float = 4.0"},{name:"device",val:" = None"}],parametersDescription:[{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.interpolate.images_and_prompts",description:`<strong>images_and_prompts</strong> (<code>List[Union[str, PIL.Image.Image, torch.FloatTensor]]</code>) &#x2014;
list of prompts and images to guide the image generation.
weights &#x2014; (<code>List[float]</code>):
list of weights for each condition in <code>images_and_prompts</code>`,name:"images_and_prompts"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.interpolate.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.interpolate.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.interpolate.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.interpolate.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.interpolate.negative_prior_prompt",description:`<strong>negative_prior_prompt</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The prompt not to guide the prior diffusion process. Ignored when not using guidance (i.e., ignored if
<code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prior_prompt"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.interpolate.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt 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.KandinskyV22PriorEmb2EmbPipeline.interpolate.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior_emb2emb.py#L155",returnType:`
<p><code>KandinskyPriorPipelineOutput</code> or <code>tuple</code></p>
`}}),_n=new Gn({props:{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.interpolate.example",$$slots:{default:[Cu]},$$scope:{ctx:V}}}),zt=new $({}),At=new J({props:{name:"class diffusers.KandinskyV22CombinedPipeline",anchor:"diffusers.KandinskyV22CombinedPipeline",parameters:[{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"movq",val:": VQModel"},{name:"prior_prior",val:": PriorTransformer"},{name:"prior_image_encoder",val:": CLIPVisionModelWithProjection"},{name:"prior_text_encoder",val:": CLIPTextModelWithProjection"},{name:"prior_tokenizer",val:": CLIPTokenizer"},{name:"prior_scheduler",val:": UnCLIPScheduler"},{name:"prior_image_processor",val:": CLIPImageProcessor"}],parametersDescription:[{anchor:"diffusers.KandinskyV22CombinedPipeline.scheduler",description:`<strong>scheduler</strong> (Union[<code>DDIMScheduler</code>,<code>DDPMScheduler</code>]) &#x2014;
A scheduler to be used in combination with <code>unet</code> to generate image latents.`,name:"scheduler"},{anchor:"diffusers.KandinskyV22CombinedPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyV22CombinedPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ Decoder to generate the image from the latents.`,name:"movq"},{anchor:"diffusers.KandinskyV22CombinedPipeline.prior_prior",description:`<strong>prior_prior</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/prior_transformer#diffusers.PriorTransformer">PriorTransformer</a>) &#x2014;
The canonincal unCLIP prior to approximate the image embedding from the text embedding.`,name:"prior_prior"},{anchor:"diffusers.KandinskyV22CombinedPipeline.prior_image_encoder",description:`<strong>prior_image_encoder</strong> (<code>CLIPVisionModelWithProjection</code>) &#x2014;
Frozen image-encoder.`,name:"prior_image_encoder"},{anchor:"diffusers.KandinskyV22CombinedPipeline.prior_text_encoder",description:`<strong>prior_text_encoder</strong> (<code>CLIPTextModelWithProjection</code>) &#x2014;
Frozen text-encoder.`,name:"prior_text_encoder"},{anchor:"diffusers.KandinskyV22CombinedPipeline.prior_tokenizer",description:`<strong>prior_tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"prior_tokenizer"},{anchor:"diffusers.KandinskyV22CombinedPipeline.prior_scheduler",description:`<strong>prior_scheduler</strong> (<code>UnCLIPScheduler</code>) &#x2014;
A scheduler to be used in combination with <code>prior</code> to generate image embedding.`,name:"prior_scheduler"},{anchor:"diffusers.KandinskyV22CombinedPipeline.prior_image_processor",description:`<strong>prior_image_processor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
A image_processor to be used to preprocess image from clip.`,name:"prior_image_processor"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py#L110"}}),Ot=new J({props:{name:"__call__",anchor:"diffusers.KandinskyV22CombinedPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_inference_steps",val:": int = 100"},{name:"guidance_scale",val:": float = 4.0"},{name:"num_images_per_prompt",val:": int = 1"},{name:"height",val:": int = 512"},{name:"width",val:": int = 512"},{name:"prior_guidance_scale",val:": float = 4.0"},{name:"prior_num_inference_steps",val:": int = 25"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.KandinskyV22CombinedPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.KandinskyV22CombinedPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. Ignored when not using guidance (i.e., ignored
if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.KandinskyV22CombinedPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.KandinskyV22CombinedPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.KandinskyV22CombinedPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.KandinskyV22CombinedPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.KandinskyV22CombinedPipeline.__call__.prior_guidance_scale",description:`<strong>prior_guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"prior_guidance_scale"},{anchor:"diffusers.KandinskyV22CombinedPipeline.__call__.prior_num_inference_steps",description:`<strong>prior_num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"prior_num_inference_steps"},{anchor:"diffusers.KandinskyV22CombinedPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.KandinskyV22CombinedPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.KandinskyV22CombinedPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.KandinskyV22CombinedPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between: <code>&quot;pil&quot;</code> (<code>PIL.Image.Image</code>), <code>&quot;np&quot;</code>
(<code>np.array</code>) or <code>&quot;pt&quot;</code> (<code>torch.Tensor</code>).`,name:"output_type"},{anchor:"diffusers.KandinskyV22CombinedPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is called with the
following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.KandinskyV22CombinedPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function is called. If not specified, the callback is called at
every step.`,name:"callback_steps"},{anchor:"diffusers.KandinskyV22CombinedPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py#L204",returnType:`
<p><a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),kn=new Gn({props:{anchor:"diffusers.KandinskyV22CombinedPipeline.__call__.example",$$slots:{default:[Zu]},$$scope:{ctx:V}}}),ea=new J({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.KandinskyV22CombinedPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py#L184"}}),na=new $({}),ta=new J({props:{name:"class diffusers.KandinskyV22Img2ImgCombinedPipeline",anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline",parameters:[{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"movq",val:": VQModel"},{name:"prior_prior",val:": PriorTransformer"},{name:"prior_image_encoder",val:": CLIPVisionModelWithProjection"},{name:"prior_text_encoder",val:": CLIPTextModelWithProjection"},{name:"prior_tokenizer",val:": CLIPTokenizer"},{name:"prior_scheduler",val:": UnCLIPScheduler"},{name:"prior_image_processor",val:": CLIPImageProcessor"}],parametersDescription:[{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.scheduler",description:`<strong>scheduler</strong> (Union[<code>DDIMScheduler</code>,<code>DDPMScheduler</code>]) &#x2014;
A scheduler to be used in combination with <code>unet</code> to generate image latents.`,name:"scheduler"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ Decoder to generate the image from the latents.`,name:"movq"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.prior_prior",description:`<strong>prior_prior</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/prior_transformer#diffusers.PriorTransformer">PriorTransformer</a>) &#x2014;
The canonincal unCLIP prior to approximate the image embedding from the text embedding.`,name:"prior_prior"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.prior_image_encoder",description:`<strong>prior_image_encoder</strong> (<code>CLIPVisionModelWithProjection</code>) &#x2014;
Frozen image-encoder.`,name:"prior_image_encoder"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.prior_text_encoder",description:`<strong>prior_text_encoder</strong> (<code>CLIPTextModelWithProjection</code>) &#x2014;
Frozen text-encoder.`,name:"prior_text_encoder"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.prior_tokenizer",description:`<strong>prior_tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"prior_tokenizer"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.prior_scheduler",description:`<strong>prior_scheduler</strong> (<code>UnCLIPScheduler</code>) &#x2014;
A scheduler to be used in combination with <code>prior</code> to generate image embedding.`,name:"prior_scheduler"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.prior_image_processor",description:`<strong>prior_image_processor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
A image_processor to be used to preprocess image from clip.`,name:"prior_image_processor"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py#L316"}}),ia=new J({props:{name:"__call__",anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image]]"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_inference_steps",val:": int = 100"},{name:"guidance_scale",val:": float = 4.0"},{name:"strength",val:": float = 0.3"},{name:"num_images_per_prompt",val:": int = 1"},{name:"height",val:": int = 512"},{name:"width",val:": int = 512"},{name:"prior_guidance_scale",val:": float = 4.0"},{name:"prior_num_inference_steps",val:": int = 25"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, or <code>List[np.ndarray]</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, that will be used as the starting point for the
process. Can also accept image latents as <code>image</code>, if passing latents directly, it will not be encoded
again.`,name:"image"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. Ignored when not using guidance (i.e., ignored
if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.3) &#x2014;
Conceptually, indicates how much to transform the reference <code>image</code>. Must be between 0 and 1. <code>image</code>
will be used as a starting point, adding more noise to it the larger the <code>strength</code>. The number of
denoising steps depends on the amount of noise initially added. When <code>strength</code> is 1, added noise will
be maximum and the denoising process will run for the full number of iterations specified in
<code>num_inference_steps</code>. A value of 1, therefore, essentially ignores <code>image</code>.`,name:"strength"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__.prior_guidance_scale",description:`<strong>prior_guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"prior_guidance_scale"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__.prior_num_inference_steps",description:`<strong>prior_num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"prior_num_inference_steps"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between: <code>&quot;pil&quot;</code> (<code>PIL.Image.Image</code>), <code>&quot;np&quot;</code>
(<code>np.array</code>) or <code>&quot;pt&quot;</code> (<code>torch.Tensor</code>).`,name:"output_type"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is called with the
following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function is called. If not specified, the callback is called at
every step.`,name:"callback_steps"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py#L420",returnType:`
<p><a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Mn=new Gn({props:{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__.example",$$slots:{default:[Gu]},$$scope:{ctx:V}}}),oa=new J({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py#L400"}}),sa=new $({}),ra=new J({props:{name:"class diffusers.KandinskyV22InpaintCombinedPipeline",anchor:"diffusers.KandinskyV22InpaintCombinedPipeline",parameters:[{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"movq",val:": VQModel"},{name:"prior_prior",val:": PriorTransformer"},{name:"prior_image_encoder",val:": CLIPVisionModelWithProjection"},{name:"prior_text_encoder",val:": CLIPTextModelWithProjection"},{name:"prior_tokenizer",val:": CLIPTokenizer"},{name:"prior_scheduler",val:": UnCLIPScheduler"},{name:"prior_image_processor",val:": CLIPImageProcessor"}],parametersDescription:[{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.scheduler",description:`<strong>scheduler</strong> (Union[<code>DDIMScheduler</code>,<code>DDPMScheduler</code>]) &#x2014;
A scheduler to be used in combination with <code>unet</code> to generate image latents.`,name:"scheduler"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ Decoder to generate the image from the latents.`,name:"movq"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.prior_prior",description:`<strong>prior_prior</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/prior_transformer#diffusers.PriorTransformer">PriorTransformer</a>) &#x2014;
The canonincal unCLIP prior to approximate the image embedding from the text embedding.`,name:"prior_prior"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.prior_image_encoder",description:`<strong>prior_image_encoder</strong> (<code>CLIPVisionModelWithProjection</code>) &#x2014;
Frozen image-encoder.`,name:"prior_image_encoder"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.prior_text_encoder",description:`<strong>prior_text_encoder</strong> (<code>CLIPTextModelWithProjection</code>) &#x2014;
Frozen text-encoder.`,name:"prior_text_encoder"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.prior_tokenizer",description:`<strong>prior_tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"prior_tokenizer"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.prior_scheduler",description:`<strong>prior_scheduler</strong> (<code>UnCLIPScheduler</code>) &#x2014;
A scheduler to be used in combination with <code>prior</code> to generate image embedding.`,name:"prior_scheduler"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.prior_image_processor",description:`<strong>prior_image_processor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
A image_processor to be used to preprocess image from clip.`,name:"prior_image_processor"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py#L554"}}),pa=new J({props:{name:"__call__",anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image]]"},{name:"mask_image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image]]"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_inference_steps",val:": int = 100"},{name:"guidance_scale",val:": float = 4.0"},{name:"num_images_per_prompt",val:": int = 1"},{name:"height",val:": int = 512"},{name:"width",val:": int = 512"},{name:"prior_guidance_scale",val:": float = 4.0"},{name:"prior_num_inference_steps",val:": int = 25"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, or <code>List[np.ndarray]</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, that will be used as the starting point for the
process. Can also accept image latents as <code>image</code>, if passing latents directly, it will not be encoded
again.`,name:"image"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__.mask_image",description:`<strong>mask_image</strong> (<code>np.array</code>) &#x2014;
Tensor representing an image batch, to mask <code>image</code>. White pixels in the mask will be repainted, while
black pixels will be preserved. If <code>mask_image</code> is a PIL image, it will be converted to a single
channel (luminance) before use. If it&#x2019;s a tensor, it should contain one color channel (L) instead of 3,
so the expected shape would be <code>(B, H, W, 1)</code>.`,name:"mask_image"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. Ignored when not using guidance (i.e., ignored
if <code>guidance_scale</code> is less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__.prior_guidance_scale",description:`<strong>prior_guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"prior_guidance_scale"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__.prior_num_inference_steps",description:`<strong>prior_num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 100) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"prior_num_inference_steps"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between: <code>&quot;pil&quot;</code> (<code>PIL.Image.Image</code>), <code>&quot;np&quot;</code>
(<code>np.array</code>) or <code>&quot;pt&quot;</code> (<code>torch.Tensor</code>).`,name:"output_type"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is called with the
following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function is called. If not specified, the callback is called at
every step.`,name:"callback_steps"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py#L648",returnType:`
<p><a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/latent_diffusion_uncond#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Jn=new Gn({props:{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__.example",$$slots:{default:[Wu]},$$scope:{ctx:V}}}),da=new J({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py#L628"}}),{c(){f=a("meta"),I=l(),M=a("h1"),u=a("a"),T=a("span"),h(c.$$.fragment),v=l(),ke=a("span"),S=s("Kandinsky 2.2"),qe=l(),j=a("p"),Y=s("The Kandinsky 2.2 release includes robust new text-to-image models that support text-to-image generation, image-to-image generation, image interpolation, and text-guided image inpainting. The general workflow to perform these tasks using Kandinsky 2.2 is the same as in Kandinsky 2.1. First, you will need to use a prior pipeline to generate image embeddings based on your text prompt, and then use one of the image decoding pipelines to generate the output image. The only difference is that in Kandinsky 2.2, all of the decoding pipelines no longer accept the "),we=a("code"),En=s("prompt"),D=s(" input, and the image generation process is conditioned with only "),ve=a("code"),xn=s("image_embeds"),L=s(" and "),Me=a("code"),$n=s("negative_image_embeds"),z=s("."),Qe=l(),A=a("p"),Te=s("Same as with Kandinsky 2.1, the easiest way to perform text-to-image generation is to use the combined Kandinsky pipeline. This process is exactly the same as Kandinsky 2.1. All you need to do is to replace the Kandinsky 2.1 checkpoint with 2.2."),U=l(),h(H.$$.fragment),Bn=l(),Ie=a("p"),ma=s("Now, let\u2019s look at an example where we take separate steps to run the prior pipeline and text-to-image pipeline. This way, we can understand what\u2019s happening under the hood and how Kandinsky 2.2 differs from Kandinsky 2.1."),Kn=l(),Je=a("p"),ga=s("First, let\u2019s create the prior pipeline and text-to-image pipeline with Kandinsky 2.2 checkpoints."),ns=l(),h(Fn.$$.fragment),ts=l(),Se=a("p"),tl=s("You can then use "),ci=a("code"),al=s("pipe_prior"),il=s(" to generate image embeddings."),as=l(),h(Nn.$$.fragment),is=l(),Ye=a("p"),ol=s("Now you can pass these embeddings to the text-to-image pipeline. When using Kandinsky 2.2 you don\u2019t need to pass the "),mi=a("code"),sl=s("prompt"),rl=s(" (but you do with the previous version, Kandinsky 2.1)."),os=l(),h(Rn.$$.fragment),ss=l(),fa=a("p"),ua=a("img"),rs=l(),ha=a("p"),ll=s("We used the text-to-image pipeline as an example, but the same process applies to all decoding pipelines in Kandinsky 2.2. For more information, please refer to our API section for each pipeline."),ls=l(),Ue=a("h3"),De=a("a"),gi=a("span"),h(Xn.$$.fragment),pl=l(),fi=a("span"),dl=s("Text-to-Image Generation with ControlNet Conditioning"),ps=l(),Le=a("p"),cl=s("In the following, we give a simple example of how to use "),ya=a("a"),ml=s("KandinskyV22ControlnetPipeline"),gl=s(" to add control to the text-to-image generation with a depth image."),ds=l(),_a=a("p"),fl=s("First, let\u2019s take an image and extract its depth map."),cs=l(),h(qn.$$.fragment),ms=l(),ba=a("p"),ka=a("img"),gs=l(),ze=a("p"),ul=s("We can use the "),ui=a("code"),hl=s("depth-estimation"),yl=s(" pipeline from transformers to process the image and retrieve its depth map."),fs=l(),h(Qn.$$.fragment),us=l(),wa=a("p"),_l=s("Now, we load the prior pipeline and the text-to-image controlnet pipeline"),hs=l(),h(Sn.$$.fragment),ys=l(),va=a("p"),bl=s("We pass the prompt and negative prompt through the prior to generate image embeddings"),_s=l(),h(Yn.$$.fragment),bs=l(),Ae=a("p"),kl=s("Now we can pass the image embeddings and the depth image we extracted to the controlnet pipeline. With Kandinsky 2.2, only prior pipelines accept "),hi=a("code"),wl=s("prompt"),vl=s(" input. You do not need to pass the prompt to the controlnet pipeline."),ks=l(),h(Dn.$$.fragment),ws=l(),Ln=a("p"),Ml=s(`The output image looks as follow:
`),Ma=a("img"),vs=l(),Pe=a("h3"),He=a("a"),yi=a("span"),h(zn.$$.fragment),Tl=l(),_i=a("span"),Il=s("Image-to-Image Generation with ControlNet Conditioning"),Ms=l(),O=a("p"),Jl=s("Kandinsky 2.2 also includes a "),Ta=a("a"),Ul=s("KandinskyV22ControlnetImg2ImgPipeline"),Pl=s(" that will allow you to add control to the image generation process with both the image and its depth map. This pipeline works really well with "),Ia=a("a"),Vl=s("KandinskyV22PriorEmb2EmbPipeline"),jl=s(", which generates image embeddings based on both a text prompt and an image."),Ts=l(),Ja=a("p"),Cl=s("For our robot cat example, we will pass the prompt and cat image together to the prior pipeline to generate an image embedding. We will then use that image embedding and the depth map of the cat to further control the image generation process."),Is=l(),Ua=a("p"),Zl=s("We can use the same cat image and its depth map from the last example."),Js=l(),h(An.$$.fragment),Us=l(),Pa=a("p"),Gl=s("Here is the output. Compared with the output from our text-to-image controlnet example, it kept a lot more cat facial details from the original image and worked into the robot style we asked for."),Ps=l(),Va=a("p"),ja=a("img"),Vs=l(),Ve=a("h2"),Oe=a("a"),bi=a("span"),h(Hn.$$.fragment),Wl=l(),ki=a("span"),El=s("Optimization"),js=l(),B=a("p"),xl=s("Running Kandinsky in inference requires running both a first prior pipeline: "),Ca=a("a"),$l=s("KandinskyPriorPipeline"),Bl=s(`
and a second image decoding pipeline which is one of `),Za=a("a"),Kl=s("KandinskyPipeline"),Fl=s(", "),Ga=a("a"),Nl=s("KandinskyImg2ImgPipeline"),Rl=s(", or "),Wa=a("a"),Xl=s("KandinskyInpaintPipeline"),ql=s("."),Cs=l(),Ea=a("p"),Ql=s(`The bulk of the computation time will always be the second image decoding pipeline, so when looking
into optimizing the model, one should look into the second image decoding pipeline.`),Zs=l(),en=a("p"),Sl=s("When running with PyTorch < 2.0, we strongly recommend making use of "),On=a("a"),wi=a("code"),Yl=s("xformers"),Dl=s(`
to speed-up the optimization. This can be done by simply running:`),Gs=l(),h(et.$$.fragment),Ws=l(),nn=a("p"),Ll=s(`When running on PyTorch >= 2.0, PyTorch\u2019s SDPA attention will automatically be used. For more information on
PyTorch\u2019s SDPA, feel free to have a look at `),nt=a("a"),zl=s("this blog post"),Al=s("."),Es=l(),xa=a("p"),Hl=s("To have explicit control , you can also manually set the pipeline to use PyTorch\u2019s 2.0 efficient attention:"),xs=l(),h(tt.$$.fragment),$s=l(),ee=a("p"),Ol=s("The slowest and most memory intense attention processor is the default "),vi=a("code"),ep=s("AttnAddedKVProcessor"),np=s(` processor.
We do `),Mi=a("strong"),tp=s("not"),ap=s(` recommend using it except for testing purposes or cases where very high determistic behaviour is desired.
You can set it with:`),Bs=l(),h(at.$$.fragment),Ks=l(),ne=a("p"),ip=s("With PyTorch >= 2.0, you can also use Kandinsky with "),Ti=a("code"),op=s("torch.compile"),sp=s(` which depending
on your hardware can signficantly speed-up your inference time once the model is compiled.
To use Kandinsksy with `),Ii=a("code"),rp=s("torch.compile"),lp=s(", you can do:"),Fs=l(),h(it.$$.fragment),Ns=l(),tn=a("p"),pp=s(`After compilation you should see a very fast inference time. For more information,
feel free to have a look at `),ot=a("a"),dp=s("Our PyTorch 2.0 benchmark"),cp=s("."),Rs=l(),h(an.$$.fragment),Xs=l(),je=a("h2"),on=a("a"),Ji=a("span"),h(st.$$.fragment),mp=l(),Ui=a("span"),gp=s("Available Pipelines:"),qs=l(),sn=a("table"),Pi=a("thead"),rt=a("tr"),Vi=a("th"),fp=s("Pipeline"),up=l(),ji=a("th"),hp=s("Tasks"),yp=l(),C=a("tbody"),lt=a("tr"),Ci=a("td"),pt=a("a"),_p=s("pipeline_kandinsky2_2.py"),bp=l(),Zi=a("td"),Gi=a("em"),kp=s("Text-to-Image Generation"),wp=l(),dt=a("tr"),Wi=a("td"),ct=a("a"),vp=s("pipeline_kandinsky2_2_combined.py"),Mp=l(),Ei=a("td"),xi=a("em"),Tp=s("End-to-end Text-to-Image, image-to-image, Inpainting Generation"),Ip=l(),mt=a("tr"),$i=a("td"),gt=a("a"),Jp=s("pipeline_kandinsky2_2_inpaint.py"),Up=l(),Bi=a("td"),Ki=a("em"),Pp=s("Image-Guided Image Generation"),Vp=l(),ft=a("tr"),Fi=a("td"),ut=a("a"),jp=s("pipeline_kandinsky2_2_img2img.py"),Cp=l(),Ni=a("td"),Ri=a("em"),Zp=s("Image-Guided Image Generation"),Gp=l(),ht=a("tr"),Xi=a("td"),yt=a("a"),Wp=s("pipeline_kandinsky2_2_controlnet.py"),Ep=l(),qi=a("td"),Qi=a("em"),xp=s("Image-Guided Image Generation"),$p=l(),_t=a("tr"),Si=a("td"),bt=a("a"),Bp=s("pipeline_kandinsky2_2_controlnet_img2img.py"),Kp=l(),Yi=a("td"),Di=a("em"),Fp=s("Image-Guided Image Generation"),Qs=l(),Ce=a("h3"),rn=a("a"),Li=a("span"),h(kt.$$.fragment),Np=l(),zi=a("span"),Rp=s("KandinskyV22Pipeline"),Ss=l(),K=a("div"),h(wt.$$.fragment),Xp=l(),Ai=a("p"),qp=s("Pipeline for text-to-image generation using Kandinsky"),Qp=l(),vt=a("p"),Sp=s("This model inherits from "),$a=a("a"),Yp=s("DiffusionPipeline"),Dp=s(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Lp=l(),te=a("div"),h(Mt.$$.fragment),zp=l(),Hi=a("p"),Ap=s("Function invoked when calling the pipeline for generation."),Hp=l(),h(ln.$$.fragment),Ys=l(),Ze=a("h3"),pn=a("a"),Oi=a("span"),h(Tt.$$.fragment),Op=l(),eo=a("span"),ed=s("KandinskyV22ControlnetPipeline"),Ds=l(),F=a("div"),h(It.$$.fragment),nd=l(),no=a("p"),td=s("Pipeline for text-to-image generation using Kandinsky"),ad=l(),Jt=a("p"),id=s("This model inherits from "),Ba=a("a"),od=s("DiffusionPipeline"),sd=s(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),rd=l(),ae=a("div"),h(Ut.$$.fragment),ld=l(),to=a("p"),pd=s("Function invoked when calling the pipeline for generation."),dd=l(),ao=a("p"),cd=s("Examples:"),Ls=l(),Ge=a("h3"),dn=a("a"),io=a("span"),h(Pt.$$.fragment),md=l(),oo=a("span"),gd=s("KandinskyV22ControlnetImg2ImgPipeline"),zs=l(),N=a("div"),h(Vt.$$.fragment),fd=l(),so=a("p"),ud=s("Pipeline for image-to-image generation using Kandinsky"),hd=l(),jt=a("p"),yd=s("This model inherits from "),Ka=a("a"),_d=s("DiffusionPipeline"),bd=s(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),kd=l(),ie=a("div"),h(Ct.$$.fragment),wd=l(),ro=a("p"),vd=s("Function invoked when calling the pipeline for generation."),Md=l(),lo=a("p"),Td=s("Examples:"),As=l(),We=a("h3"),cn=a("a"),po=a("span"),h(Zt.$$.fragment),Id=l(),co=a("span"),Jd=s("KandinskyV22Img2ImgPipeline"),Hs=l(),R=a("div"),h(Gt.$$.fragment),Ud=l(),mo=a("p"),Pd=s("Pipeline for image-to-image generation using Kandinsky"),Vd=l(),Wt=a("p"),jd=s("This model inherits from "),Fa=a("a"),Cd=s("DiffusionPipeline"),Zd=s(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Gd=l(),oe=a("div"),h(Et.$$.fragment),Wd=l(),go=a("p"),Ed=s("Function invoked when calling the pipeline for generation."),xd=l(),fo=a("p"),$d=s("Examples:"),Os=l(),Ee=a("h3"),mn=a("a"),uo=a("span"),h(xt.$$.fragment),Bd=l(),ho=a("span"),Kd=s("KandinskyV22InpaintPipeline"),er=l(),X=a("div"),h($t.$$.fragment),Fd=l(),yo=a("p"),Nd=s("Pipeline for text-guided image inpainting using Kandinsky2.1"),Rd=l(),Bt=a("p"),Xd=s("This model inherits from "),Na=a("a"),qd=s("DiffusionPipeline"),Qd=s(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Sd=l(),se=a("div"),h(Kt.$$.fragment),Yd=l(),_o=a("p"),Dd=s("Function invoked when calling the pipeline for generation."),Ld=l(),bo=a("p"),zd=s("Examples:"),nr=l(),xe=a("h3"),gn=a("a"),ko=a("span"),h(Ft.$$.fragment),Ad=l(),wo=a("span"),Hd=s("KandinskyV22PriorPipeline"),tr=l(),Z=a("div"),h(Nt.$$.fragment),Od=l(),vo=a("p"),ec=s("Pipeline for generating image prior for Kandinsky"),nc=l(),Rt=a("p"),tc=s("This model inherits from "),Ra=a("a"),ac=s("DiffusionPipeline"),ic=s(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),oc=l(),re=a("div"),h(Xt.$$.fragment),sc=l(),Mo=a("p"),rc=s("Function invoked when calling the pipeline for generation."),lc=l(),h(fn.$$.fragment),pc=l(),le=a("div"),h(qt.$$.fragment),dc=l(),To=a("p"),cc=s("Function invoked when using the prior pipeline for interpolation."),mc=l(),h(un.$$.fragment),ar=l(),$e=a("h3"),hn=a("a"),Io=a("span"),h(Qt.$$.fragment),gc=l(),Jo=a("span"),fc=s("KandinskyV22PriorEmb2EmbPipeline"),ir=l(),G=a("div"),h(St.$$.fragment),uc=l(),Uo=a("p"),hc=s("Pipeline for generating image prior for Kandinsky"),yc=l(),Yt=a("p"),_c=s("This model inherits from "),Xa=a("a"),bc=s("DiffusionPipeline"),kc=s(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),wc=l(),pe=a("div"),h(Dt.$$.fragment),vc=l(),Po=a("p"),Mc=s("Function invoked when calling the pipeline for generation."),Tc=l(),h(yn.$$.fragment),Ic=l(),de=a("div"),h(Lt.$$.fragment),Jc=l(),Vo=a("p"),Uc=s("Function invoked when using the prior pipeline for interpolation."),Pc=l(),h(_n.$$.fragment),or=l(),Be=a("h3"),bn=a("a"),jo=a("span"),h(zt.$$.fragment),Vc=l(),Co=a("span"),jc=s("KandinskyV22CombinedPipeline"),sr=l(),W=a("div"),h(At.$$.fragment),Cc=l(),Zo=a("p"),Zc=s("Combined Pipeline for text-to-image generation using Kandinsky"),Gc=l(),Ht=a("p"),Wc=s("This model inherits from "),qa=a("a"),Ec=s("DiffusionPipeline"),xc=s(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),$c=l(),ce=a("div"),h(Ot.$$.fragment),Bc=l(),Go=a("p"),Kc=s("Function invoked when calling the pipeline for generation."),Fc=l(),h(kn.$$.fragment),Nc=l(),wn=a("div"),h(ea.$$.fragment),Rc=l(),Ke=a("p"),Xc=s(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),Wo=a("code"),qc=s("torch.device('meta') and loaded to GPU only when their specific submodule has its "),Qc=s("forward"),Eo=a("code"),Sc=s("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),Yc=s("enable_model_cpu_offload`, but performance is lower."),rr=l(),Fe=a("h3"),vn=a("a"),xo=a("span"),h(na.$$.fragment),Dc=l(),$o=a("span"),Lc=s("KandinskyV22Img2ImgCombinedPipeline"),lr=l(),E=a("div"),h(ta.$$.fragment),zc=l(),Bo=a("p"),Ac=s("Combined Pipeline for image-to-image generation using Kandinsky"),Hc=l(),aa=a("p"),Oc=s("This model inherits from "),Qa=a("a"),em=s("DiffusionPipeline"),nm=s(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),tm=l(),me=a("div"),h(ia.$$.fragment),am=l(),Ko=a("p"),im=s("Function invoked when calling the pipeline for generation."),om=l(),h(Mn.$$.fragment),sm=l(),Tn=a("div"),h(oa.$$.fragment),rm=l(),Ne=a("p"),lm=s(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),Fo=a("code"),pm=s("torch.device('meta') and loaded to GPU only when their specific submodule has its "),dm=s("forward"),No=a("code"),cm=s("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),mm=s("enable_model_cpu_offload`, but performance is lower."),pr=l(),Re=a("h3"),In=a("a"),Ro=a("span"),h(sa.$$.fragment),gm=l(),Xo=a("span"),fm=s("KandinskyV22InpaintCombinedPipeline"),dr=l(),x=a("div"),h(ra.$$.fragment),um=l(),qo=a("p"),hm=s("Combined Pipeline for inpainting generation using Kandinsky"),ym=l(),la=a("p"),_m=s("This model inherits from "),Sa=a("a"),bm=s("DiffusionPipeline"),km=s(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),wm=l(),ge=a("div"),h(pa.$$.fragment),vm=l(),Qo=a("p"),Mm=s("Function invoked when calling the pipeline for generation."),Tm=l(),h(Jn.$$.fragment),Im=l(),Un=a("div"),h(da.$$.fragment),Jm=l(),Xe=a("p"),Um=s(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),So=a("code"),Pm=s("torch.device('meta') and loaded to GPU only when their specific submodule has its "),Vm=s("forward"),Yo=a("code"),jm=s("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),Cm=s("enable_model_cpu_offload`, but performance is lower."),this.h()},l(e){const d=Mu('[data-svelte="svelte-1phssyn"]',document.head);f=i(d,"META",{name:!0,content:!0}),d.forEach(t),I=p(e),M=i(e,"H1",{class:!0});var ca=o(M);u=i(ca,"A",{id:!0,class:!0,href:!0});var Do=o(u);T=i(Do,"SPAN",{});var Lo=o(T);y(c.$$.fragment,Lo),Lo.forEach(t),Do.forEach(t),v=p(ca),ke=i(ca,"SPAN",{});var zo=o(ke);S=r(zo,"Kandinsky 2.2"),zo.forEach(t),ca.forEach(t),qe=p(e),j=i(e,"P",{});var Q=o(j);Y=r(Q,"The Kandinsky 2.2 release includes robust new text-to-image models that support text-to-image generation, image-to-image generation, image interpolation, and text-guided image inpainting. The general workflow to perform these tasks using Kandinsky 2.2 is the same as in Kandinsky 2.1. First, you will need to use a prior pipeline to generate image embeddings based on your text prompt, and then use one of the image decoding pipelines to generate the output image. The only difference is that in Kandinsky 2.2, all of the decoding pipelines no longer accept the "),we=i(Q,"CODE",{});var Ao=o(we);En=r(Ao,"prompt"),Ao.forEach(t),D=r(Q," input, and the image generation process is conditioned with only "),ve=i(Q,"CODE",{});var Ho=o(ve);xn=r(Ho,"image_embeds"),Ho.forEach(t),L=r(Q," and "),Me=i(Q,"CODE",{});var Oo=o(Me);$n=r(Oo,"negative_image_embeds"),Oo.forEach(t),z=r(Q,"."),Q.forEach(t),Qe=p(e),A=i(e,"P",{});var es=o(A);Te=r(es,"Same as with Kandinsky 2.1, the easiest way to perform text-to-image generation is to use the combined Kandinsky pipeline. This process is exactly the same as Kandinsky 2.1. All you need to do is to replace the Kandinsky 2.1 checkpoint with 2.2."),es.forEach(t),U=p(e),y(H.$$.fragment,e),Bn=p(e),Ie=i(e,"P",{});var $m=o(Ie);ma=r($m,"Now, let\u2019s look at an example where we take separate steps to run the prior pipeline and text-to-image pipeline. This way, we can understand what\u2019s happening under the hood and how Kandinsky 2.2 differs from Kandinsky 2.1."),$m.forEach(t),Kn=p(e),Je=i(e,"P",{});var Bm=o(Je);ga=r(Bm,"First, let\u2019s create the prior pipeline and text-to-image pipeline with Kandinsky 2.2 checkpoints."),Bm.forEach(t),ns=p(e),y(Fn.$$.fragment,e),ts=p(e),Se=i(e,"P",{});var mr=o(Se);tl=r(mr,"You can then use "),ci=i(mr,"CODE",{});var Km=o(ci);al=r(Km,"pipe_prior"),Km.forEach(t),il=r(mr," to generate image embeddings."),mr.forEach(t),as=p(e),y(Nn.$$.fragment,e),is=p(e),Ye=i(e,"P",{});var gr=o(Ye);ol=r(gr,"Now you can pass these embeddings to the text-to-image pipeline. When using Kandinsky 2.2 you don\u2019t need to pass the "),mi=i(gr,"CODE",{});var Fm=o(mi);sl=r(Fm,"prompt"),Fm.forEach(t),rl=r(gr," (but you do with the previous version, Kandinsky 2.1)."),gr.forEach(t),os=p(e),y(Rn.$$.fragment,e),ss=p(e),fa=i(e,"P",{});var Nm=o(fa);ua=i(Nm,"IMG",{src:!0,alt:!0}),Nm.forEach(t),rs=p(e),ha=i(e,"P",{});var Rm=o(ha);ll=r(Rm,"We used the text-to-image pipeline as an example, but the same process applies to all decoding pipelines in Kandinsky 2.2. For more information, please refer to our API section for each pipeline."),Rm.forEach(t),ls=p(e),Ue=i(e,"H3",{class:!0});var fr=o(Ue);De=i(fr,"A",{id:!0,class:!0,href:!0});var Xm=o(De);gi=i(Xm,"SPAN",{});var qm=o(gi);y(Xn.$$.fragment,qm),qm.forEach(t),Xm.forEach(t),pl=p(fr),fi=i(fr,"SPAN",{});var Qm=o(fi);dl=r(Qm,"Text-to-Image Generation with ControlNet Conditioning"),Qm.forEach(t),fr.forEach(t),ps=p(e),Le=i(e,"P",{});var ur=o(Le);cl=r(ur,"In the following, we give a simple example of how to use "),ya=i(ur,"A",{href:!0});var Sm=o(ya);ml=r(Sm,"KandinskyV22ControlnetPipeline"),Sm.forEach(t),gl=r(ur," to add control to the text-to-image generation with a depth image."),ur.forEach(t),ds=p(e),_a=i(e,"P",{});var Ym=o(_a);fl=r(Ym,"First, let\u2019s take an image and extract its depth map."),Ym.forEach(t),cs=p(e),y(qn.$$.fragment,e),ms=p(e),ba=i(e,"P",{});var Dm=o(ba);ka=i(Dm,"IMG",{src:!0,alt:!0}),Dm.forEach(t),gs=p(e),ze=i(e,"P",{});var hr=o(ze);ul=r(hr,"We can use the "),ui=i(hr,"CODE",{});var Lm=o(ui);hl=r(Lm,"depth-estimation"),Lm.forEach(t),yl=r(hr," pipeline from transformers to process the image and retrieve its depth map."),hr.forEach(t),fs=p(e),y(Qn.$$.fragment,e),us=p(e),wa=i(e,"P",{});var zm=o(wa);_l=r(zm,"Now, we load the prior pipeline and the text-to-image controlnet pipeline"),zm.forEach(t),hs=p(e),y(Sn.$$.fragment,e),ys=p(e),va=i(e,"P",{});var Am=o(va);bl=r(Am,"We pass the prompt and negative prompt through the prior to generate image embeddings"),Am.forEach(t),_s=p(e),y(Yn.$$.fragment,e),bs=p(e),Ae=i(e,"P",{});var yr=o(Ae);kl=r(yr,"Now we can pass the image embeddings and the depth image we extracted to the controlnet pipeline. With Kandinsky 2.2, only prior pipelines accept "),hi=i(yr,"CODE",{});var Hm=o(hi);wl=r(Hm,"prompt"),Hm.forEach(t),vl=r(yr," input. You do not need to pass the prompt to the controlnet pipeline."),yr.forEach(t),ks=p(e),y(Dn.$$.fragment,e),ws=p(e),Ln=i(e,"P",{});var Zm=o(Ln);Ml=r(Zm,`The output image looks as follow:
`),Ma=i(Zm,"IMG",{src:!0,alt:!0}),Zm.forEach(t),vs=p(e),Pe=i(e,"H3",{class:!0});var _r=o(Pe);He=i(_r,"A",{id:!0,class:!0,href:!0});var Om=o(He);yi=i(Om,"SPAN",{});var eg=o(yi);y(zn.$$.fragment,eg),eg.forEach(t),Om.forEach(t),Tl=p(_r),_i=i(_r,"SPAN",{});var ng=o(_i);Il=r(ng,"Image-to-Image Generation with ControlNet Conditioning"),ng.forEach(t),_r.forEach(t),Ms=p(e),O=i(e,"P",{});var Ya=o(O);Jl=r(Ya,"Kandinsky 2.2 also includes a "),Ta=i(Ya,"A",{href:!0});var tg=o(Ta);Ul=r(tg,"KandinskyV22ControlnetImg2ImgPipeline"),tg.forEach(t),Pl=r(Ya," that will allow you to add control to the image generation process with both the image and its depth map. This pipeline works really well with "),Ia=i(Ya,"A",{href:!0});var ag=o(Ia);Vl=r(ag,"KandinskyV22PriorEmb2EmbPipeline"),ag.forEach(t),jl=r(Ya,", which generates image embeddings based on both a text prompt and an image."),Ya.forEach(t),Ts=p(e),Ja=i(e,"P",{});var ig=o(Ja);Cl=r(ig,"For our robot cat example, we will pass the prompt and cat image together to the prior pipeline to generate an image embedding. We will then use that image embedding and the depth map of the cat to further control the image generation process."),ig.forEach(t),Is=p(e),Ua=i(e,"P",{});var og=o(Ua);Zl=r(og,"We can use the same cat image and its depth map from the last example."),og.forEach(t),Js=p(e),y(An.$$.fragment,e),Us=p(e),Pa=i(e,"P",{});var sg=o(Pa);Gl=r(sg,"Here is the output. Compared with the output from our text-to-image controlnet example, it kept a lot more cat facial details from the original image and worked into the robot style we asked for."),sg.forEach(t),Ps=p(e),Va=i(e,"P",{});var rg=o(Va);ja=i(rg,"IMG",{src:!0,alt:!0}),rg.forEach(t),Vs=p(e),Ve=i(e,"H2",{class:!0});var br=o(Ve);Oe=i(br,"A",{id:!0,class:!0,href:!0});var lg=o(Oe);bi=i(lg,"SPAN",{});var pg=o(bi);y(Hn.$$.fragment,pg),pg.forEach(t),lg.forEach(t),Wl=p(br),ki=i(br,"SPAN",{});var dg=o(ki);El=r(dg,"Optimization"),dg.forEach(t),br.forEach(t),js=p(e),B=i(e,"P",{});var fe=o(B);xl=r(fe,"Running Kandinsky in inference requires running both a first prior pipeline: "),Ca=i(fe,"A",{href:!0});var cg=o(Ca);$l=r(cg,"KandinskyPriorPipeline"),cg.forEach(t),Bl=r(fe,`
and a second image decoding pipeline which is one of `),Za=i(fe,"A",{href:!0});var mg=o(Za);Kl=r(mg,"KandinskyPipeline"),mg.forEach(t),Fl=r(fe,", "),Ga=i(fe,"A",{href:!0});var gg=o(Ga);Nl=r(gg,"KandinskyImg2ImgPipeline"),gg.forEach(t),Rl=r(fe,", or "),Wa=i(fe,"A",{href:!0});var fg=o(Wa);Xl=r(fg,"KandinskyInpaintPipeline"),fg.forEach(t),ql=r(fe,"."),fe.forEach(t),Cs=p(e),Ea=i(e,"P",{});var ug=o(Ea);Ql=r(ug,`The bulk of the computation time will always be the second image decoding pipeline, so when looking
into optimizing the model, one should look into the second image decoding pipeline.`),ug.forEach(t),Zs=p(e),en=i(e,"P",{});var kr=o(en);Sl=r(kr,"When running with PyTorch < 2.0, we strongly recommend making use of "),On=i(kr,"A",{href:!0,rel:!0});var hg=o(On);wi=i(hg,"CODE",{});var yg=o(wi);Yl=r(yg,"xformers"),yg.forEach(t),hg.forEach(t),Dl=r(kr,`
to speed-up the optimization. This can be done by simply running:`),kr.forEach(t),Gs=p(e),y(et.$$.fragment,e),Ws=p(e),nn=i(e,"P",{});var wr=o(nn);Ll=r(wr,`When running on PyTorch >= 2.0, PyTorch\u2019s SDPA attention will automatically be used. For more information on
PyTorch\u2019s SDPA, feel free to have a look at `),nt=i(wr,"A",{href:!0,rel:!0});var _g=o(nt);zl=r(_g,"this blog post"),_g.forEach(t),Al=r(wr,"."),wr.forEach(t),Es=p(e),xa=i(e,"P",{});var bg=o(xa);Hl=r(bg,"To have explicit control , you can also manually set the pipeline to use PyTorch\u2019s 2.0 efficient attention:"),bg.forEach(t),xs=p(e),y(tt.$$.fragment,e),$s=p(e),ee=i(e,"P",{});var Da=o(ee);Ol=r(Da,"The slowest and most memory intense attention processor is the default "),vi=i(Da,"CODE",{});var kg=o(vi);ep=r(kg,"AttnAddedKVProcessor"),kg.forEach(t),np=r(Da,` processor.
We do `),Mi=i(Da,"STRONG",{});var wg=o(Mi);tp=r(wg,"not"),wg.forEach(t),ap=r(Da,` recommend using it except for testing purposes or cases where very high determistic behaviour is desired.
You can set it with:`),Da.forEach(t),Bs=p(e),y(at.$$.fragment,e),Ks=p(e),ne=i(e,"P",{});var La=o(ne);ip=r(La,"With PyTorch >= 2.0, you can also use Kandinsky with "),Ti=i(La,"CODE",{});var vg=o(Ti);op=r(vg,"torch.compile"),vg.forEach(t),sp=r(La,` which depending
on your hardware can signficantly speed-up your inference time once the model is compiled.
To use Kandinsksy with `),Ii=i(La,"CODE",{});var Mg=o(Ii);rp=r(Mg,"torch.compile"),Mg.forEach(t),lp=r(La,", you can do:"),La.forEach(t),Fs=p(e),y(it.$$.fragment,e),Ns=p(e),tn=i(e,"P",{});var vr=o(tn);pp=r(vr,`After compilation you should see a very fast inference time. For more information,
feel free to have a look at `),ot=i(vr,"A",{href:!0,rel:!0});var Tg=o(ot);dp=r(Tg,"Our PyTorch 2.0 benchmark"),Tg.forEach(t),cp=r(vr,"."),vr.forEach(t),Rs=p(e),y(an.$$.fragment,e),Xs=p(e),je=i(e,"H2",{class:!0});var Mr=o(je);on=i(Mr,"A",{id:!0,class:!0,href:!0});var Ig=o(on);Ji=i(Ig,"SPAN",{});var Jg=o(Ji);y(st.$$.fragment,Jg),Jg.forEach(t),Ig.forEach(t),mp=p(Mr),Ui=i(Mr,"SPAN",{});var Ug=o(Ui);gp=r(Ug,"Available Pipelines:"),Ug.forEach(t),Mr.forEach(t),qs=p(e),sn=i(e,"TABLE",{});var Tr=o(sn);Pi=i(Tr,"THEAD",{});var Pg=o(Pi);rt=i(Pg,"TR",{});var Ir=o(rt);Vi=i(Ir,"TH",{});var Vg=o(Vi);fp=r(Vg,"Pipeline"),Vg.forEach(t),up=p(Ir),ji=i(Ir,"TH",{});var jg=o(ji);hp=r(jg,"Tasks"),jg.forEach(t),Ir.forEach(t),Pg.forEach(t),yp=p(Tr),C=i(Tr,"TBODY",{});var q=o(C);lt=i(q,"TR",{});var Jr=o(lt);Ci=i(Jr,"TD",{});var Cg=o(Ci);pt=i(Cg,"A",{href:!0,rel:!0});var Zg=o(pt);_p=r(Zg,"pipeline_kandinsky2_2.py"),Zg.forEach(t),Cg.forEach(t),bp=p(Jr),Zi=i(Jr,"TD",{});var Gg=o(Zi);Gi=i(Gg,"EM",{});var Wg=o(Gi);kp=r(Wg,"Text-to-Image Generation"),Wg.forEach(t),Gg.forEach(t),Jr.forEach(t),wp=p(q),dt=i(q,"TR",{});var Ur=o(dt);Wi=i(Ur,"TD",{});var Eg=o(Wi);ct=i(Eg,"A",{href:!0,rel:!0});var xg=o(ct);vp=r(xg,"pipeline_kandinsky2_2_combined.py"),xg.forEach(t),Eg.forEach(t),Mp=p(Ur),Ei=i(Ur,"TD",{});var $g=o(Ei);xi=i($g,"EM",{});var Bg=o(xi);Tp=r(Bg,"End-to-end Text-to-Image, image-to-image, Inpainting Generation"),Bg.forEach(t),$g.forEach(t),Ur.forEach(t),Ip=p(q),mt=i(q,"TR",{});var Pr=o(mt);$i=i(Pr,"TD",{});var Kg=o($i);gt=i(Kg,"A",{href:!0,rel:!0});var Fg=o(gt);Jp=r(Fg,"pipeline_kandinsky2_2_inpaint.py"),Fg.forEach(t),Kg.forEach(t),Up=p(Pr),Bi=i(Pr,"TD",{});var Ng=o(Bi);Ki=i(Ng,"EM",{});var Rg=o(Ki);Pp=r(Rg,"Image-Guided Image Generation"),Rg.forEach(t),Ng.forEach(t),Pr.forEach(t),Vp=p(q),ft=i(q,"TR",{});var Vr=o(ft);Fi=i(Vr,"TD",{});var Xg=o(Fi);ut=i(Xg,"A",{href:!0,rel:!0});var qg=o(ut);jp=r(qg,"pipeline_kandinsky2_2_img2img.py"),qg.forEach(t),Xg.forEach(t),Cp=p(Vr),Ni=i(Vr,"TD",{});var Qg=o(Ni);Ri=i(Qg,"EM",{});var Sg=o(Ri);Zp=r(Sg,"Image-Guided Image Generation"),Sg.forEach(t),Qg.forEach(t),Vr.forEach(t),Gp=p(q),ht=i(q,"TR",{});var jr=o(ht);Xi=i(jr,"TD",{});var Yg=o(Xi);yt=i(Yg,"A",{href:!0,rel:!0});var Dg=o(yt);Wp=r(Dg,"pipeline_kandinsky2_2_controlnet.py"),Dg.forEach(t),Yg.forEach(t),Ep=p(jr),qi=i(jr,"TD",{});var Lg=o(qi);Qi=i(Lg,"EM",{});var zg=o(Qi);xp=r(zg,"Image-Guided Image Generation"),zg.forEach(t),Lg.forEach(t),jr.forEach(t),$p=p(q),_t=i(q,"TR",{});var Cr=o(_t);Si=i(Cr,"TD",{});var Ag=o(Si);bt=i(Ag,"A",{href:!0,rel:!0});var Hg=o(bt);Bp=r(Hg,"pipeline_kandinsky2_2_controlnet_img2img.py"),Hg.forEach(t),Ag.forEach(t),Kp=p(Cr),Yi=i(Cr,"TD",{});var Og=o(Yi);Di=i(Og,"EM",{});var ef=o(Di);Fp=r(ef,"Image-Guided Image Generation"),ef.forEach(t),Og.forEach(t),Cr.forEach(t),q.forEach(t),Tr.forEach(t),Qs=p(e),Ce=i(e,"H3",{class:!0});var Zr=o(Ce);rn=i(Zr,"A",{id:!0,class:!0,href:!0});var nf=o(rn);Li=i(nf,"SPAN",{});var tf=o(Li);y(kt.$$.fragment,tf),tf.forEach(t),nf.forEach(t),Np=p(Zr),zi=i(Zr,"SPAN",{});var af=o(zi);Rp=r(af,"KandinskyV22Pipeline"),af.forEach(t),Zr.forEach(t),Ss=p(e),K=i(e,"DIV",{class:!0});var Pn=o(K);y(wt.$$.fragment,Pn),Xp=p(Pn),Ai=i(Pn,"P",{});var of=o(Ai);qp=r(of,"Pipeline for text-to-image generation using Kandinsky"),of.forEach(t),Qp=p(Pn),vt=i(Pn,"P",{});var Gr=o(vt);Sp=r(Gr,"This model inherits from "),$a=i(Gr,"A",{href:!0});var sf=o($a);Yp=r(sf,"DiffusionPipeline"),sf.forEach(t),Dp=r(Gr,`. 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.)`),Gr.forEach(t),Lp=p(Pn),te=i(Pn,"DIV",{class:!0});var za=o(te);y(Mt.$$.fragment,za),zp=p(za),Hi=i(za,"P",{});var rf=o(Hi);Ap=r(rf,"Function invoked when calling the pipeline for generation."),rf.forEach(t),Hp=p(za),y(ln.$$.fragment,za),za.forEach(t),Pn.forEach(t),Ys=p(e),Ze=i(e,"H3",{class:!0});var Wr=o(Ze);pn=i(Wr,"A",{id:!0,class:!0,href:!0});var lf=o(pn);Oi=i(lf,"SPAN",{});var pf=o(Oi);y(Tt.$$.fragment,pf),pf.forEach(t),lf.forEach(t),Op=p(Wr),eo=i(Wr,"SPAN",{});var df=o(eo);ed=r(df,"KandinskyV22ControlnetPipeline"),df.forEach(t),Wr.forEach(t),Ds=p(e),F=i(e,"DIV",{class:!0});var Vn=o(F);y(It.$$.fragment,Vn),nd=p(Vn),no=i(Vn,"P",{});var cf=o(no);td=r(cf,"Pipeline for text-to-image generation using Kandinsky"),cf.forEach(t),ad=p(Vn),Jt=i(Vn,"P",{});var Er=o(Jt);id=r(Er,"This model inherits from "),Ba=i(Er,"A",{href:!0});var mf=o(Ba);od=r(mf,"DiffusionPipeline"),mf.forEach(t),sd=r(Er,`. 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.)`),Er.forEach(t),rd=p(Vn),ae=i(Vn,"DIV",{class:!0});var Aa=o(ae);y(Ut.$$.fragment,Aa),ld=p(Aa),to=i(Aa,"P",{});var gf=o(to);pd=r(gf,"Function invoked when calling the pipeline for generation."),gf.forEach(t),dd=p(Aa),ao=i(Aa,"P",{});var ff=o(ao);cd=r(ff,"Examples:"),ff.forEach(t),Aa.forEach(t),Vn.forEach(t),Ls=p(e),Ge=i(e,"H3",{class:!0});var xr=o(Ge);dn=i(xr,"A",{id:!0,class:!0,href:!0});var uf=o(dn);io=i(uf,"SPAN",{});var hf=o(io);y(Pt.$$.fragment,hf),hf.forEach(t),uf.forEach(t),md=p(xr),oo=i(xr,"SPAN",{});var yf=o(oo);gd=r(yf,"KandinskyV22ControlnetImg2ImgPipeline"),yf.forEach(t),xr.forEach(t),zs=p(e),N=i(e,"DIV",{class:!0});var jn=o(N);y(Vt.$$.fragment,jn),fd=p(jn),so=i(jn,"P",{});var _f=o(so);ud=r(_f,"Pipeline for image-to-image generation using Kandinsky"),_f.forEach(t),hd=p(jn),jt=i(jn,"P",{});var $r=o(jt);yd=r($r,"This model inherits from "),Ka=i($r,"A",{href:!0});var bf=o(Ka);_d=r(bf,"DiffusionPipeline"),bf.forEach(t),bd=r($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.)`),$r.forEach(t),kd=p(jn),ie=i(jn,"DIV",{class:!0});var Ha=o(ie);y(Ct.$$.fragment,Ha),wd=p(Ha),ro=i(Ha,"P",{});var kf=o(ro);vd=r(kf,"Function invoked when calling the pipeline for generation."),kf.forEach(t),Md=p(Ha),lo=i(Ha,"P",{});var wf=o(lo);Td=r(wf,"Examples:"),wf.forEach(t),Ha.forEach(t),jn.forEach(t),As=p(e),We=i(e,"H3",{class:!0});var Br=o(We);cn=i(Br,"A",{id:!0,class:!0,href:!0});var vf=o(cn);po=i(vf,"SPAN",{});var Mf=o(po);y(Zt.$$.fragment,Mf),Mf.forEach(t),vf.forEach(t),Id=p(Br),co=i(Br,"SPAN",{});var Tf=o(co);Jd=r(Tf,"KandinskyV22Img2ImgPipeline"),Tf.forEach(t),Br.forEach(t),Hs=p(e),R=i(e,"DIV",{class:!0});var Cn=o(R);y(Gt.$$.fragment,Cn),Ud=p(Cn),mo=i(Cn,"P",{});var If=o(mo);Pd=r(If,"Pipeline for image-to-image generation using Kandinsky"),If.forEach(t),Vd=p(Cn),Wt=i(Cn,"P",{});var Kr=o(Wt);jd=r(Kr,"This model inherits from "),Fa=i(Kr,"A",{href:!0});var Jf=o(Fa);Cd=r(Jf,"DiffusionPipeline"),Jf.forEach(t),Zd=r(Kr,`. 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.)`),Kr.forEach(t),Gd=p(Cn),oe=i(Cn,"DIV",{class:!0});var Oa=o(oe);y(Et.$$.fragment,Oa),Wd=p(Oa),go=i(Oa,"P",{});var Uf=o(go);Ed=r(Uf,"Function invoked when calling the pipeline for generation."),Uf.forEach(t),xd=p(Oa),fo=i(Oa,"P",{});var Pf=o(fo);$d=r(Pf,"Examples:"),Pf.forEach(t),Oa.forEach(t),Cn.forEach(t),Os=p(e),Ee=i(e,"H3",{class:!0});var Fr=o(Ee);mn=i(Fr,"A",{id:!0,class:!0,href:!0});var Vf=o(mn);uo=i(Vf,"SPAN",{});var jf=o(uo);y(xt.$$.fragment,jf),jf.forEach(t),Vf.forEach(t),Bd=p(Fr),ho=i(Fr,"SPAN",{});var Cf=o(ho);Kd=r(Cf,"KandinskyV22InpaintPipeline"),Cf.forEach(t),Fr.forEach(t),er=p(e),X=i(e,"DIV",{class:!0});var Zn=o(X);y($t.$$.fragment,Zn),Fd=p(Zn),yo=i(Zn,"P",{});var Zf=o(yo);Nd=r(Zf,"Pipeline for text-guided image inpainting using Kandinsky2.1"),Zf.forEach(t),Rd=p(Zn),Bt=i(Zn,"P",{});var Nr=o(Bt);Xd=r(Nr,"This model inherits from "),Na=i(Nr,"A",{href:!0});var Gf=o(Na);qd=r(Gf,"DiffusionPipeline"),Gf.forEach(t),Qd=r(Nr,`. 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.)`),Nr.forEach(t),Sd=p(Zn),se=i(Zn,"DIV",{class:!0});var ei=o(se);y(Kt.$$.fragment,ei),Yd=p(ei),_o=i(ei,"P",{});var Wf=o(_o);Dd=r(Wf,"Function invoked when calling the pipeline for generation."),Wf.forEach(t),Ld=p(ei),bo=i(ei,"P",{});var Ef=o(bo);zd=r(Ef,"Examples:"),Ef.forEach(t),ei.forEach(t),Zn.forEach(t),nr=p(e),xe=i(e,"H3",{class:!0});var Rr=o(xe);gn=i(Rr,"A",{id:!0,class:!0,href:!0});var xf=o(gn);ko=i(xf,"SPAN",{});var $f=o(ko);y(Ft.$$.fragment,$f),$f.forEach(t),xf.forEach(t),Ad=p(Rr),wo=i(Rr,"SPAN",{});var Bf=o(wo);Hd=r(Bf,"KandinskyV22PriorPipeline"),Bf.forEach(t),Rr.forEach(t),tr=p(e),Z=i(e,"DIV",{class:!0});var ue=o(Z);y(Nt.$$.fragment,ue),Od=p(ue),vo=i(ue,"P",{});var Kf=o(vo);ec=r(Kf,"Pipeline for generating image prior for Kandinsky"),Kf.forEach(t),nc=p(ue),Rt=i(ue,"P",{});var Xr=o(Rt);tc=r(Xr,"This model inherits from "),Ra=i(Xr,"A",{href:!0});var Ff=o(Ra);ac=r(Ff,"DiffusionPipeline"),Ff.forEach(t),ic=r(Xr,`. 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.)`),Xr.forEach(t),oc=p(ue),re=i(ue,"DIV",{class:!0});var ni=o(re);y(Xt.$$.fragment,ni),sc=p(ni),Mo=i(ni,"P",{});var Nf=o(Mo);rc=r(Nf,"Function invoked when calling the pipeline for generation."),Nf.forEach(t),lc=p(ni),y(fn.$$.fragment,ni),ni.forEach(t),pc=p(ue),le=i(ue,"DIV",{class:!0});var ti=o(le);y(qt.$$.fragment,ti),dc=p(ti),To=i(ti,"P",{});var Rf=o(To);cc=r(Rf,"Function invoked when using the prior pipeline for interpolation."),Rf.forEach(t),mc=p(ti),y(un.$$.fragment,ti),ti.forEach(t),ue.forEach(t),ar=p(e),$e=i(e,"H3",{class:!0});var qr=o($e);hn=i(qr,"A",{id:!0,class:!0,href:!0});var Xf=o(hn);Io=i(Xf,"SPAN",{});var qf=o(Io);y(Qt.$$.fragment,qf),qf.forEach(t),Xf.forEach(t),gc=p(qr),Jo=i(qr,"SPAN",{});var Qf=o(Jo);fc=r(Qf,"KandinskyV22PriorEmb2EmbPipeline"),Qf.forEach(t),qr.forEach(t),ir=p(e),G=i(e,"DIV",{class:!0});var he=o(G);y(St.$$.fragment,he),uc=p(he),Uo=i(he,"P",{});var Sf=o(Uo);hc=r(Sf,"Pipeline for generating image prior for Kandinsky"),Sf.forEach(t),yc=p(he),Yt=i(he,"P",{});var Qr=o(Yt);_c=r(Qr,"This model inherits from "),Xa=i(Qr,"A",{href:!0});var Yf=o(Xa);bc=r(Yf,"DiffusionPipeline"),Yf.forEach(t),kc=r(Qr,`. 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.)`),Qr.forEach(t),wc=p(he),pe=i(he,"DIV",{class:!0});var ai=o(pe);y(Dt.$$.fragment,ai),vc=p(ai),Po=i(ai,"P",{});var Df=o(Po);Mc=r(Df,"Function invoked when calling the pipeline for generation."),Df.forEach(t),Tc=p(ai),y(yn.$$.fragment,ai),ai.forEach(t),Ic=p(he),de=i(he,"DIV",{class:!0});var ii=o(de);y(Lt.$$.fragment,ii),Jc=p(ii),Vo=i(ii,"P",{});var Lf=o(Vo);Uc=r(Lf,"Function invoked when using the prior pipeline for interpolation."),Lf.forEach(t),Pc=p(ii),y(_n.$$.fragment,ii),ii.forEach(t),he.forEach(t),or=p(e),Be=i(e,"H3",{class:!0});var Sr=o(Be);bn=i(Sr,"A",{id:!0,class:!0,href:!0});var zf=o(bn);jo=i(zf,"SPAN",{});var Af=o(jo);y(zt.$$.fragment,Af),Af.forEach(t),zf.forEach(t),Vc=p(Sr),Co=i(Sr,"SPAN",{});var Hf=o(Co);jc=r(Hf,"KandinskyV22CombinedPipeline"),Hf.forEach(t),Sr.forEach(t),sr=p(e),W=i(e,"DIV",{class:!0});var ye=o(W);y(At.$$.fragment,ye),Cc=p(ye),Zo=i(ye,"P",{});var Of=o(Zo);Zc=r(Of,"Combined Pipeline for text-to-image generation using Kandinsky"),Of.forEach(t),Gc=p(ye),Ht=i(ye,"P",{});var Yr=o(Ht);Wc=r(Yr,"This model inherits from "),qa=i(Yr,"A",{href:!0});var eu=o(qa);Ec=r(eu,"DiffusionPipeline"),eu.forEach(t),xc=r(Yr,`. 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.)`),Yr.forEach(t),$c=p(ye),ce=i(ye,"DIV",{class:!0});var oi=o(ce);y(Ot.$$.fragment,oi),Bc=p(oi),Go=i(oi,"P",{});var nu=o(Go);Kc=r(nu,"Function invoked when calling the pipeline for generation."),nu.forEach(t),Fc=p(oi),y(kn.$$.fragment,oi),oi.forEach(t),Nc=p(ye),wn=i(ye,"DIV",{class:!0});var Dr=o(wn);y(ea.$$.fragment,Dr),Rc=p(Dr),Ke=i(Dr,"P",{});var si=o(Ke);Xc=r(si,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),Wo=i(si,"CODE",{});var tu=o(Wo);qc=r(tu,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),tu.forEach(t),Qc=r(si,"forward"),Eo=i(si,"CODE",{});var au=o(Eo);Sc=r(au,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),au.forEach(t),Yc=r(si,"enable_model_cpu_offload`, but performance is lower."),si.forEach(t),Dr.forEach(t),ye.forEach(t),rr=p(e),Fe=i(e,"H3",{class:!0});var Lr=o(Fe);vn=i(Lr,"A",{id:!0,class:!0,href:!0});var iu=o(vn);xo=i(iu,"SPAN",{});var ou=o(xo);y(na.$$.fragment,ou),ou.forEach(t),iu.forEach(t),Dc=p(Lr),$o=i(Lr,"SPAN",{});var su=o($o);Lc=r(su,"KandinskyV22Img2ImgCombinedPipeline"),su.forEach(t),Lr.forEach(t),lr=p(e),E=i(e,"DIV",{class:!0});var _e=o(E);y(ta.$$.fragment,_e),zc=p(_e),Bo=i(_e,"P",{});var ru=o(Bo);Ac=r(ru,"Combined Pipeline for image-to-image generation using Kandinsky"),ru.forEach(t),Hc=p(_e),aa=i(_e,"P",{});var zr=o(aa);Oc=r(zr,"This model inherits from "),Qa=i(zr,"A",{href:!0});var lu=o(Qa);em=r(lu,"DiffusionPipeline"),lu.forEach(t),nm=r(zr,`. 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.)`),zr.forEach(t),tm=p(_e),me=i(_e,"DIV",{class:!0});var ri=o(me);y(ia.$$.fragment,ri),am=p(ri),Ko=i(ri,"P",{});var pu=o(Ko);im=r(pu,"Function invoked when calling the pipeline for generation."),pu.forEach(t),om=p(ri),y(Mn.$$.fragment,ri),ri.forEach(t),sm=p(_e),Tn=i(_e,"DIV",{class:!0});var Ar=o(Tn);y(oa.$$.fragment,Ar),rm=p(Ar),Ne=i(Ar,"P",{});var li=o(Ne);lm=r(li,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),Fo=i(li,"CODE",{});var du=o(Fo);pm=r(du,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),du.forEach(t),dm=r(li,"forward"),No=i(li,"CODE",{});var cu=o(No);cm=r(cu,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),cu.forEach(t),mm=r(li,"enable_model_cpu_offload`, but performance is lower."),li.forEach(t),Ar.forEach(t),_e.forEach(t),pr=p(e),Re=i(e,"H3",{class:!0});var Hr=o(Re);In=i(Hr,"A",{id:!0,class:!0,href:!0});var mu=o(In);Ro=i(mu,"SPAN",{});var gu=o(Ro);y(sa.$$.fragment,gu),gu.forEach(t),mu.forEach(t),gm=p(Hr),Xo=i(Hr,"SPAN",{});var fu=o(Xo);fm=r(fu,"KandinskyV22InpaintCombinedPipeline"),fu.forEach(t),Hr.forEach(t),dr=p(e),x=i(e,"DIV",{class:!0});var be=o(x);y(ra.$$.fragment,be),um=p(be),qo=i(be,"P",{});var uu=o(qo);hm=r(uu,"Combined Pipeline for inpainting generation using Kandinsky"),uu.forEach(t),ym=p(be),la=i(be,"P",{});var Or=o(la);_m=r(Or,"This model inherits from "),Sa=i(Or,"A",{href:!0});var hu=o(Sa);bm=r(hu,"DiffusionPipeline"),hu.forEach(t),km=r(Or,`. 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.)`),Or.forEach(t),wm=p(be),ge=i(be,"DIV",{class:!0});var pi=o(ge);y(pa.$$.fragment,pi),vm=p(pi),Qo=i(pi,"P",{});var yu=o(Qo);Mm=r(yu,"Function invoked when calling the pipeline for generation."),yu.forEach(t),Tm=p(pi),y(Jn.$$.fragment,pi),pi.forEach(t),Im=p(be),Un=i(be,"DIV",{class:!0});var el=o(Un);y(da.$$.fragment,el),Jm=p(el),Xe=i(el,"P",{});var di=o(Xe);Um=r(di,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae and safety checker have their state dicts saved to CPU and then are moved to a
`),So=i(di,"CODE",{});var _u=o(So);Pm=r(_u,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),_u.forEach(t),Vm=r(di,"forward"),Yo=i(di,"CODE",{});var bu=o(Yo);jm=r(bu,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),bu.forEach(t),Cm=r(di,"enable_model_cpu_offload`, but performance is lower."),di.forEach(t),el.forEach(t),be.forEach(t),this.h()},h(){g(f,"name","hf:doc:metadata"),g(f,"content",JSON.stringify(xu)),g(u,"id","kandinsky-22"),g(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"),g(u,"href","#kandinsky-22"),g(M,"class","relative group"),nl(ua.src,Gm="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinskyv22/%20blue%20eyes.png")||g(ua,"src",Gm),g(ua,"alt","img"),g(De,"id","texttoimage-generation-with-controlnet-conditioning"),g(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"),g(De,"href","#texttoimage-generation-with-controlnet-conditioning"),g(Ue,"class","relative group"),g(ya,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22ControlnetPipeline"),nl(ka.src,Wm="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinskyv22/cat.png")||g(ka,"src",Wm),g(ka,"alt","img"),nl(Ma.src,Em="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinskyv22/robot_cat_text2img.png")||g(Ma,"src",Em),g(Ma,"alt","img"),g(He,"id","imagetoimage-generation-with-controlnet-conditioning"),g(He,"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"),g(He,"href","#imagetoimage-generation-with-controlnet-conditioning"),g(Pe,"class","relative group"),g(Ta,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22ControlnetImg2ImgPipeline"),g(Ia,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22PriorEmb2EmbPipeline"),nl(ja.src,xm="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinskyv22/robot_cat.png")||g(ja,"src",xm),g(ja,"alt","img"),g(Oe,"id","optimization"),g(Oe,"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"),g(Oe,"href","#optimization"),g(Ve,"class","relative group"),g(Ca,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky#diffusers.KandinskyPriorPipeline"),g(Za,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky#diffusers.KandinskyPipeline"),g(Ga,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky#diffusers.KandinskyImg2ImgPipeline"),g(Wa,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky#diffusers.KandinskyInpaintPipeline"),g(On,"href","https://github.com/facebookresearch/xformers"),g(On,"rel","nofollow"),g(nt,"href","https://pytorch.org/blog/accelerated-diffusers-pt-20/"),g(nt,"rel","nofollow"),g(ot,"href","https://huggingface.co/docs/diffusers/main/en/optimization/torch2.0"),g(ot,"rel","nofollow"),g(on,"id","available-pipelines"),g(on,"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"),g(on,"href","#available-pipelines"),g(je,"class","relative group"),g(pt,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2.py"),g(pt,"rel","nofollow"),g(ct,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py"),g(ct,"rel","nofollow"),g(gt,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_inpaint.py"),g(gt,"rel","nofollow"),g(ut,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_img2img.py"),g(ut,"rel","nofollow"),g(yt,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet.py"),g(yt,"rel","nofollow"),g(bt,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet_img2img.py"),g(bt,"rel","nofollow"),g(rn,"id","diffusers.KandinskyV22Pipeline"),g(rn,"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"),g(rn,"href","#diffusers.KandinskyV22Pipeline"),g(Ce,"class","relative group"),g($a,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(pn,"id","diffusers.KandinskyV22ControlnetPipeline"),g(pn,"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"),g(pn,"href","#diffusers.KandinskyV22ControlnetPipeline"),g(Ze,"class","relative group"),g(Ba,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(dn,"id","diffusers.KandinskyV22ControlnetImg2ImgPipeline"),g(dn,"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"),g(dn,"href","#diffusers.KandinskyV22ControlnetImg2ImgPipeline"),g(Ge,"class","relative group"),g(Ka,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(cn,"id","diffusers.KandinskyV22Img2ImgPipeline"),g(cn,"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"),g(cn,"href","#diffusers.KandinskyV22Img2ImgPipeline"),g(We,"class","relative group"),g(Fa,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(mn,"id","diffusers.KandinskyV22InpaintPipeline"),g(mn,"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"),g(mn,"href","#diffusers.KandinskyV22InpaintPipeline"),g(Ee,"class","relative group"),g(Na,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(gn,"id","diffusers.KandinskyV22PriorPipeline"),g(gn,"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"),g(gn,"href","#diffusers.KandinskyV22PriorPipeline"),g(xe,"class","relative group"),g(Ra,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(hn,"id","diffusers.KandinskyV22PriorEmb2EmbPipeline"),g(hn,"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"),g(hn,"href","#diffusers.KandinskyV22PriorEmb2EmbPipeline"),g($e,"class","relative group"),g(Xa,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(bn,"id","diffusers.KandinskyV22CombinedPipeline"),g(bn,"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"),g(bn,"href","#diffusers.KandinskyV22CombinedPipeline"),g(Be,"class","relative group"),g(qa,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(wn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(vn,"id","diffusers.KandinskyV22Img2ImgCombinedPipeline"),g(vn,"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"),g(vn,"href","#diffusers.KandinskyV22Img2ImgCombinedPipeline"),g(Fe,"class","relative group"),g(Qa,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Tn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(In,"id","diffusers.KandinskyV22InpaintCombinedPipeline"),g(In,"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"),g(In,"href","#diffusers.KandinskyV22InpaintCombinedPipeline"),g(Re,"class","relative group"),g(Sa,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Un,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,d){n(document.head,f),m(e,I,d),m(e,M,d),n(M,u),n(u,T),_(c,T,null),n(M,v),n(M,ke),n(ke,S),m(e,qe,d),m(e,j,d),n(j,Y),n(j,we),n(we,En),n(j,D),n(j,ve),n(ve,xn),n(j,L),n(j,Me),n(Me,$n),n(j,z),m(e,Qe,d),m(e,A,d),n(A,Te),m(e,U,d),_(H,e,d),m(e,Bn,d),m(e,Ie,d),n(Ie,ma),m(e,Kn,d),m(e,Je,d),n(Je,ga),m(e,ns,d),_(Fn,e,d),m(e,ts,d),m(e,Se,d),n(Se,tl),n(Se,ci),n(ci,al),n(Se,il),m(e,as,d),_(Nn,e,d),m(e,is,d),m(e,Ye,d),n(Ye,ol),n(Ye,mi),n(mi,sl),n(Ye,rl),m(e,os,d),_(Rn,e,d),m(e,ss,d),m(e,fa,d),n(fa,ua),m(e,rs,d),m(e,ha,d),n(ha,ll),m(e,ls,d),m(e,Ue,d),n(Ue,De),n(De,gi),_(Xn,gi,null),n(Ue,pl),n(Ue,fi),n(fi,dl),m(e,ps,d),m(e,Le,d),n(Le,cl),n(Le,ya),n(ya,ml),n(Le,gl),m(e,ds,d),m(e,_a,d),n(_a,fl),m(e,cs,d),_(qn,e,d),m(e,ms,d),m(e,ba,d),n(ba,ka),m(e,gs,d),m(e,ze,d),n(ze,ul),n(ze,ui),n(ui,hl),n(ze,yl),m(e,fs,d),_(Qn,e,d),m(e,us,d),m(e,wa,d),n(wa,_l),m(e,hs,d),_(Sn,e,d),m(e,ys,d),m(e,va,d),n(va,bl),m(e,_s,d),_(Yn,e,d),m(e,bs,d),m(e,Ae,d),n(Ae,kl),n(Ae,hi),n(hi,wl),n(Ae,vl),m(e,ks,d),_(Dn,e,d),m(e,ws,d),m(e,Ln,d),n(Ln,Ml),n(Ln,Ma),m(e,vs,d),m(e,Pe,d),n(Pe,He),n(He,yi),_(zn,yi,null),n(Pe,Tl),n(Pe,_i),n(_i,Il),m(e,Ms,d),m(e,O,d),n(O,Jl),n(O,Ta),n(Ta,Ul),n(O,Pl),n(O,Ia),n(Ia,Vl),n(O,jl),m(e,Ts,d),m(e,Ja,d),n(Ja,Cl),m(e,Is,d),m(e,Ua,d),n(Ua,Zl),m(e,Js,d),_(An,e,d),m(e,Us,d),m(e,Pa,d),n(Pa,Gl),m(e,Ps,d),m(e,Va,d),n(Va,ja),m(e,Vs,d),m(e,Ve,d),n(Ve,Oe),n(Oe,bi),_(Hn,bi,null),n(Ve,Wl),n(Ve,ki),n(ki,El),m(e,js,d),m(e,B,d),n(B,xl),n(B,Ca),n(Ca,$l),n(B,Bl),n(B,Za),n(Za,Kl),n(B,Fl),n(B,Ga),n(Ga,Nl),n(B,Rl),n(B,Wa),n(Wa,Xl),n(B,ql),m(e,Cs,d),m(e,Ea,d),n(Ea,Ql),m(e,Zs,d),m(e,en,d),n(en,Sl),n(en,On),n(On,wi),n(wi,Yl),n(en,Dl),m(e,Gs,d),_(et,e,d),m(e,Ws,d),m(e,nn,d),n(nn,Ll),n(nn,nt),n(nt,zl),n(nn,Al),m(e,Es,d),m(e,xa,d),n(xa,Hl),m(e,xs,d),_(tt,e,d),m(e,$s,d),m(e,ee,d),n(ee,Ol),n(ee,vi),n(vi,ep),n(ee,np),n(ee,Mi),n(Mi,tp),n(ee,ap),m(e,Bs,d),_(at,e,d),m(e,Ks,d),m(e,ne,d),n(ne,ip),n(ne,Ti),n(Ti,op),n(ne,sp),n(ne,Ii),n(Ii,rp),n(ne,lp),m(e,Fs,d),_(it,e,d),m(e,Ns,d),m(e,tn,d),n(tn,pp),n(tn,ot),n(ot,dp),n(tn,cp),m(e,Rs,d),_(an,e,d),m(e,Xs,d),m(e,je,d),n(je,on),n(on,Ji),_(st,Ji,null),n(je,mp),n(je,Ui),n(Ui,gp),m(e,qs,d),m(e,sn,d),n(sn,Pi),n(Pi,rt),n(rt,Vi),n(Vi,fp),n(rt,up),n(rt,ji),n(ji,hp),n(sn,yp),n(sn,C),n(C,lt),n(lt,Ci),n(Ci,pt),n(pt,_p),n(lt,bp),n(lt,Zi),n(Zi,Gi),n(Gi,kp),n(C,wp),n(C,dt),n(dt,Wi),n(Wi,ct),n(ct,vp),n(dt,Mp),n(dt,Ei),n(Ei,xi),n(xi,Tp),n(C,Ip),n(C,mt),n(mt,$i),n($i,gt),n(gt,Jp),n(mt,Up),n(mt,Bi),n(Bi,Ki),n(Ki,Pp),n(C,Vp),n(C,ft),n(ft,Fi),n(Fi,ut),n(ut,jp),n(ft,Cp),n(ft,Ni),n(Ni,Ri),n(Ri,Zp),n(C,Gp),n(C,ht),n(ht,Xi),n(Xi,yt),n(yt,Wp),n(ht,Ep),n(ht,qi),n(qi,Qi),n(Qi,xp),n(C,$p),n(C,_t),n(_t,Si),n(Si,bt),n(bt,Bp),n(_t,Kp),n(_t,Yi),n(Yi,Di),n(Di,Fp),m(e,Qs,d),m(e,Ce,d),n(Ce,rn),n(rn,Li),_(kt,Li,null),n(Ce,Np),n(Ce,zi),n(zi,Rp),m(e,Ss,d),m(e,K,d),_(wt,K,null),n(K,Xp),n(K,Ai),n(Ai,qp),n(K,Qp),n(K,vt),n(vt,Sp),n(vt,$a),n($a,Yp),n(vt,Dp),n(K,Lp),n(K,te),_(Mt,te,null),n(te,zp),n(te,Hi),n(Hi,Ap),n(te,Hp),_(ln,te,null),m(e,Ys,d),m(e,Ze,d),n(Ze,pn),n(pn,Oi),_(Tt,Oi,null),n(Ze,Op),n(Ze,eo),n(eo,ed),m(e,Ds,d),m(e,F,d),_(It,F,null),n(F,nd),n(F,no),n(no,td),n(F,ad),n(F,Jt),n(Jt,id),n(Jt,Ba),n(Ba,od),n(Jt,sd),n(F,rd),n(F,ae),_(Ut,ae,null),n(ae,ld),n(ae,to),n(to,pd),n(ae,dd),n(ae,ao),n(ao,cd),m(e,Ls,d),m(e,Ge,d),n(Ge,dn),n(dn,io),_(Pt,io,null),n(Ge,md),n(Ge,oo),n(oo,gd),m(e,zs,d),m(e,N,d),_(Vt,N,null),n(N,fd),n(N,so),n(so,ud),n(N,hd),n(N,jt),n(jt,yd),n(jt,Ka),n(Ka,_d),n(jt,bd),n(N,kd),n(N,ie),_(Ct,ie,null),n(ie,wd),n(ie,ro),n(ro,vd),n(ie,Md),n(ie,lo),n(lo,Td),m(e,As,d),m(e,We,d),n(We,cn),n(cn,po),_(Zt,po,null),n(We,Id),n(We,co),n(co,Jd),m(e,Hs,d),m(e,R,d),_(Gt,R,null),n(R,Ud),n(R,mo),n(mo,Pd),n(R,Vd),n(R,Wt),n(Wt,jd),n(Wt,Fa),n(Fa,Cd),n(Wt,Zd),n(R,Gd),n(R,oe),_(Et,oe,null),n(oe,Wd),n(oe,go),n(go,Ed),n(oe,xd),n(oe,fo),n(fo,$d),m(e,Os,d),m(e,Ee,d),n(Ee,mn),n(mn,uo),_(xt,uo,null),n(Ee,Bd),n(Ee,ho),n(ho,Kd),m(e,er,d),m(e,X,d),_($t,X,null),n(X,Fd),n(X,yo),n(yo,Nd),n(X,Rd),n(X,Bt),n(Bt,Xd),n(Bt,Na),n(Na,qd),n(Bt,Qd),n(X,Sd),n(X,se),_(Kt,se,null),n(se,Yd),n(se,_o),n(_o,Dd),n(se,Ld),n(se,bo),n(bo,zd),m(e,nr,d),m(e,xe,d),n(xe,gn),n(gn,ko),_(Ft,ko,null),n(xe,Ad),n(xe,wo),n(wo,Hd),m(e,tr,d),m(e,Z,d),_(Nt,Z,null),n(Z,Od),n(Z,vo),n(vo,ec),n(Z,nc),n(Z,Rt),n(Rt,tc),n(Rt,Ra),n(Ra,ac),n(Rt,ic),n(Z,oc),n(Z,re),_(Xt,re,null),n(re,sc),n(re,Mo),n(Mo,rc),n(re,lc),_(fn,re,null),n(Z,pc),n(Z,le),_(qt,le,null),n(le,dc),n(le,To),n(To,cc),n(le,mc),_(un,le,null),m(e,ar,d),m(e,$e,d),n($e,hn),n(hn,Io),_(Qt,Io,null),n($e,gc),n($e,Jo),n(Jo,fc),m(e,ir,d),m(e,G,d),_(St,G,null),n(G,uc),n(G,Uo),n(Uo,hc),n(G,yc),n(G,Yt),n(Yt,_c),n(Yt,Xa),n(Xa,bc),n(Yt,kc),n(G,wc),n(G,pe),_(Dt,pe,null),n(pe,vc),n(pe,Po),n(Po,Mc),n(pe,Tc),_(yn,pe,null),n(G,Ic),n(G,de),_(Lt,de,null),n(de,Jc),n(de,Vo),n(Vo,Uc),n(de,Pc),_(_n,de,null),m(e,or,d),m(e,Be,d),n(Be,bn),n(bn,jo),_(zt,jo,null),n(Be,Vc),n(Be,Co),n(Co,jc),m(e,sr,d),m(e,W,d),_(At,W,null),n(W,Cc),n(W,Zo),n(Zo,Zc),n(W,Gc),n(W,Ht),n(Ht,Wc),n(Ht,qa),n(qa,Ec),n(Ht,xc),n(W,$c),n(W,ce),_(Ot,ce,null),n(ce,Bc),n(ce,Go),n(Go,Kc),n(ce,Fc),_(kn,ce,null),n(W,Nc),n(W,wn),_(ea,wn,null),n(wn,Rc),n(wn,Ke),n(Ke,Xc),n(Ke,Wo),n(Wo,qc),n(Ke,Qc),n(Ke,Eo),n(Eo,Sc),n(Ke,Yc),m(e,rr,d),m(e,Fe,d),n(Fe,vn),n(vn,xo),_(na,xo,null),n(Fe,Dc),n(Fe,$o),n($o,Lc),m(e,lr,d),m(e,E,d),_(ta,E,null),n(E,zc),n(E,Bo),n(Bo,Ac),n(E,Hc),n(E,aa),n(aa,Oc),n(aa,Qa),n(Qa,em),n(aa,nm),n(E,tm),n(E,me),_(ia,me,null),n(me,am),n(me,Ko),n(Ko,im),n(me,om),_(Mn,me,null),n(E,sm),n(E,Tn),_(oa,Tn,null),n(Tn,rm),n(Tn,Ne),n(Ne,lm),n(Ne,Fo),n(Fo,pm),n(Ne,dm),n(Ne,No),n(No,cm),n(Ne,mm),m(e,pr,d),m(e,Re,d),n(Re,In),n(In,Ro),_(sa,Ro,null),n(Re,gm),n(Re,Xo),n(Xo,fm),m(e,dr,d),m(e,x,d),_(ra,x,null),n(x,um),n(x,qo),n(qo,hm),n(x,ym),n(x,la),n(la,_m),n(la,Sa),n(Sa,bm),n(la,km),n(x,wm),n(x,ge),_(pa,ge,null),n(ge,vm),n(ge,Qo),n(Qo,Mm),n(ge,Tm),_(Jn,ge,null),n(x,Im),n(x,Un),_(da,Un,null),n(Un,Jm),n(Un,Xe),n(Xe,Um),n(Xe,So),n(So,Pm),n(Xe,Vm),n(Xe,Yo),n(Yo,jm),n(Xe,Cm),cr=!0},p(e,[d]){const ca={};d&2&&(ca.$$scope={dirty:d,ctx:e}),an.$set(ca);const Do={};d&2&&(Do.$$scope={dirty:d,ctx:e}),ln.$set(Do);const Lo={};d&2&&(Lo.$$scope={dirty:d,ctx:e}),fn.$set(Lo);const zo={};d&2&&(zo.$$scope={dirty:d,ctx:e}),un.$set(zo);const Q={};d&2&&(Q.$$scope={dirty:d,ctx:e}),yn.$set(Q);const Ao={};d&2&&(Ao.$$scope={dirty:d,ctx:e}),_n.$set(Ao);const Ho={};d&2&&(Ho.$$scope={dirty:d,ctx:e}),kn.$set(Ho);const Oo={};d&2&&(Oo.$$scope={dirty:d,ctx:e}),Mn.$set(Oo);const es={};d&2&&(es.$$scope={dirty:d,ctx:e}),Jn.$set(es)},i(e){cr||(b(c.$$.fragment,e),b(H.$$.fragment,e),b(Fn.$$.fragment,e),b(Nn.$$.fragment,e),b(Rn.$$.fragment,e),b(Xn.$$.fragment,e),b(qn.$$.fragment,e),b(Qn.$$.fragment,e),b(Sn.$$.fragment,e),b(Yn.$$.fragment,e),b(Dn.$$.fragment,e),b(zn.$$.fragment,e),b(An.$$.fragment,e),b(Hn.$$.fragment,e),b(et.$$.fragment,e),b(tt.$$.fragment,e),b(at.$$.fragment,e),b(it.$$.fragment,e),b(an.$$.fragment,e),b(st.$$.fragment,e),b(kt.$$.fragment,e),b(wt.$$.fragment,e),b(Mt.$$.fragment,e),b(ln.$$.fragment,e),b(Tt.$$.fragment,e),b(It.$$.fragment,e),b(Ut.$$.fragment,e),b(Pt.$$.fragment,e),b(Vt.$$.fragment,e),b(Ct.$$.fragment,e),b(Zt.$$.fragment,e),b(Gt.$$.fragment,e),b(Et.$$.fragment,e),b(xt.$$.fragment,e),b($t.$$.fragment,e),b(Kt.$$.fragment,e),b(Ft.$$.fragment,e),b(Nt.$$.fragment,e),b(Xt.$$.fragment,e),b(fn.$$.fragment,e),b(qt.$$.fragment,e),b(un.$$.fragment,e),b(Qt.$$.fragment,e),b(St.$$.fragment,e),b(Dt.$$.fragment,e),b(yn.$$.fragment,e),b(Lt.$$.fragment,e),b(_n.$$.fragment,e),b(zt.$$.fragment,e),b(At.$$.fragment,e),b(Ot.$$.fragment,e),b(kn.$$.fragment,e),b(ea.$$.fragment,e),b(na.$$.fragment,e),b(ta.$$.fragment,e),b(ia.$$.fragment,e),b(Mn.$$.fragment,e),b(oa.$$.fragment,e),b(sa.$$.fragment,e),b(ra.$$.fragment,e),b(pa.$$.fragment,e),b(Jn.$$.fragment,e),b(da.$$.fragment,e),cr=!0)},o(e){k(c.$$.fragment,e),k(H.$$.fragment,e),k(Fn.$$.fragment,e),k(Nn.$$.fragment,e),k(Rn.$$.fragment,e),k(Xn.$$.fragment,e),k(qn.$$.fragment,e),k(Qn.$$.fragment,e),k(Sn.$$.fragment,e),k(Yn.$$.fragment,e),k(Dn.$$.fragment,e),k(zn.$$.fragment,e),k(An.$$.fragment,e),k(Hn.$$.fragment,e),k(et.$$.fragment,e),k(tt.$$.fragment,e),k(at.$$.fragment,e),k(it.$$.fragment,e),k(an.$$.fragment,e),k(st.$$.fragment,e),k(kt.$$.fragment,e),k(wt.$$.fragment,e),k(Mt.$$.fragment,e),k(ln.$$.fragment,e),k(Tt.$$.fragment,e),k(It.$$.fragment,e),k(Ut.$$.fragment,e),k(Pt.$$.fragment,e),k(Vt.$$.fragment,e),k(Ct.$$.fragment,e),k(Zt.$$.fragment,e),k(Gt.$$.fragment,e),k(Et.$$.fragment,e),k(xt.$$.fragment,e),k($t.$$.fragment,e),k(Kt.$$.fragment,e),k(Ft.$$.fragment,e),k(Nt.$$.fragment,e),k(Xt.$$.fragment,e),k(fn.$$.fragment,e),k(qt.$$.fragment,e),k(un.$$.fragment,e),k(Qt.$$.fragment,e),k(St.$$.fragment,e),k(Dt.$$.fragment,e),k(yn.$$.fragment,e),k(Lt.$$.fragment,e),k(_n.$$.fragment,e),k(zt.$$.fragment,e),k(At.$$.fragment,e),k(Ot.$$.fragment,e),k(kn.$$.fragment,e),k(ea.$$.fragment,e),k(na.$$.fragment,e),k(ta.$$.fragment,e),k(ia.$$.fragment,e),k(Mn.$$.fragment,e),k(oa.$$.fragment,e),k(sa.$$.fragment,e),k(ra.$$.fragment,e),k(pa.$$.fragment,e),k(Jn.$$.fragment,e),k(da.$$.fragment,e),cr=!1},d(e){t(f),e&&t(I),e&&t(M),w(c),e&&t(qe),e&&t(j),e&&t(Qe),e&&t(A),e&&t(U),w(H,e),e&&t(Bn),e&&t(Ie),e&&t(Kn),e&&t(Je),e&&t(ns),w(Fn,e),e&&t(ts),e&&t(Se),e&&t(as),w(Nn,e),e&&t(is),e&&t(Ye),e&&t(os),w(Rn,e),e&&t(ss),e&&t(fa),e&&t(rs),e&&t(ha),e&&t(ls),e&&t(Ue),w(Xn),e&&t(ps),e&&t(Le),e&&t(ds),e&&t(_a),e&&t(cs),w(qn,e),e&&t(ms),e&&t(ba),e&&t(gs),e&&t(ze),e&&t(fs),w(Qn,e),e&&t(us),e&&t(wa),e&&t(hs),w(Sn,e),e&&t(ys),e&&t(va),e&&t(_s),w(Yn,e),e&&t(bs),e&&t(Ae),e&&t(ks),w(Dn,e),e&&t(ws),e&&t(Ln),e&&t(vs),e&&t(Pe),w(zn),e&&t(Ms),e&&t(O),e&&t(Ts),e&&t(Ja),e&&t(Is),e&&t(Ua),e&&t(Js),w(An,e),e&&t(Us),e&&t(Pa),e&&t(Ps),e&&t(Va),e&&t(Vs),e&&t(Ve),w(Hn),e&&t(js),e&&t(B),e&&t(Cs),e&&t(Ea),e&&t(Zs),e&&t(en),e&&t(Gs),w(et,e),e&&t(Ws),e&&t(nn),e&&t(Es),e&&t(xa),e&&t(xs),w(tt,e),e&&t($s),e&&t(ee),e&&t(Bs),w(at,e),e&&t(Ks),e&&t(ne),e&&t(Fs),w(it,e),e&&t(Ns),e&&t(tn),e&&t(Rs),w(an,e),e&&t(Xs),e&&t(je),w(st),e&&t(qs),e&&t(sn),e&&t(Qs),e&&t(Ce),w(kt),e&&t(Ss),e&&t(K),w(wt),w(Mt),w(ln),e&&t(Ys),e&&t(Ze),w(Tt),e&&t(Ds),e&&t(F),w(It),w(Ut),e&&t(Ls),e&&t(Ge),w(Pt),e&&t(zs),e&&t(N),w(Vt),w(Ct),e&&t(As),e&&t(We),w(Zt),e&&t(Hs),e&&t(R),w(Gt),w(Et),e&&t(Os),e&&t(Ee),w(xt),e&&t(er),e&&t(X),w($t),w(Kt),e&&t(nr),e&&t(xe),w(Ft),e&&t(tr),e&&t(Z),w(Nt),w(Xt),w(fn),w(qt),w(un),e&&t(ar),e&&t($e),w(Qt),e&&t(ir),e&&t(G),w(St),w(Dt),w(yn),w(Lt),w(_n),e&&t(or),e&&t(Be),w(zt),e&&t(sr),e&&t(W),w(At),w(Ot),w(kn),w(ea),e&&t(rr),e&&t(Fe),w(na),e&&t(lr),e&&t(E),w(ta),w(ia),w(Mn),w(oa),e&&t(pr),e&&t(Re),w(sa),e&&t(dr),e&&t(x),w(ra),w(pa),w(Jn),w(da)}}}const xu={local:"kandinsky-22",sections:[{local:null,sections:[{local:"texttoimage-generation-with-controlnet-conditioning",title:"Text-to-Image Generation with ControlNet Conditioning"},{local:"imagetoimage-generation-with-controlnet-conditioning",title:"Image-to-Image Generation with ControlNet Conditioning"}],title:null},{local:"optimization",title:"Optimization"},{local:"available-pipelines",sections:[{local:"diffusers.KandinskyV22Pipeline",title:"KandinskyV22Pipeline"},{local:"diffusers.KandinskyV22ControlnetPipeline",title:"KandinskyV22ControlnetPipeline"},{local:"diffusers.KandinskyV22ControlnetImg2ImgPipeline",title:"KandinskyV22ControlnetImg2ImgPipeline"},{local:"diffusers.KandinskyV22Img2ImgPipeline",title:"KandinskyV22Img2ImgPipeline"},{local:"diffusers.KandinskyV22InpaintPipeline",title:"KandinskyV22InpaintPipeline"},{local:"diffusers.KandinskyV22PriorPipeline",title:"KandinskyV22PriorPipeline"},{local:"diffusers.KandinskyV22PriorEmb2EmbPipeline",title:"KandinskyV22PriorEmb2EmbPipeline"},{local:"diffusers.KandinskyV22CombinedPipeline",title:"KandinskyV22CombinedPipeline"},{local:"diffusers.KandinskyV22Img2ImgCombinedPipeline",title:"KandinskyV22Img2ImgCombinedPipeline"},{local:"diffusers.KandinskyV22InpaintCombinedPipeline",title:"KandinskyV22InpaintCombinedPipeline"}],title:"Available Pipelines:"}],title:"Kandinsky 2.2"};function $u(V){return Tu(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class qu extends ku{constructor(f){super();wu(this,f,$u,Eu,vu,{})}}export{qu as default,xu as metadata};
