import{S as Dg,i as Yg,s as Ag,e as a,k as d,w as g,t as o,M as Hg,c as i,d as t,m as c,a as s,x as y,h as r,b as p,N as cn,G as n,g as m,y as _,q as b,o as k,B as w,v as Og,L as ze}from"../../../chunks/vendor-hf-doc-builder.js";import{T as Ff}from"../../../chunks/Tip-hf-doc-builder.js";import{D as W}from"../../../chunks/Docstring-hf-doc-builder.js";import{C}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as Q}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as et}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function ey(G){let u,I,M,h,T,f,v,K,$,R;return $=new C({props:{code:"c2NoZWR1bGVyJTIwJTNEJTIwRERQTVNjaGVkdWxlci5mcm9tX3ByZXRyYWluZWQoJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTElMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJkZHBtX3NjaGVkdWxlciUyMiklMEF0MmlfcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMSUyMiUyQyUyMHNjaGVkdWxlciUzRHNjaGVkdWxlciUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEF0MmlfcGlwZS50byglMjJjdWRhJTIyKQ==",highlighted:`scheduler = DDPMScheduler.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1&quot;</span>, subfolder=<span class="hljs-string">&quot;ddpm_scheduler&quot;</span>)
t2i_pipe = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1&quot;</span>, scheduler=scheduler, torch_dtype=torch.float16
)
t2i_pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),{c(){u=a("p"),I=o("By default, the text-to-image pipeline use "),M=a("a"),h=o("DDIMScheduler"),T=o(", you can change the scheduler to "),f=a("a"),v=o("DDPMScheduler"),K=d(),g($.$$.fragment),this.h()},l(J){u=i(J,"P",{});var U=s(u);I=r(U,"By default, the text-to-image pipeline use "),M=i(U,"A",{href:!0});var z=s(M);h=r(z,"DDIMScheduler"),z.forEach(t),T=r(U,", you can change the scheduler to "),f=i(U,"A",{href:!0});var V=s(f);v=r(V,"DDPMScheduler"),V.forEach(t),U.forEach(t),K=c(J),y($.$$.fragment,J),this.h()},h(){p(M,"href","/docs/diffusers/v0.19.0/en/api/schedulers/ddim#diffusers.DDIMScheduler"),p(f,"href","/docs/diffusers/v0.19.0/en/api/schedulers/ddpm#diffusers.DDPMScheduler")},m(J,U){m(J,u,U),n(u,I),n(u,M),n(M,h),n(u,T),n(u,f),n(f,v),m(J,K,U),_($,J,U),R=!0},p:ze,i(J){R||(b($.$$.fragment,J),R=!0)},o(J){k($.$$.fragment,J),R=!1},d(J){J&&t(u),J&&t(K),w($,J)}}}function ny(G){let u,I,M,h,T,f,v,K,$,R,J,U,z,V,S,x,me,q,N,fe,B,ue,he,F,j,ge;return j=new C({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMGFsaWVuJTIwY2hlZXNlYnVyZ2VyJTIwY3JlYXR1cmUlMjBlYXRpbmclMjBpdHNlbGYlMkMlMjBjbGF5bWF0aW9uJTJDJTIwY2luZW1hdGljJTJDJTIwbW9vZHklMjBsaWdodGluZyUyMiUwQW5lZ2F0aXZlX3Byb21wdCUyMCUzRCUyMCUyMmxvdyUyMHF1YWxpdHklMkMlMjBiYWQlMjBxdWFsaXR5JTIyJTBBJTBBaW1hZ2VfZW1iZWRzJTJDJTIwbmVnYXRpdmVfaW1hZ2VfZW1iZWRzJTIwJTNEJTIwcGlwZV9wcmlvcihwcm9tcHQlMkMlMjBuZWdhdGl2ZV9wcm9tcHQlMkMlMjBndWlkYW5jZV9zY2FsZSUzRDEuMCkudG9fdHVwbGUoKQ==",highlighted:`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_embeds, negative_image_embeds = pipe_prior(prompt, negative_prompt, guidance_scale=<span class="hljs-number">1.0</span>).to_tuple()`}}),{c(){u=a("p"),I=o("The text-to-image pipeline expects both "),M=a("code"),h=o("image_embeds"),T=o(", "),f=a("code"),v=o("negative_image_embeds"),K=o(` and the original
`),$=a("code"),R=o("prompt"),J=o(` as the text-to-image pipeline uses another text encoder to better guide the second diffusion
process of `),U=a("code"),z=o("t2i_pipe"),V=o("."),S=d(),x=a("p"),me=o("By default, the prior returns unconditioned negative image embeddings corresponding to the negative prompt of "),q=a("code"),N=o('""'),fe=o(`.
For better results, you can also pass a `),B=a("code"),ue=o("negative_prompt"),he=o(` to the prior. This will increase the effective batch size
of the prior by a factor of 2.`),F=d(),g(j.$$.fragment)},l(P){u=i(P,"P",{});var Z=s(u);I=r(Z,"The text-to-image pipeline expects both "),M=i(Z,"CODE",{});var Qe=s(M);h=r(Qe,"image_embeds"),Qe.forEach(t),T=r(Z,", "),f=i(Z,"CODE",{});var te=s(f);v=r(te,"negative_image_embeds"),te.forEach(t),K=r(Z,` and the original
`),$=i(Z,"CODE",{});var Se=s($);R=r(Se,"prompt"),Se.forEach(t),J=r(Z,` as the text-to-image pipeline uses another text encoder to better guide the second diffusion
process of `),U=i(Z,"CODE",{});var Le=s(U);z=r(Le,"t2i_pipe"),Le.forEach(t),V=r(Z,"."),Z.forEach(t),S=c(P),x=i(P,"P",{});var ye=s(x);me=r(ye,"By default, the prior returns unconditioned negative image embeddings corresponding to the negative prompt of "),q=i(ye,"CODE",{});var E=s(q);N=r(E,'""'),E.forEach(t),fe=r(ye,`.
For better results, you can also pass a `),B=i(ye,"CODE",{});var Pa=s(B);ue=r(Pa,"negative_prompt"),Pa.forEach(t),he=r(ye,` to the prior. This will increase the effective batch size
of the prior by a factor of 2.`),ye.forEach(t),F=c(P),y(j.$$.fragment,P)},m(P,Z){m(P,u,Z),n(u,I),n(u,M),n(M,h),n(u,T),n(u,f),n(f,v),n(u,K),n(u,$),n($,R),n(u,J),n(u,U),n(U,z),n(u,V),m(P,S,Z),m(P,x,Z),n(x,me),n(x,q),n(q,N),n(x,fe),n(x,B),n(B,ue),n(x,he),m(P,F,Z),_(j,P,Z),ge=!0},p:ze,i(P){ge||(b(j.$$.fragment,P),ge=!0)},o(P){k(j.$$.fragment,P),ge=!1},d(P){P&&t(u),P&&t(S),P&&t(x),P&&t(F),w(j,P)}}}function ty(G){let u,I,M,h,T,f,v,K,$,R,J,U,z,V,S,x,me,q,N,fe,B,ue,he;return{c(){u=a("p"),I=o("To generate images directly from a single pipeline, you can use "),M=a("a"),h=o("KandinskyCombinedPipeline"),T=o(", "),f=a("a"),v=o("KandinskyImg2ImgCombinedPipeline"),K=o(", "),$=a("a"),R=o("KandinskyInpaintCombinedPipeline"),J=o(`.
These combined pipelines wrap the `),U=a("a"),z=o("KandinskyPriorPipeline"),V=o(" and "),S=a("a"),x=o("KandinskyPipeline"),me=o(", "),q=a("a"),N=o("KandinskyImg2ImgPipeline"),fe=o(", "),B=a("a"),ue=o("KandinskyInpaintPipeline"),he=o(` respectively into a single
pipeline for a simpler user experience`),this.h()},l(F){u=i(F,"P",{});var j=s(u);I=r(j,"To generate images directly from a single pipeline, you can use "),M=i(j,"A",{href:!0});var ge=s(M);h=r(ge,"KandinskyCombinedPipeline"),ge.forEach(t),T=r(j,", "),f=i(j,"A",{href:!0});var P=s(f);v=r(P,"KandinskyImg2ImgCombinedPipeline"),P.forEach(t),K=r(j,", "),$=i(j,"A",{href:!0});var Z=s($);R=r(Z,"KandinskyInpaintCombinedPipeline"),Z.forEach(t),J=r(j,`.
These combined pipelines wrap the `),U=i(j,"A",{href:!0});var Qe=s(U);z=r(Qe,"KandinskyPriorPipeline"),Qe.forEach(t),V=r(j," and "),S=i(j,"A",{href:!0});var te=s(S);x=r(te,"KandinskyPipeline"),te.forEach(t),me=r(j,", "),q=i(j,"A",{href:!0});var Se=s(q);N=r(Se,"KandinskyImg2ImgPipeline"),Se.forEach(t),fe=r(j,", "),B=i(j,"A",{href:!0});var Le=s(B);ue=r(Le,"KandinskyInpaintPipeline"),Le.forEach(t),he=r(j,` respectively into a single
pipeline for a simpler user experience`),j.forEach(t),this.h()},h(){p(M,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyCombinedPipeline"),p(f,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyImg2ImgCombinedPipeline"),p($,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyInpaintCombinedPipeline"),p(U,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyPriorPipeline"),p(S,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyPipeline"),p(q,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyImg2ImgPipeline"),p(B,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyInpaintPipeline")},m(F,j){m(F,u,j),n(u,I),n(u,M),n(M,h),n(u,T),n(u,f),n(f,v),n(u,K),n(u,$),n($,R),n(u,J),n(u,U),n(U,z),n(u,V),n(u,S),n(S,x),n(u,me),n(u,q),n(q,N),n(u,fe),n(u,B),n(B,ue),n(u,he)},d(F){F&&t(u)}}}function ay(G){let u,I,M,h,T;return h=new C({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVBpcGVsaW5lJTJDJTIwS2FuZGluc2t5UHJpb3JQaXBlbGluZSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLXByaW9yJTIyKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJyZWQlMjBjYXQlMkMlMjA0ayUyMHBob3RvJTIyJTBBb3V0JTIwJTNEJTIwcGlwZV9wcmlvcihwcm9tcHQpJTBBaW1hZ2VfZW1iJTIwJTNEJTIwb3V0LmltYWdlX2VtYmVkcyUwQW5lZ2F0aXZlX2ltYWdlX2VtYiUyMCUzRCUyMG91dC5uZWdhdGl2ZV9pbWFnZV9lbWJlZHMlMEElMEFwaXBlJTIwJTNEJTIwS2FuZGluc2t5UGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xJTIyKSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2VfZW1iZWRzJTNEaW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfaW1hZ2VfZW1iZWRzJTNEbmVnYXRpdmVfaW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMTAwJTJDJTBBKS5pbWFnZXMlMEElMEFpbWFnZSU1QjAlNUQuc2F2ZSglMjJjYXQucG5nJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyPipeline, KandinskyPriorPipeline
<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-string">&quot;kandinsky-community/kandinsky-2-1-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>negative_image_emb = out.negative_image_embeds

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = KandinskyPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1&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>    prompt,
<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(){u=a("p"),I=o("Examples:"),M=d(),g(h.$$.fragment)},l(f){u=i(f,"P",{});var v=s(u);I=r(v,"Examples:"),v.forEach(t),M=c(f),y(h.$$.fragment,f)},m(f,v){m(f,u,v),n(u,I),m(f,M,v),_(h,f,v),T=!0},p:ze,i(f){T||(b(h.$$.fragment,f),T=!0)},o(f){k(h.$$.fragment,f),T=!1},d(f){f&&t(u),f&&t(M),w(h,f)}}}function iy(G){let u,I,M,h,T;return h=new C({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUlMkMlMjBLYW5kaW5za3lQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBaW1wb3J0JTIwUElMJTBBJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdG9yY2h2aXNpb24lMjBpbXBvcnQlMjB0cmFuc2Zvcm1zJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEFpbWcxJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZoZi1pbnRlcm5hbC10ZXN0aW5nJTJGZGlmZnVzZXJzLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTIyJTBBJTIwJTIwJTIwJTIwJTIyJTJGa2FuZGluc2t5JTJGY2F0LnBuZyUyMiUwQSklMEElMEFpbWcyJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZoZi1pbnRlcm5hbC10ZXN0aW5nJTJGZGlmZnVzZXJzLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTIyJTBBJTIwJTIwJTIwJTIwJTIyJTJGa2FuZGluc2t5JTJGc3RhcnJ5X25pZ2h0LmpwZWclMjIlMEEpJTBBJTBBaW1hZ2VzX3RleHRzJTIwJTNEJTIwJTVCJTIyYSUyMGNhdCUyMiUyQyUyMGltZzElMkMlMjBpbWcyJTVEJTBBd2VpZ2h0cyUyMCUzRCUyMCU1QjAuMyUyQyUyMDAuMyUyQyUyMDAuNCU1RCUwQWltYWdlX2VtYiUyQyUyMHplcm9faW1hZ2VfZW1iJTIwJTNEJTIwcGlwZV9wcmlvci5pbnRlcnBvbGF0ZShpbWFnZXNfdGV4dHMlMkMlMjB3ZWlnaHRzKSUwQSUwQXBpcGUlMjAlM0QlMjBLYW5kaW5za3lQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTElMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjAlMjIlMjIlMkMlMEElMjAlMjAlMjAlMjBpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWIlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0R6ZXJvX2ltYWdlX2VtYiUyQyUwQSUyMCUyMCUyMCUyMGhlaWdodCUzRDc2OCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDE1MCUyQyUwQSkuaW1hZ2VzJTVCMCU1RCUwQSUwQWltYWdlLnNhdmUoJTIyc3RhcnJ5X2NhdC5wbmclMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyPriorPipeline, KandinskyPipeline
<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 = KandinskyPriorPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1-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 = KandinskyPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1&quot;</span>, torch_dtype=torch.float16)
<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>    <span class="hljs-string">&quot;&quot;</span>,
<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(){u=a("p"),I=o("Examples:"),M=d(),g(h.$$.fragment)},l(f){u=i(f,"P",{});var v=s(u);I=r(v,"Examples:"),v.forEach(t),M=c(f),y(h.$$.fragment,f)},m(f,v){m(f,u,v),n(u,I),m(f,M,v),_(h,f,v),T=!0},p:ze,i(f){T||(b(h.$$.fragment,f),T=!0)},o(f){k(h.$$.fragment,f),T=!1},d(f){f&&t(u),f&&t(M),w(h,f)}}}function sy(G){let u,I,M,h,T;return h=new C({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVBpcGVsaW5lJTJDJTIwS2FuZGluc2t5UHJpb3JQaXBlbGluZSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZLYW5kaW5za3ktMi0xLXByaW9yJTIyKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJyZWQlMjBjYXQlMkMlMjA0ayUyMHBob3RvJTIyJTBBb3V0JTIwJTNEJTIwcGlwZV9wcmlvcihwcm9tcHQpJTBBaW1hZ2VfZW1iJTIwJTNEJTIwb3V0LmltYWdlX2VtYmVkcyUwQW5lZ2F0aXZlX2ltYWdlX2VtYiUyMCUzRCUyMG91dC5uZWdhdGl2ZV9pbWFnZV9lbWJlZHMlMEElMEFwaXBlJTIwJTNEJTIwS2FuZGluc2t5UGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xJTIyKSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2VfZW1iZWRzJTNEaW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfaW1hZ2VfZW1iZWRzJTNEbmVnYXRpdmVfaW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMTAwJTJDJTBBKS5pbWFnZXMlMEElMEFpbWFnZSU1QjAlNUQuc2F2ZSglMjJjYXQucG5nJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyPipeline, KandinskyPriorPipeline
<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-string">&quot;kandinsky-community/Kandinsky-2-1-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>negative_image_emb = out.negative_image_embeds

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = KandinskyPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1&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>    prompt,
<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(){u=a("p"),I=o("Examples:"),M=d(),g(h.$$.fragment)},l(f){u=i(f,"P",{});var v=s(u);I=r(v,"Examples:"),v.forEach(t),M=c(f),y(h.$$.fragment,f)},m(f,v){m(f,u,v),n(u,I),m(f,M,v),_(h,f,v),T=!0},p:ze,i(f){T||(b(h.$$.fragment,f),T=!0)},o(f){k(h.$$.fragment,f),T=!1},d(f){f&&t(u),f&&t(M),w(h,f)}}}function oy(G){let u,I,M,h,T;return h=new C({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreUltZzJJbWdQaXBlbGluZSUyQyUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwcmVkJTIwY2FydG9vbiUyMGZyb2clMkMlMjA0ayUyMiUwQWltYWdlX2VtYiUyQyUyMHplcm9faW1hZ2VfZW1iJTIwJTNEJTIwcGlwZV9wcmlvcihwcm9tcHQlMkMlMjByZXR1cm5fZGljdCUzREZhbHNlKSUwQSUwQXBpcGUlMjAlM0QlMjBLYW5kaW5za3lJbWcySW1nUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFpbml0X2ltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZoZi1pbnRlcm5hbC10ZXN0aW5nJTJGZGlmZnVzZXJzLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTIyJTBBJTIwJTIwJTIwJTIwJTIyJTJGa2FuZGluc2t5JTJGZnJvZy5wbmclMjIlMEEpJTBBJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMHByb21wdCUyQyUwQSUyMCUyMCUyMCUyMGltYWdlJTNEaW5pdF9pbWFnZSUyQyUwQSUyMCUyMCUyMCUyMGltYWdlX2VtYmVkcyUzRGltYWdlX2VtYiUyQyUwQSUyMCUyMCUyMCUyMG5lZ2F0aXZlX2ltYWdlX2VtYmVkcyUzRHplcm9faW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMTAwJTJDJTBBJTIwJTIwJTIwJTIwc3RyZW5ndGglM0QwLjIlMkMlMEEpLmltYWdlcyUwQSUwQWltYWdlJTVCMCU1RC5zYXZlKCUyMnJlZF9mcm9nLnBuZyUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyImg2ImgPipeline, KandinskyPriorPipeline
<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> 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-1-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;A red cartoon frog, 4k&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_emb, zero_image_emb = pipe_prior(prompt, return_dict=<span class="hljs-literal">False</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = KandinskyImg2ImgPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1&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>init_image = 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/frog.png&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(
<span class="hljs-meta">... </span>    prompt,
<span class="hljs-meta">... </span>    image=init_image,
<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">100</span>,
<span class="hljs-meta">... </span>    strength=<span class="hljs-number">0.2</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;red_frog.png&quot;</span>)`}}),{c(){u=a("p"),I=o("Examples:"),M=d(),g(h.$$.fragment)},l(f){u=i(f,"P",{});var v=s(u);I=r(v,"Examples:"),v.forEach(t),M=c(f),y(h.$$.fragment,f)},m(f,v){m(f,u,v),n(u,I),m(f,M,v),_(h,f,v),T=!0},p:ze,i(f){T||(b(h.$$.fragment,f),T=!0)},o(f){k(h.$$.fragment,f),T=!1},d(f){f&&t(u),f&&t(M),w(h,f)}}}function ry(G){let u,I,M,h,T;return h=new C({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreUlucGFpbnRQaXBlbGluZSUyQyUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQWltcG9ydCUyMHRvcmNoJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwaGF0JTIyJTBBaW1hZ2VfZW1iJTJDJTIwemVyb19pbWFnZV9lbWIlMjAlM0QlMjBwaXBlX3ByaW9yKHByb21wdCUyQyUyMHJldHVybl9kaWN0JTNERmFsc2UpJTBBJTBBcGlwZSUyMCUzRCUyMEthbmRpbnNreUlucGFpbnRQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTEtaW5wYWludCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBaW5pdF9pbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGaGYtaW50ZXJuYWwtdGVzdGluZyUyRmRpZmZ1c2Vycy1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyMiUwQSUyMCUyMCUyMCUyMCUyMiUyRmthbmRpbnNreSUyRmNhdC5wbmclMjIlMEEpJTBBJTBBbWFzayUyMCUzRCUyMG5wLnplcm9zKCg3NjglMkMlMjA3NjgpJTJDJTIwZHR5cGUlM0RucC5mbG9hdDMyKSUwQW1hc2slNUIlM0EyNTAlMkMlMjAyNTAlM0EtMjUwJTVEJTIwJTNEJTIwMSUwQSUwQW91dCUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0Rpbml0X2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwbWFza19pbWFnZSUzRG1hc2slMkMlMEElMjAlMjAlMjAlMjBpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWIlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0R6ZXJvX2ltYWdlX2VtYiUyQyUwQSUyMCUyMCUyMCUyMGhlaWdodCUzRDc2OCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTBBKSUwQSUwQWltYWdlJTIwJTNEJTIwb3V0LmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNhdF93aXRoX2hhdC5wbmclMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyInpaintPipeline, KandinskyPriorPipeline
<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> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

<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-1-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;a hat&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_emb, zero_image_emb = pipe_prior(prompt, return_dict=<span class="hljs-literal">False</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = KandinskyInpaintPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1-inpaint&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>init_image = 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>mask = np.zeros((<span class="hljs-number">768</span>, <span class="hljs-number">768</span>), dtype=np.float32)
<span class="hljs-meta">&gt;&gt;&gt; </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>

<span class="hljs-meta">&gt;&gt;&gt; </span>out = pipe(
<span class="hljs-meta">... </span>    prompt,
<span class="hljs-meta">... </span>    image=init_image,
<span class="hljs-meta">... </span>    mask_image=mask,
<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>)

<span class="hljs-meta">&gt;&gt;&gt; </span>image = out.images[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>image.save(<span class="hljs-string">&quot;cat_with_hat.png&quot;</span>)`}}),{c(){u=a("p"),I=o("Examples:"),M=d(),g(h.$$.fragment)},l(f){u=i(f,"P",{});var v=s(u);I=r(v,"Examples:"),v.forEach(t),M=c(f),y(h.$$.fragment,f)},m(f,v){m(f,u,v),n(u,I),m(f,M,v),_(h,f,v),T=!0},p:ze,i(f){T||(b(h.$$.fragment,f),T=!0)},o(f){k(h.$$.fragment,f),T=!1},d(f){f&&t(u),f&&t(M),w(h,f)}}}function ly(G){let u,I,M,h,T;return h=new C({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvclRleHQySW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXBpcGUlMjAlM0QlMjBBdXRvUGlwZWxpbmVGb3JUZXh0MkltYWdlLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMGxpb24lMjBpbiUyMGdhbGF4aWVzJTJDJTIwc3BpcmFscyUyQyUyMG5lYnVsYWUlMkMlMjBzdGFycyUyQyUyMHNtb2tlJTJDJTIwaXJpZGVzY2VudCUyQyUyMGludHJpY2F0ZSUyMGRldGFpbCUyQyUyMG9jdGFuZSUyMHJlbmRlciUyQyUyMDhrJTIyJTBBJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUzRHByb21wdCUyQyUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QyNSkuaW1hZ2VzJTVCMCU1RA==",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-1&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(){u=a("p"),I=o("Examples:"),M=d(),g(h.$$.fragment)},l(f){u=i(f,"P",{});var v=s(u);I=r(v,"Examples:"),v.forEach(t),M=c(f),y(h.$$.fragment,f)},m(f,v){m(f,u,v),n(u,I),m(f,M,v),_(h,f,v),T=!0},p:ze,i(f){T||(b(h.$$.fragment,f),T=!0)},o(f){k(h.$$.fragment,f),T=!1},d(f){f&&t(u),f&&t(M),w(h,f)}}}function py(G){let u,I,M,h,T;return h=new C({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvckltYWdlMkltYWdlJTBBaW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjBvcyUwQSUwQXBpcGUlMjAlM0QlMjBBdXRvUGlwZWxpbmVGb3JJbWFnZTJJbWFnZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTElMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTBBcGlwZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkElMjBmYW50YXN5JTIwbGFuZHNjYXBlJTJDJTIwQ2luZW1hdGljJTIwbGlnaHRpbmclMjIlMEFuZWdhdGl2ZV9wcm9tcHQlMjAlM0QlMjAlMjJsb3clMjBxdWFsaXR5JTJDJTIwYmFkJTIwcXVhbGl0eSUyMiUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRkNvbXBWaXMlMkZzdGFibGUtZGlmZnVzaW9uJTJGbWFpbiUyRmFzc2V0cyUyRnN0YWJsZS1zYW1wbGVzJTJGaW1nMmltZyUyRnNrZXRjaC1tb3VudGFpbnMtaW5wdXQuanBnJTIyJTBBJTBBcmVzcG9uc2UlMjAlM0QlMjByZXF1ZXN0cy5nZXQodXJsKSUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihCeXRlc0lPKHJlc3BvbnNlLmNvbnRlbnQpKS5jb252ZXJ0KCUyMlJHQiUyMiklMEFpbWFnZS50aHVtYm5haWwoKDc2OCUyQyUyMDc2OCkpJTBBJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUzRHByb21wdCUyQyUyMGltYWdlJTNEb3JpZ2luYWxfaW1hZ2UlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMjUpLmltYWdlcyU1QjAlNUQ=",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-1&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(){u=a("p"),I=o("Examples:"),M=d(),g(h.$$.fragment)},l(f){u=i(f,"P",{});var v=s(u);I=r(v,"Examples:"),v.forEach(t),M=c(f),y(h.$$.fragment,f)},m(f,v){m(f,u,v),n(u,I),m(f,M,v),_(h,f,v),T=!0},p:ze,i(f){T||(b(h.$$.fragment,f),T=!0)},o(f){k(h.$$.fragment,f),T=!1},d(f){f&&t(u),f&&t(M),w(h,f)}}}function dy(G){let u,I,M,h,T;return h=new C({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvcklucGFpbnRpbmclMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQWltcG9ydCUyMHRvcmNoJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBcGlwZSUyMCUzRCUyMEF1dG9QaXBlbGluZUZvcklucGFpbnRpbmcuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLWlucGFpbnQlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTBBcGlwZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkElMjBmYW50YXN5JTIwbGFuZHNjYXBlJTJDJTIwQ2luZW1hdGljJTIwbGlnaHRpbmclMjIlMEFuZWdhdGl2ZV9wcm9tcHQlMjAlM0QlMjAlMjJsb3clMjBxdWFsaXR5JTJDJTIwYmFkJTIwcXVhbGl0eSUyMiUwQSUwQW9yaWdpbmFsX2ltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZoZi1pbnRlcm5hbC10ZXN0aW5nJTJGZGlmZnVzZXJzLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTIyJTIwJTIyJTJGa2FuZGluc2t5JTJGY2F0LnBuZyUyMiUwQSklMEElMEFtYXNrJTIwJTNEJTIwbnAuemVyb3MoKDc2OCUyQyUyMDc2OCklMkMlMjBkdHlwZSUzRG5wLmZsb2F0MzIpJTBBJTIzJTIwTGV0J3MlMjBtYXNrJTIwb3V0JTIwYW4lMjBhcmVhJTIwYWJvdmUlMjB0aGUlMjBjYXQncyUyMGhlYWQlMEFtYXNrJTVCJTNBMjUwJTJDJTIwMjUwJTNBLTI1MCU1RCUyMCUzRCUyMDElMEElMEFpbWFnZSUyMCUzRCUyMHBpcGUocHJvbXB0JTNEcHJvbXB0JTJDJTIwaW1hZ2UlM0RvcmlnaW5hbF9pbWFnZSUyQyUyMG1hc2tfaW1hZ2UlM0RtYXNrJTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDI1KS5pbWFnZXMlNUIwJTVE",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-1-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(){u=a("p"),I=o("Examples:"),M=d(),g(h.$$.fragment)},l(f){u=i(f,"P",{});var v=s(u);I=r(v,"Examples:"),v.forEach(t),M=c(f),y(h.$$.fragment,f)},m(f,v){m(f,u,v),n(u,I),m(f,M,v),_(h,f,v),T=!0},p:ze,i(f){T||(b(h.$$.fragment,f),T=!0)},o(f){k(h.$$.fragment,f),T=!1},d(f){f&&t(u),f&&t(M),w(h,f)}}}function cy(G){let u,I,M,h,T,f,v,K,$,R,J,U,z,V,S,x,me,q,N,fe,B,ue,he,F,j,ge,P,Z,Qe,te,Se,Le,ye,E,Pa,nt,$l,El,tt,Wl,xl,at,Bl,Kl,it,Vl,Nl,st,Fl,Rl,ot,ql,Xl,rt,zl,Uo,De,mn,Ci,lt,Ql,Gi,Sl,jo,Za,Ll,Po,Ye,fn,$i,pt,Dl,Ei,Yl,Zo,de,Al,Ca,Hl,Ol,Ga,ep,np,dt,tp,ap,Co,ct,Go,$a,ip,$o,mt,Eo,un,Wo,Ea,sp,xo,ft,Bo,hn,Ko,gn,op,Wi,rp,lp,Vo,ut,No,Wa,pp,Fo,xa,Ba,Rf,Ro,Ka,dp,qo,ht,Xo,Va,Na,qf,zo,gt,Qo,Fa,Ra,Xf,So,yt,Lo,qa,Xa,zf,Do,_t,Yo,za,Qa,Qf,Ao,Ae,yn,xi,bt,cp,Bi,mp,Ho,_n,fp,Sa,up,hp,Oo,_e,Ki,gp,yp,La,_p,bp,Da,kp,wp,er,Ya,vp,nr,kt,tr,Aa,Ha,Sf,ar,wt,ir,Oa,ei,Lf,sr,He,bn,Vi,vt,Mp,Ni,Tp,or,kn,Ip,ni,Jp,Up,rr,Mt,lr,ti,ai,Df,pr,Oe,wn,Fi,Tt,jp,Ri,Pp,dr,vn,Zp,ii,Cp,Gp,cr,ke,$p,qi,Ep,Wp,Xi,xp,Bp,mr,It,fr,si,oi,Yf,ur,en,Mn,zi,Jt,Kp,Qi,Vp,hr,ne,Np,ri,Fp,Rp,li,qp,Xp,pi,zp,Qp,di,Sp,Lp,gr,ci,Dp,yr,Tn,Yp,Ut,Si,Ap,Hp,_r,jt,br,In,Op,Pt,ed,nd,kr,mi,td,wr,Zt,vr,we,ad,Li,id,sd,Di,od,rd,Mr,Ct,Tr,ve,ld,Yi,pd,dd,Ai,cd,md,Ir,Gt,Jr,Jn,fd,$t,ud,hd,Ur,Un,jr,nn,jn,Hi,Et,gd,Oi,yd,Pr,Pn,es,Wt,ns,_d,bd,ts,kd,wd,be,xt,as,Bt,vd,Md,is,ss,Td,Id,Kt,os,Vt,Jd,Ud,rs,ls,jd,Pd,Nt,ps,Ft,Zd,Cd,ds,cs,Gd,$d,Rt,ms,qt,Ed,Wd,fs,us,xd,Zr,tn,Zn,hs,Xt,Bd,gs,Kd,Cr,X,zt,Vd,ys,Nd,Fd,Qt,Rd,fi,qd,Xd,zd,Me,St,Qd,_s,Sd,Ld,Cn,Dd,Te,Lt,Yd,bs,Ad,Hd,Gn,Od,$n,Dt,ec,ae,nc,ks,tc,ac,ws,ic,sc,vs,oc,rc,Ms,lc,pc,Gr,an,En,Ts,Yt,dc,Is,cc,$r,L,At,mc,Js,fc,uc,Ht,hc,ui,gc,yc,_c,Ie,Ot,bc,Us,kc,wc,Wn,vc,xn,ea,Mc,ie,Tc,js,Ic,Jc,Ps,Uc,jc,Zs,Pc,Zc,Cs,Cc,Gc,Er,sn,Bn,Gs,na,$c,$s,Ec,Wr,D,ta,Wc,Es,xc,Bc,aa,Kc,hi,Vc,Nc,Fc,Je,ia,Rc,Ws,qc,Xc,Kn,zc,Vn,sa,Qc,se,Sc,xs,Lc,Dc,Bs,Yc,Ac,Ks,Hc,Oc,Vs,em,nm,xr,on,Nn,Ns,oa,tm,Fs,am,Br,Y,ra,im,Rs,sm,om,la,rm,gi,lm,pm,dm,Ue,pa,cm,qs,mm,fm,Fn,um,Rn,da,hm,oe,gm,Xs,ym,_m,zs,bm,km,Qs,wm,vm,Ss,Mm,Tm,Kr,rn,qn,Ls,ca,Im,Ds,Jm,Vr,A,ma,Um,Ys,jm,Pm,fa,Zm,yi,Cm,Gm,$m,je,ua,Em,As,Wm,xm,Xn,Bm,zn,ha,Km,re,Vm,Hs,Nm,Fm,Os,Rm,qm,eo,Xm,zm,no,Qm,Sm,Nr,ln,Qn,to,ga,Lm,ao,Dm,Fr,H,ya,Ym,io,Am,Hm,_a,Om,_i,ef,nf,tf,Pe,ba,af,so,sf,of,Sn,rf,Ln,ka,lf,le,pf,oo,df,cf,ro,mf,ff,lo,uf,hf,po,gf,yf,Rr,pn,Dn,co,wa,_f,mo,bf,qr,O,va,kf,fo,wf,vf,Ma,Mf,bi,Tf,If,Jf,Ze,Ta,Uf,uo,jf,Pf,Yn,Zf,An,Ia,Cf,pe,Gf,ho,$f,Ef,go,Wf,xf,yo,Bf,Kf,_o,Vf,Nf,Xr;return f=new Q({}),V=new Q({}),lt=new Q({}),pt=new Q({}),ct=new C({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMGFsaWVuJTIwY2hlZXNlYnVyZ2VyJTIwY3JlYXR1cmUlMjBlYXRpbmclMjBpdHNlbGYlMkMlMjBjbGF5bWF0aW9uJTJDJTIwY2luZW1hdGljJTJDJTIwbW9vZHklMjBsaWdodGluZyUyMg==",highlighted:'prompt = <span class="hljs-string">&quot;A alien cheeseburger creature eating itself, claymation, cinematic, moody lighting&quot;</span>'}}),mt=new C({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlX3ByaW9yJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEF0MmlfcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEF0MmlfcGlwZS50byglMjJjdWRhJTIyKQ==",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-1-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-1&quot;</span>, torch_dtype=torch.float16)
t2i_pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),un=new Ff({props:{warning:!0,$$slots:{default:[ey]},$$scope:{ctx:G}}}),ft=new C({props:{code:"aW1hZ2VfZW1iZWRzJTJDJTIwbmVnYXRpdmVfaW1hZ2VfZW1iZWRzJTIwJTNEJTIwcGlwZV9wcmlvcihwcm9tcHQlMkMlMjBndWlkYW5jZV9zY2FsZSUzRDEuMCkudG9fdHVwbGUoKQ==",highlighted:'image_embeds, negative_image_embeds = pipe_prior(prompt, guidance_scale=<span class="hljs-number">1.0</span>).to_tuple()'}}),hn=new Ff({props:{warning:!0,$$slots:{default:[ny]},$$scope:{ctx:G}}}),ut=new C({props:{code:"aW1hZ2UlMjAlM0QlMjB0MmlfcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlMkMlMjBpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWJlZHMlMkMlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0RuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlMkMlMjBoZWlnaHQlM0Q3NjglMkMlMjB3aWR0aCUzRDc2OCUwQSkuaW1hZ2VzJTVCMCU1RCUwQWltYWdlLnNhdmUoJTIyY2hlZXNlYnVyZ2VyX21vbnN0ZXIucG5nJTIyKQ==",highlighted:`image = t2i_pipe(
    prompt, image_embeds=image_embeds, negative_image_embeds=negative_image_embeds, height=<span class="hljs-number">768</span>, width=<span class="hljs-number">768</span>
).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;cheeseburger_monster.png&quot;</span>)`}}),ht=new C({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyYmlyZCUyMGV5ZSUyMHZpZXclMjBzaG90JTIwb2YlMjBhJTIwZnVsbCUyMGJvZHklMjB3b21hbiUyMHdpdGglMjBjeWFuJTIwbGlnaHQlMjBvcmFuZ2UlMjBtYWdlbnRhJTIwbWFrZXVwJTJDJTIwZGlnaXRhbCUyMGFydCUyQyUyMGxvbmclMjBicmFpZGVkJTIwaGFpciUyMGhlciUyMGZhY2UlMjBzZXBhcmF0ZWQlMjBieSUyMG1ha2V1cCUyMGluJTIwdGhlJTIwc3R5bGUlMjBvZiUyMHlpbiUyMFlhbmclMjBzdXJyZWFsaXNtJTJDJTIwc3ltbWV0cmljYWwlMjBmYWNlJTJDJTIwcmVhbCUyMGltYWdlJTJDJTIwY29udHJhc3RpbmclMjB0b25lJTJDJTIwcGFzdGVsJTIwZ3JhZGllbnQlMjBiYWNrZ3JvdW5kJTIy",highlighted:'prompt = <span class="hljs-string">&quot;bird eye view shot of a full body woman with cyan light orange magenta makeup, digital art, long braided hair her face separated by makeup in the style of yin Yang surrealism, symmetrical face, real image, contrasting tone, pastel gradient background&quot;</span>'}}),gt=new C({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMGNhciUyMGV4cGxvZGluZyUyMGludG8lMjBjb2xvcmZ1bCUyMGR1c3QlMjI=",highlighted:'prompt = <span class="hljs-string">&quot;A car exploding into colorful dust&quot;</span>'}}),yt=new C({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyZWRpdG9yaWFsJTIwcGhvdG9ncmFwaHklMjBvZiUyMGFuJTIwb3JnYW5pYyUyQyUyMGFsbW9zdCUyMGxpcXVpZCUyMHNtb2tlJTIwc3R5bGUlMjBhcm1jaGFpciUyMg==",highlighted:'prompt = <span class="hljs-string">&quot;editorial photography of an organic, almost liquid smoke style armchair&quot;</span>'}}),_t=new C({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyYmlyZHMlMjBleWUlMjB2aWV3JTIwb2YlMjBhJTIwcXVpbHRlZCUyMHBhcGVyJTIwc3R5bGUlMjBhbGllbiUyMHBsYW5ldCUyMGxhbmRzY2FwZSUyQyUyMHZpYnJhbnQlMjBjb2xvdXJzJTJDJTIwQ2luZW1hdGljJTIwbGlnaHRpbmclMjI=",highlighted:'prompt = <span class="hljs-string">&quot;birds eye view of a quilted paper style alien planet landscape, vibrant colours, Cinematic lighting&quot;</span>'}}),bt=new Q({}),kt=new C({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwaW8lMjBpbXBvcnQlMjBCeXRlc0lPJTBBJTBBJTIzJTIwZG93bmxvYWQlMjBpbWFnZSUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRkNvbXBWaXMlMkZzdGFibGUtZGlmZnVzaW9uJTJGbWFpbiUyRmFzc2V0cyUyRnN0YWJsZS1zYW1wbGVzJTJGaW1nMmltZyUyRnNrZXRjaC1tb3VudGFpbnMtaW5wdXQuanBnJTIyJTBBcmVzcG9uc2UlMjAlM0QlMjByZXF1ZXN0cy5nZXQodXJsKSUwQW9yaWdpbmFsX2ltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihCeXRlc0lPKHJlc3BvbnNlLmNvbnRlbnQpKS5jb252ZXJ0KCUyMlJHQiUyMiklMEFvcmlnaW5hbF9pbWFnZSUyMCUzRCUyMG9yaWdpbmFsX2ltYWdlLnJlc2l6ZSgoNzY4JTJDJTIwNTEyKSk=",highlighted:`<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> requests
<span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO

<span class="hljs-comment"># download image</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)
original_image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
original_image = original_image.resize((<span class="hljs-number">768</span>, <span class="hljs-number">512</span>))`}}),wt=new C({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwS2FuZGluc2t5SW1nMkltZ1BpcGVsaW5lJTJDJTIwS2FuZGluc2t5UHJpb3JQaXBlbGluZSUwQSUwQSUyMyUyMGNyZWF0ZSUyMHByaW9yJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEElMjMlMjBjcmVhdGUlMjBpbWcyaW1nJTIwcGlwZWxpbmUlMEFwaXBlJTIwJTNEJTIwS2FuZGluc2t5SW1nMkltZ1BpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMGZhbnRhc3klMjBsYW5kc2NhcGUlMkMlMjBDaW5lbWF0aWMlMjBsaWdodGluZyUyMiUwQW5lZ2F0aXZlX3Byb21wdCUyMCUzRCUyMCUyMmxvdyUyMHF1YWxpdHklMkMlMjBiYWQlMjBxdWFsaXR5JTIyJTBBJTBBaW1hZ2VfZW1iZWRzJTJDJTIwbmVnYXRpdmVfaW1hZ2VfZW1iZWRzJTIwJTNEJTIwcGlwZV9wcmlvcihwcm9tcHQlMkMlMjBuZWdhdGl2ZV9wcm9tcHQpLnRvX3R1cGxlKCklMEElMEFvdXQlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMHByb21wdCUyQyUwQSUyMCUyMCUyMCUyMGltYWdlJTNEb3JpZ2luYWxfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWJlZHMlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0RuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlMkMlMEElMjAlMjAlMjAlMjBoZWlnaHQlM0Q3NjglMkMlMEElMjAlMjAlMjAlMjB3aWR0aCUzRDc2OCUyQyUwQSUyMCUyMCUyMCUyMHN0cmVuZ3RoJTNEMC4zJTJDJTBBKSUwQSUwQW91dC5pbWFnZXMlNUIwJTVELnNhdmUoJTIyZmFudGFzeV9sYW5kLnBuZyUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyImg2ImgPipeline, KandinskyPriorPipeline

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

<span class="hljs-comment"># create img2img pipeline</span>
pipe = KandinskyImg2ImgPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1&quot;</span>, torch_dtype=torch.float16)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

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>

image_embeds, negative_image_embeds = pipe_prior(prompt, negative_prompt).to_tuple()

out = pipe(
    prompt,
    image=original_image,
    image_embeds=image_embeds,
    negative_image_embeds=negative_image_embeds,
    height=<span class="hljs-number">768</span>,
    width=<span class="hljs-number">768</span>,
    strength=<span class="hljs-number">0.3</span>,
)

out.images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;fantasy_land.png&quot;</span>)`}}),vt=new Q({}),Mt=new C({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreUlucGFpbnRQaXBlbGluZSUyQyUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQWltcG9ydCUyMHRvcmNoJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwaGF0JTIyJTBBcHJpb3Jfb3V0cHV0JTIwJTNEJTIwcGlwZV9wcmlvcihwcm9tcHQpJTBBJTBBcGlwZSUyMCUzRCUyMEthbmRpbnNreUlucGFpbnRQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTEtaW5wYWludCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBaW5pdF9pbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGaGYtaW50ZXJuYWwtdGVzdGluZyUyRmRpZmZ1c2Vycy1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyMiUyMCUyMiUyRmthbmRpbnNreSUyRmNhdC5wbmclMjIlMEEpJTBBJTBBbWFzayUyMCUzRCUyMG5wLnplcm9zKCg3NjglMkMlMjA3NjgpJTJDJTIwZHR5cGUlM0RucC5mbG9hdDMyKSUwQSUyMyUyMExldCdzJTIwbWFzayUyMG91dCUyMGFuJTIwYXJlYSUyMGFib3ZlJTIwdGhlJTIwY2F0J3MlMjBoZWFkJTBBbWFzayU1QiUzQTI1MCUyQyUyMDI1MCUzQS0yNTAlNUQlMjAlM0QlMjAxJTBBJTBBb3V0JTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBpbWFnZSUzRGluaXRfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBtYXNrX2ltYWdlJTNEbWFzayUyQyUwQSUyMCUyMCUyMCUyMCoqcHJpb3Jfb3V0cHV0JTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMTUwJTJDJTBBKSUwQSUwQWltYWdlJTIwJTNEJTIwb3V0LmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNhdF93aXRoX2hhdC5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyInpaintPipeline, KandinskyPriorPipeline
<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_prior = KandinskyPriorPipeline.from_pretrained(
    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1-prior&quot;</span>, torch_dtype=torch.float16
)
pipe_prior.to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;a hat&quot;</span>
prior_output = pipe_prior(prompt)

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

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

out = pipe(
    prompt,
    image=init_image,
    mask_image=mask,
    **prior_output,
    height=<span class="hljs-number">768</span>,
    width=<span class="hljs-number">768</span>,
    num_inference_steps=<span class="hljs-number">150</span>,
)

image = out.images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;cat_with_hat.png&quot;</span>)`}}),Tt=new Q({}),It=new C({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUlMkMlMjBLYW5kaW5za3lQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBaW1wb3J0JTIwUElMJTBBJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlX3ByaW9yJTIwJTNEJTIwS2FuZGluc2t5UHJpb3JQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTEtcHJpb3IlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTBBcGlwZV9wcmlvci50byglMjJjdWRhJTIyKSUwQSUwQWltZzElMjAlM0QlMjBsb2FkX2ltYWdlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmhmLWludGVybmFsLXRlc3RpbmclMkZkaWZmdXNlcnMtaW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMjIlMjAlMjIlMkZrYW5kaW5za3klMkZjYXQucG5nJTIyJTBBKSUwQSUwQWltZzIlMjAlM0QlMjBsb2FkX2ltYWdlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmhmLWludGVybmFsLXRlc3RpbmclMkZkaWZmdXNlcnMtaW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMjIlMjAlMjIlMkZrYW5kaW5za3klMkZzdGFycnlfbmlnaHQuanBlZyUyMiUwQSklMEElMEElMjMlMjBhZGQlMjBhbGwlMjB0aGUlMjBjb25kaXRpb25zJTIwd2UlMjB3YW50JTIwdG8lMjBpbnRlcnBvbGF0ZSUyQyUyMGNhbiUyMGJlJTIwZWl0aGVyJTIwdGV4dCUyMG9yJTIwaW1hZ2UlMEFpbWFnZXNfdGV4dHMlMjAlM0QlMjAlNUIlMjJhJTIwY2F0JTIyJTJDJTIwaW1nMSUyQyUyMGltZzIlNUQlMEElMEElMjMlMjBzcGVjaWZ5JTIwdGhlJTIwd2VpZ2h0cyUyMGZvciUyMGVhY2glMjBjb25kaXRpb24lMjBpbiUyMGltYWdlc190ZXh0cyUwQXdlaWdodHMlMjAlM0QlMjAlNUIwLjMlMkMlMjAwLjMlMkMlMjAwLjQlNUQlMEElMEElMjMlMjBXZSUyMGNhbiUyMGxlYXZlJTIwdGhlJTIwcHJvbXB0JTIwZW1wdHklMEFwcm9tcHQlMjAlM0QlMjAlMjIlMjIlMEFwcmlvcl9vdXQlMjAlM0QlMjBwaXBlX3ByaW9yLmludGVycG9sYXRlKGltYWdlc190ZXh0cyUyQyUyMHdlaWdodHMpJTBBJTBBcGlwZSUyMCUzRCUyMEthbmRpbnNreVBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUyQyUyMCoqcHJpb3Jfb3V0JTJDJTIwaGVpZ2h0JTNENzY4JTJDJTIwd2lkdGglM0Q3NjgpLmltYWdlcyU1QjAlNUQlMEElMEFpbWFnZS5zYXZlKCUyMnN0YXJyeV9jYXQucG5nJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyPriorPipeline, KandinskyPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">import</span> PIL

<span class="hljs-keyword">import</span> torch

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

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

img2 = 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/starry_night.jpeg&quot;</span>
)

<span class="hljs-comment"># add all the conditions we want to interpolate, can be either text or image</span>
images_texts = [<span class="hljs-string">&quot;a cat&quot;</span>, img1, img2]

<span class="hljs-comment"># specify the weights for each condition in images_texts</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-comment"># We can leave the prompt empty</span>
prompt = <span class="hljs-string">&quot;&quot;</span>
prior_out = pipe_prior.interpolate(images_texts, weights)

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

image = pipe(prompt, **prior_out, height=<span class="hljs-number">768</span>, width=<span class="hljs-number">768</span>).images[<span class="hljs-number">0</span>]

image.save(<span class="hljs-string">&quot;starry_cat.png&quot;</span>)`}}),Jt=new Q({}),jt=new C({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()`}}),Zt=new C({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())`}}),Ct=new C({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())`}}),Gt=new C({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>)`}}),Un=new Ff({props:{$$slots:{default:[ty]},$$scope:{ctx:G}}}),Et=new Q({}),Xt=new Q({}),zt=new W({props:{name:"class diffusers.KandinskyPriorPipeline",anchor:"diffusers.KandinskyPriorPipeline",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.KandinskyPriorPipeline.prior",description:`<strong>prior</strong> (<a href="/docs/diffusers/v0.19.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.KandinskyPriorPipeline.image_encoder",description:`<strong>image_encoder</strong> (<code>CLIPVisionModelWithProjection</code>) &#x2014;
Frozen image-encoder.`,name:"image_encoder"},{anchor:"diffusers.KandinskyPriorPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModelWithProjection</code>) &#x2014;
Frozen text-encoder.`,name:"text_encoder"},{anchor:"diffusers.KandinskyPriorPipeline.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.KandinskyPriorPipeline.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.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_prior.py#L130"}}),St=new W({props:{name:"__call__",anchor:"diffusers.KandinskyPriorPipeline.__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.KandinskyPriorPipeline.__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.KandinskyPriorPipeline.__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.KandinskyPriorPipeline.__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.KandinskyPriorPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 25) &#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.KandinskyPriorPipeline.__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.KandinskyPriorPipeline.__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.KandinskyPriorPipeline.__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.KandinskyPriorPipeline.__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.KandinskyPriorPipeline.__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.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_prior.py#L427",returnType:`
<p><code>KandinskyPriorPipelineOutput</code> or <code>tuple</code></p>
`}}),Cn=new et({props:{anchor:"diffusers.KandinskyPriorPipeline.__call__.example",$$slots:{default:[ay]},$$scope:{ctx:G}}}),Lt=new W({props:{name:"interpolate",anchor:"diffusers.KandinskyPriorPipeline.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.KandinskyPriorPipeline.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.KandinskyPriorPipeline.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.KandinskyPriorPipeline.interpolate.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 25) &#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.KandinskyPriorPipeline.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.KandinskyPriorPipeline.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.KandinskyPriorPipeline.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.KandinskyPriorPipeline.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.KandinskyPriorPipeline.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.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_prior.py#L173",returnType:`
<p><code>KandinskyPriorPipelineOutput</code> or <code>tuple</code></p>
`}}),Gn=new et({props:{anchor:"diffusers.KandinskyPriorPipeline.interpolate.example",$$slots:{default:[iy]},$$scope:{ctx:G}}}),Dt=new W({props:{name:"enable_model_cpu_offload",anchor:"diffusers.KandinskyPriorPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_prior.py#L398"}}),Yt=new Q({}),At=new W({props:{name:"class diffusers.KandinskyPipeline",anchor:"diffusers.KandinskyPipeline",parameters:[{name:"text_encoder",val:": MultilingualCLIP"},{name:"tokenizer",val:": XLMRobertaTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim.DDIMScheduler, diffusers.schedulers.scheduling_ddpm.DDPMScheduler]"},{name:"movq",val:": VQModel"}],parametersDescription:[{anchor:"diffusers.KandinskyPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>MultilingualCLIP</code>) &#x2014;
Frozen text-encoder.`,name:"text_encoder"},{anchor:"diffusers.KandinskyPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>XLMRobertaTokenizer</code>) &#x2014;
Tokenizer of class`,name:"tokenizer"},{anchor:"diffusers.KandinskyPipeline.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.KandinskyPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.19.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.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky.py#L78"}}),Ot=new W({props:{name:"__call__",anchor:"diffusers.KandinskyPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{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:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{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.KandinskyPipeline.__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.KandinskyPipeline.__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.KandinskyPipeline.__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.KandinskyPipeline.__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.KandinskyPipeline.__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.KandinskyPipeline.__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.KandinskyPipeline.__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.KandinskyPipeline.__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.KandinskyPipeline.__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.KandinskyPipeline.__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.KandinskyPipeline.__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.KandinskyPipeline.__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.KandinskyPipeline.__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.KandinskyPipeline.__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.KandinskyPipeline.__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.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky.py#L256",returnType:`
<p><a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Wn=new et({props:{anchor:"diffusers.KandinskyPipeline.__call__.example",$$slots:{default:[sy]},$$scope:{ctx:G}}}),ea=new W({props:{name:"enable_model_cpu_offload",anchor:"diffusers.KandinskyPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky.py#L231"}}),na=new Q({}),ta=new W({props:{name:"class diffusers.KandinskyImg2ImgPipeline",anchor:"diffusers.KandinskyImg2ImgPipeline",parameters:[{name:"text_encoder",val:": MultilingualCLIP"},{name:"movq",val:": VQModel"},{name:"tokenizer",val:": XLMRobertaTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDIMScheduler"}],parametersDescription:[{anchor:"diffusers.KandinskyImg2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>MultilingualCLIP</code>) &#x2014;
Frozen text-encoder.`,name:"text_encoder"},{anchor:"diffusers.KandinskyImg2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>XLMRobertaTokenizer</code>) &#x2014;
Tokenizer of class`,name:"tokenizer"},{anchor:"diffusers.KandinskyImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.19.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.KandinskyImg2ImgPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyImg2ImgPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ image encoder and decoder`,name:"movq"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_img2img.py#L100"}}),ia=new W({props:{name:"__call__",anchor:"diffusers.KandinskyImg2ImgPipeline.__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:"image_embeds",val:": FloatTensor"},{name:"negative_image_embeds",val:": FloatTensor"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"height",val:": int = 512"},{name:"width",val:": int = 512"},{name:"num_inference_steps",val:": int = 100"},{name:"strength",val:": float = 0.3"},{name:"guidance_scale",val:": float = 7.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:"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.KandinskyImg2ImgPipeline.__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.KandinskyImg2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, that will be used as the starting point for the
process.`,name:"image"},{anchor:"diffusers.KandinskyImg2ImgPipeline.__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.KandinskyImg2ImgPipeline.__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.KandinskyImg2ImgPipeline.__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.KandinskyImg2ImgPipeline.__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.KandinskyImg2ImgPipeline.__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.KandinskyImg2ImgPipeline.__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.KandinskyImg2ImgPipeline.__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.KandinskyImg2ImgPipeline.__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.KandinskyImg2ImgPipeline.__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.KandinskyImg2ImgPipeline.__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.KandinskyImg2ImgPipeline.__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.KandinskyImg2ImgPipeline.__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.KandinskyImg2ImgPipeline.__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.KandinskyImg2ImgPipeline.__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.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_img2img.py#L318",returnType:`
<p><a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Kn=new et({props:{anchor:"diffusers.KandinskyImg2ImgPipeline.__call__.example",$$slots:{default:[oy]},$$scope:{ctx:G}}}),sa=new W({props:{name:"enable_model_cpu_offload",anchor:"diffusers.KandinskyImg2ImgPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_img2img.py#L266"}}),oa=new Q({}),ra=new W({props:{name:"class diffusers.KandinskyInpaintPipeline",anchor:"diffusers.KandinskyInpaintPipeline",parameters:[{name:"text_encoder",val:": MultilingualCLIP"},{name:"movq",val:": VQModel"},{name:"tokenizer",val:": XLMRobertaTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDIMScheduler"}],parametersDescription:[{anchor:"diffusers.KandinskyInpaintPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>MultilingualCLIP</code>) &#x2014;
Frozen text-encoder.`,name:"text_encoder"},{anchor:"diffusers.KandinskyInpaintPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>XLMRobertaTokenizer</code>) &#x2014;
Tokenizer of class`,name:"tokenizer"},{anchor:"diffusers.KandinskyInpaintPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.19.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.KandinskyInpaintPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyInpaintPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ image encoder and decoder`,name:"movq"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_inpaint.py#L242"}}),pa=new W({props:{name:"__call__",anchor:"diffusers.KandinskyInpaintPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image]"},{name:"mask_image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, numpy.ndarray]"},{name:"image_embeds",val:": FloatTensor"},{name:"negative_image_embeds",val:": FloatTensor"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{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.KandinskyInpaintPipeline.__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.KandinskyInpaintPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code> or <code>np.ndarray</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, that will be used as the starting point for the
process.`,name:"image"},{anchor:"diffusers.KandinskyInpaintPipeline.__call__.mask_image",description:`<strong>mask_image</strong> (<code>PIL.Image.Image</code>,<code>torch.FloatTensor</code> or <code>np.ndarray</code>) &#x2014;
<code>Image</code>, or a tensor representing an image batch, to mask <code>image</code>. White pixels in the mask will be
repainted, while black pixels will be preserved. You can pass a pytorch tensor as mask only if the
image you passed is a pytorch tensor, and it should contain one color channel (L) instead of 3, so the
expected shape would be either <code>(B, 1, H, W,)</code>, <code>(B, H, W)</code>, <code>(1, H, W)</code> or <code>(H, W)</code> If image is an PIL
image or numpy array, mask should also be a either PIL image or numpy array. If it is a PIL image, it
will be converted to a single channel (luminance) before use. If it is a nummpy array, the expected
shape is <code>(H, W)</code>.`,name:"mask_image"},{anchor:"diffusers.KandinskyInpaintPipeline.__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.KandinskyInpaintPipeline.__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.KandinskyInpaintPipeline.__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.KandinskyInpaintPipeline.__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.KandinskyInpaintPipeline.__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.KandinskyInpaintPipeline.__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.KandinskyInpaintPipeline.__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.KandinskyInpaintPipeline.__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.KandinskyInpaintPipeline.__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.KandinskyInpaintPipeline.__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.KandinskyInpaintPipeline.__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.KandinskyInpaintPipeline.__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.KandinskyInpaintPipeline.__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.KandinskyInpaintPipeline.__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.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_inpaint.py#L421",returnType:`
<p><a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Fn=new et({props:{anchor:"diffusers.KandinskyInpaintPipeline.__call__.example",$$slots:{default:[ry]},$$scope:{ctx:G}}}),da=new W({props:{name:"enable_model_cpu_offload",anchor:"diffusers.KandinskyInpaintPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_inpaint.py#L396"}}),ca=new Q({}),ma=new W({props:{name:"class diffusers.KandinskyCombinedPipeline",anchor:"diffusers.KandinskyCombinedPipeline",parameters:[{name:"text_encoder",val:": MultilingualCLIP"},{name:"tokenizer",val:": XLMRobertaTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim.DDIMScheduler, diffusers.schedulers.scheduling_ddpm.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.KandinskyCombinedPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>MultilingualCLIP</code>) &#x2014;
Frozen text-encoder.`,name:"text_encoder"},{anchor:"diffusers.KandinskyCombinedPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>XLMRobertaTokenizer</code>) &#x2014;
Tokenizer of class`,name:"tokenizer"},{anchor:"diffusers.KandinskyCombinedPipeline.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.KandinskyCombinedPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyCombinedPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ Decoder to generate the image from the latents.`,name:"movq"},{anchor:"diffusers.KandinskyCombinedPipeline.prior_prior",description:`<strong>prior_prior</strong> (<a href="/docs/diffusers/v0.19.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.KandinskyCombinedPipeline.prior_image_encoder",description:`<strong>prior_image_encoder</strong> (<code>CLIPVisionModelWithProjection</code>) &#x2014;
Frozen image-encoder.`,name:"prior_image_encoder"},{anchor:"diffusers.KandinskyCombinedPipeline.prior_text_encoder",description:`<strong>prior_text_encoder</strong> (<code>CLIPTextModelWithProjection</code>) &#x2014;
Frozen text-encoder.`,name:"prior_text_encoder"},{anchor:"diffusers.KandinskyCombinedPipeline.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.KandinskyCombinedPipeline.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"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_combined.py#L113"}}),ua=new W({props:{name:"__call__",anchor:"diffusers.KandinskyCombinedPipeline.__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.KandinskyCombinedPipeline.__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.KandinskyCombinedPipeline.__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.KandinskyCombinedPipeline.__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.KandinskyCombinedPipeline.__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.KandinskyCombinedPipeline.__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.KandinskyCombinedPipeline.__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.KandinskyCombinedPipeline.__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.KandinskyCombinedPipeline.__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.KandinskyCombinedPipeline.__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.KandinskyCombinedPipeline.__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.KandinskyCombinedPipeline.__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.KandinskyCombinedPipeline.__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.KandinskyCombinedPipeline.__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.KandinskyCombinedPipeline.__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.KandinskyCombinedPipeline.__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.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_combined.py#L210",returnType:`
<p><a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Xn=new et({props:{anchor:"diffusers.KandinskyCombinedPipeline.__call__.example",$$slots:{default:[ly]},$$scope:{ctx:G}}}),ha=new W({props:{name:"enable_model_cpu_offload",anchor:"diffusers.KandinskyCombinedPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_combined.py#L191"}}),ga=new Q({}),ya=new W({props:{name:"class diffusers.KandinskyImg2ImgCombinedPipeline",anchor:"diffusers.KandinskyImg2ImgCombinedPipeline",parameters:[{name:"text_encoder",val:": MultilingualCLIP"},{name:"tokenizer",val:": XLMRobertaTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim.DDIMScheduler, diffusers.schedulers.scheduling_ddpm.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.KandinskyImg2ImgCombinedPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>MultilingualCLIP</code>) &#x2014;
Frozen text-encoder.`,name:"text_encoder"},{anchor:"diffusers.KandinskyImg2ImgCombinedPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>XLMRobertaTokenizer</code>) &#x2014;
Tokenizer of class`,name:"tokenizer"},{anchor:"diffusers.KandinskyImg2ImgCombinedPipeline.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.KandinskyImg2ImgCombinedPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyImg2ImgCombinedPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ Decoder to generate the image from the latents.`,name:"movq"},{anchor:"diffusers.KandinskyImg2ImgCombinedPipeline.prior_prior",description:`<strong>prior_prior</strong> (<a href="/docs/diffusers/v0.19.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.KandinskyImg2ImgCombinedPipeline.prior_image_encoder",description:`<strong>prior_image_encoder</strong> (<code>CLIPVisionModelWithProjection</code>) &#x2014;
Frozen image-encoder.`,name:"prior_image_encoder"},{anchor:"diffusers.KandinskyImg2ImgCombinedPipeline.prior_text_encoder",description:`<strong>prior_text_encoder</strong> (<code>CLIPTextModelWithProjection</code>) &#x2014;
Frozen text-encoder.`,name:"prior_text_encoder"},{anchor:"diffusers.KandinskyImg2ImgCombinedPipeline.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.KandinskyImg2ImgCombinedPipeline.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"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_combined.py#L323"}}),ba=new W({props:{name:"__call__",anchor:"diffusers.KandinskyImg2ImgCombinedPipeline.__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:"num_images_per_prompt",val:": int = 1"},{name:"strength",val:": float = 0.3"},{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.KandinskyImg2ImgCombinedPipeline.__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.KandinskyImg2ImgCombinedPipeline.__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 accpet image latents as <code>image</code>, if passing latents directly, it will not be encoded
again.`,name:"image"},{anchor:"diffusers.KandinskyImg2ImgCombinedPipeline.__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.KandinskyImg2ImgCombinedPipeline.__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.KandinskyImg2ImgCombinedPipeline.__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.KandinskyImg2ImgCombinedPipeline.__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.KandinskyImg2ImgCombinedPipeline.__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.KandinskyImg2ImgCombinedPipeline.__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.KandinskyImg2ImgCombinedPipeline.__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.KandinskyImg2ImgCombinedPipeline.__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.KandinskyImg2ImgCombinedPipeline.__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.KandinskyImg2ImgCombinedPipeline.__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.KandinskyImg2ImgCombinedPipeline.__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.KandinskyImg2ImgCombinedPipeline.__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.KandinskyImg2ImgCombinedPipeline.__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.KandinskyImg2ImgCombinedPipeline.__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.KandinskyImg2ImgCombinedPipeline.__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.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_combined.py#L420",returnType:`
<p><a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Sn=new et({props:{anchor:"diffusers.KandinskyImg2ImgCombinedPipeline.__call__.example",$$slots:{default:[py]},$$scope:{ctx:G}}}),ka=new W({props:{name:"enable_model_cpu_offload",anchor:"diffusers.KandinskyImg2ImgCombinedPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_combined.py#L401"}}),wa=new Q({}),va=new W({props:{name:"class diffusers.KandinskyInpaintCombinedPipeline",anchor:"diffusers.KandinskyInpaintCombinedPipeline",parameters:[{name:"text_encoder",val:": MultilingualCLIP"},{name:"tokenizer",val:": XLMRobertaTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim.DDIMScheduler, diffusers.schedulers.scheduling_ddpm.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.KandinskyInpaintCombinedPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>MultilingualCLIP</code>) &#x2014;
Frozen text-encoder.`,name:"text_encoder"},{anchor:"diffusers.KandinskyInpaintCombinedPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>XLMRobertaTokenizer</code>) &#x2014;
Tokenizer of class`,name:"tokenizer"},{anchor:"diffusers.KandinskyInpaintCombinedPipeline.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.KandinskyInpaintCombinedPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyInpaintCombinedPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ Decoder to generate the image from the latents.`,name:"movq"},{anchor:"diffusers.KandinskyInpaintCombinedPipeline.prior_prior",description:`<strong>prior_prior</strong> (<a href="/docs/diffusers/v0.19.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.KandinskyInpaintCombinedPipeline.prior_image_encoder",description:`<strong>prior_image_encoder</strong> (<code>CLIPVisionModelWithProjection</code>) &#x2014;
Frozen image-encoder.`,name:"prior_image_encoder"},{anchor:"diffusers.KandinskyInpaintCombinedPipeline.prior_text_encoder",description:`<strong>prior_text_encoder</strong> (<code>CLIPTextModelWithProjection</code>) &#x2014;
Frozen text-encoder.`,name:"prior_text_encoder"},{anchor:"diffusers.KandinskyInpaintCombinedPipeline.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.KandinskyInpaintCombinedPipeline.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"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_combined.py#L555"}}),Ta=new W({props:{name:"__call__",anchor:"diffusers.KandinskyInpaintCombinedPipeline.__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.KandinskyInpaintCombinedPipeline.__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.KandinskyInpaintCombinedPipeline.__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 accpet image latents as <code>image</code>, if passing latents directly, it will not be encoded
again.`,name:"image"},{anchor:"diffusers.KandinskyInpaintCombinedPipeline.__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.KandinskyInpaintCombinedPipeline.__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.KandinskyInpaintCombinedPipeline.__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.KandinskyInpaintCombinedPipeline.__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.KandinskyInpaintCombinedPipeline.__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.KandinskyInpaintCombinedPipeline.__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.KandinskyInpaintCombinedPipeline.__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.KandinskyInpaintCombinedPipeline.__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.KandinskyInpaintCombinedPipeline.__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.KandinskyInpaintCombinedPipeline.__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.KandinskyInpaintCombinedPipeline.__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.KandinskyInpaintCombinedPipeline.__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.KandinskyInpaintCombinedPipeline.__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.KandinskyInpaintCombinedPipeline.__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.KandinskyInpaintCombinedPipeline.__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.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_combined.py#L652",returnType:`
<p><a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Yn=new et({props:{anchor:"diffusers.KandinskyInpaintCombinedPipeline.__call__.example",$$slots:{default:[dy]},$$scope:{ctx:G}}}),Ia=new W({props:{name:"enable_model_cpu_offload",anchor:"diffusers.KandinskyInpaintCombinedPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_combined.py#L633"}}),{c(){u=a("meta"),I=d(),M=a("h1"),h=a("a"),T=a("span"),g(f.$$.fragment),v=d(),K=a("span"),$=o("Kandinsky"),R=d(),J=a("h2"),U=a("a"),z=a("span"),g(V.$$.fragment),S=d(),x=a("span"),me=o("Overview"),q=d(),N=a("p"),fe=o("Kandinsky inherits best practices from "),B=a("a"),ue=o("DALL-E 2"),he=o(" and "),F=a("a"),j=o("Latent Diffusion"),ge=o(", while introducing some new ideas."),P=d(),Z=a("p"),Qe=o("It uses "),te=a("a"),Se=o("CLIP"),Le=o(" for encoding images and text, and a diffusion image prior (mapping) between latent spaces of CLIP modalities. This approach enhances the visual performance of the model and unveils new horizons in blending images and text-guided image manipulation."),ye=d(),E=a("p"),Pa=o("The Kandinsky model is created by "),nt=a("a"),$l=o("Arseniy Shakhmatov"),El=o(", "),tt=a("a"),Wl=o("Anton Razzhigaev"),xl=o(", "),at=a("a"),Bl=o("Aleksandr Nikolich"),Kl=o(", "),it=a("a"),Vl=o("Igor Pavlov"),Nl=o(", "),st=a("a"),Fl=o("Andrey Kuznetsov"),Rl=o(" and "),ot=a("a"),ql=o("Denis Dimitrov"),Xl=o(". The original codebase can be found "),rt=a("a"),zl=o("here"),Uo=d(),De=a("h2"),mn=a("a"),Ci=a("span"),g(lt.$$.fragment),Ql=d(),Gi=a("span"),Sl=o("Usage example"),jo=d(),Za=a("p"),Ll=o("In the following, we will walk you through some examples of how to use the Kandinsky pipelines to create some visually aesthetic artwork."),Po=d(),Ye=a("h3"),fn=a("a"),$i=a("span"),g(pt.$$.fragment),Dl=d(),Ei=a("span"),Yl=o("Text-to-Image Generation"),Zo=d(),de=a("p"),Al=o("For text-to-image generation, we need to use both "),Ca=a("a"),Hl=o("KandinskyPriorPipeline"),Ol=o(" and "),Ga=a("a"),ep=o("KandinskyPipeline"),np=o(`.
The first step is to encode text prompts with CLIP and then diffuse the CLIP text embeddings to CLIP image embeddings,
as first proposed in `),dt=a("a"),tp=o("DALL-E 2"),ap=o(`.
Let\u2019s throw a fun prompt at Kandinsky to see what it comes up with.`),Co=d(),g(ct.$$.fragment),Go=d(),$a=a("p"),ip=o(`First, let\u2019s instantiate the prior pipeline and the text-to-image pipeline. Both
pipelines are diffusion models.`),$o=d(),g(mt.$$.fragment),Eo=d(),g(un.$$.fragment),Wo=d(),Ea=a("p"),sp=o(`Now we pass the prompt through the prior to generate image embeddings. The prior
returns both the image embeddings corresponding to the prompt and negative/unconditional image
embeddings corresponding to an empty string.`),xo=d(),g(ft.$$.fragment),Bo=d(),g(hn.$$.fragment),Ko=d(),gn=a("p"),op=o(`Next, we can pass the embeddings as well as the prompt to the text-to-image pipeline. Remember that
in case you are using a customized negative prompt, that you should pass this one also to the text-to-image pipelines
with `),Wi=a("code"),rp=o("negative_prompt=negative_prompt"),lp=o(":"),Vo=d(),g(ut.$$.fragment),No=d(),Wa=a("p"),pp=o("One cheeseburger monster coming up! Enjoy!"),Fo=d(),xa=a("p"),Ba=a("img"),Ro=d(),Ka=a("p"),dp=o("The Kandinsky model works extremely well with creative prompts. Here is some of the amazing art that can be created using the exact same process but with different prompts."),qo=d(),g(ht.$$.fragment),Xo=d(),Va=a("p"),Na=a("img"),zo=d(),g(gt.$$.fragment),Qo=d(),Fa=a("p"),Ra=a("img"),So=d(),g(yt.$$.fragment),Lo=d(),qa=a("p"),Xa=a("img"),Do=d(),g(_t.$$.fragment),Yo=d(),za=a("p"),Qa=a("img"),Ao=d(),Ae=a("h3"),yn=a("a"),xi=a("span"),g(bt.$$.fragment),cp=d(),Bi=a("span"),mp=o("Text Guided Image-to-Image Generation"),Ho=d(),_n=a("p"),fp=o("The same Kandinsky model weights can be used for text-guided image-to-image translation. In this case, just make sure to load the weights using the "),Sa=a("a"),up=o("KandinskyImg2ImgPipeline"),hp=o(" pipeline."),Oo=d(),_e=a("p"),Ki=a("strong"),gp=o("Note"),yp=o(`: You can also directly move the weights of the text-to-image pipelines to the image-to-image pipelines
without loading them twice by making use of the `),La=a("a"),_p=o("components"),bp=o(" function as explained "),Da=a("a"),kp=o("here"),wp=o("."),er=d(),Ya=a("p"),vp=o("Let\u2019s download an image."),nr=d(),g(kt.$$.fragment),tr=d(),Aa=a("p"),Ha=a("img"),ar=d(),g(wt.$$.fragment),ir=d(),Oa=a("p"),ei=a("img"),sr=d(),He=a("h3"),bn=a("a"),Vi=a("span"),g(vt.$$.fragment),Mp=d(),Ni=a("span"),Tp=o("Text Guided Inpainting Generation"),or=d(),kn=a("p"),Ip=o("You can use "),ni=a("a"),Jp=o("KandinskyInpaintPipeline"),Up=o(" to edit images. In this example, we will add a hat to the portrait of a cat."),rr=d(),g(Mt.$$.fragment),lr=d(),ti=a("p"),ai=a("img"),pr=d(),Oe=a("h3"),wn=a("a"),Fi=a("span"),g(Tt.$$.fragment),jp=d(),Ri=a("span"),Pp=o("Interpolate"),dr=d(),vn=a("p"),Zp=o("The "),ii=a("a"),Cp=o("KandinskyPriorPipeline"),Gp=o(" also comes with a cool utility function that will allow you to interpolate the latent space of different images and texts super easily. Here is an example of how you can create an Impressionist-style portrait for your pet based on \u201CThe Starry Night\u201D."),cr=d(),ke=a("p"),$p=o("Note that you can interpolate between texts and images - in the below example, we passed a text prompt \u201Ca cat\u201D and two images to the "),qi=a("code"),Ep=o("interplate"),Wp=o(" function, along with a "),Xi=a("code"),xp=o("weights"),Bp=o(" variable containing the corresponding weights for each condition we interplate."),mr=d(),g(It.$$.fragment),fr=d(),si=a("p"),oi=a("img"),ur=d(),en=a("h2"),Mn=a("a"),zi=a("span"),g(Jt.$$.fragment),Kp=d(),Qi=a("span"),Vp=o("Optimization"),hr=d(),ne=a("p"),Np=o("Running Kandinsky in inference requires running both a first prior pipeline: "),ri=a("a"),Fp=o("KandinskyPriorPipeline"),Rp=o(`
and a second image decoding pipeline which is one of `),li=a("a"),qp=o("KandinskyPipeline"),Xp=o(", "),pi=a("a"),zp=o("KandinskyImg2ImgPipeline"),Qp=o(", or "),di=a("a"),Sp=o("KandinskyInpaintPipeline"),Lp=o("."),gr=d(),ci=a("p"),Dp=o(`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.`),yr=d(),Tn=a("p"),Yp=o("When running with PyTorch < 2.0, we strongly recommend making use of "),Ut=a("a"),Si=a("code"),Ap=o("xformers"),Hp=o(`
to speed-up the optimization. This can be done by simply running:`),_r=d(),g(jt.$$.fragment),br=d(),In=a("p"),Op=o(`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 `),Pt=a("a"),ed=o("this blog post"),nd=o("."),kr=d(),mi=a("p"),td=o("To have explicit control , you can also manually set the pipeline to use PyTorch\u2019s 2.0 efficient attention:"),wr=d(),g(Zt.$$.fragment),vr=d(),we=a("p"),ad=o("The slowest and most memory intense attention processor is the default "),Li=a("code"),id=o("AttnAddedKVProcessor"),sd=o(` processor.
We do `),Di=a("strong"),od=o("not"),rd=o(` recommend using it except for testing purposes or cases where very high determistic behaviour is desired.
You can set it with:`),Mr=d(),g(Ct.$$.fragment),Tr=d(),ve=a("p"),ld=o("With PyTorch >= 2.0, you can also use Kandinsky with "),Yi=a("code"),pd=o("torch.compile"),dd=o(` which depending
on your hardware can signficantly speed-up your inference time once the model is compiled.
To use Kandinsksy with `),Ai=a("code"),cd=o("torch.compile"),md=o(", you can do:"),Ir=d(),g(Gt.$$.fragment),Jr=d(),Jn=a("p"),fd=o(`After compilation you should see a very fast inference time. For more information,
feel free to have a look at `),$t=a("a"),ud=o("Our PyTorch 2.0 benchmark"),hd=o("."),Ur=d(),g(Un.$$.fragment),jr=d(),nn=a("h2"),jn=a("a"),Hi=a("span"),g(Et.$$.fragment),gd=d(),Oi=a("span"),yd=o("Available Pipelines:"),Pr=d(),Pn=a("table"),es=a("thead"),Wt=a("tr"),ns=a("th"),_d=o("Pipeline"),bd=d(),ts=a("th"),kd=o("Tasks"),wd=d(),be=a("tbody"),xt=a("tr"),as=a("td"),Bt=a("a"),vd=o("pipeline_kandinsky.py"),Md=d(),is=a("td"),ss=a("em"),Td=o("Text-to-Image Generation"),Id=d(),Kt=a("tr"),os=a("td"),Vt=a("a"),Jd=o("pipeline_kandinsky_combined.py"),Ud=d(),rs=a("td"),ls=a("em"),jd=o("End-to-end Text-to-Image, image-to-image, Inpainting Generation"),Pd=d(),Nt=a("tr"),ps=a("td"),Ft=a("a"),Zd=o("pipeline_kandinsky_inpaint.py"),Cd=d(),ds=a("td"),cs=a("em"),Gd=o("Image-Guided Image Generation"),$d=d(),Rt=a("tr"),ms=a("td"),qt=a("a"),Ed=o("pipeline_kandinsky_img2img.py"),Wd=d(),fs=a("td"),us=a("em"),xd=o("Image-Guided Image Generation"),Zr=d(),tn=a("h3"),Zn=a("a"),hs=a("span"),g(Xt.$$.fragment),Bd=d(),gs=a("span"),Kd=o("KandinskyPriorPipeline"),Cr=d(),X=a("div"),g(zt.$$.fragment),Vd=d(),ys=a("p"),Nd=o("Pipeline for generating image prior for Kandinsky"),Fd=d(),Qt=a("p"),Rd=o("This model inherits from "),fi=a("a"),qd=o("DiffusionPipeline"),Xd=o(`. 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.)`),zd=d(),Me=a("div"),g(St.$$.fragment),Qd=d(),_s=a("p"),Sd=o("Function invoked when calling the pipeline for generation."),Ld=d(),g(Cn.$$.fragment),Dd=d(),Te=a("div"),g(Lt.$$.fragment),Yd=d(),bs=a("p"),Ad=o("Function invoked when using the prior pipeline for interpolation."),Hd=d(),g(Gn.$$.fragment),Od=d(),$n=a("div"),g(Dt.$$.fragment),ec=d(),ae=a("p"),nc=o(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),ks=a("code"),tc=o("enable_sequential_cpu_offload"),ac=o(", this method moves one whole model at a time to the GPU when its "),ws=a("code"),ic=o("forward"),sc=o(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),vs=a("code"),oc=o("enable_sequential_cpu_offload"),rc=o(", but performance is much better due to the iterative execution of the "),Ms=a("code"),lc=o("unet"),pc=o("."),Gr=d(),an=a("h3"),En=a("a"),Ts=a("span"),g(Yt.$$.fragment),dc=d(),Is=a("span"),cc=o("KandinskyPipeline"),$r=d(),L=a("div"),g(At.$$.fragment),mc=d(),Js=a("p"),fc=o("Pipeline for text-to-image generation using Kandinsky"),uc=d(),Ht=a("p"),hc=o("This model inherits from "),ui=a("a"),gc=o("DiffusionPipeline"),yc=o(`. 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=d(),Ie=a("div"),g(Ot.$$.fragment),bc=d(),Us=a("p"),kc=o("Function invoked when calling the pipeline for generation."),wc=d(),g(Wn.$$.fragment),vc=d(),xn=a("div"),g(ea.$$.fragment),Mc=d(),ie=a("p"),Tc=o(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),js=a("code"),Ic=o("enable_sequential_cpu_offload"),Jc=o(", this method moves one whole model at a time to the GPU when its "),Ps=a("code"),Uc=o("forward"),jc=o(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Zs=a("code"),Pc=o("enable_sequential_cpu_offload"),Zc=o(", but performance is much better due to the iterative execution of the "),Cs=a("code"),Cc=o("unet"),Gc=o("."),Er=d(),sn=a("h3"),Bn=a("a"),Gs=a("span"),g(na.$$.fragment),$c=d(),$s=a("span"),Ec=o("KandinskyImg2ImgPipeline"),Wr=d(),D=a("div"),g(ta.$$.fragment),Wc=d(),Es=a("p"),xc=o("Pipeline for image-to-image generation using Kandinsky"),Bc=d(),aa=a("p"),Kc=o("This model inherits from "),hi=a("a"),Vc=o("DiffusionPipeline"),Nc=o(`. 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.)`),Fc=d(),Je=a("div"),g(ia.$$.fragment),Rc=d(),Ws=a("p"),qc=o("Function invoked when calling the pipeline for generation."),Xc=d(),g(Kn.$$.fragment),zc=d(),Vn=a("div"),g(sa.$$.fragment),Qc=d(),se=a("p"),Sc=o(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),xs=a("code"),Lc=o("enable_sequential_cpu_offload"),Dc=o(", this method moves one whole model at a time to the GPU when its "),Bs=a("code"),Yc=o("forward"),Ac=o(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Ks=a("code"),Hc=o("enable_sequential_cpu_offload"),Oc=o(", but performance is much better due to the iterative execution of the "),Vs=a("code"),em=o("unet"),nm=o("."),xr=d(),on=a("h3"),Nn=a("a"),Ns=a("span"),g(oa.$$.fragment),tm=d(),Fs=a("span"),am=o("KandinskyInpaintPipeline"),Br=d(),Y=a("div"),g(ra.$$.fragment),im=d(),Rs=a("p"),sm=o("Pipeline for text-guided image inpainting using Kandinsky2.1"),om=d(),la=a("p"),rm=o("This model inherits from "),gi=a("a"),lm=o("DiffusionPipeline"),pm=o(`. 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.)`),dm=d(),Ue=a("div"),g(pa.$$.fragment),cm=d(),qs=a("p"),mm=o("Function invoked when calling the pipeline for generation."),fm=d(),g(Fn.$$.fragment),um=d(),Rn=a("div"),g(da.$$.fragment),hm=d(),oe=a("p"),gm=o(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Xs=a("code"),ym=o("enable_sequential_cpu_offload"),_m=o(", this method moves one whole model at a time to the GPU when its "),zs=a("code"),bm=o("forward"),km=o(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Qs=a("code"),wm=o("enable_sequential_cpu_offload"),vm=o(", but performance is much better due to the iterative execution of the "),Ss=a("code"),Mm=o("unet"),Tm=o("."),Kr=d(),rn=a("h3"),qn=a("a"),Ls=a("span"),g(ca.$$.fragment),Im=d(),Ds=a("span"),Jm=o("KandinskyCombinedPipeline"),Vr=d(),A=a("div"),g(ma.$$.fragment),Um=d(),Ys=a("p"),jm=o("Combined Pipeline for text-to-image generation using Kandinsky"),Pm=d(),fa=a("p"),Zm=o("This model inherits from "),yi=a("a"),Cm=o("DiffusionPipeline"),Gm=o(`. 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.)`),$m=d(),je=a("div"),g(ua.$$.fragment),Em=d(),As=a("p"),Wm=o("Function invoked when calling the pipeline for generation."),xm=d(),g(Xn.$$.fragment),Bm=d(),zn=a("div"),g(ha.$$.fragment),Km=d(),re=a("p"),Vm=o(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Hs=a("code"),Nm=o("enable_sequential_cpu_offload"),Fm=o(", this method moves one whole model at a time to the GPU when its "),Os=a("code"),Rm=o("forward"),qm=o(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),eo=a("code"),Xm=o("enable_sequential_cpu_offload"),zm=o(", but performance is much better due to the iterative execution of the "),no=a("code"),Qm=o("unet"),Sm=o("."),Nr=d(),ln=a("h3"),Qn=a("a"),to=a("span"),g(ga.$$.fragment),Lm=d(),ao=a("span"),Dm=o("KandinskyImg2ImgCombinedPipeline"),Fr=d(),H=a("div"),g(ya.$$.fragment),Ym=d(),io=a("p"),Am=o("Combined Pipeline for image-to-image generation using Kandinsky"),Hm=d(),_a=a("p"),Om=o("This model inherits from "),_i=a("a"),ef=o("DiffusionPipeline"),nf=o(`. 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.)`),tf=d(),Pe=a("div"),g(ba.$$.fragment),af=d(),so=a("p"),sf=o("Function invoked when calling the pipeline for generation."),of=d(),g(Sn.$$.fragment),rf=d(),Ln=a("div"),g(ka.$$.fragment),lf=d(),le=a("p"),pf=o(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),oo=a("code"),df=o("enable_sequential_cpu_offload"),cf=o(", this method moves one whole model at a time to the GPU when its "),ro=a("code"),mf=o("forward"),ff=o(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),lo=a("code"),uf=o("enable_sequential_cpu_offload"),hf=o(", but performance is much better due to the iterative execution of the "),po=a("code"),gf=o("unet"),yf=o("."),Rr=d(),pn=a("h3"),Dn=a("a"),co=a("span"),g(wa.$$.fragment),_f=d(),mo=a("span"),bf=o("KandinskyInpaintCombinedPipeline"),qr=d(),O=a("div"),g(va.$$.fragment),kf=d(),fo=a("p"),wf=o("Combined Pipeline for generation using Kandinsky"),vf=d(),Ma=a("p"),Mf=o("This model inherits from "),bi=a("a"),Tf=o("DiffusionPipeline"),If=o(`. 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.)`),Jf=d(),Ze=a("div"),g(Ta.$$.fragment),Uf=d(),uo=a("p"),jf=o("Function invoked when calling the pipeline for generation."),Pf=d(),g(Yn.$$.fragment),Zf=d(),An=a("div"),g(Ia.$$.fragment),Cf=d(),pe=a("p"),Gf=o(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),ho=a("code"),$f=o("enable_sequential_cpu_offload"),Ef=o(", this method moves one whole model at a time to the GPU when its "),go=a("code"),Wf=o("forward"),xf=o(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),yo=a("code"),Bf=o("enable_sequential_cpu_offload"),Kf=o(", but performance is much better due to the iterative execution of the "),_o=a("code"),Vf=o("unet"),Nf=o("."),this.h()},l(e){const l=Hg('[data-svelte="svelte-1phssyn"]',document.head);u=i(l,"META",{name:!0,content:!0}),l.forEach(t),I=c(e),M=i(e,"H1",{class:!0});var Ja=s(M);h=i(Ja,"A",{id:!0,class:!0,href:!0});var bo=s(h);T=i(bo,"SPAN",{});var ko=s(T);y(f.$$.fragment,ko),ko.forEach(t),bo.forEach(t),v=c(Ja),K=i(Ja,"SPAN",{});var wo=s(K);$=r(wo,"Kandinsky"),wo.forEach(t),Ja.forEach(t),R=c(e),J=i(e,"H2",{class:!0});var Ua=s(J);U=i(Ua,"A",{id:!0,class:!0,href:!0});var vo=s(U);z=i(vo,"SPAN",{});var Mo=s(z);y(V.$$.fragment,Mo),Mo.forEach(t),vo.forEach(t),S=c(Ua),x=i(Ua,"SPAN",{});var To=s(x);me=r(To,"Overview"),To.forEach(t),Ua.forEach(t),q=c(e),N=i(e,"P",{});var dn=s(N);fe=r(dn,"Kandinsky inherits best practices from "),B=i(dn,"A",{href:!0,rel:!0});var Io=s(B);ue=r(Io,"DALL-E 2"),Io.forEach(t),he=r(dn," and "),F=i(dn,"A",{href:!0,rel:!0});var Jo=s(F);j=r(Jo,"Latent Diffusion"),Jo.forEach(t),ge=r(dn,", while introducing some new ideas."),dn.forEach(t),P=c(e),Z=i(e,"P",{});var zr=s(Z);Qe=r(zr,"It uses "),te=i(zr,"A",{href:!0,rel:!0});var Af=s(te);Se=r(Af,"CLIP"),Af.forEach(t),Le=r(zr," for encoding images and text, and a diffusion image prior (mapping) between latent spaces of CLIP modalities. This approach enhances the visual performance of the model and unveils new horizons in blending images and text-guided image manipulation."),zr.forEach(t),ye=c(e),E=i(e,"P",{});var ee=s(E);Pa=r(ee,"The Kandinsky model is created by "),nt=i(ee,"A",{href:!0,rel:!0});var Hf=s(nt);$l=r(Hf,"Arseniy Shakhmatov"),Hf.forEach(t),El=r(ee,", "),tt=i(ee,"A",{href:!0,rel:!0});var Of=s(tt);Wl=r(Of,"Anton Razzhigaev"),Of.forEach(t),xl=r(ee,", "),at=i(ee,"A",{href:!0,rel:!0});var eu=s(at);Bl=r(eu,"Aleksandr Nikolich"),eu.forEach(t),Kl=r(ee,", "),it=i(ee,"A",{href:!0,rel:!0});var nu=s(it);Vl=r(nu,"Igor Pavlov"),nu.forEach(t),Nl=r(ee,", "),st=i(ee,"A",{href:!0,rel:!0});var tu=s(st);Fl=r(tu,"Andrey Kuznetsov"),tu.forEach(t),Rl=r(ee," and "),ot=i(ee,"A",{href:!0,rel:!0});var au=s(ot);ql=r(au,"Denis Dimitrov"),au.forEach(t),Xl=r(ee,". The original codebase can be found "),rt=i(ee,"A",{href:!0,rel:!0});var iu=s(rt);zl=r(iu,"here"),iu.forEach(t),ee.forEach(t),Uo=c(e),De=i(e,"H2",{class:!0});var Qr=s(De);mn=i(Qr,"A",{id:!0,class:!0,href:!0});var su=s(mn);Ci=i(su,"SPAN",{});var ou=s(Ci);y(lt.$$.fragment,ou),ou.forEach(t),su.forEach(t),Ql=c(Qr),Gi=i(Qr,"SPAN",{});var ru=s(Gi);Sl=r(ru,"Usage example"),ru.forEach(t),Qr.forEach(t),jo=c(e),Za=i(e,"P",{});var lu=s(Za);Ll=r(lu,"In the following, we will walk you through some examples of how to use the Kandinsky pipelines to create some visually aesthetic artwork."),lu.forEach(t),Po=c(e),Ye=i(e,"H3",{class:!0});var Sr=s(Ye);fn=i(Sr,"A",{id:!0,class:!0,href:!0});var pu=s(fn);$i=i(pu,"SPAN",{});var du=s($i);y(pt.$$.fragment,du),du.forEach(t),pu.forEach(t),Dl=c(Sr),Ei=i(Sr,"SPAN",{});var cu=s(Ei);Yl=r(cu,"Text-to-Image Generation"),cu.forEach(t),Sr.forEach(t),Zo=c(e),de=i(e,"P",{});var Hn=s(de);Al=r(Hn,"For text-to-image generation, we need to use both "),Ca=i(Hn,"A",{href:!0});var mu=s(Ca);Hl=r(mu,"KandinskyPriorPipeline"),mu.forEach(t),Ol=r(Hn," and "),Ga=i(Hn,"A",{href:!0});var fu=s(Ga);ep=r(fu,"KandinskyPipeline"),fu.forEach(t),np=r(Hn,`.
The first step is to encode text prompts with CLIP and then diffuse the CLIP text embeddings to CLIP image embeddings,
as first proposed in `),dt=i(Hn,"A",{href:!0,rel:!0});var uu=s(dt);tp=r(uu,"DALL-E 2"),uu.forEach(t),ap=r(Hn,`.
Let\u2019s throw a fun prompt at Kandinsky to see what it comes up with.`),Hn.forEach(t),Co=c(e),y(ct.$$.fragment,e),Go=c(e),$a=i(e,"P",{});var hu=s($a);ip=r(hu,`First, let\u2019s instantiate the prior pipeline and the text-to-image pipeline. Both
pipelines are diffusion models.`),hu.forEach(t),$o=c(e),y(mt.$$.fragment,e),Eo=c(e),y(un.$$.fragment,e),Wo=c(e),Ea=i(e,"P",{});var gu=s(Ea);sp=r(gu,`Now we pass the prompt through the prior to generate image embeddings. The prior
returns both the image embeddings corresponding to the prompt and negative/unconditional image
embeddings corresponding to an empty string.`),gu.forEach(t),xo=c(e),y(ft.$$.fragment,e),Bo=c(e),y(hn.$$.fragment,e),Ko=c(e),gn=i(e,"P",{});var Lr=s(gn);op=r(Lr,`Next, we can pass the embeddings as well as the prompt to the text-to-image pipeline. Remember that
in case you are using a customized negative prompt, that you should pass this one also to the text-to-image pipelines
with `),Wi=i(Lr,"CODE",{});var yu=s(Wi);rp=r(yu,"negative_prompt=negative_prompt"),yu.forEach(t),lp=r(Lr,":"),Lr.forEach(t),Vo=c(e),y(ut.$$.fragment,e),No=c(e),Wa=i(e,"P",{});var _u=s(Wa);pp=r(_u,"One cheeseburger monster coming up! Enjoy!"),_u.forEach(t),Fo=c(e),xa=i(e,"P",{});var bu=s(xa);Ba=i(bu,"IMG",{src:!0,alt:!0}),bu.forEach(t),Ro=c(e),Ka=i(e,"P",{});var ku=s(Ka);dp=r(ku,"The Kandinsky model works extremely well with creative prompts. Here is some of the amazing art that can be created using the exact same process but with different prompts."),ku.forEach(t),qo=c(e),y(ht.$$.fragment,e),Xo=c(e),Va=i(e,"P",{});var wu=s(Va);Na=i(wu,"IMG",{src:!0,alt:!0}),wu.forEach(t),zo=c(e),y(gt.$$.fragment,e),Qo=c(e),Fa=i(e,"P",{});var vu=s(Fa);Ra=i(vu,"IMG",{src:!0,alt:!0}),vu.forEach(t),So=c(e),y(yt.$$.fragment,e),Lo=c(e),qa=i(e,"P",{});var Mu=s(qa);Xa=i(Mu,"IMG",{src:!0,alt:!0}),Mu.forEach(t),Do=c(e),y(_t.$$.fragment,e),Yo=c(e),za=i(e,"P",{});var Tu=s(za);Qa=i(Tu,"IMG",{src:!0,alt:!0}),Tu.forEach(t),Ao=c(e),Ae=i(e,"H3",{class:!0});var Dr=s(Ae);yn=i(Dr,"A",{id:!0,class:!0,href:!0});var Iu=s(yn);xi=i(Iu,"SPAN",{});var Ju=s(xi);y(bt.$$.fragment,Ju),Ju.forEach(t),Iu.forEach(t),cp=c(Dr),Bi=i(Dr,"SPAN",{});var Uu=s(Bi);mp=r(Uu,"Text Guided Image-to-Image Generation"),Uu.forEach(t),Dr.forEach(t),Ho=c(e),_n=i(e,"P",{});var Yr=s(_n);fp=r(Yr,"The same Kandinsky model weights can be used for text-guided image-to-image translation. In this case, just make sure to load the weights using the "),Sa=i(Yr,"A",{href:!0});var ju=s(Sa);up=r(ju,"KandinskyImg2ImgPipeline"),ju.forEach(t),hp=r(Yr," pipeline."),Yr.forEach(t),Oo=c(e),_e=i(e,"P",{});var ja=s(_e);Ki=i(ja,"STRONG",{});var Pu=s(Ki);gp=r(Pu,"Note"),Pu.forEach(t),yp=r(ja,`: You can also directly move the weights of the text-to-image pipelines to the image-to-image pipelines
without loading them twice by making use of the `),La=i(ja,"A",{href:!0});var Zu=s(La);_p=r(Zu,"components"),Zu.forEach(t),bp=r(ja," function as explained "),Da=i(ja,"A",{href:!0});var Cu=s(Da);kp=r(Cu,"here"),Cu.forEach(t),wp=r(ja,"."),ja.forEach(t),er=c(e),Ya=i(e,"P",{});var Gu=s(Ya);vp=r(Gu,"Let\u2019s download an image."),Gu.forEach(t),nr=c(e),y(kt.$$.fragment,e),tr=c(e),Aa=i(e,"P",{});var $u=s(Aa);Ha=i($u,"IMG",{src:!0,alt:!0}),$u.forEach(t),ar=c(e),y(wt.$$.fragment,e),ir=c(e),Oa=i(e,"P",{});var Eu=s(Oa);ei=i(Eu,"IMG",{src:!0,alt:!0}),Eu.forEach(t),sr=c(e),He=i(e,"H3",{class:!0});var Ar=s(He);bn=i(Ar,"A",{id:!0,class:!0,href:!0});var Wu=s(bn);Vi=i(Wu,"SPAN",{});var xu=s(Vi);y(vt.$$.fragment,xu),xu.forEach(t),Wu.forEach(t),Mp=c(Ar),Ni=i(Ar,"SPAN",{});var Bu=s(Ni);Tp=r(Bu,"Text Guided Inpainting Generation"),Bu.forEach(t),Ar.forEach(t),or=c(e),kn=i(e,"P",{});var Hr=s(kn);Ip=r(Hr,"You can use "),ni=i(Hr,"A",{href:!0});var Ku=s(ni);Jp=r(Ku,"KandinskyInpaintPipeline"),Ku.forEach(t),Up=r(Hr," to edit images. In this example, we will add a hat to the portrait of a cat."),Hr.forEach(t),rr=c(e),y(Mt.$$.fragment,e),lr=c(e),ti=i(e,"P",{});var Vu=s(ti);ai=i(Vu,"IMG",{src:!0,alt:!0}),Vu.forEach(t),pr=c(e),Oe=i(e,"H3",{class:!0});var Or=s(Oe);wn=i(Or,"A",{id:!0,class:!0,href:!0});var Nu=s(wn);Fi=i(Nu,"SPAN",{});var Fu=s(Fi);y(Tt.$$.fragment,Fu),Fu.forEach(t),Nu.forEach(t),jp=c(Or),Ri=i(Or,"SPAN",{});var Ru=s(Ri);Pp=r(Ru,"Interpolate"),Ru.forEach(t),Or.forEach(t),dr=c(e),vn=i(e,"P",{});var el=s(vn);Zp=r(el,"The "),ii=i(el,"A",{href:!0});var qu=s(ii);Cp=r(qu,"KandinskyPriorPipeline"),qu.forEach(t),Gp=r(el," also comes with a cool utility function that will allow you to interpolate the latent space of different images and texts super easily. Here is an example of how you can create an Impressionist-style portrait for your pet based on \u201CThe Starry Night\u201D."),el.forEach(t),cr=c(e),ke=i(e,"P",{});var ki=s(ke);$p=r(ki,"Note that you can interpolate between texts and images - in the below example, we passed a text prompt \u201Ca cat\u201D and two images to the "),qi=i(ki,"CODE",{});var Xu=s(qi);Ep=r(Xu,"interplate"),Xu.forEach(t),Wp=r(ki," function, along with a "),Xi=i(ki,"CODE",{});var zu=s(Xi);xp=r(zu,"weights"),zu.forEach(t),Bp=r(ki," variable containing the corresponding weights for each condition we interplate."),ki.forEach(t),mr=c(e),y(It.$$.fragment,e),fr=c(e),si=i(e,"P",{});var Qu=s(si);oi=i(Qu,"IMG",{src:!0,alt:!0}),Qu.forEach(t),ur=c(e),en=i(e,"H2",{class:!0});var nl=s(en);Mn=i(nl,"A",{id:!0,class:!0,href:!0});var Su=s(Mn);zi=i(Su,"SPAN",{});var Lu=s(zi);y(Jt.$$.fragment,Lu),Lu.forEach(t),Su.forEach(t),Kp=c(nl),Qi=i(nl,"SPAN",{});var Du=s(Qi);Vp=r(Du,"Optimization"),Du.forEach(t),nl.forEach(t),hr=c(e),ne=i(e,"P",{});var Ce=s(ne);Np=r(Ce,"Running Kandinsky in inference requires running both a first prior pipeline: "),ri=i(Ce,"A",{href:!0});var Yu=s(ri);Fp=r(Yu,"KandinskyPriorPipeline"),Yu.forEach(t),Rp=r(Ce,`
and a second image decoding pipeline which is one of `),li=i(Ce,"A",{href:!0});var Au=s(li);qp=r(Au,"KandinskyPipeline"),Au.forEach(t),Xp=r(Ce,", "),pi=i(Ce,"A",{href:!0});var Hu=s(pi);zp=r(Hu,"KandinskyImg2ImgPipeline"),Hu.forEach(t),Qp=r(Ce,", or "),di=i(Ce,"A",{href:!0});var Ou=s(di);Sp=r(Ou,"KandinskyInpaintPipeline"),Ou.forEach(t),Lp=r(Ce,"."),Ce.forEach(t),gr=c(e),ci=i(e,"P",{});var eh=s(ci);Dp=r(eh,`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.`),eh.forEach(t),yr=c(e),Tn=i(e,"P",{});var tl=s(Tn);Yp=r(tl,"When running with PyTorch < 2.0, we strongly recommend making use of "),Ut=i(tl,"A",{href:!0,rel:!0});var nh=s(Ut);Si=i(nh,"CODE",{});var th=s(Si);Ap=r(th,"xformers"),th.forEach(t),nh.forEach(t),Hp=r(tl,`
to speed-up the optimization. This can be done by simply running:`),tl.forEach(t),_r=c(e),y(jt.$$.fragment,e),br=c(e),In=i(e,"P",{});var al=s(In);Op=r(al,`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 `),Pt=i(al,"A",{href:!0,rel:!0});var ah=s(Pt);ed=r(ah,"this blog post"),ah.forEach(t),nd=r(al,"."),al.forEach(t),kr=c(e),mi=i(e,"P",{});var ih=s(mi);td=r(ih,"To have explicit control , you can also manually set the pipeline to use PyTorch\u2019s 2.0 efficient attention:"),ih.forEach(t),wr=c(e),y(Zt.$$.fragment,e),vr=c(e),we=i(e,"P",{});var wi=s(we);ad=r(wi,"The slowest and most memory intense attention processor is the default "),Li=i(wi,"CODE",{});var sh=s(Li);id=r(sh,"AttnAddedKVProcessor"),sh.forEach(t),sd=r(wi,` processor.
We do `),Di=i(wi,"STRONG",{});var oh=s(Di);od=r(oh,"not"),oh.forEach(t),rd=r(wi,` recommend using it except for testing purposes or cases where very high determistic behaviour is desired.
You can set it with:`),wi.forEach(t),Mr=c(e),y(Ct.$$.fragment,e),Tr=c(e),ve=i(e,"P",{});var vi=s(ve);ld=r(vi,"With PyTorch >= 2.0, you can also use Kandinsky with "),Yi=i(vi,"CODE",{});var rh=s(Yi);pd=r(rh,"torch.compile"),rh.forEach(t),dd=r(vi,` which depending
on your hardware can signficantly speed-up your inference time once the model is compiled.
To use Kandinsksy with `),Ai=i(vi,"CODE",{});var lh=s(Ai);cd=r(lh,"torch.compile"),lh.forEach(t),md=r(vi,", you can do:"),vi.forEach(t),Ir=c(e),y(Gt.$$.fragment,e),Jr=c(e),Jn=i(e,"P",{});var il=s(Jn);fd=r(il,`After compilation you should see a very fast inference time. For more information,
feel free to have a look at `),$t=i(il,"A",{href:!0,rel:!0});var ph=s($t);ud=r(ph,"Our PyTorch 2.0 benchmark"),ph.forEach(t),hd=r(il,"."),il.forEach(t),Ur=c(e),y(Un.$$.fragment,e),jr=c(e),nn=i(e,"H2",{class:!0});var sl=s(nn);jn=i(sl,"A",{id:!0,class:!0,href:!0});var dh=s(jn);Hi=i(dh,"SPAN",{});var ch=s(Hi);y(Et.$$.fragment,ch),ch.forEach(t),dh.forEach(t),gd=c(sl),Oi=i(sl,"SPAN",{});var mh=s(Oi);yd=r(mh,"Available Pipelines:"),mh.forEach(t),sl.forEach(t),Pr=c(e),Pn=i(e,"TABLE",{});var ol=s(Pn);es=i(ol,"THEAD",{});var fh=s(es);Wt=i(fh,"TR",{});var rl=s(Wt);ns=i(rl,"TH",{});var uh=s(ns);_d=r(uh,"Pipeline"),uh.forEach(t),bd=c(rl),ts=i(rl,"TH",{});var hh=s(ts);kd=r(hh,"Tasks"),hh.forEach(t),rl.forEach(t),fh.forEach(t),wd=c(ol),be=i(ol,"TBODY",{});var On=s(be);xt=i(On,"TR",{});var ll=s(xt);as=i(ll,"TD",{});var gh=s(as);Bt=i(gh,"A",{href:!0,rel:!0});var yh=s(Bt);vd=r(yh,"pipeline_kandinsky.py"),yh.forEach(t),gh.forEach(t),Md=c(ll),is=i(ll,"TD",{});var _h=s(is);ss=i(_h,"EM",{});var bh=s(ss);Td=r(bh,"Text-to-Image Generation"),bh.forEach(t),_h.forEach(t),ll.forEach(t),Id=c(On),Kt=i(On,"TR",{});var pl=s(Kt);os=i(pl,"TD",{});var kh=s(os);Vt=i(kh,"A",{href:!0,rel:!0});var wh=s(Vt);Jd=r(wh,"pipeline_kandinsky_combined.py"),wh.forEach(t),kh.forEach(t),Ud=c(pl),rs=i(pl,"TD",{});var vh=s(rs);ls=i(vh,"EM",{});var Mh=s(ls);jd=r(Mh,"End-to-end Text-to-Image, image-to-image, Inpainting Generation"),Mh.forEach(t),vh.forEach(t),pl.forEach(t),Pd=c(On),Nt=i(On,"TR",{});var dl=s(Nt);ps=i(dl,"TD",{});var Th=s(ps);Ft=i(Th,"A",{href:!0,rel:!0});var Ih=s(Ft);Zd=r(Ih,"pipeline_kandinsky_inpaint.py"),Ih.forEach(t),Th.forEach(t),Cd=c(dl),ds=i(dl,"TD",{});var Jh=s(ds);cs=i(Jh,"EM",{});var Uh=s(cs);Gd=r(Uh,"Image-Guided Image Generation"),Uh.forEach(t),Jh.forEach(t),dl.forEach(t),$d=c(On),Rt=i(On,"TR",{});var cl=s(Rt);ms=i(cl,"TD",{});var jh=s(ms);qt=i(jh,"A",{href:!0,rel:!0});var Ph=s(qt);Ed=r(Ph,"pipeline_kandinsky_img2img.py"),Ph.forEach(t),jh.forEach(t),Wd=c(cl),fs=i(cl,"TD",{});var Zh=s(fs);us=i(Zh,"EM",{});var Ch=s(us);xd=r(Ch,"Image-Guided Image Generation"),Ch.forEach(t),Zh.forEach(t),cl.forEach(t),On.forEach(t),ol.forEach(t),Zr=c(e),tn=i(e,"H3",{class:!0});var ml=s(tn);Zn=i(ml,"A",{id:!0,class:!0,href:!0});var Gh=s(Zn);hs=i(Gh,"SPAN",{});var $h=s(hs);y(Xt.$$.fragment,$h),$h.forEach(t),Gh.forEach(t),Bd=c(ml),gs=i(ml,"SPAN",{});var Eh=s(gs);Kd=r(Eh,"KandinskyPriorPipeline"),Eh.forEach(t),ml.forEach(t),Cr=c(e),X=i(e,"DIV",{class:!0});var ce=s(X);y(zt.$$.fragment,ce),Vd=c(ce),ys=i(ce,"P",{});var Wh=s(ys);Nd=r(Wh,"Pipeline for generating image prior for Kandinsky"),Wh.forEach(t),Fd=c(ce),Qt=i(ce,"P",{});var fl=s(Qt);Rd=r(fl,"This model inherits from "),fi=i(fl,"A",{href:!0});var xh=s(fi);qd=r(xh,"DiffusionPipeline"),xh.forEach(t),Xd=r(fl,`. 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.)`),fl.forEach(t),zd=c(ce),Me=i(ce,"DIV",{class:!0});var Mi=s(Me);y(St.$$.fragment,Mi),Qd=c(Mi),_s=i(Mi,"P",{});var Bh=s(_s);Sd=r(Bh,"Function invoked when calling the pipeline for generation."),Bh.forEach(t),Ld=c(Mi),y(Cn.$$.fragment,Mi),Mi.forEach(t),Dd=c(ce),Te=i(ce,"DIV",{class:!0});var Ti=s(Te);y(Lt.$$.fragment,Ti),Yd=c(Ti),bs=i(Ti,"P",{});var Kh=s(bs);Ad=r(Kh,"Function invoked when using the prior pipeline for interpolation."),Kh.forEach(t),Hd=c(Ti),y(Gn.$$.fragment,Ti),Ti.forEach(t),Od=c(ce),$n=i(ce,"DIV",{class:!0});var ul=s($n);y(Dt.$$.fragment,ul),ec=c(ul),ae=i(ul,"P",{});var Ge=s(ae);nc=r(Ge,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),ks=i(Ge,"CODE",{});var Vh=s(ks);tc=r(Vh,"enable_sequential_cpu_offload"),Vh.forEach(t),ac=r(Ge,", this method moves one whole model at a time to the GPU when its "),ws=i(Ge,"CODE",{});var Nh=s(ws);ic=r(Nh,"forward"),Nh.forEach(t),sc=r(Ge,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),vs=i(Ge,"CODE",{});var Fh=s(vs);oc=r(Fh,"enable_sequential_cpu_offload"),Fh.forEach(t),rc=r(Ge,", but performance is much better due to the iterative execution of the "),Ms=i(Ge,"CODE",{});var Rh=s(Ms);lc=r(Rh,"unet"),Rh.forEach(t),pc=r(Ge,"."),Ge.forEach(t),ul.forEach(t),ce.forEach(t),Gr=c(e),an=i(e,"H3",{class:!0});var hl=s(an);En=i(hl,"A",{id:!0,class:!0,href:!0});var qh=s(En);Ts=i(qh,"SPAN",{});var Xh=s(Ts);y(Yt.$$.fragment,Xh),Xh.forEach(t),qh.forEach(t),dc=c(hl),Is=i(hl,"SPAN",{});var zh=s(Is);cc=r(zh,"KandinskyPipeline"),zh.forEach(t),hl.forEach(t),$r=c(e),L=i(e,"DIV",{class:!0});var $e=s(L);y(At.$$.fragment,$e),mc=c($e),Js=i($e,"P",{});var Qh=s(Js);fc=r(Qh,"Pipeline for text-to-image generation using Kandinsky"),Qh.forEach(t),uc=c($e),Ht=i($e,"P",{});var gl=s(Ht);hc=r(gl,"This model inherits from "),ui=i(gl,"A",{href:!0});var Sh=s(ui);gc=r(Sh,"DiffusionPipeline"),Sh.forEach(t),yc=r(gl,`. 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.)`),gl.forEach(t),_c=c($e),Ie=i($e,"DIV",{class:!0});var Ii=s(Ie);y(Ot.$$.fragment,Ii),bc=c(Ii),Us=i(Ii,"P",{});var Lh=s(Us);kc=r(Lh,"Function invoked when calling the pipeline for generation."),Lh.forEach(t),wc=c(Ii),y(Wn.$$.fragment,Ii),Ii.forEach(t),vc=c($e),xn=i($e,"DIV",{class:!0});var yl=s(xn);y(ea.$$.fragment,yl),Mc=c(yl),ie=i(yl,"P",{});var Ee=s(ie);Tc=r(Ee,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),js=i(Ee,"CODE",{});var Dh=s(js);Ic=r(Dh,"enable_sequential_cpu_offload"),Dh.forEach(t),Jc=r(Ee,", this method moves one whole model at a time to the GPU when its "),Ps=i(Ee,"CODE",{});var Yh=s(Ps);Uc=r(Yh,"forward"),Yh.forEach(t),jc=r(Ee,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Zs=i(Ee,"CODE",{});var Ah=s(Zs);Pc=r(Ah,"enable_sequential_cpu_offload"),Ah.forEach(t),Zc=r(Ee,", but performance is much better due to the iterative execution of the "),Cs=i(Ee,"CODE",{});var Hh=s(Cs);Cc=r(Hh,"unet"),Hh.forEach(t),Gc=r(Ee,"."),Ee.forEach(t),yl.forEach(t),$e.forEach(t),Er=c(e),sn=i(e,"H3",{class:!0});var _l=s(sn);Bn=i(_l,"A",{id:!0,class:!0,href:!0});var Oh=s(Bn);Gs=i(Oh,"SPAN",{});var eg=s(Gs);y(na.$$.fragment,eg),eg.forEach(t),Oh.forEach(t),$c=c(_l),$s=i(_l,"SPAN",{});var ng=s($s);Ec=r(ng,"KandinskyImg2ImgPipeline"),ng.forEach(t),_l.forEach(t),Wr=c(e),D=i(e,"DIV",{class:!0});var We=s(D);y(ta.$$.fragment,We),Wc=c(We),Es=i(We,"P",{});var tg=s(Es);xc=r(tg,"Pipeline for image-to-image generation using Kandinsky"),tg.forEach(t),Bc=c(We),aa=i(We,"P",{});var bl=s(aa);Kc=r(bl,"This model inherits from "),hi=i(bl,"A",{href:!0});var ag=s(hi);Vc=r(ag,"DiffusionPipeline"),ag.forEach(t),Nc=r(bl,`. 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.)`),bl.forEach(t),Fc=c(We),Je=i(We,"DIV",{class:!0});var Ji=s(Je);y(ia.$$.fragment,Ji),Rc=c(Ji),Ws=i(Ji,"P",{});var ig=s(Ws);qc=r(ig,"Function invoked when calling the pipeline for generation."),ig.forEach(t),Xc=c(Ji),y(Kn.$$.fragment,Ji),Ji.forEach(t),zc=c(We),Vn=i(We,"DIV",{class:!0});var kl=s(Vn);y(sa.$$.fragment,kl),Qc=c(kl),se=i(kl,"P",{});var xe=s(se);Sc=r(xe,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),xs=i(xe,"CODE",{});var sg=s(xs);Lc=r(sg,"enable_sequential_cpu_offload"),sg.forEach(t),Dc=r(xe,", this method moves one whole model at a time to the GPU when its "),Bs=i(xe,"CODE",{});var og=s(Bs);Yc=r(og,"forward"),og.forEach(t),Ac=r(xe,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Ks=i(xe,"CODE",{});var rg=s(Ks);Hc=r(rg,"enable_sequential_cpu_offload"),rg.forEach(t),Oc=r(xe,", but performance is much better due to the iterative execution of the "),Vs=i(xe,"CODE",{});var lg=s(Vs);em=r(lg,"unet"),lg.forEach(t),nm=r(xe,"."),xe.forEach(t),kl.forEach(t),We.forEach(t),xr=c(e),on=i(e,"H3",{class:!0});var wl=s(on);Nn=i(wl,"A",{id:!0,class:!0,href:!0});var pg=s(Nn);Ns=i(pg,"SPAN",{});var dg=s(Ns);y(oa.$$.fragment,dg),dg.forEach(t),pg.forEach(t),tm=c(wl),Fs=i(wl,"SPAN",{});var cg=s(Fs);am=r(cg,"KandinskyInpaintPipeline"),cg.forEach(t),wl.forEach(t),Br=c(e),Y=i(e,"DIV",{class:!0});var Be=s(Y);y(ra.$$.fragment,Be),im=c(Be),Rs=i(Be,"P",{});var mg=s(Rs);sm=r(mg,"Pipeline for text-guided image inpainting using Kandinsky2.1"),mg.forEach(t),om=c(Be),la=i(Be,"P",{});var vl=s(la);rm=r(vl,"This model inherits from "),gi=i(vl,"A",{href:!0});var fg=s(gi);lm=r(fg,"DiffusionPipeline"),fg.forEach(t),pm=r(vl,`. 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.)`),vl.forEach(t),dm=c(Be),Ue=i(Be,"DIV",{class:!0});var Ui=s(Ue);y(pa.$$.fragment,Ui),cm=c(Ui),qs=i(Ui,"P",{});var ug=s(qs);mm=r(ug,"Function invoked when calling the pipeline for generation."),ug.forEach(t),fm=c(Ui),y(Fn.$$.fragment,Ui),Ui.forEach(t),um=c(Be),Rn=i(Be,"DIV",{class:!0});var Ml=s(Rn);y(da.$$.fragment,Ml),hm=c(Ml),oe=i(Ml,"P",{});var Ke=s(oe);gm=r(Ke,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Xs=i(Ke,"CODE",{});var hg=s(Xs);ym=r(hg,"enable_sequential_cpu_offload"),hg.forEach(t),_m=r(Ke,", this method moves one whole model at a time to the GPU when its "),zs=i(Ke,"CODE",{});var gg=s(zs);bm=r(gg,"forward"),gg.forEach(t),km=r(Ke,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Qs=i(Ke,"CODE",{});var yg=s(Qs);wm=r(yg,"enable_sequential_cpu_offload"),yg.forEach(t),vm=r(Ke,", but performance is much better due to the iterative execution of the "),Ss=i(Ke,"CODE",{});var _g=s(Ss);Mm=r(_g,"unet"),_g.forEach(t),Tm=r(Ke,"."),Ke.forEach(t),Ml.forEach(t),Be.forEach(t),Kr=c(e),rn=i(e,"H3",{class:!0});var Tl=s(rn);qn=i(Tl,"A",{id:!0,class:!0,href:!0});var bg=s(qn);Ls=i(bg,"SPAN",{});var kg=s(Ls);y(ca.$$.fragment,kg),kg.forEach(t),bg.forEach(t),Im=c(Tl),Ds=i(Tl,"SPAN",{});var wg=s(Ds);Jm=r(wg,"KandinskyCombinedPipeline"),wg.forEach(t),Tl.forEach(t),Vr=c(e),A=i(e,"DIV",{class:!0});var Ve=s(A);y(ma.$$.fragment,Ve),Um=c(Ve),Ys=i(Ve,"P",{});var vg=s(Ys);jm=r(vg,"Combined Pipeline for text-to-image generation using Kandinsky"),vg.forEach(t),Pm=c(Ve),fa=i(Ve,"P",{});var Il=s(fa);Zm=r(Il,"This model inherits from "),yi=i(Il,"A",{href:!0});var Mg=s(yi);Cm=r(Mg,"DiffusionPipeline"),Mg.forEach(t),Gm=r(Il,`. 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.)`),Il.forEach(t),$m=c(Ve),je=i(Ve,"DIV",{class:!0});var ji=s(je);y(ua.$$.fragment,ji),Em=c(ji),As=i(ji,"P",{});var Tg=s(As);Wm=r(Tg,"Function invoked when calling the pipeline for generation."),Tg.forEach(t),xm=c(ji),y(Xn.$$.fragment,ji),ji.forEach(t),Bm=c(Ve),zn=i(Ve,"DIV",{class:!0});var Jl=s(zn);y(ha.$$.fragment,Jl),Km=c(Jl),re=i(Jl,"P",{});var Ne=s(re);Vm=r(Ne,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Hs=i(Ne,"CODE",{});var Ig=s(Hs);Nm=r(Ig,"enable_sequential_cpu_offload"),Ig.forEach(t),Fm=r(Ne,", this method moves one whole model at a time to the GPU when its "),Os=i(Ne,"CODE",{});var Jg=s(Os);Rm=r(Jg,"forward"),Jg.forEach(t),qm=r(Ne,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),eo=i(Ne,"CODE",{});var Ug=s(eo);Xm=r(Ug,"enable_sequential_cpu_offload"),Ug.forEach(t),zm=r(Ne,", but performance is much better due to the iterative execution of the "),no=i(Ne,"CODE",{});var jg=s(no);Qm=r(jg,"unet"),jg.forEach(t),Sm=r(Ne,"."),Ne.forEach(t),Jl.forEach(t),Ve.forEach(t),Nr=c(e),ln=i(e,"H3",{class:!0});var Ul=s(ln);Qn=i(Ul,"A",{id:!0,class:!0,href:!0});var Pg=s(Qn);to=i(Pg,"SPAN",{});var Zg=s(to);y(ga.$$.fragment,Zg),Zg.forEach(t),Pg.forEach(t),Lm=c(Ul),ao=i(Ul,"SPAN",{});var Cg=s(ao);Dm=r(Cg,"KandinskyImg2ImgCombinedPipeline"),Cg.forEach(t),Ul.forEach(t),Fr=c(e),H=i(e,"DIV",{class:!0});var Fe=s(H);y(ya.$$.fragment,Fe),Ym=c(Fe),io=i(Fe,"P",{});var Gg=s(io);Am=r(Gg,"Combined Pipeline for image-to-image generation using Kandinsky"),Gg.forEach(t),Hm=c(Fe),_a=i(Fe,"P",{});var jl=s(_a);Om=r(jl,"This model inherits from "),_i=i(jl,"A",{href:!0});var $g=s(_i);ef=r($g,"DiffusionPipeline"),$g.forEach(t),nf=r(jl,`. 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.)`),jl.forEach(t),tf=c(Fe),Pe=i(Fe,"DIV",{class:!0});var Pi=s(Pe);y(ba.$$.fragment,Pi),af=c(Pi),so=i(Pi,"P",{});var Eg=s(so);sf=r(Eg,"Function invoked when calling the pipeline for generation."),Eg.forEach(t),of=c(Pi),y(Sn.$$.fragment,Pi),Pi.forEach(t),rf=c(Fe),Ln=i(Fe,"DIV",{class:!0});var Pl=s(Ln);y(ka.$$.fragment,Pl),lf=c(Pl),le=i(Pl,"P",{});var Re=s(le);pf=r(Re,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),oo=i(Re,"CODE",{});var Wg=s(oo);df=r(Wg,"enable_sequential_cpu_offload"),Wg.forEach(t),cf=r(Re,", this method moves one whole model at a time to the GPU when its "),ro=i(Re,"CODE",{});var xg=s(ro);mf=r(xg,"forward"),xg.forEach(t),ff=r(Re,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),lo=i(Re,"CODE",{});var Bg=s(lo);uf=r(Bg,"enable_sequential_cpu_offload"),Bg.forEach(t),hf=r(Re,", but performance is much better due to the iterative execution of the "),po=i(Re,"CODE",{});var Kg=s(po);gf=r(Kg,"unet"),Kg.forEach(t),yf=r(Re,"."),Re.forEach(t),Pl.forEach(t),Fe.forEach(t),Rr=c(e),pn=i(e,"H3",{class:!0});var Zl=s(pn);Dn=i(Zl,"A",{id:!0,class:!0,href:!0});var Vg=s(Dn);co=i(Vg,"SPAN",{});var Ng=s(co);y(wa.$$.fragment,Ng),Ng.forEach(t),Vg.forEach(t),_f=c(Zl),mo=i(Zl,"SPAN",{});var Fg=s(mo);bf=r(Fg,"KandinskyInpaintCombinedPipeline"),Fg.forEach(t),Zl.forEach(t),qr=c(e),O=i(e,"DIV",{class:!0});var qe=s(O);y(va.$$.fragment,qe),kf=c(qe),fo=i(qe,"P",{});var Rg=s(fo);wf=r(Rg,"Combined Pipeline for generation using Kandinsky"),Rg.forEach(t),vf=c(qe),Ma=i(qe,"P",{});var Cl=s(Ma);Mf=r(Cl,"This model inherits from "),bi=i(Cl,"A",{href:!0});var qg=s(bi);Tf=r(qg,"DiffusionPipeline"),qg.forEach(t),If=r(Cl,`. 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.)`),Cl.forEach(t),Jf=c(qe),Ze=i(qe,"DIV",{class:!0});var Zi=s(Ze);y(Ta.$$.fragment,Zi),Uf=c(Zi),uo=i(Zi,"P",{});var Xg=s(uo);jf=r(Xg,"Function invoked when calling the pipeline for generation."),Xg.forEach(t),Pf=c(Zi),y(Yn.$$.fragment,Zi),Zi.forEach(t),Zf=c(qe),An=i(qe,"DIV",{class:!0});var Gl=s(An);y(Ia.$$.fragment,Gl),Cf=c(Gl),pe=i(Gl,"P",{});var Xe=s(pe);Gf=r(Xe,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),ho=i(Xe,"CODE",{});var zg=s(ho);$f=r(zg,"enable_sequential_cpu_offload"),zg.forEach(t),Ef=r(Xe,", this method moves one whole model at a time to the GPU when its "),go=i(Xe,"CODE",{});var Qg=s(go);Wf=r(Qg,"forward"),Qg.forEach(t),xf=r(Xe,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),yo=i(Xe,"CODE",{});var Sg=s(yo);Bf=r(Sg,"enable_sequential_cpu_offload"),Sg.forEach(t),Kf=r(Xe,", but performance is much better due to the iterative execution of the "),_o=i(Xe,"CODE",{});var Lg=s(_o);Vf=r(Lg,"unet"),Lg.forEach(t),Nf=r(Xe,"."),Xe.forEach(t),Gl.forEach(t),qe.forEach(t),this.h()},h(){p(u,"name","hf:doc:metadata"),p(u,"content",JSON.stringify(my)),p(h,"id","kandinsky"),p(h,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(h,"href","#kandinsky"),p(M,"class","relative group"),p(U,"id","overview"),p(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"),p(U,"href","#overview"),p(J,"class","relative group"),p(B,"href","https://huggingface.co/papers/2204.06125"),p(B,"rel","nofollow"),p(F,"href","https://huggingface.co/docs/diffusers/api/pipelines/latent_diffusion"),p(F,"rel","nofollow"),p(te,"href","https://huggingface.co/docs/transformers/model_doc/clip"),p(te,"rel","nofollow"),p(nt,"href","https://github.com/cene555"),p(nt,"rel","nofollow"),p(tt,"href","https://github.com/razzant"),p(tt,"rel","nofollow"),p(at,"href","https://github.com/AlexWortega"),p(at,"rel","nofollow"),p(it,"href","https://github.com/boomb0om"),p(it,"rel","nofollow"),p(st,"href","https://github.com/kuznetsoffandrey"),p(st,"rel","nofollow"),p(ot,"href","https://github.com/denndimitrov"),p(ot,"rel","nofollow"),p(rt,"href","https://github.com/ai-forever/Kandinsky-2"),p(rt,"rel","nofollow"),p(mn,"id","usage-example"),p(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"),p(mn,"href","#usage-example"),p(De,"class","relative group"),p(fn,"id","texttoimage-generation"),p(fn,"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"),p(fn,"href","#texttoimage-generation"),p(Ye,"class","relative group"),p(Ca,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyPriorPipeline"),p(Ga,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyPipeline"),p(dt,"href","https://cdn.openai.com/papers/dall-e-2.pdf"),p(dt,"rel","nofollow"),cn(Ba.src,Rf="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/kandinsky-docs/cheeseburger.png")||p(Ba,"src",Rf),p(Ba,"alt","img"),cn(Na.src,qf="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/kandinsky-docs/hair.png")||p(Na,"src",qf),p(Na,"alt","img"),cn(Ra.src,Xf="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/kandinsky-docs/dusts.png")||p(Ra,"src",Xf),p(Ra,"alt","img"),cn(Xa.src,zf="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/kandinsky-docs/smokechair.png")||p(Xa,"src",zf),p(Xa,"alt","img"),cn(Qa.src,Qf="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/kandinsky-docs/alienplanet.png")||p(Qa,"src",Qf),p(Qa,"alt","img"),p(yn,"id","text-guided-imagetoimage-generation"),p(yn,"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"),p(yn,"href","#text-guided-imagetoimage-generation"),p(Ae,"class","relative group"),p(Sa,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyImg2ImgPipeline"),p(La,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline.components"),p(Da,"href","#converting-between-different-pipelines"),cn(Ha.src,Sf="https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg")||p(Ha,"src",Sf),p(Ha,"alt","img"),cn(ei.src,Lf="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/kandinsky-docs/img2img_fantasyland.png")||p(ei,"src",Lf),p(ei,"alt","img"),p(bn,"id","text-guided-inpainting-generation"),p(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"),p(bn,"href","#text-guided-inpainting-generation"),p(He,"class","relative group"),p(ni,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyInpaintPipeline"),cn(ai.src,Df="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/kandinsky-docs/inpaint_cat_hat.png")||p(ai,"src",Df),p(ai,"alt","img"),p(wn,"id","interpolate"),p(wn,"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"),p(wn,"href","#interpolate"),p(Oe,"class","relative group"),p(ii,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyPriorPipeline"),cn(oi.src,Yf="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/kandinsky-docs/starry_cat.png")||p(oi,"src",Yf),p(oi,"alt","img"),p(Mn,"id","optimization"),p(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"),p(Mn,"href","#optimization"),p(en,"class","relative group"),p(ri,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyPriorPipeline"),p(li,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyPipeline"),p(pi,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyImg2ImgPipeline"),p(di,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyInpaintPipeline"),p(Ut,"href","https://github.com/facebookresearch/xformers"),p(Ut,"rel","nofollow"),p(Pt,"href","https://pytorch.org/blog/accelerated-diffusers-pt-20/"),p(Pt,"rel","nofollow"),p($t,"href","https://huggingface.co/docs/diffusers/main/en/optimization/torch2.0"),p($t,"rel","nofollow"),p(jn,"id","available-pipelines"),p(jn,"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"),p(jn,"href","#available-pipelines"),p(nn,"class","relative group"),p(Bt,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky/pipeline_kandinsky.py"),p(Bt,"rel","nofollow"),p(Vt,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky_combined.py"),p(Vt,"rel","nofollow"),p(Ft,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_inpaint.py"),p(Ft,"rel","nofollow"),p(qt,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky/pipeline_kandinsky_img2img.py"),p(qt,"rel","nofollow"),p(Zn,"id","diffusers.KandinskyPriorPipeline"),p(Zn,"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"),p(Zn,"href","#diffusers.KandinskyPriorPipeline"),p(tn,"class","relative group"),p(fi,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p($n,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(En,"id","diffusers.KandinskyPipeline"),p(En,"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"),p(En,"href","#diffusers.KandinskyPipeline"),p(an,"class","relative group"),p(ui,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(xn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Bn,"id","diffusers.KandinskyImg2ImgPipeline"),p(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"),p(Bn,"href","#diffusers.KandinskyImg2ImgPipeline"),p(sn,"class","relative group"),p(hi,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Vn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Nn,"id","diffusers.KandinskyInpaintPipeline"),p(Nn,"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"),p(Nn,"href","#diffusers.KandinskyInpaintPipeline"),p(on,"class","relative group"),p(gi,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Rn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(qn,"id","diffusers.KandinskyCombinedPipeline"),p(qn,"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"),p(qn,"href","#diffusers.KandinskyCombinedPipeline"),p(rn,"class","relative group"),p(yi,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(zn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Qn,"id","diffusers.KandinskyImg2ImgCombinedPipeline"),p(Qn,"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"),p(Qn,"href","#diffusers.KandinskyImg2ImgCombinedPipeline"),p(ln,"class","relative group"),p(_i,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ln,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Dn,"id","diffusers.KandinskyInpaintCombinedPipeline"),p(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"),p(Dn,"href","#diffusers.KandinskyInpaintCombinedPipeline"),p(pn,"class","relative group"),p(bi,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),p(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(An,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(O,"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,l){n(document.head,u),m(e,I,l),m(e,M,l),n(M,h),n(h,T),_(f,T,null),n(M,v),n(M,K),n(K,$),m(e,R,l),m(e,J,l),n(J,U),n(U,z),_(V,z,null),n(J,S),n(J,x),n(x,me),m(e,q,l),m(e,N,l),n(N,fe),n(N,B),n(B,ue),n(N,he),n(N,F),n(F,j),n(N,ge),m(e,P,l),m(e,Z,l),n(Z,Qe),n(Z,te),n(te,Se),n(Z,Le),m(e,ye,l),m(e,E,l),n(E,Pa),n(E,nt),n(nt,$l),n(E,El),n(E,tt),n(tt,Wl),n(E,xl),n(E,at),n(at,Bl),n(E,Kl),n(E,it),n(it,Vl),n(E,Nl),n(E,st),n(st,Fl),n(E,Rl),n(E,ot),n(ot,ql),n(E,Xl),n(E,rt),n(rt,zl),m(e,Uo,l),m(e,De,l),n(De,mn),n(mn,Ci),_(lt,Ci,null),n(De,Ql),n(De,Gi),n(Gi,Sl),m(e,jo,l),m(e,Za,l),n(Za,Ll),m(e,Po,l),m(e,Ye,l),n(Ye,fn),n(fn,$i),_(pt,$i,null),n(Ye,Dl),n(Ye,Ei),n(Ei,Yl),m(e,Zo,l),m(e,de,l),n(de,Al),n(de,Ca),n(Ca,Hl),n(de,Ol),n(de,Ga),n(Ga,ep),n(de,np),n(de,dt),n(dt,tp),n(de,ap),m(e,Co,l),_(ct,e,l),m(e,Go,l),m(e,$a,l),n($a,ip),m(e,$o,l),_(mt,e,l),m(e,Eo,l),_(un,e,l),m(e,Wo,l),m(e,Ea,l),n(Ea,sp),m(e,xo,l),_(ft,e,l),m(e,Bo,l),_(hn,e,l),m(e,Ko,l),m(e,gn,l),n(gn,op),n(gn,Wi),n(Wi,rp),n(gn,lp),m(e,Vo,l),_(ut,e,l),m(e,No,l),m(e,Wa,l),n(Wa,pp),m(e,Fo,l),m(e,xa,l),n(xa,Ba),m(e,Ro,l),m(e,Ka,l),n(Ka,dp),m(e,qo,l),_(ht,e,l),m(e,Xo,l),m(e,Va,l),n(Va,Na),m(e,zo,l),_(gt,e,l),m(e,Qo,l),m(e,Fa,l),n(Fa,Ra),m(e,So,l),_(yt,e,l),m(e,Lo,l),m(e,qa,l),n(qa,Xa),m(e,Do,l),_(_t,e,l),m(e,Yo,l),m(e,za,l),n(za,Qa),m(e,Ao,l),m(e,Ae,l),n(Ae,yn),n(yn,xi),_(bt,xi,null),n(Ae,cp),n(Ae,Bi),n(Bi,mp),m(e,Ho,l),m(e,_n,l),n(_n,fp),n(_n,Sa),n(Sa,up),n(_n,hp),m(e,Oo,l),m(e,_e,l),n(_e,Ki),n(Ki,gp),n(_e,yp),n(_e,La),n(La,_p),n(_e,bp),n(_e,Da),n(Da,kp),n(_e,wp),m(e,er,l),m(e,Ya,l),n(Ya,vp),m(e,nr,l),_(kt,e,l),m(e,tr,l),m(e,Aa,l),n(Aa,Ha),m(e,ar,l),_(wt,e,l),m(e,ir,l),m(e,Oa,l),n(Oa,ei),m(e,sr,l),m(e,He,l),n(He,bn),n(bn,Vi),_(vt,Vi,null),n(He,Mp),n(He,Ni),n(Ni,Tp),m(e,or,l),m(e,kn,l),n(kn,Ip),n(kn,ni),n(ni,Jp),n(kn,Up),m(e,rr,l),_(Mt,e,l),m(e,lr,l),m(e,ti,l),n(ti,ai),m(e,pr,l),m(e,Oe,l),n(Oe,wn),n(wn,Fi),_(Tt,Fi,null),n(Oe,jp),n(Oe,Ri),n(Ri,Pp),m(e,dr,l),m(e,vn,l),n(vn,Zp),n(vn,ii),n(ii,Cp),n(vn,Gp),m(e,cr,l),m(e,ke,l),n(ke,$p),n(ke,qi),n(qi,Ep),n(ke,Wp),n(ke,Xi),n(Xi,xp),n(ke,Bp),m(e,mr,l),_(It,e,l),m(e,fr,l),m(e,si,l),n(si,oi),m(e,ur,l),m(e,en,l),n(en,Mn),n(Mn,zi),_(Jt,zi,null),n(en,Kp),n(en,Qi),n(Qi,Vp),m(e,hr,l),m(e,ne,l),n(ne,Np),n(ne,ri),n(ri,Fp),n(ne,Rp),n(ne,li),n(li,qp),n(ne,Xp),n(ne,pi),n(pi,zp),n(ne,Qp),n(ne,di),n(di,Sp),n(ne,Lp),m(e,gr,l),m(e,ci,l),n(ci,Dp),m(e,yr,l),m(e,Tn,l),n(Tn,Yp),n(Tn,Ut),n(Ut,Si),n(Si,Ap),n(Tn,Hp),m(e,_r,l),_(jt,e,l),m(e,br,l),m(e,In,l),n(In,Op),n(In,Pt),n(Pt,ed),n(In,nd),m(e,kr,l),m(e,mi,l),n(mi,td),m(e,wr,l),_(Zt,e,l),m(e,vr,l),m(e,we,l),n(we,ad),n(we,Li),n(Li,id),n(we,sd),n(we,Di),n(Di,od),n(we,rd),m(e,Mr,l),_(Ct,e,l),m(e,Tr,l),m(e,ve,l),n(ve,ld),n(ve,Yi),n(Yi,pd),n(ve,dd),n(ve,Ai),n(Ai,cd),n(ve,md),m(e,Ir,l),_(Gt,e,l),m(e,Jr,l),m(e,Jn,l),n(Jn,fd),n(Jn,$t),n($t,ud),n(Jn,hd),m(e,Ur,l),_(Un,e,l),m(e,jr,l),m(e,nn,l),n(nn,jn),n(jn,Hi),_(Et,Hi,null),n(nn,gd),n(nn,Oi),n(Oi,yd),m(e,Pr,l),m(e,Pn,l),n(Pn,es),n(es,Wt),n(Wt,ns),n(ns,_d),n(Wt,bd),n(Wt,ts),n(ts,kd),n(Pn,wd),n(Pn,be),n(be,xt),n(xt,as),n(as,Bt),n(Bt,vd),n(xt,Md),n(xt,is),n(is,ss),n(ss,Td),n(be,Id),n(be,Kt),n(Kt,os),n(os,Vt),n(Vt,Jd),n(Kt,Ud),n(Kt,rs),n(rs,ls),n(ls,jd),n(be,Pd),n(be,Nt),n(Nt,ps),n(ps,Ft),n(Ft,Zd),n(Nt,Cd),n(Nt,ds),n(ds,cs),n(cs,Gd),n(be,$d),n(be,Rt),n(Rt,ms),n(ms,qt),n(qt,Ed),n(Rt,Wd),n(Rt,fs),n(fs,us),n(us,xd),m(e,Zr,l),m(e,tn,l),n(tn,Zn),n(Zn,hs),_(Xt,hs,null),n(tn,Bd),n(tn,gs),n(gs,Kd),m(e,Cr,l),m(e,X,l),_(zt,X,null),n(X,Vd),n(X,ys),n(ys,Nd),n(X,Fd),n(X,Qt),n(Qt,Rd),n(Qt,fi),n(fi,qd),n(Qt,Xd),n(X,zd),n(X,Me),_(St,Me,null),n(Me,Qd),n(Me,_s),n(_s,Sd),n(Me,Ld),_(Cn,Me,null),n(X,Dd),n(X,Te),_(Lt,Te,null),n(Te,Yd),n(Te,bs),n(bs,Ad),n(Te,Hd),_(Gn,Te,null),n(X,Od),n(X,$n),_(Dt,$n,null),n($n,ec),n($n,ae),n(ae,nc),n(ae,ks),n(ks,tc),n(ae,ac),n(ae,ws),n(ws,ic),n(ae,sc),n(ae,vs),n(vs,oc),n(ae,rc),n(ae,Ms),n(Ms,lc),n(ae,pc),m(e,Gr,l),m(e,an,l),n(an,En),n(En,Ts),_(Yt,Ts,null),n(an,dc),n(an,Is),n(Is,cc),m(e,$r,l),m(e,L,l),_(At,L,null),n(L,mc),n(L,Js),n(Js,fc),n(L,uc),n(L,Ht),n(Ht,hc),n(Ht,ui),n(ui,gc),n(Ht,yc),n(L,_c),n(L,Ie),_(Ot,Ie,null),n(Ie,bc),n(Ie,Us),n(Us,kc),n(Ie,wc),_(Wn,Ie,null),n(L,vc),n(L,xn),_(ea,xn,null),n(xn,Mc),n(xn,ie),n(ie,Tc),n(ie,js),n(js,Ic),n(ie,Jc),n(ie,Ps),n(Ps,Uc),n(ie,jc),n(ie,Zs),n(Zs,Pc),n(ie,Zc),n(ie,Cs),n(Cs,Cc),n(ie,Gc),m(e,Er,l),m(e,sn,l),n(sn,Bn),n(Bn,Gs),_(na,Gs,null),n(sn,$c),n(sn,$s),n($s,Ec),m(e,Wr,l),m(e,D,l),_(ta,D,null),n(D,Wc),n(D,Es),n(Es,xc),n(D,Bc),n(D,aa),n(aa,Kc),n(aa,hi),n(hi,Vc),n(aa,Nc),n(D,Fc),n(D,Je),_(ia,Je,null),n(Je,Rc),n(Je,Ws),n(Ws,qc),n(Je,Xc),_(Kn,Je,null),n(D,zc),n(D,Vn),_(sa,Vn,null),n(Vn,Qc),n(Vn,se),n(se,Sc),n(se,xs),n(xs,Lc),n(se,Dc),n(se,Bs),n(Bs,Yc),n(se,Ac),n(se,Ks),n(Ks,Hc),n(se,Oc),n(se,Vs),n(Vs,em),n(se,nm),m(e,xr,l),m(e,on,l),n(on,Nn),n(Nn,Ns),_(oa,Ns,null),n(on,tm),n(on,Fs),n(Fs,am),m(e,Br,l),m(e,Y,l),_(ra,Y,null),n(Y,im),n(Y,Rs),n(Rs,sm),n(Y,om),n(Y,la),n(la,rm),n(la,gi),n(gi,lm),n(la,pm),n(Y,dm),n(Y,Ue),_(pa,Ue,null),n(Ue,cm),n(Ue,qs),n(qs,mm),n(Ue,fm),_(Fn,Ue,null),n(Y,um),n(Y,Rn),_(da,Rn,null),n(Rn,hm),n(Rn,oe),n(oe,gm),n(oe,Xs),n(Xs,ym),n(oe,_m),n(oe,zs),n(zs,bm),n(oe,km),n(oe,Qs),n(Qs,wm),n(oe,vm),n(oe,Ss),n(Ss,Mm),n(oe,Tm),m(e,Kr,l),m(e,rn,l),n(rn,qn),n(qn,Ls),_(ca,Ls,null),n(rn,Im),n(rn,Ds),n(Ds,Jm),m(e,Vr,l),m(e,A,l),_(ma,A,null),n(A,Um),n(A,Ys),n(Ys,jm),n(A,Pm),n(A,fa),n(fa,Zm),n(fa,yi),n(yi,Cm),n(fa,Gm),n(A,$m),n(A,je),_(ua,je,null),n(je,Em),n(je,As),n(As,Wm),n(je,xm),_(Xn,je,null),n(A,Bm),n(A,zn),_(ha,zn,null),n(zn,Km),n(zn,re),n(re,Vm),n(re,Hs),n(Hs,Nm),n(re,Fm),n(re,Os),n(Os,Rm),n(re,qm),n(re,eo),n(eo,Xm),n(re,zm),n(re,no),n(no,Qm),n(re,Sm),m(e,Nr,l),m(e,ln,l),n(ln,Qn),n(Qn,to),_(ga,to,null),n(ln,Lm),n(ln,ao),n(ao,Dm),m(e,Fr,l),m(e,H,l),_(ya,H,null),n(H,Ym),n(H,io),n(io,Am),n(H,Hm),n(H,_a),n(_a,Om),n(_a,_i),n(_i,ef),n(_a,nf),n(H,tf),n(H,Pe),_(ba,Pe,null),n(Pe,af),n(Pe,so),n(so,sf),n(Pe,of),_(Sn,Pe,null),n(H,rf),n(H,Ln),_(ka,Ln,null),n(Ln,lf),n(Ln,le),n(le,pf),n(le,oo),n(oo,df),n(le,cf),n(le,ro),n(ro,mf),n(le,ff),n(le,lo),n(lo,uf),n(le,hf),n(le,po),n(po,gf),n(le,yf),m(e,Rr,l),m(e,pn,l),n(pn,Dn),n(Dn,co),_(wa,co,null),n(pn,_f),n(pn,mo),n(mo,bf),m(e,qr,l),m(e,O,l),_(va,O,null),n(O,kf),n(O,fo),n(fo,wf),n(O,vf),n(O,Ma),n(Ma,Mf),n(Ma,bi),n(bi,Tf),n(Ma,If),n(O,Jf),n(O,Ze),_(Ta,Ze,null),n(Ze,Uf),n(Ze,uo),n(uo,jf),n(Ze,Pf),_(Yn,Ze,null),n(O,Zf),n(O,An),_(Ia,An,null),n(An,Cf),n(An,pe),n(pe,Gf),n(pe,ho),n(ho,$f),n(pe,Ef),n(pe,go),n(go,Wf),n(pe,xf),n(pe,yo),n(yo,Bf),n(pe,Kf),n(pe,_o),n(_o,Vf),n(pe,Nf),Xr=!0},p(e,[l]){const Ja={};l&2&&(Ja.$$scope={dirty:l,ctx:e}),un.$set(Ja);const bo={};l&2&&(bo.$$scope={dirty:l,ctx:e}),hn.$set(bo);const ko={};l&2&&(ko.$$scope={dirty:l,ctx:e}),Un.$set(ko);const wo={};l&2&&(wo.$$scope={dirty:l,ctx:e}),Cn.$set(wo);const Ua={};l&2&&(Ua.$$scope={dirty:l,ctx:e}),Gn.$set(Ua);const vo={};l&2&&(vo.$$scope={dirty:l,ctx:e}),Wn.$set(vo);const Mo={};l&2&&(Mo.$$scope={dirty:l,ctx:e}),Kn.$set(Mo);const To={};l&2&&(To.$$scope={dirty:l,ctx:e}),Fn.$set(To);const dn={};l&2&&(dn.$$scope={dirty:l,ctx:e}),Xn.$set(dn);const Io={};l&2&&(Io.$$scope={dirty:l,ctx:e}),Sn.$set(Io);const Jo={};l&2&&(Jo.$$scope={dirty:l,ctx:e}),Yn.$set(Jo)},i(e){Xr||(b(f.$$.fragment,e),b(V.$$.fragment,e),b(lt.$$.fragment,e),b(pt.$$.fragment,e),b(ct.$$.fragment,e),b(mt.$$.fragment,e),b(un.$$.fragment,e),b(ft.$$.fragment,e),b(hn.$$.fragment,e),b(ut.$$.fragment,e),b(ht.$$.fragment,e),b(gt.$$.fragment,e),b(yt.$$.fragment,e),b(_t.$$.fragment,e),b(bt.$$.fragment,e),b(kt.$$.fragment,e),b(wt.$$.fragment,e),b(vt.$$.fragment,e),b(Mt.$$.fragment,e),b(Tt.$$.fragment,e),b(It.$$.fragment,e),b(Jt.$$.fragment,e),b(jt.$$.fragment,e),b(Zt.$$.fragment,e),b(Ct.$$.fragment,e),b(Gt.$$.fragment,e),b(Un.$$.fragment,e),b(Et.$$.fragment,e),b(Xt.$$.fragment,e),b(zt.$$.fragment,e),b(St.$$.fragment,e),b(Cn.$$.fragment,e),b(Lt.$$.fragment,e),b(Gn.$$.fragment,e),b(Dt.$$.fragment,e),b(Yt.$$.fragment,e),b(At.$$.fragment,e),b(Ot.$$.fragment,e),b(Wn.$$.fragment,e),b(ea.$$.fragment,e),b(na.$$.fragment,e),b(ta.$$.fragment,e),b(ia.$$.fragment,e),b(Kn.$$.fragment,e),b(sa.$$.fragment,e),b(oa.$$.fragment,e),b(ra.$$.fragment,e),b(pa.$$.fragment,e),b(Fn.$$.fragment,e),b(da.$$.fragment,e),b(ca.$$.fragment,e),b(ma.$$.fragment,e),b(ua.$$.fragment,e),b(Xn.$$.fragment,e),b(ha.$$.fragment,e),b(ga.$$.fragment,e),b(ya.$$.fragment,e),b(ba.$$.fragment,e),b(Sn.$$.fragment,e),b(ka.$$.fragment,e),b(wa.$$.fragment,e),b(va.$$.fragment,e),b(Ta.$$.fragment,e),b(Yn.$$.fragment,e),b(Ia.$$.fragment,e),Xr=!0)},o(e){k(f.$$.fragment,e),k(V.$$.fragment,e),k(lt.$$.fragment,e),k(pt.$$.fragment,e),k(ct.$$.fragment,e),k(mt.$$.fragment,e),k(un.$$.fragment,e),k(ft.$$.fragment,e),k(hn.$$.fragment,e),k(ut.$$.fragment,e),k(ht.$$.fragment,e),k(gt.$$.fragment,e),k(yt.$$.fragment,e),k(_t.$$.fragment,e),k(bt.$$.fragment,e),k(kt.$$.fragment,e),k(wt.$$.fragment,e),k(vt.$$.fragment,e),k(Mt.$$.fragment,e),k(Tt.$$.fragment,e),k(It.$$.fragment,e),k(Jt.$$.fragment,e),k(jt.$$.fragment,e),k(Zt.$$.fragment,e),k(Ct.$$.fragment,e),k(Gt.$$.fragment,e),k(Un.$$.fragment,e),k(Et.$$.fragment,e),k(Xt.$$.fragment,e),k(zt.$$.fragment,e),k(St.$$.fragment,e),k(Cn.$$.fragment,e),k(Lt.$$.fragment,e),k(Gn.$$.fragment,e),k(Dt.$$.fragment,e),k(Yt.$$.fragment,e),k(At.$$.fragment,e),k(Ot.$$.fragment,e),k(Wn.$$.fragment,e),k(ea.$$.fragment,e),k(na.$$.fragment,e),k(ta.$$.fragment,e),k(ia.$$.fragment,e),k(Kn.$$.fragment,e),k(sa.$$.fragment,e),k(oa.$$.fragment,e),k(ra.$$.fragment,e),k(pa.$$.fragment,e),k(Fn.$$.fragment,e),k(da.$$.fragment,e),k(ca.$$.fragment,e),k(ma.$$.fragment,e),k(ua.$$.fragment,e),k(Xn.$$.fragment,e),k(ha.$$.fragment,e),k(ga.$$.fragment,e),k(ya.$$.fragment,e),k(ba.$$.fragment,e),k(Sn.$$.fragment,e),k(ka.$$.fragment,e),k(wa.$$.fragment,e),k(va.$$.fragment,e),k(Ta.$$.fragment,e),k(Yn.$$.fragment,e),k(Ia.$$.fragment,e),Xr=!1},d(e){t(u),e&&t(I),e&&t(M),w(f),e&&t(R),e&&t(J),w(V),e&&t(q),e&&t(N),e&&t(P),e&&t(Z),e&&t(ye),e&&t(E),e&&t(Uo),e&&t(De),w(lt),e&&t(jo),e&&t(Za),e&&t(Po),e&&t(Ye),w(pt),e&&t(Zo),e&&t(de),e&&t(Co),w(ct,e),e&&t(Go),e&&t($a),e&&t($o),w(mt,e),e&&t(Eo),w(un,e),e&&t(Wo),e&&t(Ea),e&&t(xo),w(ft,e),e&&t(Bo),w(hn,e),e&&t(Ko),e&&t(gn),e&&t(Vo),w(ut,e),e&&t(No),e&&t(Wa),e&&t(Fo),e&&t(xa),e&&t(Ro),e&&t(Ka),e&&t(qo),w(ht,e),e&&t(Xo),e&&t(Va),e&&t(zo),w(gt,e),e&&t(Qo),e&&t(Fa),e&&t(So),w(yt,e),e&&t(Lo),e&&t(qa),e&&t(Do),w(_t,e),e&&t(Yo),e&&t(za),e&&t(Ao),e&&t(Ae),w(bt),e&&t(Ho),e&&t(_n),e&&t(Oo),e&&t(_e),e&&t(er),e&&t(Ya),e&&t(nr),w(kt,e),e&&t(tr),e&&t(Aa),e&&t(ar),w(wt,e),e&&t(ir),e&&t(Oa),e&&t(sr),e&&t(He),w(vt),e&&t(or),e&&t(kn),e&&t(rr),w(Mt,e),e&&t(lr),e&&t(ti),e&&t(pr),e&&t(Oe),w(Tt),e&&t(dr),e&&t(vn),e&&t(cr),e&&t(ke),e&&t(mr),w(It,e),e&&t(fr),e&&t(si),e&&t(ur),e&&t(en),w(Jt),e&&t(hr),e&&t(ne),e&&t(gr),e&&t(ci),e&&t(yr),e&&t(Tn),e&&t(_r),w(jt,e),e&&t(br),e&&t(In),e&&t(kr),e&&t(mi),e&&t(wr),w(Zt,e),e&&t(vr),e&&t(we),e&&t(Mr),w(Ct,e),e&&t(Tr),e&&t(ve),e&&t(Ir),w(Gt,e),e&&t(Jr),e&&t(Jn),e&&t(Ur),w(Un,e),e&&t(jr),e&&t(nn),w(Et),e&&t(Pr),e&&t(Pn),e&&t(Zr),e&&t(tn),w(Xt),e&&t(Cr),e&&t(X),w(zt),w(St),w(Cn),w(Lt),w(Gn),w(Dt),e&&t(Gr),e&&t(an),w(Yt),e&&t($r),e&&t(L),w(At),w(Ot),w(Wn),w(ea),e&&t(Er),e&&t(sn),w(na),e&&t(Wr),e&&t(D),w(ta),w(ia),w(Kn),w(sa),e&&t(xr),e&&t(on),w(oa),e&&t(Br),e&&t(Y),w(ra),w(pa),w(Fn),w(da),e&&t(Kr),e&&t(rn),w(ca),e&&t(Vr),e&&t(A),w(ma),w(ua),w(Xn),w(ha),e&&t(Nr),e&&t(ln),w(ga),e&&t(Fr),e&&t(H),w(ya),w(ba),w(Sn),w(ka),e&&t(Rr),e&&t(pn),w(wa),e&&t(qr),e&&t(O),w(va),w(Ta),w(Yn),w(Ia)}}}const my={local:"kandinsky",sections:[{local:"overview",title:"Overview"},{local:"usage-example",sections:[{local:"texttoimage-generation",title:"Text-to-Image Generation"},{local:"text-guided-imagetoimage-generation",title:"Text Guided Image-to-Image Generation"},{local:"text-guided-inpainting-generation",title:"Text Guided Inpainting Generation"},{local:"interpolate",title:"Interpolate "}],title:"Usage example"},{local:"optimization",title:"Optimization"},{local:"available-pipelines",sections:[{local:"diffusers.KandinskyPriorPipeline",title:"KandinskyPriorPipeline"},{local:"diffusers.KandinskyPipeline",title:"KandinskyPipeline"},{local:"diffusers.KandinskyImg2ImgPipeline",title:"KandinskyImg2ImgPipeline"},{local:"diffusers.KandinskyInpaintPipeline",title:"KandinskyInpaintPipeline"},{local:"diffusers.KandinskyCombinedPipeline",title:"KandinskyCombinedPipeline"},{local:"diffusers.KandinskyImg2ImgCombinedPipeline",title:"KandinskyImg2ImgCombinedPipeline"},{local:"diffusers.KandinskyInpaintCombinedPipeline",title:"KandinskyInpaintCombinedPipeline"}],title:"Available Pipelines:"}],title:"Kandinsky"};function fy(G){return Og(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ky extends Dg{constructor(u){super();Yg(this,u,fy,cy,Ag,{})}}export{ky as default,my as metadata};
