import{S as n_,i as t_,s as a_,e as a,k as d,w as _,t as i,M as s_,c as s,d as t,m as c,a as r,x as b,h as o,b as p,N as _n,G as n,g as m,y as w,q as k,o as M,B as v,v as i_,L as Te}from"../../../chunks/vendor-hf-doc-builder.js";import{T as Ls}from"../../../chunks/Tip-hf-doc-builder.js";import{D as N}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as W}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as oe}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ut}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function o_(B){let f,I,y,h,T,u,g,G,J,P;return J=new W({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=i("By default, the text-to-image pipeline use "),y=a("a"),h=i("DDIMScheduler"),T=i(", you can change the scheduler to "),u=a("a"),g=i("DDPMScheduler"),G=d(),_(J.$$.fragment),this.h()},l(j){f=s(j,"P",{});var U=r(f);I=o(U,"By default, the text-to-image pipeline use "),y=s(U,"A",{href:!0});var z=r(y);h=o(z,"DDIMScheduler"),z.forEach(t),T=o(U,", you can change the scheduler to "),u=s(U,"A",{href:!0});var K=r(u);g=o(K,"DDPMScheduler"),K.forEach(t),U.forEach(t),G=c(j),b(J.$$.fragment,j),this.h()},h(){p(y,"href","/docs/diffusers/v0.20.0/en/api/schedulers/ddim#diffusers.DDIMScheduler"),p(u,"href","/docs/diffusers/v0.20.0/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:Te,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 r_(B){let f,I,y,h,T,u,g,G,J,P,j,U,z,K,Y,F,D,S,R,O,V,re,ee,X,$,ne;return $=new W({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=i("The text-to-image pipeline expects both "),y=a("code"),h=i("image_embeds"),T=i(", "),u=a("code"),g=i("negative_image_embeds"),G=i(` and the original
`),J=a("code"),P=i("prompt"),j=i(` as the text-to-image pipeline uses another text encoder to better guide the second diffusion
process of `),U=a("code"),z=i("t2i_pipe"),K=i("."),Y=d(),F=a("p"),D=i("By default, the prior returns unconditioned negative image embeddings corresponding to the negative prompt of "),S=a("code"),R=i('""'),O=i(`.
For better results, you can also pass a `),V=a("code"),re=i("negative_prompt"),ee=i(` to the prior. This will increase the effective batch size
of the prior by a factor of 2.`),X=d(),_($.$$.fragment)},l(C){f=s(C,"P",{});var E=r(f);I=o(E,"The text-to-image pipeline expects both "),y=s(E,"CODE",{});var le=r(y);h=o(le,"image_embeds"),le.forEach(t),T=o(E,", "),u=s(E,"CODE",{});var te=r(u);g=o(te,"negative_image_embeds"),te.forEach(t),G=o(E,` and the original
`),J=s(E,"CODE",{});var ge=r(J);P=o(ge,"prompt"),ge.forEach(t),j=o(E,` as the text-to-image pipeline uses another text encoder to better guide the second diffusion
process of `),U=s(E,"CODE",{});var fe=r(U);z=o(fe,"t2i_pipe"),fe.forEach(t),K=o(E,"."),E.forEach(t),Y=c(C),F=s(C,"P",{});var L=r(F);D=o(L,"By default, the prior returns unconditioned negative image embeddings corresponding to the negative prompt of "),S=s(L,"CODE",{});var x=r(S);R=o(x,'""'),x.forEach(t),O=o(L,`.
For better results, you can also pass a `),V=s(L,"CODE",{});var Z=r(V);re=o(Z,"negative_prompt"),Z.forEach(t),ee=o(L,` to the prior. This will increase the effective batch size
of the prior by a factor of 2.`),L.forEach(t),X=c(C),b($.$$.fragment,C)},m(C,E){m(C,f,E),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,E),m(C,F,E),n(F,D),n(F,S),n(S,R),n(F,O),n(F,V),n(V,re),n(F,ee),m(C,X,E),w($,C,E),ne=!0},p:Te,i(C){ne||(k($.$$.fragment,C),ne=!0)},o(C){M($.$$.fragment,C),ne=!1},d(C){C&&t(f),C&&t(Y),C&&t(F),C&&t(X),v($,C)}}}function l_(B){let f,I,y,h,T,u,g,G,J,P,j,U,z,K,Y,F,D,S,R,O,V,re,ee,X,$,ne,C,E,le,te,ge,fe,L,x;return P=new W({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvclRleHQySW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXBpcGUlMjAlM0QlMjBBdXRvUGlwZWxpbmVGb3JUZXh0MkltYWdlLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgp",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()`}}),L=new W({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=i("We also provide an end-to-end Kandinsky pipeline "),y=a("a"),h=i("KandinskyCombinedPipeline"),T=i(", 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("a"),g=i("from_pretrained()"),G=i(" method"),J=d(),_(P.$$.fragment),j=d(),U=a("p"),z=i("Under the hood, it will automatically load both "),K=a("a"),Y=i("KandinskyPriorPipeline"),F=i(" and "),D=a("a"),S=i("KandinskyPipeline"),R=i(". 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 "),O=a("code"),V=i("guidance_scale"),re=i(" and "),ee=a("code"),X=i("num_inference_steps"),$=i(" for the prior pipeline with the "),ne=a("code"),C=i("prior_guidance_scale"),E=i(" and "),le=a("code"),te=i("prior_num_inference_steps"),ge=i(" arguments."),fe=d(),_(L.$$.fragment),this.h()},l(Z){f=s(Z,"P",{});var Q=r(f);I=o(Q,"We also provide an end-to-end Kandinsky pipeline "),y=s(Q,"A",{href:!0});var Ra=r(y);h=o(Ra,"KandinskyCombinedPipeline"),Ra.forEach(t),T=o(Q,", 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=s(Q,"A",{href:!0});var Xa=r(u);g=o(Xa,"from_pretrained()"),Xa.forEach(t),G=o(Q," method"),Q.forEach(t),J=c(Z),b(P.$$.fragment,Z),j=c(Z),U=s(Z,"P",{});var q=r(U);z=o(q,"Under the hood, it will automatically load both "),K=s(q,"A",{href:!0});var Qa=r(K);Y=o(Qa,"KandinskyPriorPipeline"),Qa.forEach(t),F=o(q," and "),D=s(q,"A",{href:!0});var qa=r(D);S=o(qa,"KandinskyPipeline"),qa.forEach(t),R=o(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 "),O=s(q,"CODE",{});var Ze=r(O);V=o(Ze,"guidance_scale"),Ze.forEach(t),re=o(q," and "),ee=s(q,"CODE",{});var Sa=r(ee);X=o(Sa,"num_inference_steps"),Sa.forEach(t),$=o(q," for the prior pipeline with the "),ne=s(q,"CODE",{});var za=r(ne);C=o(za,"prior_guidance_scale"),za.forEach(t),E=o(q," and "),le=s(q,"CODE",{});var $e=r(le);te=o($e,"prior_num_inference_steps"),$e.forEach(t),ge=o(q," arguments."),q.forEach(t),fe=c(Z),b(L.$$.fragment,Z),this.h()},h(){p(y,"href","/docs/diffusers/v0.20.0/en/api/pipelines/kandinsky#diffusers.KandinskyCombinedPipeline"),p(u,"href","/docs/diffusers/v0.20.0/en/api/pipelines/auto_pipeline#diffusers.AutoPipelineForText2Image.from_pretrained"),p(K,"href","/docs/diffusers/v0.20.0/en/api/pipelines/kandinsky#diffusers.KandinskyPriorPipeline"),p(D,"href","/docs/diffusers/v0.20.0/en/api/pipelines/kandinsky#diffusers.KandinskyPipe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IwYmFkJTIwcXVhbGl0eSUyMiUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRkNvbXBWaXMlMkZzdGFibGUtZGlmZnVzaW9uJTJGbWFpbiUyRmFzc2V0cyUyRnN0YWJsZS1zYW1wbGVzJTJGaW1nMmltZyUyRnNrZXRjaC1tb3VudGFpbnMtaW5wdXQuanBnJTIyJTBBJTIwJTBBcmVzcG9uc2UlMjAlM0QlMjByZXF1ZXN0cy5nZXQodXJsKSUwQW9yaWdpbmFsX2ltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihCeXRlc0lPKHJlc3BvbnNlLmNvbnRlbnQpKS5jb252ZXJ0KCUyMlJHQiUyMiklMEFvcmlnaW5hbF9pbWFnZS50aHVtYm5haWwoKDc2OCUyQyUyMDc2OCkpJTBBJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUzRHByb21wdCUyQyUyMGltYWdlJTNEb3JpZ2luYWxfaW1hZ2UlMkMlMjBzdHJlbmd0aCUzRDAuMykuaW1hZ2VzJTVCMCU1RA==",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=i("You can also use the "),y=a("a"),h=i("KandinskyImg2ImgCombinedPipeline"),T=i(" for end-to-end image-to-image generation with Kandinsky 2.1"),u=d(),_(g.$$.fragment),this.h()},l(J){f=s(J,"P",{});var P=r(f);I=o(P,"You can also use the "),y=s(P,"A",{href:!0});var j=r(y);h=o(j,"KandinskyImg2ImgCombinedPipeline"),j.forEach(t),T=o(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.20.0/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:Te,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 d_(B){let f,I,y,h,T,u,g,G;return g=new W({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=i("To use the "),y=a("a"),h=i("KandinskyInpaintCombinedPipeline"),T=i(" to perform end-to-end image inpainting generation, you can run below code instead"),u=d(),_(g.$$.fragment),this.h()},l(J){f=s(J,"P",{});var P=r(f);I=o(P,"To use the "),y=s(P,"A",{href:!0});var j=r(y);h=o(j,"KandinskyInpaintCombinedPipeline"),j.forEach(t),T=o(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.20.0/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:Te,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 c_(B){let f,I,y,h,T,u,g,G,J,P,j,U,z,K,Y,F,D,S,R,O,V,re,ee;return{c(){f=a("p"),I=i("To generate images directly from a single pipeline, you can use "),y=a("a"),h=i("KandinskyCombinedPipeline"),T=i(", "),u=a("a"),g=i("KandinskyImg2ImgCombinedPipeline"),G=i(", "),J=a("a"),P=i("KandinskyInpaintCombinedPipeline"),j=i(`.
These combined pipelines wrap the `),U=a("a"),z=i("KandinskyPriorPipeline"),K=i(" and "),Y=a("a"),F=i("KandinskyPipeline"),D=i(", "),S=a("a"),R=i("KandinskyImg2ImgPipeline"),O=i(", "),V=a("a"),re=i("KandinskyInpaintPipeline"),ee=i(` respectively into a single
pipeline for a simpler user experience`),this.h()},l(X){f=s(X,"P",{});var $=r(f);I=o($,"To generate images directly from a single pipeline, you can use "),y=s($,"A",{href:!0});var ne=r(y);h=o(ne,"KandinskyCombinedPipeline"),ne.forEach(t),T=o($,", "),u=s($,"A",{href:!0});var C=r(u);g=o(C,"KandinskyImg2ImgCombinedPipeline"),C.forEach(t),G=o($,", "),J=s($,"A",{href:!0});var E=r(J);P=o(E,"KandinskyInpaintCombinedPipeline"),E.forEach(t),j=o($,`.
These combined pipelines wrap the `),U=s($,"A",{href:!0});var le=r(U);z=o(le,"KandinskyPriorPipeline"),le.forEach(t),K=o($," and "),Y=s($,"A",{href:!0});var te=r(Y);F=o(te,"KandinskyPipeline"),te.forEach(t),D=o($,", "),S=s($,"A",{href:!0});var ge=r(S);R=o(ge,"KandinskyImg2ImgPipeline"),ge.forEach(t),O=o($,", "),V=s($,"A",{href:!0});var fe=r(V);re=o(fe,"KandinskyInpaintPipeline"),fe.forEach(t),ee=o($,` respectively into a single
pipeline for a simpler user experience`),$.forEach(t),this.h()},h(){p(y,"href","/docs/diffusers/v0.20.0/en/api/pipelines/kandinsky#diffusers.KandinskyCombinedPipeline"),p(u,"href","/docs/diffusers/v0.20.0/en/api/pipelines/kandinsky#diffusers.KandinskyImg2ImgCombinedPipeline"),p(J,"href","/docs/diffusers/v0.20.0/en/api/pipelines/kandinsky#diffusers.KandinskyInpaintCombinedPipeline"),p(U,"href","/docs/diffusers/v0.20.0/en/api/pipelines/kandinsky#diffusers.KandinskyPriorPipeline"),p(Y,"href","/docs/diffusers/v0.20.0/en/api/pipelines/kandinsky#diffusers.KandinskyPipeline"),p(S,"href","/docs/diffusers/v0.20.0/en/api/pipelines/kandinsky#diffusers.KandinskyImg2ImgPipeline"),p(V,"href","/docs/diffusers/v0.20.0/en/api/pipelines/kandinsky#di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wbmVnYXRpdmVfaW1hZ2VfZW1iZWRzJTNEbmVnYXRpdmVfaW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMTAwJTJDJTBBKS5pbWFnZXMlMEElMEFpbWFnZSU1QjAlNUQuc2F2ZSglMjJjYXQucG5nJTIyKQ==",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=i("Examples:"),y=d(),_(h.$$.fragment)},l(u){f=s(u,"P",{});var g=r(f);I=o(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:Te,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 u_(B){let f,I,y,h,T;return h=new W({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUlMkMlMjBLYW5kaW5za3lQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBaW1wb3J0JTIwUElMJTBBJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdG9yY2h2aXNpb24lMjBpbXBvcnQlMjB0cmFuc2Zvcm1zJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEFpbWcxJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNv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FnZV9lbWJlZHMlM0R6ZXJvX2ltYWdlX2VtYiUyQyUwQSUyMCUyMCUyMCUyMGhlaWdodCUzRDc2OCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDE1MCUyQyUwQSkuaW1hZ2VzJTVCMCU1RCUwQSUwQWltYWdlLnNhdmUoJTIyc3RhcnJ5X2NhdC5wbmclMjIp",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=i("Examples:"),y=d(),_(h.$$.fragment)},l(u){f=s(u,"P",{});var g=r(f);I=o(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:Te,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 f_(B){let f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wJTJDJTBBKS5pbWFnZXMlMEElMEFpbWFnZSU1QjAlNUQuc2F2ZSglMjJjYXQucG5nJTIyKQ==",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=i("Examples:"),y=d(),_(h.$$.fragment)},l(u){f=s(u,"P",{});var g=r(f);I=o(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:Te,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 h_(B){let f,I,y,h,T;return h=new W({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=i("Examples:"),y=d(),_(h.$$.fragment)},l(u){f=s(u,"P",{});var g=r(f);I=o(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:Te,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 g_(B){let f,I,y,h,T;return h=new W({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreUlucGFpbnRQaXBlbGluZSUyQyUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQWltcG9ydCUyMHRvcmNoJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwaGF0JTIyJTBBaW1hZ2VfZW1iJTJDJTIwemVyb19pbWFnZV9lbWIlMjAlM0QlMjBwaXBlX3ByaW9yKHByb21wdCUyQyUyMHJldHVybl9kaWN0JTNERmFsc2UpJTBBJTBBcGlwZSUyMCUzRCUyMEthbmRpbnNreUlucGFpbnRQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIya2FuZGluc2t5LWNvbW11bml0eS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C5wbmclMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyInpaintPipeline, KandinskyPriorPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a hat&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_emb, zero_image_emb = pipe_prior(prompt, return_dict=<span class="hljs-literal">False</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>mask = np.zeros((<span class="hljs-number">768</span>, <span class="hljs-number">768</span>), dtype=np.float32)
<span class="hljs-meta">&gt;&gt;&gt; </span>mask[:<span class="hljs-number">250</span>, <span class="hljs-number">250</span>:-<span class="hljs-number">250</span>] = <span class="hljs-number">1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>out = pipe(
<span class="hljs-meta">... </span>    prompt,
<span class="hljs-meta">... </span>    image=init_image,
<span class="hljs-meta">... </span>    mask_image=mask,
<span class="hljs-meta">... </span>    image_embeds=image_emb,
<span class="hljs-meta">... </span>    negative_image_embeds=zero_image_emb,
<span class="hljs-meta">... </span>    height=<span class="hljs-number">768</span>,
<span class="hljs-meta">... </span>    width=<span class="hljs-number">768</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">50</span>,
<span class="hljs-meta">... </span>)

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