import{S as Ug,i as jg,s as Pg,e as a,k as m,w as _,t as o,M as Zg,c as s,d as t,m as u,a as i,x as b,h as r,b as p,N as tn,G as n,g as d,y as k,q as w,o as M,B as v,v as Wg,L as ye}from"../../../chunks/vendor-hf-doc-builder.js";import{T as Ps}from"../../../chunks/Tip-hf-doc-builder.js";import{D as H}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as E}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as se}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as An}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function $g(B){let f,I,y,g,T,c,h,G,J,P;return J=new E({props:{code:"c2NoZWR1bGVyJTIwJTNEJTIwRERQTVNjaGVkdWxlci5mcm9tX3ByZXRyYWluZWQoJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTElMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJkZHBtX3NjaGVkdWxlciUyMiklMEF0MmlfcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMSUyMiUyQyUyMHNjaGVkdWxlciUzRHNjaGVkdWxlciUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEF0MmlfcGlwZS50byglMjJjdWRhJTIyKQ==",highlighted:`scheduler = DDPMScheduler.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1&quot;</span>, subfolder=<span class="hljs-string">&quot;ddpm_scheduler&quot;</span>)
t2i_pipe = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1&quot;</span>, scheduler=scheduler, torch_dtype=torch.float16
)
t2i_pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),{c(){f=a("p"),I=o("By default, the text-to-image pipeline use "),y=a("a"),g=o("DDIMScheduler"),T=o(", you can change the scheduler to "),c=a("a"),h=o("DDPMScheduler"),G=m(),_(J.$$.fragment),this.h()},l(j){f=s(j,"P",{});var U=i(f);I=r(U,"By default, the text-to-image pipeline use "),y=s(U,"A",{href:!0});var z=i(y);g=r(z,"DDIMScheduler"),z.forEach(t),T=r(U,", you can change the scheduler to "),c=s(U,"A",{href:!0});var K=i(c);h=r(K,"DDPMScheduler"),K.forEach(t),U.forEach(t),G=u(j),b(J.$$.fragment,j),this.h()},h(){p(y,"href","/docs/diffusers/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler"),p(c,"href","/docs/diffusers/v0.21.0/en/api/schedulers/ddpm#diffusers.DDPMScheduler")},m(j,U){d(j,f,U),n(f,I),n(f,y),n(y,g),n(f,T),n(f,c),n(c,h),d(j,G,U),k(J,j,U),P=!0},p:ye,i(j){P||(w(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 Gg(B){let f,I,y,g,T,c,h,G,J,P,j,U,z,K,Y,F,A,S,V,O,N,ie,ee,R,W,ne;return W=new E({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMGFsaWVuJTIwY2hlZXNlYnVyZ2VyJTIwY3JlYXR1cmUlMjBlYXRpbmclMjBpdHNlbGYlMkMlMjBjbGF5bWF0aW9uJTJDJTIwY2luZW1hdGljJTJDJTIwbW9vZHklMjBsaWdodGluZyUyMiUwQW5lZ2F0aXZlX3Byb21wdCUyMCUzRCUyMCUyMmxvdyUyMHF1YWxpdHklMkMlMjBiYWQlMjBxdWFsaXR5JTIyJTBBJTBBaW1hZ2VfZW1iZWRzJTJDJTIwbmVnYXRpdmVfaW1hZ2VfZW1iZWRzJTIwJTNEJTIwcGlwZV9wcmlvcihwcm9tcHQlMkMlMjBuZWdhdGl2ZV9wcm9tcHQlMkMlMjBndWlkYW5jZV9zY2FsZSUzRDEuMCkudG9fdHVwbGUoKQ==",highlighted:`prompt = <span class="hljs-string">&quot;A alien cheeseburger creature eating itself, claymation, cinematic, moody lighting&quot;</span>
negative_prompt = <span class="hljs-string">&quot;low quality, bad quality&quot;</span>

image_embeds, negative_image_embeds = pipe_prior(prompt, negative_prompt, guidance_scale=<span class="hljs-number">1.0</span>).to_tuple()`}}),{c(){f=a("p"),I=o("The text-to-image pipeline expects both "),y=a("code"),g=o("image_embeds"),T=o(", "),c=a("code"),h=o("negative_image_embeds"),G=o(` and the original
`),J=a("code"),P=o("prompt"),j=o(` as the text-to-image pipeline uses another text encoder to better guide the second diffusion
process of `),U=a("code"),z=o("t2i_pipe"),K=o("."),Y=m(),F=a("p"),A=o("By default, the prior returns unconditioned negative image embeddings corresponding to the negative prompt of "),S=a("code"),V=o('""'),O=o(`.
For better results, you can also pass a `),N=a("code"),ie=o("negative_prompt"),ee=o(` to the prior. This will increase the effective batch size
of the prior by a factor of 2.`),R=m(),_(W.$$.fragment)},l($){f=s($,"P",{});var C=i(f);I=r(C,"The text-to-image pipeline expects both "),y=s(C,"CODE",{});var oe=i(y);g=r(oe,"image_embeds"),oe.forEach(t),T=r(C,", "),c=s(C,"CODE",{});var te=i(c);h=r(te,"negative_image_embeds"),te.forEach(t),G=r(C,` and the original
`),J=s(C,"CODE",{});var ue=i(J);P=r(ue,"prompt"),ue.forEach(t),j=r(C,` as the text-to-image pipeline uses another text encoder to better guide the second diffusion
process of `),U=s(C,"CODE",{});var ce=i(U);z=r(ce,"t2i_pipe"),ce.forEach(t),K=r(C,"."),C.forEach(t),Y=u($),F=s($,"P",{});var q=i(F);A=r(q,"By default, the prior returns unconditioned negative image embeddings corresponding to the negative prompt of "),S=s(q,"CODE",{});var x=i(S);V=r(x,'""'),x.forEach(t),O=r(q,`.
For better results, you can also pass a `),N=s(q,"CODE",{});var Z=i(N);ie=r(Z,"negative_prompt"),Z.forEach(t),ee=r(q,` to the prior. This will increase the effective batch size
of the prior by a factor of 2.`),q.forEach(t),R=u($),b(W.$$.fragment,$)},m($,C){d($,f,C),n(f,I),n(f,y),n(y,g),n(f,T),n(f,c),n(c,h),n(f,G),n(f,J),n(J,P),n(f,j),n(f,U),n(U,z),n(f,K),d($,Y,C),d($,F,C),n(F,A),n(F,S),n(S,V),n(F,O),n(F,N),n(N,ie),n(F,ee),d($,R,C),k(W,$,C),ne=!0},p:ye,i($){ne||(w(W.$$.fragment,$),ne=!0)},o($){M(W.$$.fragment,$),ne=!1},d($){$&&t(f),$&&t(Y),$&&t(F),$&&t(R),v(W,$)}}}function Cg(B){let f,I,y,g,T,c,h,G,J,P,j,U,z,K,Y,F,A,S,V,O,N,ie,ee,R,W,ne,$,C,oe,te,ue,ce,q,x;return P=new E({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()`}}),q=new E({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMGFsaWVuJTIwY2hlZXNlYnVyZ2VyJTIwY3JlYXR1cmUlMjBlYXRpbmclMjBpdHNlbGYlMkMlMjBjbGF5bWF0aW9uJTJDJTIwY2luZW1hdGljJTJDJTIwbW9vZHklMjBsaWdodGluZyUyMiUwQW5lZ2F0aXZlX3Byb21wdCUyMCUzRCUyMCUyMmxvdyUyMHF1YWxpdHklMkMlMjBiYWQlMjBxdWFsaXR5JTIyJTBBJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUzRHByb21wdCUyQyUyMG5lZ2F0aXZlX3Byb21wdCUzRG5lZ2F0aXZlX3Byb21wdCUyQyUyMHByaW9yX2d1aWRhbmNlX3NjYWxlJTIwJTNEMS4wJTJDJTIwZ3VpZGFuY2Vfc2NhY2xlJTIwJTNEJTIwNC4wJTJDJTIwaGVpZ2h0JTNENzY4JTJDJTIwd2lkdGglM0Q3NjgpLmltYWdlcyU1QjAlNUQ=",highlighted:`prompt = <span class="hljs-string">&quot;A alien cheeseburger creature eating itself, claymation, cinematic, moody lighting&quot;</span>
negative_prompt = <span class="hljs-string">&quot;low quality, bad quality&quot;</span>

image = pipe(prompt=prompt, negative_prompt=negative_prompt, prior_guidance_scale =<span class="hljs-number">1.0</span>, guidance_scacle = <span class="hljs-number">4.0</span>, height=<span class="hljs-number">768</span>, width=<span class="hljs-number">768</span>).images[<span class="hljs-number">0</span>]`}}),{c(){f=a("p"),I=o("We also provide an end-to-end Kandinsky pipeline "),y=a("a"),g=o("KandinskyCombinedPipeline"),T=o(", which combines both the prior pipeline and text-to-image pipeline, and lets you perform inference in a single step. You can create the combined pipeline with the "),c=a("a"),h=o("from_pretrained()"),G=o(" method"),J=m(),_(P.$$.fragment),j=m(),U=a("p"),z=o("Under the hood, it will automatically load both "),K=a("a"),Y=o("KandinskyPriorPipeline"),F=o(" and "),A=a("a"),S=o("KandinskyPipeline"),V=o(". To generate images, you no longer need to call both pipelines and pass the outputs from one to another. You only need to call the combined pipeline once. You can set different "),O=a("code"),N=o("guidance_scale"),ie=o(" and "),ee=a("code"),R=o("num_inference_steps"),W=o(" for the prior pipeline with the "),ne=a("code"),$=o("prior_guidance_scale"),C=o(" and "),oe=a("code"),te=o("prior_num_inference_steps"),ue=o(" arguments."),ce=m(),_(q.$$.fragment),this.h()},l(Z){f=s(Z,"P",{});var X=i(f);I=r(X,"We also provide an end-to-end Kandinsky pipeline "),y=s(X,"A",{href:!0});var ka=i(y);g=r(ka,"KandinskyCombinedPipeline"),ka.forEach(t),T=r(X,", which combines both the prior pipeline and text-to-image pipeline, and lets you perform inference in a single step. You can create the combined pipeline with the "),c=s(X,"A",{href:!0});var wa=i(c);h=r(wa,"from_pretrained()"),wa.forEach(t),G=r(X," method"),X.forEach(t),J=u(Z),b(P.$$.fragment,Z),j=u(Z),U=s(Z,"P",{});var Q=i(U);z=r(Q,"Under the hood, it will automatically load both "),K=s(Q,"A",{href:!0});var Ma=i(K);Y=r(Ma,"KandinskyPriorPipeline"),Ma.forEach(t),F=r(Q," and "),A=s(Q,"A",{href:!0});var va=i(A);S=r(va,"KandinskyPipeline"),va.forEach(t),V=r(Q,". To generate images, you no longer need to call both pipelines and pass the outputs from one to another. You only need to call the combined pipeline once. You can set different "),O=s(Q,"CODE",{});var we=i(O);N=r(we,"guidance_scale"),we.forEach(t),ie=r(Q," and "),ee=s(Q,"CODE",{});var Ta=i(ee);R=r(Ta,"num_inference_steps"),Ta.forEach(t),W=r(Q," for the prior pipeline with the "),ne=s(Q,"CODE",{});var Ja=i(ne);$=r(Ja,"prior_guidance_scale"),Ja.forEach(t),C=r(Q," and "),oe=s(Q,"CODE",{});var Me=i(oe);te=r(Me,"prior_num_inference_steps"),Me.forEach(t),ue=r(Q," arguments."),Q.forEach(t),ce=u(Z),b(q.$$.fragment,Z),this.h()},h(){p(y,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky#diffusers.KandinskyCombinedPipeline"),p(c,"href","/docs/diffusers/v0.21.0/en/api/pipelines/auto_pipeline#diffusers.AutoPipelineForText2Image.from_pretrained"),p(K,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky#diffusers.KandinskyPriorPipeline"),p(A,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky#diffusers.KandinskyPipeline")},m(Z,X){d(Z,f,X),n(f,I),n(f,y),n(y,g),n(f,T),n(f,c),n(c,h),n(f,G),d(Z,J,X),k(P,Z,X),d(Z,j,X),d(Z,U,X),n(U,z),n(U,K),n(K,Y),n(U,F),n(U,A),n(A,S),n(U,V),n(U,O),n(O,N),n(U,ie),n(U,ee),n(ee,R),n(U,W),n(U,ne),n(ne,$),n(U,C),n(U,oe),n(oe,te),n(U,ue),d(Z,ce,X),k(q,Z,X),x=!0},p:ye,i(Z){x||(w(P.$$.fragment,Z),w(q.$$.fragment,Z),x=!0)},o(Z){M(P.$$.fragment,Z),M(q.$$.fragment,Z),x=!1},d(Z){Z&&t(f),Z&&t(J),v(P,Z),Z&&t(j),Z&&t(U),Z&&t(ce),v(q,Z)}}}function Eg(B){let f,I,y,g,T,c,h,G;return h=new E({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvckltYWdlMkltYWdlJTBBaW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjBvcyUwQSUwQXBpcGUlMjAlM0QlMjBBdXRvUGlwZWxpbmVGb3JJbWFnZTJJbWFnZS5mcm9tX3ByZXRyYWluZWQoJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTElMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBcGlwZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkElMjBmYW50YXN5JTIwbGFuZHNjYXBlJTJDJTIwQ2luZW1hdGljJTIwbGlnaHRpbmclMjIlMEFuZWdhdGl2ZV9wcm9tcHQlMjAlM0QlMjAlMjJsb3clMjBxdWFsaXR5JTJDJTIwYmFkJTIwcXVhbGl0eSUyMiUwQSUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRkNvbXBWaXMlMkZzdGFibGUtZGlmZnVzaW9uJTJGbWFpbiUyRmFzc2V0cyUyRnN0YWJsZS1zYW1wbGVzJTJGaW1nMmltZyUyRnNrZXRjaC1tb3VudGFpbnMtaW5wdXQuanBnJTIyJTBBJTIwJTBBcmVzcG9uc2UlMjAlM0QlMjByZXF1ZXN0cy5nZXQodXJsKSUwQW9yaWdpbmFsX2ltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihCeXRlc0lPKHJlc3BvbnNlLmNvbnRlbnQpKS5jb252ZXJ0KCUyMlJHQiUyMiklMEFvcmlnaW5hbF9pbWFnZS50aHVtYm5haWwoKDc2OCUyQyUyMDc2OCkpJTBBJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUzRHByb21wdCUyQyUyMGltYWdlJTNEb3JpZ2luYWxfaW1hZ2UlMkMlMjBzdHJlbmd0aCUzRDAuMykuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForImage2Image
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> requests
<span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> os

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

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

url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg&quot;</span>
 
response = requests.get(url)
original_image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
original_image.thumbnail((<span class="hljs-number">768</span>, <span class="hljs-number">768</span>))

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

pipe = AutoPipelineForInpainting.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1-inpaint&quot;</span>, torch_dtype=torch.float16)
pipe.enable_model_cpu_offload()
image = pipe(prompt=prompt, image=original_image, mask_image=mask).images[<span class="hljs-number">0</span>]`}}),{c(){f=a("p"),I=o("To use the "),y=a("a"),g=o("KandinskyInpaintCombinedPipeline"),T=o(" to perform end-to-end image inpainting generation, you can run below code instead"),c=m(),_(h.$$.fragment),this.h()},l(J){f=s(J,"P",{});var P=i(f);I=r(P,"To use the "),y=s(P,"A",{href:!0});var j=i(y);g=r(j,"KandinskyInpaintCombinedPipeline"),j.forEach(t),T=r(P," to perform end-to-end image inpainting generation, you can run below code instead"),P.forEach(t),c=u(J),b(h.$$.fragment,J),this.h()},h(){p(y,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky#diffusers.KandinskyInpaintCombinedPipeline")},m(J,P){d(J,f,P),n(f,I),n(f,y),n(y,g),n(f,T),d(J,c,P),k(h,J,P),G=!0},p:ye,i(J){G||(w(h.$$.fragment,J),G=!0)},o(J){M(h.$$.fragment,J),G=!1},d(J){J&&t(f),J&&t(c),v(h,J)}}}function xg(B){let f,I,y,g,T,c,h,G,J,P,j,U,z,K,Y,F,A,S,V,O,N,ie,ee;return{c(){f=a("p"),I=o("To generate images directly from a single pipeline, you can use "),y=a("a"),g=o("KandinskyCombinedPipeline"),T=o(", "),c=a("a"),h=o("KandinskyImg2ImgCombinedPipeline"),G=o(", "),J=a("a"),P=o("KandinskyInpaintCombinedPipeline"),j=o(`.
These combined pipelines wrap the `),U=a("a"),z=o("KandinskyPriorPipeline"),K=o(" and "),Y=a("a"),F=o("KandinskyPipeline"),A=o(", "),S=a("a"),V=o("KandinskyImg2ImgPipeline"),O=o(", "),N=a("a"),ie=o("KandinskyInpaintPipeline"),ee=o(` respectively into a single
pipeline for a simpler user experience`),this.h()},l(R){f=s(R,"P",{});var W=i(f);I=r(W,"To generate images directly from a single pipeline, you can use "),y=s(W,"A",{href:!0});var ne=i(y);g=r(ne,"KandinskyCombinedPipeline"),ne.forEach(t),T=r(W,", "),c=s(W,"A",{href:!0});var $=i(c);h=r($,"KandinskyImg2ImgCombinedPipeline"),$.forEach(t),G=r(W,", "),J=s(W,"A",{href:!0});var C=i(J);P=r(C,"KandinskyInpaintCombinedPipeline"),C.forEach(t),j=r(W,`.
These combined pipelines wrap the `),U=s(W,"A",{href:!0});var oe=i(U);z=r(oe,"KandinskyPriorPipeline"),oe.forEach(t),K=r(W," and "),Y=s(W,"A",{href:!0});var te=i(Y);F=r(te,"KandinskyPipeline"),te.forEach(t),A=r(W,", "),S=s(W,"A",{href:!0});var ue=i(S);V=r(ue,"KandinskyImg2ImgPipeline"),ue.forEach(t),O=r(W,", "),N=s(W,"A",{href:!0});var ce=i(N);ie=r(ce,"KandinskyInpaintPipeline"),ce.forEach(t),ee=r(W,` respectively into a single
pipeline for a simpler user experience`),W.forEach(t),this.h()},h(){p(y,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky#diffusers.KandinskyCombinedPipeline"),p(c,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky#diffusers.KandinskyImg2ImgCombinedPipeline"),p(J,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky#diffusers.KandinskyInpaintCombinedPipeline"),p(U,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky#diffusers.KandinskyPriorPipeline"),p(Y,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky#diffusers.KandinskyPipeline"),p(S,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky#diffusers.KandinskyImg2ImgPipeline"),p(N,"href","/docs/diffusers/v0.21.0/en/api/pipelines/kandinsky#diffusers.KandinskyInpaintPipeline")},m(R,W){d(R,f,W),n(f,I),n(f,y),n(y,g),n(f,T),n(f,c),n(c,h),n(f,G),n(f,J),n(J,P),n(f,j),n(f,U),n(U,z),n(f,K),n(f,Y),n(Y,F),n(f,A),n(f,S),n(S,V),n(f,O),n(f,N),n(N,ie),n(f,ee)},d(R){R&&t(f)}}}function Kg(B){let f,I,y,g,T;return g=new E({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVBpcGVsaW5lJTJDJTIwS2FuZGluc2t5UHJpb3JQaXBlbGluZSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLXByaW9yJTIyKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJyZWQlMjBjYXQlMkMlMjA0ayUyMHBob3RvJTIyJTBBb3V0JTIwJTNEJTIwcGlwZV9wcmlvcihwcm9tcHQpJTBBaW1hZ2VfZW1iJTIwJTNEJTIwb3V0LmltYWdlX2VtYmVkcyUwQW5lZ2F0aXZlX2ltYWdlX2VtYiUyMCUzRCUyMG91dC5uZWdhdGl2ZV9pbWFnZV9lbWJlZHMlMEElMEFwaXBlJTIwJTNEJTIwS2FuZGluc2t5UGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xJTIyKSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2VfZW1iZWRzJTNEaW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfaW1hZ2VfZW1iZWRzJTNEbmVnYXRpdmVfaW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMTAwJTJDJTBBKS5pbWFnZXMlMEElMEFpbWFnZSU1QjAlNUQuc2F2ZSglMjJjYXQucG5nJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyPipeline, KandinskyPriorPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;red cat, 4k photo&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>out = pipe_prior(prompt)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_emb = out.image_embeds
<span class="hljs-meta">&gt;&gt;&gt; </span>negative_image_emb = out.negative_image_embeds

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

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

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

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

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

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;red cat, 4k photo&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>out = pipe_prior(prompt)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_emb = out.image_embeds
<span class="hljs-meta">&gt;&gt;&gt; </span>negative_image_emb = out.negative_image_embeds

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;A red cartoon frog, 4k&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image_emb, zero_image_emb = pipe_prior(prompt, return_dict=<span class="hljs-literal">False</span>)

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>image[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;red_frog.png&quot;</span>)`}}),{c(){f=a("p"),I=o("Examples:"),y=m(),_(g.$$.fragment)},l(c){f=s(c,"P",{});var h=i(f);I=r(h,"Examples:"),h.forEach(t),y=u(c),b(g.$$.fragment,c)},m(c,h){d(c,f,h),n(f,I),d(c,y,h),k(g,c,h),T=!0},p:ye,i(c){T||(w(g.$$.fragment,c),T=!0)},o(c){M(g.$$.fragment,c),T=!1},d(c){c&&t(f),c&&t(y),v(g,c)}}}function Rg(B){let f,I,y,g,T;return g=new E({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreUlucGFpbnRQaXBlbGluZSUyQyUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQWltcG9ydCUyMHRvcmNoJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwaGF0JTIyJTBBaW1hZ2VfZW1iJTJDJTIwemVyb19pbWFnZV9lbWIlMjAlM0QlMjBwaXBlX3ByaW9yKHByb21wdCUyQyUyMHJldHVybl9kaWN0JTNERmFsc2UpJTBBJTBBcGlwZSUyMCUzRCUyMEthbmRpbnNreUlucGFpbnRQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTEtaW5wYWludCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBaW5pdF9pbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGaGYtaW50ZXJuYWwtdGVzdGluZyUyRmRpZmZ1c2Vycy1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyMiUwQSUyMCUyMCUyMCUyMCUyMiUyRmthbmRpbnNreSUyRmNhdC5wbmclMjIlMEEpJTBBJTBBbWFzayUyMCUzRCUyMG5wLnplcm9zKCg3NjglMkMlMjA3NjgpJTJDJTIwZHR5cGUlM0RucC5mbG9hdDMyKSUwQW1hc2slNUIlM0EyNTAlMkMlMjAyNTAlM0EtMjUwJTVEJTIwJTNEJTIwMSUwQSUwQW91dCUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0Rpbml0X2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwbWFza19pbWFnZSUzRG1hc2slMkMlMEElMjAlMjAlMjAlMjBpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWIlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0R6ZXJvX2ltYWdlX2VtYiUyQyUwQSUyMCUyMCUyMCUyMGhlaWdodCUzRDc2OCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTBBKSUwQSUwQWltYWdlJTIwJTNEJTIwb3V0LmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNhdF93aXRoX2hhdC5wbmclMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyInpaintPipeline, KandinskyPriorPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

t2i_pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1&quot;</span>, torch_dtype=torch.float16)
t2i_pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),on=new Ps({props:{warning:!0,$$slots:{default:[$g]},$$scope:{ctx:B}}}),it=new E({props:{code:"aW1hZ2VfZW1iZWRzJTJDJTIwbmVnYXRpdmVfaW1hZ2VfZW1iZWRzJTIwJTNEJTIwcGlwZV9wcmlvcihwcm9tcHQlMkMlMjBndWlkYW5jZV9zY2FsZSUzRDEuMCkudG9fdHVwbGUoKQ==",highlighted:'image_embeds, negative_image_embeds = pipe_prior(prompt, guidance_scale=<span class="hljs-number">1.0</span>).to_tuple()'}}),rn=new Ps({props:{warning:!0,$$slots:{default:[Gg]},$$scope:{ctx:B}}}),ot=new E({props:{code:"aW1hZ2UlMjAlM0QlMjB0MmlfcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlMkMlMjBpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWJlZHMlMkMlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0RuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlMkMlMjBoZWlnaHQlM0Q3NjglMkMlMjB3aWR0aCUzRDc2OCUwQSkuaW1hZ2VzJTVCMCU1RCUwQWltYWdlLnNhdmUoJTIyY2hlZXNlYnVyZ2VyX21vbnN0ZXIucG5nJTIyKQ==",highlighted:`image = t2i_pipe(
    prompt, image_embeds=image_embeds, negative_image_embeds=negative_image_embeds, height=<span class="hljs-number">768</span>, width=<span class="hljs-number">768</span>
).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;cheeseburger_monster.png&quot;</span>)`}}),pn=new Ps({props:{$$slots:{default:[Cg]},$$scope:{ctx:B}}}),rt=new E({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyYmlyZCUyMGV5ZSUyMHZpZXclMjBzaG90JTIwb2YlMjBhJTIwZnVsbCUyMGJvZHklMjB3b21hbiUyMHdpdGglMjBjeWFuJTIwbGlnaHQlMjBvcmFuZ2UlMjBtYWdlbnRhJTIwbWFrZXVwJTJDJTIwZGlnaXRhbCUyMGFydCUyQyUyMGxvbmclMjBicmFpZGVkJTIwaGFpciUyMGhlciUyMGZhY2UlMjBzZXBhcmF0ZWQlMjBieSUyMG1ha2V1cCUyMGluJTIwdGhlJTIwc3R5bGUlMjBvZiUyMHlpbiUyMFlhbmclMjBzdXJyZWFsaXNtJTJDJTIwc3ltbWV0cmljYWwlMjBmYWNlJTJDJTIwcmVhbCUyMGltYWdlJTJDJTIwY29udHJhc3RpbmclMjB0b25lJTJDJTIwcGFzdGVsJTIwZ3JhZGllbnQlMjBiYWNrZ3JvdW5kJTIy",highlighted:'prompt = <span class="hljs-string">&quot;bird eye view shot of a full body woman with cyan light orange magenta makeup, digital art, long braided hair her face separated by makeup in the style of yin Yang surrealism, symmetrical face, real image, contrasting tone, pastel gradient background&quot;</span>'}}),lt=new E({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMGNhciUyMGV4cGxvZGluZyUyMGludG8lMjBjb2xvcmZ1bCUyMGR1c3QlMjI=",highlighted:'prompt = <span class="hljs-string">&quot;A car exploding into colorful dust&quot;</span>'}}),pt=new E({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyZWRpdG9yaWFsJTIwcGhvdG9ncmFwaHklMjBvZiUyMGFuJTIwb3JnYW5pYyUyQyUyMGFsbW9zdCUyMGxpcXVpZCUyMHNtb2tlJTIwc3R5bGUlMjBhcm1jaGFpciUyMg==",highlighted:'prompt = <span class="hljs-string">&quot;editorial photography of an organic, almost liquid smoke style armchair&quot;</span>'}}),dt=new E({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyYmlyZHMlMjBleWUlMjB2aWV3JTIwb2YlMjBhJTIwcXVpbHRlZCUyMHBhcGVyJTIwc3R5bGUlMjBhbGllbiUyMHBsYW5ldCUyMGxhbmRzY2FwZSUyQyUyMHZpYnJhbnQlMjBjb2xvdXJzJTJDJTIwQ2luZW1hdGljJTIwbGlnaHRpbmclMjI=",highlighted:'prompt = <span class="hljs-string">&quot;birds eye view of a quilted paper style alien planet landscape, vibrant colours, Cinematic lighting&quot;</span>'}}),ct=new se({}),mt=new E({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwcmVxdWVzdHMlMEFmcm9tJTIwaW8lMjBpbXBvcnQlMjBCeXRlc0lPJTBBJTBBJTIzJTIwZG93bmxvYWQlMjBpbWFnZSUwQXVybCUyMCUzRCUyMCUyMmh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRkNvbXBWaXMlMkZzdGFibGUtZGlmZnVzaW9uJTJGbWFpbiUyRmFzc2V0cyUyRnN0YWJsZS1zYW1wbGVzJTJGaW1nMmltZyUyRnNrZXRjaC1tb3VudGFpbnMtaW5wdXQuanBnJTIyJTBBcmVzcG9uc2UlMjAlM0QlMjByZXF1ZXN0cy5nZXQodXJsKSUwQW9yaWdpbmFsX2ltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihCeXRlc0lPKHJlc3BvbnNlLmNvbnRlbnQpKS5jb252ZXJ0KCUyMlJHQiUyMiklMEFvcmlnaW5hbF9pbWFnZSUyMCUzRCUyMG9yaWdpbmFsX2ltYWdlLnJlc2l6ZSgoNzY4JTJDJTIwNTEyKSk=",highlighted:`<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> requests
<span class="hljs-keyword">from</span> io <span class="hljs-keyword">import</span> BytesIO

<span class="hljs-comment"># download image</span>
url = <span class="hljs-string">&quot;https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg&quot;</span>
response = requests.get(url)
original_image = Image.<span class="hljs-built_in">open</span>(BytesIO(response.content)).convert(<span class="hljs-string">&quot;RGB&quot;</span>)
original_image = original_image.resize((<span class="hljs-number">768</span>, <span class="hljs-number">512</span>))`}}),ut=new E({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwS2FuZGluc2t5SW1nMkltZ1BpcGVsaW5lJTJDJTIwS2FuZGluc2t5UHJpb3JQaXBlbGluZSUwQSUwQSUyMyUyMGNyZWF0ZSUyMHByaW9yJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEElMjMlMjBjcmVhdGUlMjBpbWcyaW1nJTIwcGlwZWxpbmUlMEFwaXBlJTIwJTNEJTIwS2FuZGluc2t5SW1nMkltZ1BpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMGZhbnRhc3klMjBsYW5kc2NhcGUlMkMlMjBDaW5lbWF0aWMlMjBsaWdodGluZyUyMiUwQW5lZ2F0aXZlX3Byb21wdCUyMCUzRCUyMCUyMmxvdyUyMHF1YWxpdHklMkMlMjBiYWQlMjBxdWFsaXR5JTIyJTBBJTBBaW1hZ2VfZW1iZWRzJTJDJTIwbmVnYXRpdmVfaW1hZ2VfZW1iZWRzJTIwJTNEJTIwcGlwZV9wcmlvcihwcm9tcHQlMkMlMjBuZWdhdGl2ZV9wcm9tcHQpLnRvX3R1cGxlKCklMEElMEFvdXQlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMHByb21wdCUyQyUwQSUyMCUyMCUyMCUyMGltYWdlJTNEb3JpZ2luYWxfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWJlZHMlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0RuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlMkMlMEElMjAlMjAlMjAlMjBoZWlnaHQlM0Q3NjglMkMlMEElMjAlMjAlMjAlMjB3aWR0aCUzRDc2OCUyQyUwQSUyMCUyMCUyMCUyMHN0cmVuZ3RoJTNEMC4zJTJDJTBBKSUwQSUwQW91dC5pbWFnZXMlNUIwJTVELnNhdmUoJTIyZmFudGFzeV9sYW5kLnBuZyUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyImg2ImgPipeline, KandinskyPriorPipeline

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

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

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

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

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

out.images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;fantasy_land.png&quot;</span>)`}}),mn=new Ps({props:{$$slots:{default:[Eg]},$$scope:{ctx:B}}}),ft=new se({}),gt=new E({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreUlucGFpbnRQaXBlbGluZSUyQyUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQWltcG9ydCUyMHRvcmNoJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwaGF0JTIyJTBBcHJpb3Jfb3V0cHV0JTIwJTNEJTIwcGlwZV9wcmlvcihwcm9tcHQpJTBBJTBBcGlwZSUyMCUzRCUyMEthbmRpbnNreUlucGFpbnRQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTEtaW5wYWludCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBaW5pdF9pbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGaGYtaW50ZXJuYWwtdGVzdGluZyUyRmRpZmZ1c2Vycy1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyMiUyMCUyMiUyRmthbmRpbnNreSUyRmNhdC5wbmclMjIlMEEpJTBBJTBBbWFzayUyMCUzRCUyMG5wLnplcm9zKCg3NjglMkMlMjA3NjgpJTJDJTIwZHR5cGUlM0RucC5mbG9hdDMyKSUwQSUyMyUyMExldCdzJTIwbWFzayUyMG91dCUyMGFuJTIwYXJlYSUyMGFib3ZlJTIwdGhlJTIwY2F0J3MlMjBoZWFkJTBBbWFzayU1QiUzQTI1MCUyQyUyMDI1MCUzQS0yNTAlNUQlMjAlM0QlMjAxJTBBJTBBb3V0JTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBpbWFnZSUzRGluaXRfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBtYXNrX2ltYWdlJTNEbWFzayUyQyUwQSUyMCUyMCUyMCUyMCoqcHJpb3Jfb3V0cHV0JTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMTUwJTJDJTBBKSUwQSUwQWltYWdlJTIwJTNEJTIwb3V0LmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNhdF93aXRoX2hhdC5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyInpaintPipeline, KandinskyPriorPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

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

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

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

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

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

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

image = out.images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;cat_with_hat.png&quot;</span>)`}}),gn=new Ps({props:{$$slots:{default:[Bg]},$$scope:{ctx:B}}}),yt=new E({props:{code:"JTIzJTIwRm9yJTIwUElMJTIwaW5wdXQlMEFpbXBvcnQlMjBQSUwuSW1hZ2VPcHMlMEFtYXNrJTIwJTNEJTIwUElMLkltYWdlT3BzLmludmVydChtYXNrKSUwQSUwQSUyMyUyMEZvciUyMFB5VG9yY2glMjBhbmQlMjBOdW1weSUyMGlucHV0JTBBbWFzayUyMCUzRCUyMDElMjAtJTIwbWFzaw==",highlighted:`<span class="hljs-comment"># For PIL input</span>
<span class="hljs-keyword">import</span> PIL.ImageOps
mask = PIL.ImageOps.invert(mask)

<span class="hljs-comment"># For PyTorch and Numpy input</span>
mask = <span class="hljs-number">1</span> - mask`}}),_t=new se({}),bt=new E({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUlMkMlMjBLYW5kaW5za3lQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBaW1wb3J0JTIwUElMJTBBJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlX3ByaW9yJTIwJTNEJTIwS2FuZGluc2t5UHJpb3JQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTEtcHJpb3IlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTBBcGlwZV9wcmlvci50byglMjJjdWRhJTIyKSUwQSUwQWltZzElMjAlM0QlMjBsb2FkX2ltYWdlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmhmLWludGVybmFsLXRlc3RpbmclMkZkaWZmdXNlcnMtaW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMjIlMjAlMjIlMkZrYW5kaW5za3klMkZjYXQucG5nJTIyJTBBKSUwQSUwQWltZzIlMjAlM0QlMjBsb2FkX2ltYWdlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmhmLWludGVybmFsLXRlc3RpbmclMkZkaWZmdXNlcnMtaW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMjIlMjAlMjIlMkZrYW5kaW5za3klMkZzdGFycnlfbmlnaHQuanBlZyUyMiUwQSklMEElMEElMjMlMjBhZGQlMjBhbGwlMjB0aGUlMjBjb25kaXRpb25zJTIwd2UlMjB3YW50JTIwdG8lMjBpbnRlcnBvbGF0ZSUyQyUyMGNhbiUyMGJlJTIwZWl0aGVyJTIwdGV4dCUyMG9yJTIwaW1hZ2UlMEFpbWFnZXNfdGV4dHMlMjAlM0QlMjAlNUIlMjJhJTIwY2F0JTIyJTJDJTIwaW1nMSUyQyUyMGltZzIlNUQlMEElMEElMjMlMjBzcGVjaWZ5JTIwdGhlJTIwd2VpZ2h0cyUyMGZvciUyMGVhY2glMjBjb25kaXRpb24lMjBpbiUyMGltYWdlc190ZXh0cyUwQXdlaWdodHMlMjAlM0QlMjAlNUIwLjMlMkMlMjAwLjMlMkMlMjAwLjQlNUQlMEElMEElMjMlMjBXZSUyMGNhbiUyMGxlYXZlJTIwdGhlJTIwcHJvbXB0JTIwZW1wdHklMEFwcm9tcHQlMjAlM0QlMjAlMjIlMjIlMEFwcmlvcl9vdXQlMjAlM0QlMjBwaXBlX3ByaW9yLmludGVycG9sYXRlKGltYWdlc190ZXh0cyUyQyUyMHdlaWdodHMpJTBBJTBBcGlwZSUyMCUzRCUyMEthbmRpbnNreVBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlLnRvKCUyMmN1ZGElMjIpJTBBJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUyQyUyMCoqcHJpb3Jfb3V0JTJDJTIwaGVpZ2h0JTNENzY4JTJDJTIwd2lkdGglM0Q3NjgpLmltYWdlcyU1QjAlNUQlMEElMEFpbWFnZS5zYXZlKCUyMnN0YXJyeV9jYXQucG5nJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyPriorPipeline, KandinskyPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">import</span> PIL

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

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

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

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

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

<span class="hljs-comment"># specify the weights for each condition in images_texts</span>
weights = [<span class="hljs-number">0.3</span>, <span class="hljs-number">0.3</span>, <span class="hljs-number">0.4</span>]

<span class="hljs-comment"># We can leave the prompt empty</span>
prompt = <span class="hljs-string">&quot;&quot;</span>
prior_out = pipe_prior.interpolate(images_texts, weights)

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

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

image.save(<span class="hljs-string">&quot;starry_cat.png&quot;</span>)`}}),kt=new se({}),Mt=new E({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEF0MmlfcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEF0MmlfcGlwZS5lbmFibGVfeGZvcm1lcnNfbWVtb3J5X2VmZmljaWVudF9hdHRlbnRpb24oKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">import</span> torch

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

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

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