import{S as by,i as wy,s as ky,e as a,k as d,w as _,t as o,M as My,c as i,d as t,m as c,a as s,x as b,h as r,b as p,N as gn,G as n,g as m,y as w,q as k,o as M,B as v,v as vy,L as Me}from"../../../chunks/vendor-hf-doc-builder.js";import{T as qi}from"../../../chunks/Tip-hf-doc-builder.js";import{D as q}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as E}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as ae}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as dt}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ty(B){let f,I,y,h,T,u,g,G,J,P;return J=new E({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(){f=a("p"),I=o("By default, the text-to-image pipeline use "),y=a("a"),h=o("DDIMScheduler"),T=o(", you can change the scheduler to "),u=a("a"),g=o("DDPMScheduler"),G=d(),_(J.$$.fragment),this.h()},l(j){f=i(j,"P",{});var U=s(f);I=r(U,"By default, the text-to-image pipeline use "),y=i(U,"A",{href:!0});var z=s(y);h=r(z,"DDIMScheduler"),z.forEach(t),T=r(U,", you can change the scheduler to "),u=i(U,"A",{href:!0});var K=s(u);g=r(K,"DDPMScheduler"),K.forEach(t),U.forEach(t),G=c(j),b(J.$$.fragment,j),this.h()},h(){p(y,"href","/docs/diffusers/v0.19.2/en/api/schedulers/ddim#diffusers.DDIMScheduler"),p(u,"href","/docs/diffusers/v0.19.2/en/api/schedulers/ddpm#diffusers.DDPMScheduler")},m(j,U){m(j,f,U),n(f,I),n(f,y),n(y,h),n(f,T),n(f,u),n(u,g),m(j,G,U),w(J,j,U),P=!0},p:Me,i(j){P||(k(J.$$.fragment,j),P=!0)},o(j){M(J.$$.fragment,j),P=!1},d(j){j&&t(f),j&&t(G),v(J,j)}}}function Jy(B){let f,I,y,h,T,u,g,G,J,P,j,U,z,K,Y,F,D,S,N,H,V,ie,O,R,$,ee;return $=new E({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(){f=a("p"),I=o("The text-to-image pipeline expects both "),y=a("code"),h=o("image_embeds"),T=o(", "),u=a("code"),g=o("negative_image_embeds"),G=o(` and the original
`),J=a("code"),P=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"),K=o("."),Y=d(),F=a("p"),D=o("By default, the prior returns unconditioned negative image embeddings corresponding to the negative prompt of "),S=a("code"),N=o('""'),H=o(`.
For better results, you can also pass a `),V=a("code"),ie=o("negative_prompt"),O=o(` to the prior. This will increase the effective batch size
of the prior by a factor of 2.`),R=d(),_($.$$.fragment)},l(C){f=i(C,"P",{});var W=s(f);I=r(W,"The text-to-image pipeline expects both "),y=i(W,"CODE",{});var se=s(y);h=r(se,"image_embeds"),se.forEach(t),T=r(W,", "),u=i(W,"CODE",{});var ne=s(u);g=r(ne,"negative_image_embeds"),ne.forEach(t),G=r(W,` and the original
`),J=i(W,"CODE",{});var fe=s(J);P=r(fe,"prompt"),fe.forEach(t),j=r(W,` as the text-to-image pipeline uses another text encoder to better guide the second diffusion
process of `),U=i(W,"CODE",{});var me=s(U);z=r(me,"t2i_pipe"),me.forEach(t),K=r(W,"."),W.forEach(t),Y=c(C),F=i(C,"P",{});var L=s(F);D=r(L,"By default, the prior returns unconditioned negative image embeddings corresponding to the negative prompt of "),S=i(L,"CODE",{});var x=s(S);N=r(x,'""'),x.forEach(t),H=r(L,`.
For better results, you can also pass a `),V=i(L,"CODE",{});var Z=s(V);ie=r(Z,"negative_prompt"),Z.forEach(t),O=r(L,` to the prior. This will increase the effective batch size
of the prior by a factor of 2.`),L.forEach(t),R=c(C),b($.$$.fragment,C)},m(C,W){m(C,f,W),n(f,I),n(f,y),n(y,h),n(f,T),n(f,u),n(u,g),n(f,G),n(f,J),n(J,P),n(f,j),n(f,U),n(U,z),n(f,K),m(C,Y,W),m(C,F,W),n(F,D),n(F,S),n(S,N),n(F,H),n(F,V),n(V,ie),n(F,O),m(C,R,W),w($,C,W),ee=!0},p:Me,i(C){ee||(k($.$$.fragment,C),ee=!0)},o(C){M($.$$.fragment,C),ee=!1},d(C){C&&t(f),C&&t(Y),C&&t(F),C&&t(R),v($,C)}}}function Iy(B){let f,I,y,h,T,u,g,G,J,P,j,U,z,K,Y,F,D,S,N,H,V,ie,O,R,$,ee,C,W,se,ne,fe,me,L,x;return P=new E({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvclRleHRUb0ltYWdlJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlJTIwJTNEJTIwQXV0b1BpcGVsaW5lRm9yVGV4dFRvSW1hZ2UuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForTextToImage
<span class="hljs-keyword">import</span> torch

pipe = AutoPipelineForTextToImage.from_pretrained(
    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1&quot;</span>, torch_dtype=torch.float16
)
pipe.enable_model_cpu_offload()`}}),L=new E({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMGFsaWVuJTIwY2hlZXNlYnVyZ2VyJTIwY3JlYXR1cmUlMjBlYXRpbmclMjBpdHNlbGYlMkMlMjBjbGF5bWF0aW9uJTJDJTIwY2luZW1hdGljJTJDJTIwbW9vZHklMjBsaWdodGluZyUyMiUwQW5lZ2F0aXZlX3Byb21wdCUyMCUzRCUyMCUyMmxvdyUyMHF1YWxpdHklMkMlMjBiYWQlMjBxdWFsaXR5JTIyJTBBJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUzRHByb21wdCUyQyUyMG5lZ2F0aXZlX3Byb21wdCUzRG5lZ2F0aXZlX3Byb21wdCUyQyUyMHByaW9yX2d1aWRhbmNlX3NjYWxlJTIwJTNEMS4wJTJDJTIwZ3VpZGFuY2Vfc2NhY2xlJTIwJTNEJTIwNC4wJTJDJTIwaGVpZ2h0JTNENzY4JTJDJTIwd2lkdGglM0Q3NjgpLmltYWdlcyU1QjAlNUQ=",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 = pipe(prompt=prompt, negative_prompt=negative_prompt, prior_guidance_scale =<span class="hljs-number">1.0</span>, guidance_scacle = <span class="hljs-number">4.0</span>, height=<span class="hljs-number">768</span>, width=<span class="hljs-number">768</span>).images[<span class="hljs-number">0</span>]`}}),{c(){f=a("p"),I=o("We also provide an end-to-end Kandinsky pipeline "),y=a("a"),h=o("KandinskyCombinedPipeline"),T=o(", which combines both the prior pipeline and text-to-image pipeline, and lets you perform inference in a single step. You can create the combined pipeline with the "),u=a("code"),g=o("~AutoPipelineForTextToImage.from_pretrained"),G=o(" method"),J=d(),_(P.$$.fragment),j=d(),U=a("p"),z=o("Under the hood, it will automatically load both "),K=a("a"),Y=o("KandinskyPriorPipeline"),F=o(" and "),D=a("a"),S=o("KandinskyPipeline"),N=o(". To generate images, you no longer need to call both pipelines and pass the outputs from one to another. You only need to call the combined pipeline once. You can set different "),H=a("code"),V=o("guidance_scale"),ie=o(" and "),O=a("code"),R=o("num_inference_steps"),$=o(" for the prior pipeline with the "),ee=a("code"),C=o("prior_guidance_scale"),W=o(" and "),se=a("code"),ne=o("prior_num_inference_steps"),fe=o(" arguments."),me=d(),_(L.$$.fragment),this.h()},l(Z){f=i(Z,"P",{});var X=s(f);I=r(X,"We also provide an end-to-end Kandinsky pipeline "),y=i(X,"A",{href:!0});var Ka=s(y);h=r(Ka,"KandinskyCombinedPipeline"),Ka.forEach(t),T=r(X,", which combines both the prior pipeline and text-to-image pipeline, and lets you perform inference in a single step. You can create the combined pipeline with the "),u=i(X,"CODE",{});var Fa=s(u);g=r(Fa,"~AutoPipelineForTextToImage.from_pretrained"),Fa.forEach(t),G=r(X," method"),X.forEach(t),J=c(Z),b(P.$$.fragment,Z),j=c(Z),U=i(Z,"P",{});var Q=s(U);z=r(Q,"Under the hood, it will automatically load both "),K=i(Q,"A",{href:!0});var Va=s(K);Y=r(Va,"KandinskyPriorPipeline"),Va.forEach(t),F=r(Q," and "),D=i(Q,"A",{href:!0});var Na=s(D);S=r(Na,"KandinskyPipeline"),Na.forEach(t),N=r(Q,". To generate images, you no longer need to call both pipelines and pass the outputs from one to another. You only need to call the combined pipeline once. You can set different "),H=i(Q,"CODE",{});var Ue=s(H);V=r(Ue,"guidance_scale"),Ue.forEach(t),ie=r(Q," and "),O=i(Q,"CODE",{});var Ra=s(O);R=r(Ra,"num_inference_steps"),Ra.forEach(t),$=r(Q," for the prior pipeline with the "),ee=i(Q,"CODE",{});var Xa=s(ee);C=r(Xa,"prior_guidance_scale"),Xa.forEach(t),W=r(Q," and "),se=i(Q,"CODE",{});var je=s(se);ne=r(je,"prior_num_inference_steps"),je.forEach(t),fe=r(Q," arguments."),Q.forEach(t),me=c(Z),b(L.$$.fragment,Z),this.h()},h(){p(y,"href","/docs/diffusers/v0.19.2/en/api/pipelines/kandinsky#diffusers.KandinskyCombinedPipeline"),p(K,"href","/docs/diffusers/v0.19.2/en/api/pipelines/kandinsky#diffusers.KandinskyPriorPipeline"),p(D,"href","/docs/diffusers/v0.19.2/en/api/pipelines/kandinsky#diffusers.KandinskyPipeline")},m(Z,X){m(Z,f,X),n(f,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VybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRkNvbXBWaXMlMkZzdGFibGUtZGlmZnVzaW9uJTJGbWFpbiUyRmFzc2V0cyUyRnN0YWJsZS1zYW1wbGVzJTJGaW1nMmltZyUyRnNrZXRjaC1tb3VudGFpbnMtaW5wdXQuanBnJTIyJTBBJTIwJTBBcmVzcG9uc2UlMjAlM0QlMjByZXF1ZXN0cy5nZXQodXJsKSUwQW9yaWdpbmFsX2ltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihCeXRlc0lPKHJlc3BvbnNlLmNvbnRlbnQpKS5jb252ZXJ0KCUyMlJHQiUyMiklMEFvcmlnaW5hbF9pbWFnZS50aHVtYm5haWwoKDc2OCUyQyUyMDc2OCkpJTBBJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUzRHByb21wdCUyQyUyMGltYWdlJTNEb3JpZ2luYWxfaW1hZ2UlMkMlMjBzdHJlbmd0aCUzRDAuMykuaW1hZ2VzJTVCMCU1RA==",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)
original_image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
original_image.thumbnail((<span class="hljs-number">768</span>, <span class="hljs-number">768</span>))

image = pipe(prompt=prompt, image=original_image, strength=<span class="hljs-number">0.3</span>).images[<span class="hljs-number">0</span>]`}}),{c(){f=a("p"),I=o("You can also use the "),y=a("a"),h=o("KandinskyImg2ImgCombinedPipeline"),T=o(" for end-to-end image-to-image generation with Kandinsky 2.1"),u=d(),_(g.$$.fragment),this.h()},l(J){f=i(J,"P",{});var P=s(f);I=r(P,"You can also use the "),y=i(P,"A",{href:!0});var j=s(y);h=r(j,"KandinskyImg2ImgCombinedPipeline"),j.forEach(t),T=r(P," for end-to-end image-to-image generation with Kandinsky 2.1"),P.forEach(t),u=c(J),b(g.$$.fragment,J),this.h()},h(){p(y,"href","/docs/diffusers/v0.19.2/en/api/pipelines/kandinsky#diffusers.KandinskyImg2ImgCombinedPipeline")},m(J,P){m(J,f,P),n(f,I),n(f,y),n(y,h),n(f,T),m(J,u,P),w(g,J,P),G=!0},p:Me,i(J){G||(k(g.$$.fragment,J),G=!0)},o(J){M(g.$$.fragment,J),G=!1},d(J){J&&t(f),J&&t(u),v(g,J)}}}function jy(B){let f,I,y,h,T,u,g,G;return g=new E({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvcklucGFpbnRpbmclMEElMEFwaXBlJTIwJTNEJTIwQXV0b1BpcGVsaW5lRm9ySW5wYWludGluZy5mcm9tX3ByZXRyYWluZWQoJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTEtaW5wYWludCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUzRHByb21wdCUyQyUyMGltYWdlJTNEb3JpZ2luYWxfaW1hZ2UlMkMlMjBtYXNrX2ltYWdlJTNEbWFzaykuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForInpainting

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()
image = pipe(prompt=prompt, image=original_image, mask_image=mask).images[<span class="hljs-number">0</span>]`}}),{c(){f=a("p"),I=o("To use the "),y=a("a"),h=o("KandinskyInpaintCombinedPipeline"),T=o(" to perform end-to-end image inpainting generation, you can run below code instead"),u=d(),_(g.$$.fragment),this.h()},l(J){f=i(J,"P",{});var P=s(f);I=r(P,"To use the "),y=i(P,"A",{href:!0});var j=s(y);h=r(j,"KandinskyInpaintCombinedPipeline"),j.forEach(t),T=r(P," to perform end-to-end image inpainting generation, you can run below code instead"),P.forEach(t),u=c(J),b(g.$$.fragment,J),this.h()},h(){p(y,"href","/docs/diffusers/v0.19.2/en/api/pipelines/kandinsky#diffusers.KandinskyInpaintCombinedPipeline")},m(J,P){m(J,f,P),n(f,I),n(f,y),n(y,h),n(f,T),m(J,u,P),w(g,J,P),G=!0},p:Me,i(J){G||(k(g.$$.fragment,J),G=!0)},o(J){M(g.$$.fragment,J),G=!1},d(J){J&&t(f),J&&t(u),v(g,J)}}}function Py(B){let f,I,y,h,T,u,g,G,J,P,j,U,z,K,Y,F,D,S,N,H,V,ie,O;return{c(){f=a("p"),I=o("To generate images directly from a single pipeline, you can use "),y=a("a"),h=o("KandinskyCombinedPipeline"),T=o(", "),u=a("a"),g=o("KandinskyImg2ImgCombinedPipeline"),G=o(", "),J=a("a"),P=o("KandinskyInpaintCombinedPipeline"),j=o(`.
These combined pipelines wrap the `),U=a("a"),z=o("KandinskyPriorPipeline"),K=o(" and "),Y=a("a"),F=o("KandinskyPipeline"),D=o(", "),S=a("a"),N=o("KandinskyImg2ImgPipeline"),H=o(", "),V=a("a"),ie=o("KandinskyInpaintPipeline"),O=o(` respectively into a single
pipeline for a simpler user experience`),this.h()},l(R){f=i(R,"P",{});var $=s(f);I=r($,"To generate images directly from a single pipeline, you can use "),y=i($,"A",{href:!0});var ee=s(y);h=r(ee,"KandinskyCombinedPipeline"),ee.forEach(t),T=r($,", "),u=i($,"A",{href:!0});var C=s(u);g=r(C,"KandinskyImg2ImgCombinedPipeline"),C.forEach(t),G=r($,", "),J=i($,"A",{href:!0});var W=s(J);P=r(W,"KandinskyInpaintCombinedPipeline"),W.forEach(t),j=r($,`.
These combined pipelines wrap the `),U=i($,"A",{href:!0});var se=s(U);z=r(se,"KandinskyPriorPipeline"),se.forEach(t),K=r($," and "),Y=i($,"A",{href:!0});var ne=s(Y);F=r(ne,"KandinskyPipeline"),ne.forEach(t),D=r($,", "),S=i($,"A",{href:!0});var fe=s(S);N=r(fe,"KandinskyImg2ImgPipeline"),fe.forEach(t),H=r($,", "),V=i($,"A",{href:!0});var me=s(V);ie=r(me,"KandinskyInpaintPipeline"),me.forEach(t),O=r($,` respectively into a single
pipeline for a simpler user experience`),$.forEach(t),this.h()},h(){p(y,"href","/docs/diffusers/v0.19.2/en/api/pipelines/kandinsky#diffusers.KandinskyCombinedPipeline"),p(u,"href","/docs/diffusers/v0.19.2/en/api/pipelines/kandinsky#diffusers.KandinskyImg2ImgCombinedPipeline"),p(J,"href","/docs/diffusers/v0.19.2/en/api/pipelines/kandinsky#diffusers.KandinskyInpaintCombinedPipeline"),p(U,"href","/docs/diffusers/v0.19.2/en/api/pipelines/kandinsky#diffusers.KandinskyPriorPipeline"),p(Y,"href","/docs/diffusers/v0.19.2/en/api/pipelines/kandinsky#diffusers.KandinskyPipeline"),p(S,"href","/docs/diffusers/v0.19.2/en/api/pipelines/kandinsky#diffusers.KandinskyImg2ImgPipeline"),p(V,"href","/docs/diffusers/v0.19.2/en/api/pipelines/kandinsky#diffusers.KandinskyInpaintPipeline")},m(R,$){m(R,f,$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TNEbmVnYXRpdmVfaW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMTAwJTJDJTBBKS5pbWFnZXMlMEElMEFpbWFnZSU1QjAlNUQuc2F2ZSglMjJjYXQucG5nJTIyKQ==",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(){f=a("p"),I=o("Examples:"),y=d(),_(h.$$.fragment)},l(u){f=i(u,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),y=c(u),b(h.$$.fragment,u)},m(u,g){m(u,f,g),n(f,I),m(u,y,g),w(h,u,g),T=!0},p:Me,i(u){T||(k(h.$$.fragment,u),T=!0)},o(u){M(h.$$.fragment,u),T=!1},d(u){u&&t(f),u&&t(y),v(h,u)}}}function $y(B){let f,I,y,h,T;return h=new E({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUlMkMlMjBLYW5kaW5za3lQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBaW1wb3J0JTIwUElMJTBBJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdG9yY2h2aXNpb24lMjBpbXBvcnQlMjB0cmFuc2Zvcm1zJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEFpbWcxJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZoZi1pbnRlcm5h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X2VtYiUyQyUwQSUyMCUyMCUyMCUyMGhlaWdodCUzRDc2OCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDE1MCUyQyUwQSkuaW1hZ2VzJTVCMCU1RCUwQSUwQWltYWdlLnNhdmUoJTIyc3RhcnJ5X2NhdC5wbmclMjIp",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(){f=a("p"),I=o("Examples:"),y=d(),_(h.$$.fragment)},l(u){f=i(u,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),y=c(u),b(h.$$.fragment,u)},m(u,g){m(u,f,g),n(f,I),m(u,y,g),w(h,u,g),T=!0},p:Me,i(u){T||(k(h.$$.fragment,u),T=!0)},o(u){M(h.$$.fragment,u),T=!1},d(u){u&&t(f),u&&t(y),v(h,u)}}}function Cy(B){let f,I,y,h,T;return h=new E({props:{code:"ZnJvbSUy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FnZSU1QjAlNUQuc2F2ZSglMjJjYXQucG5nJTIyKQ==",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(){f=a("p"),I=o("Examples:"),y=d(),_(h.$$.fragment)},l(u){f=i(u,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),y=c(u),b(h.$$.fragment,u)},m(u,g){m(u,f,g),n(f,I),m(u,y,g),w(h,u,g),T=!0},p:Me,i(u){T||(k(h.$$.fragment,u),T=!0)},o(u){M(h.$$.fragment,u),T=!1},d(u){u&&t(f),u&&t(y),v(h,u)}}}function Gy(B){let f,I,y,h,T;return h=new E({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(){f=a("p"),I=o("Examples:"),y=d(),_(h.$$.fragment)},l(u){f=i(u,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),y=c(u),b(h.$$.fragment,u)},m(u,g){m(u,f,g),n(f,I),m(u,y,g),w(h,u,g),T=!0},p:Me,i(u){T||(k(h.$$.fragment,u),T=!0)},o(u){M(h.$$.fragment,u),T=!1},d(u){u&&t(f),u&&t(y),v(h,u)}}}function Wy(B){let f,I,y,h,T;return h=new E({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreUlucGFpbnRQaXBlbGluZSUyQyUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQWltcG9ydCUyMHRvcmNoJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwaGF0JTIyJTBBaW1hZ2VfZW1iJTJDJTIwemVyb19pbWFnZV9lbWIlMjAlM0QlMjBwaXBlX3ByaW9yKHByb21wdCUyQyUyMHJldHVybl9kaWN0JTNERmFsc2UpJTBBJTBBcGlwZSUyMCUzRCUyMEthbmRpbnNreUlucGFpbnRQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTEtaW5wYWludC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&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(){f=a("p"),I=o("Examples:"),y=d(),_(h.$$.fragment)},l(u){f=i(u,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),y=c(u),b(h.$$.fragment,u)},m(u,g){m(u,f,g),n(f,I),m(u,y,g),w(h,u,g),T=!0},p:Me,i(u){T||(k(h.$$.fragment,u),T=!0)},o(u){M(h.$$.fragment,u),T=!1},d(u){u&&t(f),u&&t(y),v(h,u)}}}function Ey(B){let f,I,y,h,T;return h=new E({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(){f=a("p"),I=o("Examples:"),y=d(),_(h.$$.fragment)},l(u){f=i(u,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),y=c(u),b(h.$$.fragment,u)},m(u,g){m(u,f,g),n(f,I),m(u,y,g),w(h,u,g),T=!0},p:Me,i(u){T||(k(h.$$.fragment,u),T=!0)},o(u){M(h.$$.fragment,u),T=!1},d(u){u&&t(f),u&&t(y),v(h,u)}}}function By(B){let f,I,y,h,T;return h=new E({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvckltYWdlMkltYWdlJTBBaW1wb3J0JTIwdG9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3JpZ2luYWxfaW1hZ2UlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMjUpLmltYWdlcyU1QjAlNUQ=",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(){f=a("p"),I=o("Examples:"),y=d(),_(h.$$.fragment)},l(u){f=i(u,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),y=c(u),b(h.$$.fragment,u)},m(u,g){m(u,f,g),n(f,I),m(u,y,g),w(h,u,g),T=!0},p:Me,i(u){T||(k(h.$$.fragment,u),T=!0)},o(u){M(h.$$.fragment,u),T=!1},d(u){u&&t(f),u&&t(y),v(h,u)}}}function xy(B){let f,I,y,h,T;return h=new E({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvcklucGFpbnRpbmclMEFm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zRCUyMDElMEElMEFpbWFnZSUyMCUzRCUyMHBpcGUocHJvbXB0JTNEcHJvbXB0JTJDJTIwaW1hZ2UlM0RvcmlnaW5hbF9pbWFnZSUyQyUyMG1hc2tfaW1hZ2UlM0RtYXNrJTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDI1KS5pbWFnZXMlNUIwJTVE",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(){f=a("p"),I=o("Examples:"),y=d(),_(h.$$.fragment)},l(u){f=i(u,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),y=c(u),b(h.$$.fragment,u)},m(u,g){m(u,f,g),n(f,I),m(u,y,g),w(h,u,g),T=!0},p:Me,i(u){T||(k(h.$$.fragment,u),T=!0)},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o,Ta,_u,wo,bu,dl,de,Ja,wu,ko,ku,Mu,Ia,vu,Ci,Tu,Ju,Iu,Ke,Ua,Uu,Mo,ju,Pu,at,Zu,it,ja,$u,we,Cu,vo,Gu,Wu,To,Eu,Bu,Jo,xu,Ku,Io,Fu,Vu,cl,fn,st,Uo,Pa,Nu,jo,Ru,ml,ce,Za,Xu,Po,Qu,qu,$a,Su,Gi,zu,Yu,Lu,Fe,Ca,Du,Zo,Au,Hu,ot,Ou,rt,Ga,ef,ke,nf,$o,tf,af,Co,sf,of,Go,rf,lf,Wo,pf,df,ul;return u=new ae({}),K=new ae({}),ft=new ae({}),ht=new ae({}),yt=new E({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMGFsaWVuJTIwY2hlZXNlYnVyZ2VyJTIwY3JlYXR1cmUlMjBlYXRpbmclMjBpdHNlbGYlMkMlMjBjbGF5bWF0aW9uJTJDJTIwY2luZW1hdGljJTJDJTIwbW9vZHklMjBsaWdodGluZyUyMg==",highlighted:'prompt = <span class="hljs-string">&quot;A alien cheeseburger creature eating itself, claymation, cinematic, moody lighting&quot;</span>'}}),_t=new E({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>)`}}),bn=new qi({props:{warning:!0,$$slots:{default:[Ty]},$$scope:{ctx:B}}}),bt=new E({props:{code:"aW1hZ2VfZW1iZWRzJTJDJTIwbmVnYXRpdmVfaW1hZ2VfZW1iZWRzJTIwJTNEJTIwcGlwZV9wcmlvcihwcm9tcHQlMkMlMjBndWlkYW5jZV9zY2FsZSUzRDEuMCkudG9fdHVwbGUoKQ==",highlighted:'image_embeds, negative_image_embeds = pipe_prior(prompt, guidance_scale=<span class="hljs-number">1.0</span>).to_tuple()'}}),wn=new qi({props:{warning:!0,$$slots:{default:[Jy]},$$scope:{ctx:B}}}),wt=new E({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>)`}}),Mn=new qi({props:{$$slots:{default:[Iy]},$$scope:{ctx:B}}}),kt=new E({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>'}}),Mt=new E({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMGNhciUyMGV4cGxvZGluZyUyMGludG8lMjBjb2xvcmZ1bCUyMGR1c3QlMjI=",highlighted:'prompt = <span class="hljs-string">&quot;A car exploding into colorful dust&quot;</span>'}}),vt=new E({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyZWRpdG9yaWFsJTIwcGhvdG9ncmFwaHklMjBvZiUyMGFuJTIwb3JnYW5pYyUyQyUyMGFsbW9zdCUyMGxpcXVpZCUyMHNtb2tlJTIwc3R5bGUlMjBhcm1jaGFpciUyMg==",highlighted:'prompt = <span class="hljs-string">&quot;editorial photography of an organic, almost liquid smoke style armchair&quot;</span>'}}),Tt=new E({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>'}}),Jt=new ae({}),It=new E({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>))`}}),Ut=new E({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>)`}}),Jn=new qi({props:{$$slots:{default:[Uy]},$$scope:{ctx:B}}}),jt=new ae({}),Pt=new E({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreUlucGFpbnRQaXBlbGluZSUyQyUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQWltcG9ydCUyMHRvcmNoJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwaGF0JTIyJTBBcHJpb3Jfb3V0cHV0JTIwJTNEJTIwcGlwZV9wcmlvcihwcm9tcHQpJTBBJTBBcGlwZSUyMCUzRCUyMEthbmRpbnNreUlucGFpbnRQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJ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2hhdC5wbmclMjIp",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>)`}}),jn=new qi({props:{$$slots:{default:[jy]},$$scope:{ctx:B}}}),$t=new E({props:{code:"JTIzJTIwRm9yJTIwUElMJTIwaW5wdXQlMEFpbXBvcnQlMjBQSUwuSW1hZ2VPcHMlMEFtYXNrJTIwJTNEJTIwUElMLkltYWdlT3BzLmludmVydChtYXNrKSUwQSUwQSUyMyUyMEZvciUyMFB5VG9yY2glMjBhbmQlMjBOdW1weSUyMGlucHV0JTBBbWFzayUyMCUzRCUyMDElMjAtJTIwbWFzaw==",highlighted:`<span class="hljs-comment"># For PIL input</span>
<span class="hljs-keyword">import</span> PIL.ImageOps
mask = PIL.ImageOps.invert(mask)

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