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