import{S as B2,i as $2,s as x2,e as a,k as p,w as y,t as i,M as R2,c as s,d as t,m as d,a as o,x as _,h as l,b as g,N as hp,G as e,g as m,y as b,q as M,o as w,B as k,v as K2,L as se}from"../../../chunks/vendor-hf-doc-builder.js";import{T as X2}from"../../../chunks/Tip-hf-doc-builder.js";import{D as I}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as j}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as F}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ae}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function F2(U){let h,v,J,u,T,r,f,De,le,un,G,re,ze,rt,pe,Le,pt,de,He,dt,ce,fn,me;return{c(){h=a("p"),v=i("To generate images directly from a single pipeline, you can use "),J=a("a"),u=i("KandinskyV22CombinedPipeline"),T=i(", "),r=a("a"),f=i("KandinskyV22Img2ImgCombinedPipeline"),De=i(", "),le=a("a"),un=i("KandinskyV22InpaintCombinedPipeline"),G=i(`.
These combined pipelines wrap the `),re=a("a"),ze=i("KandinskyV22PriorPipeline"),rt=i(" and "),pe=a("a"),Le=i("KandinskyV22Pipeline"),pt=i(", "),de=a("a"),He=i("KandinskyV22Img2ImgPipeline"),dt=i(", "),ce=a("a"),fn=i("KandinskyV22InpaintPipeline"),me=i(` respectively into a single
pipeline for a simpler user experience`),this.h()},l(Ae){h=s(Ae,"P",{});var Z=o(h);v=l(Z,"To generate images directly from a single pipeline, you can use "),J=s(Z,"A",{href:!0});var Oe=o(J);u=l(Oe,"KandinskyV22CombinedPipeline"),Oe.forEach(t),T=l(Z,", "),r=s(Z,"A",{href:!0});var Sa=o(r);f=l(Sa,"KandinskyV22Img2ImgCombinedPipeline"),Sa.forEach(t),De=l(Z,", "),le=s(Z,"A",{href:!0});var ct=o(le);un=l(ct,"KandinskyV22InpaintCombinedPipeline"),ct.forEach(t),G=l(Z,`.
These combined pipelines wrap the `),re=s(Z,"A",{href:!0});var ge=o(re);ze=l(ge,"KandinskyV22PriorPipeline"),ge.forEach(t),rt=l(Z," and "),pe=s(Z,"A",{href:!0});var mt=o(pe);Le=l(mt,"KandinskyV22Pipeline"),mt.forEach(t),pt=l(Z,", "),de=s(Z,"A",{href:!0});var oe=o(de);He=l(oe,"KandinskyV22Img2ImgPipeline"),oe.forEach(t),dt=l(Z,", "),ce=s(Z,"A",{href:!0});var Da=o(ce);fn=l(Da,"KandinskyV22InpaintPipeline"),Da.forEach(t),me=l(Z,` respectively into a single
pipeline for a simpler user experience`),Z.forEach(t),this.h()},h(){g(J,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22CombinedPipeline"),g(r,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22Img2ImgCombinedPipeline"),g(le,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22InpaintCombinedPipeline"),g(re,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22PriorPipeline"),g(pe,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22Pipeline"),g(de,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22Img2ImgPipeline"),g(ce,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22InpaintPipeline")},m(Ae,Z){m(Ae,h,Z),e(h,v),e(h,J),e(J,u),e(h,T),e(h,r),e(r,f),e(h,De),e(h,le),e(le,un),e(h,G),e(h,re),e(re,ze),e(h,rt),e(h,pe),e(pe,Le),e(h,pt),e(h,de),e(de,He),e(h,dt),e(h,ce),e(ce,fn),e(h,me)},d(Ae){Ae&&t(h)}}}function N2(U){let h,v,J,u,T;return u=new j({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMlBpcGVsaW5lJTJDJTIwS2FuZGluc2t5VjIyUHJpb3JQaXBlbGluZSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLXByaW9yJTIyKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEFwcm9tcHQlMjAlM0QlMjAlMjJyZWQlMjBjYXQlMkMlMjA0ayUyMHBob3RvJTIyJTBBb3V0JTIwJTNEJTIwcGlwZV9wcmlvcihwcm9tcHQpJTBBaW1hZ2VfZW1iJTIwJTNEJTIwb3V0LmltYWdlX2VtYmVkcyUwQXplcm9faW1hZ2VfZW1iJTIwJTNEJTIwb3V0Lm5lZ2F0aXZlX2ltYWdlX2VtYmVkcyUwQXBpcGUlMjAlM0QlMjBLYW5kaW5za3lWMjJQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTItZGVjb2RlciUyMiklMEFwaXBlLnRvKCUyMmN1ZGElMjIpJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMGltYWdlX2VtYmVkcyUzRGltYWdlX2VtYiUyQyUwQSUyMCUyMCUyMCUyMG5lZ2F0aXZlX2ltYWdlX2VtYmVkcyUzRHplcm9faW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTAlMkMlMEEpLmltYWdlcyUwQWltYWdlJTVCMCU1RC5zYXZlKCUyMmNhdC5wbmclMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22Pipeline, KandinskyV22PriorPipeline
<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 = KandinskyV22PriorPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-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>zero_image_emb = out.negative_image_embeds
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = KandinskyV22Pipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder&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>    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>).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(){h=a("p"),v=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);v=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,v),m(r,J,f),b(u,r,f),T=!0},p:se,i(r){T||(M(u.$$.fragment,r),T=!0)},o(r){w(u.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51YWxfc2VlZCg0MyklMEElMEFpbWFnZV9lbWIlMkMlMjB6ZXJvX2ltYWdlX2VtYiUyMCUzRCUyMHBpcGVfcHJpb3IoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTIwbmVnYXRpdmVfcHJvbXB0JTNEbmVnYXRpdmVfcHJpb3JfcHJvbXB0JTJDJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTBBKS50b190dXBsZSgpJTBBJTBBaW1hZ2VzJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWIlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0R6ZXJvX2ltYWdlX2VtYiUyQyUwQSUyMCUyMCUyMCUyMGhpbnQlM0RoaW50JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEEpLmltYWdlcyUwQSUwQWltYWdlcyU1QjAlNUQuc2F2ZSglMjJyb2JvdF9jYXQucG5nJTIyKQ==",highlighted:`<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><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22PriorPipeline, KandinskyV22ControlnetPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline
<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">def</span> <span class="hljs-title function_">make_hint</span>(<span class="hljs-params">image, depth_estimator</span>):
<span class="hljs-meta">... </span>    image = depth_estimator(image)[<span class="hljs-string">&quot;depth&quot;</span>]
<span class="hljs-meta">... </span>    image = np.array(image)
<span class="hljs-meta">... </span>    image = image[:, :, <span class="hljs-literal">None</span>]
<span class="hljs-meta">... </span>    image = np.concatenate([image, image, image], axis=<span class="hljs-number">2</span>)
<span class="hljs-meta">... </span>    detected_map = torch.from_numpy(image).<span class="hljs-built_in">float</span>() / <span class="hljs-number">255.0</span>
<span class="hljs-meta">... </span>    hint = detected_map.permute(<span class="hljs-number">2</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> hint


<span class="hljs-meta">&gt;&gt;&gt; </span>depth_estimator = pipeline(<span class="hljs-string">&quot;depth-estimation&quot;</span>)

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

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


<span class="hljs-meta">&gt;&gt;&gt; </span>img = 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>).resize((<span class="hljs-number">768</span>, <span class="hljs-number">768</span>))

<span class="hljs-meta">&gt;&gt;&gt; </span>hint = make_hint(img, depth_estimator).unsqueeze(<span class="hljs-number">0</span>).half().to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;A robot, 4k photo&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>negative_prior_prompt = <span class="hljs-string">&quot;lowres, text, error, cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, username, watermark, signature&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>generator = torch.Generator(device=<span class="hljs-string">&quot;cuda&quot;</span>).manual_seed(<span class="hljs-number">43</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_emb, zero_image_emb = pipe_prior(
<span class="hljs-meta">... </span>    prompt=prompt, negative_prompt=negative_prior_prompt, generator=generator
<span class="hljs-meta">... </span>).to_tuple()

<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipe(
<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>    hint=hint,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">50</span>,
<span class="hljs-meta">... </span>    generator=generator,
<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>).images

<span class="hljs-meta">&gt;&gt;&gt; </span>images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;robot_cat.png&quot;</span>)`}}),{c(){h=a("p"),v=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);v=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,v),m(r,J,f),b(u,r,f),T=!0},p:se,i(r){T||(M(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&t(h),r&&t(J),k(u,r)}}}function Y2(U){let h,v,J,u,T;return u=new j({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwS2FuZGluc2t5VjIyUHJpb3JFbWIyRW1iUGlwZWxpbmUlMkMlMjBLYW5kaW5za3lWMjJDb250cm9sbmV0SW1nMkltZ1BpcGVsaW5lJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEElMEElMEFkZWYlMjBtYWtlX2hpbnQoaW1hZ2UlMkMlMjBkZXB0aF9lc3RpbWF0b3IpJTNBJTBBJTIwJTIwJTIwJTIwaW1hZ2UlMjAlM0QlMjBkZXB0aF9lc3RpbWF0b3IoaW1hZ2UpJTVCJTIyZGVwdGglMjIlNUQlMEElMjAlMjAlMjAlMjBpbWFnZSUyMCUzRCUyMG5wLmFycmF5KGltYWdlKSUwQSUyMCUyMCUyMCUyMGltYWdlJTIwJTNEJTIwaW1hZ2UlNUIlM0ElMkMlMjAlM0ElMkMlMjBOb25lJTVEJTBBJTIwJTIwJTIwJTIwaW1hZ2UlMjAlM0QlMjBucC5jb25jYXRlbmF0ZSglNUJpbWFnZSUyQyUyMGltYWdlJTJDJTIwaW1hZ2UlNUQlMkMlMjBheGlzJTNEMiklM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yMGhlaWdodCUzRDc2OCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNENzY4JTJDJTBBKS5pbWFnZXMlMEElMEFpbWFnZXMlNUIwJTVELnNhdmUoJTIycm9ib3RfY2F0LnBuZyUyMik=",highlighted:`<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><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22PriorEmb2EmbPipeline, KandinskyV22ControlnetImg2ImgPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline
<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">def</span> <span class="hljs-title function_">make_hint</span>(<span class="hljs-params">image, depth_estimator</span>):
<span class="hljs-meta">... </span>    image = depth_estimator(image)[<span class="hljs-string">&quot;depth&quot;</span>]
<span class="hljs-meta">... </span>    image = np.array(image)
<span class="hljs-meta">... </span>    image = image[:, :, <span class="hljs-literal">None</span>]
<span class="hljs-meta">... </span>    image = np.concatenate([image, image, image], axis=<span class="hljs-number">2</span>)
<span class="hljs-meta">... </span>    detected_map = torch.from_numpy(image).<span class="hljs-built_in">float</span>() / <span class="hljs-number">255.0</span>
<span class="hljs-meta">... </span>    hint = detected_map.permute(<span class="hljs-number">2</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> hint


<span class="hljs-meta">&gt;&gt;&gt; </span>depth_estimator = pipeline(<span class="hljs-string">&quot;depth-estimation&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>img = 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>).resize((<span class="hljs-number">768</span>, <span class="hljs-number">768</span>))


<span class="hljs-meta">&gt;&gt;&gt; </span>hint = make_hint(img, depth_estimator).unsqueeze(<span class="hljs-number">0</span>).half().to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;A robot, 4k photo&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>negative_prior_prompt = <span class="hljs-string">&quot;lowres, text, error, cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, username, watermark, signature&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>generator = torch.Generator(device=<span class="hljs-string">&quot;cuda&quot;</span>).manual_seed(<span class="hljs-number">43</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>img_emb = pipe_prior(prompt=prompt, image=img, strength=<span class="hljs-number">0.85</span>, generator=generator)
<span class="hljs-meta">&gt;&gt;&gt; </span>negative_emb = pipe_prior(prompt=negative_prior_prompt, image=img, strength=<span class="hljs-number">1</span>, generator=generator)

<span class="hljs-meta">&gt;&gt;&gt; </span>images = pipe(
<span class="hljs-meta">... </span>    image=img,
<span class="hljs-meta">... </span>    strength=<span class="hljs-number">0.5</span>,
<span class="hljs-meta">... </span>    image_embeds=img_emb.image_embeds,
<span class="hljs-meta">... </span>    negative_image_embeds=negative_emb.image_embeds,
<span class="hljs-meta">... </span>    hint=hint,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">50</span>,
<span class="hljs-meta">... </span>    generator=generator,
<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>).images

<span class="hljs-meta">&gt;&gt;&gt; </span>images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;robot_cat.png&quot;</span>)`}}),{c(){h=a("p"),v=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);v=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,v),m(r,J,f),b(u,r,f),T=!0},p:se,i(r){T||(M(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&t(h),r&&t(J),k(u,r)}}}function q2(U){let h,v,J,u,T;return u=new j({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMkltZzJJbWdQaXBlbGluZSUyQyUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1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waW1hZ2UlM0Rpbml0X2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2VfZW1iZWRzJTNEaW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfaW1hZ2VfZW1iZWRzJTNEemVyb19pbWFnZV9lbWIlMkMlMEElMjAlMjAlMjAlMjBoZWlnaHQlM0Q3NjglMkMlMEElMjAlMjAlMjAlMjB3aWR0aCUzRDc2OCUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QxMDAlMkMlMEElMjAlMjAlMjAlMjBzdHJlbmd0aCUzRDAuMiUyQyUwQSkuaW1hZ2VzJTBBJTBBaW1hZ2UlNUIwJTVELnNhdmUoJTIycmVkX2Zyb2cucG5nJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22Img2ImgPipeline, KandinskyV22PriorPipeline
<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 = KandinskyV22PriorPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-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 = KandinskyV22Img2ImgPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder&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>    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(){h=a("p"),v=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);v=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,v),m(r,J,f),b(u,r,f),T=!0},p:se,i(r){T||(M(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&t(h),r&&t(J),k(u,r)}}}function S2(U){let h,v,J,u,T;return u=new j({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMklucGFpbnRQaXBlbGluZSUyQyUyMEthbmRpbnNreVYyMlByaW9yUG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QSklMEElMEFtYXNrJTIwJTNEJTIwbnAuemVyb3MoKDc2OCUyQyUyMDc2OCklMkMlMjBkdHlwZSUzRG5wLmZsb2F0MzIpJTBBbWFzayU1QiUzQTI1MCUyQyUyMDI1MCUzQS0yNTAlNUQlMjAlM0QlMjAxJTBBJTBBb3V0JTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBpbWFnZSUzRGluaXRfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBtYXNrX2ltYWdlJTNEbWFzayUyQyUwQSUyMCUyMCUyMCUyMGltYWdlX2VtYmVkcyUzRGltYWdlX2VtYiUyQyUwQSUyMCUyMCUyMCUyMG5lZ2F0aXZlX2ltYWdlX2VtYmVkcyUzRHplcm9faW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTAlMkMlMEEpJTBBJTBBaW1hZ2UlMjAlM0QlMjBvdXQuaW1hZ2VzJTVCMCU1RCUwQWltYWdlLnNhdmUoJTIyY2F0X3dpdGhfaGF0LnBuZyUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22InpaintPipeline, KandinskyV22PriorPipeline
<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 = KandinskyV22PriorPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-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 = KandinskyV22InpaintPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder-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>    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(){h=a("p"),v=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);v=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,v),m(r,J,f),b(u,r,f),T=!0},p:se,i(r){T||(M(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&t(h),r&&t(J),k(u,r)}}}function D2(U){let h,v,J,u,T;return u=new j({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMlBpcGVsaW5lJTJDJTIwS2FuZGluc2t5VjIyUHJpb3JQaXBlbGluZSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLXByaW9yJTIyKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEFwcm9tcHQlMjAlM0QlMjAlMjJyZWQlMjBjYXQlMkMlMjA0ayUyMHBob3RvJTIyJTBBaW1hZ2VfZW1iJTJDJTIwbmVnYXRpdmVfaW1hZ2VfZW1iJTIwJTNEJTIwcGlwZV9wcmlvcihwcm9tcHQpLnRvX3R1cGxlKCklMEElMEFwaXBlJTIwJTNEJTIwS2FuZGluc2t5VjIyUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLWRlY29kZXIlMjIpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQWltYWdlJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWIlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0RuZWdhdGl2ZV9pbWFnZV9lbWIlMkMlMEElMjAlMjAlMjAlMjBoZWlnaHQlM0Q3NjglMkMlMEElMjAlMjAlMjAlMjB3aWR0aCUzRDc2OCUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q1MCUyQyUwQSkuaW1hZ2VzJTBBaW1hZ2UlNUIwJTVELnNhdmUoJTIyY2F0LnBuZyUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22Pipeline, KandinskyV22PriorPipeline
<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 = KandinskyV22PriorPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-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>image_emb, negative_image_emb = pipe_prior(prompt).to_tuple()

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = KandinskyV22Pipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder&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>    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">50</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(){h=a("p"),v=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);v=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,v),m(r,J,f),b(u,r,f),T=!0},p:se,i(r){T||(M(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&t(h),r&&t(J),k(u,r)}}}function z2(U){let h,v,J,u,T;return u=new j({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUlMkMlMjBLYW5kaW5za3lWMjJQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBaW1wb3J0JTIwUElMJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdG9yY2h2aXNpb24lMjBpbXBvcnQlMjB0cmFuc2Zvcm1zJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEFpbWcxJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZ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XZlX2ltYWdlX2VtYmVkcyUyQyUwQSUyMCUyMCUyMCUyMGhlaWdodCUzRDc2OCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTBBKS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2Uuc2F2ZSglMjJzdGFycnlfY2F0LnBuZyUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22PriorPipeline, KandinskyV22Pipeline
<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 = KandinskyV22PriorPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-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>out = pipe_prior.interpolate(images_texts, weights)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = KandinskyV22Pipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder&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>image = pipe(
<span class="hljs-meta">... </span>    image_embeds=out.image_embeds,
<span class="hljs-meta">... </span>    negative_image_embeds=out.negative_image_embeds,
<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>).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(){h=a("p"),v=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);v=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,v),m(r,J,f),b(u,r,f),T=!0},p:se,i(r){T||(M(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&t(h),r&&t(J),k(u,r)}}}function L2(U){let h,v,J,u,T;return u=new j({props:{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DE2JTIyJTBBKSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwaW1hZ2VfZW1iZWRzJTNEaW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfaW1hZ2VfZW1iZWRzJTNEbmVnYXRpdmVfaW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMTAwJTJDJTBBKS5pbWFnZXMlMEElMEFpbWFnZSU1QjAlNUQuc2F2ZSglMjJjYXQucG5nJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22Pipeline, KandinskyV22PriorEmb2EmbPipeline
<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-2-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;red cat, 4k photo&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>img = 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>image_emb, nagative_image_emb = pipe_prior(prompt, image=img, strength=<span class="hljs-number">0.2</span>).to_tuple()

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = KandinskyPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder, torch_dtype=torch.float16&quot;</span>
<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>image = pipe(
<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(){h=a("p"),v=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);v=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,v),m(r,J,f),b(u,r,f),T=!0},p:se,i(r){T||(M(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&t(h),r&&t(J),k(u,r)}}}function H2(U){let h,v,J,u,T;return u=new j({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMlByaW9yRW1iMkVtYlBpcGVsaW5lJTJDJTIwS2FuZGluc2t5VjIyUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQWltcG9ydCUyMFBJTCUwQSUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMH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HJpb3IuaW50ZXJwb2xhdGUoaW1hZ2VzX3RleHRzJTJDJTIwd2VpZ2h0cyklMEElMEFwaXBlJTIwJTNEJTIwS2FuZGluc2t5VjIyUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLWRlY29kZXIlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWIlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0R6ZXJvX2ltYWdlX2VtYiUyQyUwQSUyMCUyMCUyMCUyMGhlaWdodCUzRDc2OCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDE1MCUyQyUwQSkuaW1hZ2VzJTVCMCU1RCUwQSUwQWltYWdlLnNhdmUoJTIyc3RhcnJ5X2NhdC5wbmclMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22PriorEmb2EmbPipeline, KandinskyV22Pipeline
<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 = KandinskyV22PriorPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-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 = KandinskyV22Pipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder&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>image = pipe(
<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(){h=a("p"),v=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);v=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,v),m(r,J,f),b(u,r,f),T=!0},p:se,i(r){T||(M(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&t(h),r&&t(J),k(u,r)}}}function A2(U){let h,v,J,u,T;return u=new j({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvclRleHQySW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXBpcGUlMjAlM0QlMjBBdXRvUGlwZWxpbmVGb3JUZXh0MkltYWdlLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMi1kZWNvZGVyJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwbGlvbiUyMGluJTIwZ2FsYXhpZXMlMkMlMjBzcGlyYWxzJTJDJTIwbmVidWxhZSUyQyUyMHN0YXJzJTJDJTIwc21va2UlMkMlMjBpcmlkZXNjZW50JTJDJTIwaW50cmljYXRlJTIwZGV0YWlsJTJDJTIwb2N0YW5lJTIwcmVuZGVyJTJDJTIwOGslMjIlMEElMEFpbWFnZSUyMCUzRCUyMHBpcGUocHJvbXB0JTNEcHJvbXB0JTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDI1KS5pbWFnZXMlNUIwJTVE",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-2-decoder&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(){h=a("p"),v=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);v=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,v),m(r,J,f),b(u,r,f),T=!0},p:se,i(r){T||(M(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&t(h),r&&t(J),k(u,r)}}}function O2(U){let h,v,J,u,T;return u=new j({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvckltYWdlMkltYWdlJTBBaW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjBpbyUyMGltcG9ydCUyMEJ5dGVzSU8lMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjBvcyUwQSUwQXBpcGUlMjAlM0QlMjBBdXRvUGlwZWxpbmVGb3JJbWFnZTJJbWFnZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTItZGVjb2RlciUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMGZhbnRhc3klMjBsYW5kc2NhcGUlMkMlMjBDaW5lbWF0aWMlMjBsaWdodGluZyUyMiUwQW5lZ2F0aXZlX3Byb21wdCUyMCUzRCUyMCUyMmxvdyUyMHF1YWxpdHklMkMlMjBiYWQlMjBxdWFsaXR5JTIyJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cHMlM0ElMkYlMkZyYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tJTJGQ29tcFZpcyUyRnN0YWJsZS1kaWZmdXNpb24lMkZtYWluJTJGYXNzZXRzJTJGc3RhYmxlLXNhbXBsZXMlMkZpbWcyaW1nJTJGc2tldGNoLW1vdW50YWlucy1pbnB1dC5qcGclMjIlMEElMEFyZXNwb25zZSUyMCUzRCUyMHJlcXVlc3RzLmdldCh1cmwpJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKEJ5dGVzSU8ocmVzcG9uc2UuY29udGVudCkpLmNvbnZlcnQoJTIyUkdCJTIyKSUwQWltYWdlLnRodW1ibmFpbCgoNzY4JTJDJTIwNzY4KSklMEElMEFpbWFnZSUyMCUzRCUyMHBpcGUocHJvbXB0JTNEcHJvbXB0JTJDJTIwaW1hZ2UlM0RvcmlnaW5hbF9pbWFnZSUyQyUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QyNSkuaW1hZ2VzJTVCMCU1RA==",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-2-decoder&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(){h=a("p"),v=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);v=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,v),m(r,J,f),b(u,r,f),T=!0},p:se,i(r){T||(M(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&t(h),r&&t(J),k(u,r)}}}function e_(U){let h,v,J,u,T;return u=new j({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvcklucGFpbnRpbmclMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQWltcG9ydCUyMHRvcmNoJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBcGlwZSUyMCUzRCUyMEF1dG9QaXBlbGluZUZvcklucGFpbnRpbmcuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLWRlY29kZXItaW5wYWludCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMGZhbnRhc3klMjBsYW5kc2NhcGUlMkMlMjBDaW5lbWF0aWMlMjBsaWdodGluZyUyMiUwQW5lZ2F0aXZlX3Byb21wdCUyMCUzRCUyMCUyMmxvdyUyMHF1YWxpdHklMkMlMjBiYWQlMjBxdWFsaXR5JTIyJTBBJTBBb3JpZ2luYWxfaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmhmLWludGVybmFsLXRlc3RpbmclMkZkaWZmdXNlcnMtaW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMjIlMjAlMjIlMkZrYW5kaW5za3klMkZjYXQucG5nJTIyJTBBKSUwQSUwQW1hc2slMjAlM0QlMjBucC56ZXJvcygoNzY4JTJDJTIwNzY4KSUyQyUyMGR0eXBlJTNEbnAuZmxvYXQzMiklMEElMjMlMjBMZXQncyUyMG1hc2slMjBvdXQlMjBhbiUyMGFyZWElMjBhYm92ZSUyMHRoZSUyMGNhdCdzJTIwaGVhZCUwQW1hc2slNUIlM0EyNTAlMkMlMjAyNTAlM0EtMjUwJTVEJTIwJTNEJTIwMSUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlM0Rwcm9tcHQlMkMlMjBpbWFnZSUzRG9yaWdpbmFsX2ltYWdlJTJDJTIwbWFza19pbWFnZSUzRG1hc2slMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMjUpLmltYWdlcyU1QjAlNUQ=",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-2-decoder-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(){h=a("p"),v=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);v=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,v),m(r,J,f),b(u,r,f),T=!0},p:se,i(r){T||(M(u.$$.fragment,r),T=!0)},o(r){w(u.$$.fragment,r),T=!1},d(r){r&&t(h),r&&t(J),k(u,r)}}}function n_(U){let h,v,J,u,T,r,f,De,le,un,G,re,ze,rt,pe,Le,pt,de,He,dt,ce,fn,me,Ae,Z,Oe,Sa,ct,ge,mt,oe,Da,Ns,up,fp,cl,gt,ml,yn,yp,Qs,_p,bp,gl,ht,hl,za,La,ku,ul,Ha,Mp,fl,en,_n,Ys,ut,wp,qs,kp,yl,bn,Jp,Aa,Tp,vp,_l,Oa,Ip,bl,ft,Ml,es,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Kh,at,Xh,st,xa,Fh,A,Nh,Qi,Qh,Yh,Yi,qh,Sh,qi,Dh,zh,Si,Lh,Hh,yr,hn,ot,Di,Ra,Ah,zi,Oh,_r,X,Ka,eu,Li,nu,tu,Xa,au,Us,su,ou,iu,je,Fa,lu,Hi,ru,pu,it,du,lt,Na,cu,O,mu,Ai,gu,hu,Oi,uu,fu,el,yu,_u,nl,bu,Mu,br;return r=new F({}),ge=new j({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlX3ByaW9yJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEF0MmlfcGlwZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMi1kZWNvZGVyJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXQyaV9waXBlLnRvKCUyMmN1ZGElMjIp",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-2-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-2-decoder&quot;</span>, torch_dtype=torch.float16)
t2i_pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),gt=new j({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIycG9ydHJhaXQlMjBvZiUyMGElMjB3b21lbiUyQyUyMGJsdWUlMjBleWVzJTJDJTIwY2luZW1hdGljJTIyJTBBbmVnYXRpdmVfcHJvbXB0JTIwJTNEJTIwJTIybG93JTIwcXVhbGl0eSUyQyUyMGJhZCUyMHF1YWxpdHklMjIlMEElMEFpbWFnZV9lbWJlZHMlMkMlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlMjAlM0QlMjBwaXBlX3ByaW9yKHByb21wdCUyQyUyMGd1aWRhbmNlX3NjYWxlJTNEMS4wKS50b190dXBsZSgp",highlighted:`prompt = <span class="hljs-string">&quot;portrait of a women, blue eyes, cinematic&quot;</span>
negative_prompt = <span class="hljs-string">&quot;low quality, bad quality&quot;</span>

image_embeds, negative_image_embeds = pipe_prior(prompt, guidance_scale=<span class="hljs-number">1.0</span>).to_tuple()`}}),ht=new j({props:{code:"aW1hZ2UlMjAlM0QlMjB0MmlfcGlwZShpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWJlZHMlMkMlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0RuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlMkMlMjBoZWlnaHQlM0Q3NjglMkMlMjB3aWR0aCUzRDc2OCkuaW1hZ2VzJTVCJTBBJTIwJTIwJTIwJTIwMCUwQSU1RCUwQWltYWdlLnNhdmUoJTIycG9ydHJhaXQucG5nJTIyKQ==",highlighted:`image = t2i_pipe(<span class="hljs-attribute">image_embeds</span>=image_embeds, <span class="hljs-attribute">negative_image_embeds</span>=negative_image_embeds, <span class="hljs-attribute">height</span>=768, <span class="hljs-attribute">width</span>=768).images[
    0
]
image.save(<span class="hljs-string">&quot;portrait.png&quot;</span>)`}}),ut=new F({}),ft=new j({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEElMEFpbWclMjAlM0QlMjBsb2FkX2ltYWdlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmhmLWludGVybmFsLXRlc3RpbmclMkZkaWZmdXNlcnMtaW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZrYW5kaW5za3l2MjIlMkZjYXQucG5nJTIyJTBBKS5yZXNpemUoKDc2OCUyQyUyMDc2OCkp",highlighted:`<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

img = load_image(
    <span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinskyv22/cat.png&quot;</span>
).resize((<span class="hljs-number">768</span>, <span class="hljs-number">768</span>))`}}),yt=new j({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEElMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwcGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQSUwQSUwQWRlZiUyMG1ha2VfaGludChpbWFnZSUyQyUyMGRlcHRoX2VzdGltYXRvciklM0ElMEElMjAlMjAlMjAlMjBpbWFnZSUyMCUzRCUyMGRlcHRoX2VzdGltYXRvcihpbWFnZSklNUIlMjJkZXB0aCUyMiU1RCUwQSUyMCUyMCUyMCUyMGltYWdlJTIwJTNEJTIwbnAuYXJyYXkoaW1hZ2UpJTBBJTIwJTIwJTIwJTIwaW1hZ2UlMjAlM0QlMjBpbWFnZSU1QiUzQSUyQyUyMCUzQSUyQyUyME5vbmUlNUQlMEElMjAlMjAlMjAlMjBpbWFnZSUyMCUzRCUyMG5wLmNvbmNhdGVuYXRlKCU1QmltYWdlJTJDJTIwaW1hZ2UlMkMlMjBpbWFnZSU1RCUyQyUyMGF4aXMlM0QyKSUwQSUyMCUyMCUyMCUyMGRldGVjdGVkX21hcCUyMCUzRCUyMHRvcmNoLmZyb21fbnVtcHkoaW1hZ2UpLmZsb2F0KCklMjAlMkYlMjAyNTUuMCUwQSUyMCUyMCUyMCUyMGhpbnQlMjAlM0QlMjBkZXRlY3RlZF9tYXAucGVybXV0ZSgyJTJDJTIwMCUyQyUyMDEpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwaGludCUwQSUwQSUwQWRlcHRoX2VzdGltYXRvciUyMCUzRCUyMHBpcGVsaW5lKCUyMmRlcHRoLWVzdGltYXRpb24lMjIpJTBBaGludCUyMCUzRCUyMG1ha2VfaGludChpbWclMkMlMjBkZXB0aF9lc3RpbWF0b3IpLnVuc3F1ZWV6ZSgwKS5oYWxmKCkudG8oJTIyY3VkYSUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image


<span class="hljs-keyword">def</span> <span class="hljs-title function_">make_hint</span>(<span class="hljs-params">image, depth_estimator</span>):
    image = depth_estimator(image)[<span class="hljs-string">&quot;depth&quot;</span>]
    image = np.array(image)
    image = image[:, :, <span class="hljs-literal">None</span>]
    image = np.concatenate([image, image, image], axis=<span class="hljs-number">2</span>)
    detected_map = torch.from_numpy(image).<span class="hljs-built_in">float</span>() / <span class="hljs-number">255.0</span>
    hint = detected_map.permute(<span class="hljs-number">2</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>)
    <span class="hljs-keyword">return</span> hint


depth_estimator = pipeline(<span class="hljs-string">&quot;depth-estimation&quot;</span>)
hint = make_hint(img, depth_estimator).unsqueeze(<span class="hljs-number">0</span>).half().to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),_t=new j({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUlMkMlMjBLYW5kaW5za3lWMjJDb250cm9sbmV0UGlwZWxpbmUlMEElMEFwaXBlX3ByaW9yJTIwJTNEJTIwS2FuZGluc2t5VjIyUHJpb3JQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTItcHJpb3IlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTBBcGlwZV9wcmlvciUyMCUzRCUyMHBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlJTIwJTNEJTIwS2FuZGluc2t5VjIyQ29udHJvbG5ldFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMi1jb250cm9sbmV0LWRlcHRoJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGUlMjAlM0QlMjBwaXBlLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22PriorPipeline, KandinskyV22ControlnetPipeline

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

pipe = KandinskyV22ControlnetPipeline.from_pretrained(
    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-controlnet-depth&quot;</span>, torch_dtype=torch.float16
)
pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)`}}),bt=new j({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMHJvYm90JTJDJTIwNGslMjBwaG90byUyMiUw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B6ZXJvX2ltYWdlX2VtYiUyMCUzRCUyMHBpcGVfcHJpb3IoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTIwbmVnYXRpdmVfcHJvbXB0JTNEbmVnYXRpdmVfcHJpb3JfcHJvbXB0JTJDJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTBBKS50b190dXBsZSgp",highlighted:`prompt = <span class="hljs-string">&quot;A robot, 4k photo&quot;</span>

negative_prior_prompt = <span class="hljs-string">&quot;lowres, text, error, cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, username, watermark, signature&quot;</span>

generator = torch.Generator(device=<span class="hljs-string">&quot;cuda&quot;</span>).manual_seed(<span class="hljs-number">43</span>)
image_emb, zero_image_emb = pipe_prior(
    prompt=prompt, negative_prompt=negative_prior_prompt, generator=generator
).to_tuple()`}}),Mt=new j({props:{code:"aW1hZ2VzJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWIlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0R6ZXJvX2ltYWdlX2VtYiUyQyUwQSUyMCUyMCUyMCUyMGhpbnQlM0RoaW50JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEEpLmltYWdlcyUwQSUwQWltYWdlcyU1QjAlNUQuc2F2ZSglMjJyb2JvdF9jYXQucG5nJTIyKQ==",highlighted:`images = pipe(
    image_embeds=image_emb,
    negative_image_embeds=zero_image_emb,
    hint=hint,
    num_inference_steps=<span class="hljs-number">50</span>,
    generator=generator,
    height=<span class="hljs-number">768</span>,
    width=<span class="hljs-number">768</span>,
).images

images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;robot_cat.png&quot;</span>)`}}),kt=new F({}),Jt=new j({props:{code:" ",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22PriorEmb2EmbPipeline, KandinskyV22ControlnetImg2ImgPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

img = 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;/kandinskyv22/cat.png&quot;</span>
).resize((<span class="hljs-number">768</span>, <span class="hljs-number">768</span>))


<span class="hljs-keyword">def</span> <span class="hljs-title function_">make_hint</span>(<span class="hljs-params">image, depth_estimator</span>):
    image = depth_estimator(image)[<span class="hljs-string">&quot;depth&quot;</span>]
    image = np.array(image)
    image = image[:, :, <span class="hljs-literal">None</span>]
    image = np.concatenate([image, image, image], axis=<span class="hljs-number">2</span>)
    detected_map = torch.from_numpy(image).<span class="hljs-built_in">float</span>() / <span class="hljs-number">255.0</span>
    hint = detected_map.permute(<span class="hljs-number">2</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>)
    <span class="hljs-keyword">return</span> hint


depth_estimator = pipeline(<span class="hljs-string">&quot;depth-estimation&quot;</span>)
hint = make_hint(img, depth_estimator).unsqueeze(<span class="hljs-number">0</span>).half().to(<span class="hljs-string">&quot;cuda&quot;</span>)

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

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

prompt = <span class="hljs-string">&quot;A robot, 4k photo&quot;</span>
negative_prior_prompt = <span class="hljs-string">&quot;lowres, text, error, cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, username, watermark, signature&quot;</span>

generator = torch.Generator(device=<span class="hljs-string">&quot;cuda&quot;</span>).manual_seed(<span class="hljs-number">43</span>)

<span class="hljs-comment"># run prior pipeline</span>

img_emb = pipe_prior(prompt=prompt, image=img, strength=<span class="hljs-number">0.85</span>, generator=generator)
negative_emb = pipe_prior(prompt=negative_prior_prompt, image=img, strength=<span class="hljs-number">1</span>, generator=generator)

<span class="hljs-comment"># run controlnet img2img pipeline</span>
images = pipe(
    image=img,
    strength=<span class="hljs-number">0.5</span>,
    image_embeds=img_emb.image_embeds,
    negative_image_embeds=negative_emb.image_embeds,
    hint=hint,
    num_inference_steps=<span class="hljs-number">50</span>,
    generator=generator,
    height=<span class="hljs-number">768</span>,
    width=<span class="hljs-number">768</span>,
).images

images[<span class="hljs-number">0</span>].save(<span class="hljs-string">&quot;robot_cat.png&quot;</span>)`}}),Tt=new F({}),It=new j({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()`}}),jt=new j({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())`}}),Zt=new j({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy5tb2RlbHMuYXR0ZW50aW9uX3Byb2Nlc3NvciUyMGltcG9ydCUyMEF0dG5BZGRlZEtWUHJvY2Vzc29yJTBBJTBBdDJpX3BpcGUudW5ldC5zZXRfYXR0bl9wcm9jZXNzb3IoQXR0bkFkZGVkS1ZQcm9jZXNzb3IoKSk=",highlighted:`<span class="hljs-keyword">from</span> diffusers.models.attention_processor <span class="hljs-keyword">import</span> AttnAddedKVProcessor

t2i_pipe.unet.set_attn_processor(AttnAddedKVProcessor())`}}),Vt=new j({props:{code:"dDJpX3BpcGUudW5ldC50byhtZW1vcnlfZm9ybWF0JTNEdG9yY2guY2hhbm5lbHNfbGFzdCklMEF0MmlfcGlwZS51bmV0JTIwJTNEJTIwdG9yY2guY29tcGlsZSh0MmlfcGlwZS51bmV0JTJDJTIwbW9kZSUzRCUyMnJlZHVjZS1vdmVyaGVhZCUyMiUyQyUyMGZ1bGxncmFwaCUzRFRydWUp",highlighted:`t2i_pipe.unet.to(memory_format=torch.channels_last)
t2i_pipe.unet = torch.<span class="hljs-built_in">compile</span>(t2i_pipe.unet, mode=<span class="hljs-string">&quot;reduce-overhead&quot;</span>, fullgraph=<span class="hljs-literal">True</span>)`}}),Un=new X2({props:{$$slots:{default:[F2]},$$scope:{ctx:U}}}),Gt=new F({}),qt=new F({}),St=new I({props:{name:"class diffusers.KandinskyV22Pipeline",anchor:"diffusers.KandinskyV22Pipeline",parameters:[{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"movq",val:": VQModel"}],parametersDescription:[{anchor:"diffusers.KandinskyV22Pipeline.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.KandinskyV22Pipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyV22Pipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ Decoder to generate the image from the latents.`,name:"movq"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2.py#L69"}}),zt=new I({props:{name:"__call__",anchor:"diffusers.KandinskyV22Pipeline.__call__",parameters:[{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:"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.KandinskyV22Pipeline.__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.KandinskyV22Pipeline.__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.KandinskyV22Pipeline.__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.KandinskyV22Pipeline.__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.KandinskyV22Pipeline.__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.KandinskyV22Pipeline.__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.KandinskyV22Pipeline.__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.KandinskyV22Pipeline.__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.KandinskyV22Pipeline.__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.KandinskyV22Pipeline.__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.KandinskyV22Pipeline.__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.KandinskyV22Pipeline.__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.KandinskyV22Pipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2.py#L137",returnType:`
<p><a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Pn=new ae({props:{anchor:"diffusers.KandinskyV22Pipeline.__call__.example",$$slots:{default:[N2]},$$scope:{ctx:U}}}),Lt=new I({props:{name:"enable_model_cpu_offload",anchor:"diffusers.KandinskyV22Pipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2.py#L112"}}),Ht=new F({}),At=new I({props:{name:"class diffusers.KandinskyV22ControlnetPipeline",anchor:"diffusers.KandinskyV22ControlnetPipeline",parameters:[{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"movq",val:": VQModel"}],parametersDescription:[{anchor:"diffusers.KandinskyV22ControlnetPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.19.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to generate image latents.`,name:"scheduler"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ Decoder to generate the image from the latents.`,name:"movq"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet.py#L109"}}),ea=new I({props:{name:"__call__",anchor:"diffusers.KandinskyV22ControlnetPipeline.__call__",parameters:[{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:"hint",val:": FloatTensor"},{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.KandinskyV22ControlnetPipeline.__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.KandinskyV22ControlnetPipeline.__call__.hint",description:`<strong>hint</strong> (<code>torch.FloatTensor</code>) &#x2014;
The controlnet condition.`,name:"hint"},{anchor:"diffusers.KandinskyV22ControlnetPipeline.__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.KandinskyV22ControlnetPipeline.__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.KandinskyV22ControlnetPipeline.__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.KandinskyV22ControlnetPipeline.__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.KandinskyV22ControlnetPipeline.__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.KandinskyV22ControlnetPipeline.__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.KandinskyV22ControlnetPipeline.__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.KandinskyV22ControlnetPipeline.__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.KandinskyV22ControlnetPipeline.__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.KandinskyV22ControlnetPipeline.__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.KandinskyV22ControlnetPipeline.__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.KandinskyV22ControlnetPipeline.__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.KandinskyV22ControlnetPipeline.__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.KandinskyV22ControlnetPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet.py#L178",returnType:`
<p><a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Cn=new ae({props:{anchor:"diffusers.KandinskyV22ControlnetPipeline.__call__.example",$$slots:{default:[Q2]},$$scope:{ctx:U}}}),na=new I({props:{name:"enable_model_cpu_offload",anchor:"diffusers.KandinskyV22ControlnetPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet.py#L153"}}),ta=new F({}),aa=new I({props:{name:"class diffusers.KandinskyV22ControlnetImg2ImgPipeline",anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline",parameters:[{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"movq",val:": VQModel"}],parametersDescription:[{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.19.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to generate image latents.`,name:"scheduler"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ Decoder to generate the image from the latents.`,name:"movq"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet_img2img.py#L123"}}),oa=new I({props:{name:"__call__",anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__call__",parameters:[{name:"image_embeds",val:": typing.Union[torch.FloatTensor, typing.List[torch.FloatTensor]]"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image]]"},{name:"negative_image_embeds",val:": typing.Union[torch.FloatTensor, typing.List[torch.FloatTensor]]"},{name:"hint",val:": FloatTensor"},{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:"strength",val:": float = 0.3"},{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.KandinskyV22ControlnetImg2ImgPipeline.__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.KandinskyV22ControlnetImg2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, or <code>List[np.ndarray]</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, that will be used as the starting point for the
process. Can also accpet image latents as <code>image</code>, if passing latents directly, it will not be encoded
again.`,name:"image"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#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.KandinskyV22ControlnetImg2ImgPipeline.__call__.hint",description:`<strong>hint</strong> (<code>torch.FloatTensor</code>) &#x2014;
The controlnet condition.`,name:"hint"},{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__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.KandinskyV22ControlnetImg2ImgPipeline.__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.KandinskyV22ControlnetImg2ImgPipeline.__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.KandinskyV22ControlnetImg2ImgPipeline.__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.KandinskyV22ControlnetImg2ImgPipeline.__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.KandinskyV22ControlnetImg2ImgPipeline.__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.KandinskyV22ControlnetImg2ImgPipeline.__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.KandinskyV22ControlnetImg2ImgPipeline.__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.KandinskyV22ControlnetImg2ImgPipeline.__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.KandinskyV22ControlnetImg2ImgPipeline.__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.KandinskyV22ControlnetImg2ImgPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet_img2img.py#L233",returnType:`
<p><a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),$n=new ae({props:{anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.__call__.example",$$slots:{default:[Y2]},$$scope:{ctx:U}}}),ia=new I({props:{name:"enable_model_cpu_offload",anchor:"diffusers.KandinskyV22ControlnetImg2ImgPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet_img2img.py#L208"}}),la=new F({}),ra=new I({props:{name:"class diffusers.KandinskyV22Img2ImgPipeline",anchor:"diffusers.KandinskyV22Img2ImgPipeline",parameters:[{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"movq",val:": VQModel"}],parametersDescription:[{anchor:"diffusers.KandinskyV22Img2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.19.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to generate image latents.`,name:"scheduler"},{anchor:"diffusers.KandinskyV22Img2ImgPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyV22Img2ImgPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ Decoder to generate the image from the latents.`,name:"movq"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_img2img.py#L97"}}),da=new I({props:{name:"__call__",anchor:"diffusers.KandinskyV22Img2ImgPipeline.__call__",parameters:[{name:"image_embeds",val:": typing.Union[torch.FloatTensor, typing.List[torch.FloatTensor]]"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image]]"},{name:"negative_image_embeds",val:": typing.Union[torch.FloatTensor, typing.List[torch.FloatTensor]]"},{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:"strength",val:": float = 0.3"},{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.KandinskyV22Img2ImgPipeline.__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.KandinskyV22Img2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, or <code>List[np.ndarray]</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, that will be used as the starting point for the
process. Can also accpet image latents as <code>image</code>, if passing latents directly, it will not be encoded
again.`,name:"image"},{anchor:"diffusers.KandinskyV22Img2ImgPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#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.KandinskyV22Img2ImgPipeline.__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.KandinskyV22Img2ImgPipeline.__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.KandinskyV22Img2ImgPipeline.__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.KandinskyV22Img2ImgPipeline.__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.KandinskyV22Img2ImgPipeline.__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.KandinskyV22Img2ImgPipeline.__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.KandinskyV22Img2ImgPipeline.__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.KandinskyV22Img2ImgPipeline.__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.KandinskyV22Img2ImgPipeline.__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.KandinskyV22Img2ImgPipeline.__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.KandinskyV22Img2ImgPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_img2img.py#L206",returnType:`
<p><a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Kn=new ae({props:{anchor:"diffusers.KandinskyV22Img2ImgPipeline.__call__.example",$$slots:{default:[q2]},$$scope:{ctx:U}}}),ca=new I({props:{name:"enable_model_cpu_offload",anchor:"diffusers.KandinskyV22Img2ImgPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_img2img.py#L181"}}),ma=new F({}),ga=new I({props:{name:"class diffusers.KandinskyV22InpaintPipeline",anchor:"diffusers.KandinskyV22InpaintPipeline",parameters:[{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": DDPMScheduler"},{name:"movq",val:": VQModel"}],parametersDescription:[{anchor:"diffusers.KandinskyV22InpaintPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.19.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to generate image latents.`,name:"scheduler"},{anchor:"diffusers.KandinskyV22InpaintPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyV22InpaintPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ Decoder to generate the image from the latents.`,name:"movq"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_inpainting.py#L240"}}),ua=new I({props:{name:"__call__",anchor:"diffusers.KandinskyV22InpaintPipeline.__call__",parameters:[{name:"image_embeds",val:": typing.Union[torch.FloatTensor, typing.List[torch.FloatTensor]]"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image]"},{name:"mask_image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, numpy.ndarray]"},{name:"negative_image_embeds",val:": typing.Union[torch.FloatTensor, typing.List[torch.FloatTensor]]"},{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.KandinskyV22InpaintPipeline.__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.KandinskyV22InpaintPipeline.__call__.image",description:`<strong>image</strong> (<code>PIL.Image.Image</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch which will be inpainted, <em>i.e.</em> parts of the image will
be masked out with <code>mask_image</code> and repainted according to <code>prompt</code>.`,name:"image"},{anchor:"diffusers.KandinskyV22InpaintPipeline.__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.KandinskyV22InpaintPipeline.__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.KandinskyV22InpaintPipeline.__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.KandinskyV22InpaintPipeline.__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.KandinskyV22InpaintPipeline.__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.KandinskyV22InpaintPipeline.__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.KandinskyV22InpaintPipeline.__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.KandinskyV22InpaintPipeline.__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.KandinskyV22InpaintPipeline.__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.KandinskyV22InpaintPipeline.__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.KandinskyV22InpaintPipeline.__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.KandinskyV22InpaintPipeline.__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.KandinskyV22InpaintPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_inpainting.py#L310",returnType:`
<p><a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),Nn=new ae({props:{anchor:"diffusers.KandinskyV22InpaintPipeline.__call__.example",$$slots:{default:[S2]},$$scope:{ctx:U}}}),fa=new I({props:{name:"enable_model_cpu_offload",anchor:"diffusers.KandinskyV22InpaintPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_inpainting.py#L285"}}),ya=new F({}),_a=new I({props:{name:"class diffusers.KandinskyV22PriorPipeline",anchor:"diffusers.KandinskyV22PriorPipeline",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.KandinskyV22PriorPipeline.prior",description:`<strong>prior</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/prior_transformer#diffusers.PriorTransformer">PriorTransformer</a>) &#x2014;
The canonincal unCLIP prior to approximate the image embedding from the text embedding.`,name:"prior"},{anchor:"diffusers.KandinskyV22PriorPipeline.image_encoder",description:`<strong>image_encoder</strong> (<code>CLIPVisionModelWithProjection</code>) &#x2014;
Frozen image-encoder.`,name:"image_encoder"},{anchor:"diffusers.KandinskyV22PriorPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModelWithProjection</code>) &#x2014;
Frozen text-encoder.`,name:"text_encoder"},{anchor:"diffusers.KandinskyV22PriorPipeline.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.KandinskyV22PriorPipeline.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"},{anchor:"diffusers.KandinskyV22PriorPipeline.image_processor",description:`<strong>image_processor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
A image_processor to be used to preprocess image from clip.`,name:"image_processor"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior.py#L86"}}),Ma=new I({props:{name:"__call__",anchor:"diffusers.KandinskyV22PriorPipeline.__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.KandinskyV22PriorPipeline.__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.KandinskyV22PriorPipeline.__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.KandinskyV22PriorPipeline.__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.KandinskyV22PriorPipeline.__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.KandinskyV22PriorPipeline.__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.KandinskyV22PriorPipeline.__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.KandinskyV22PriorPipeline.__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.KandinskyV22PriorPipeline.__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.KandinskyV22PriorPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior.py#L387",returnType:`
<p><code>KandinskyPriorPipelineOutput</code> or <code>tuple</code></p>
`}}),qn=new ae({props:{anchor:"diffusers.KandinskyV22PriorPipeline.__call__.example",$$slots:{default:[D2]},$$scope:{ctx:U}}}),wa=new I({props:{name:"interpolate",anchor:"diffusers.KandinskyV22PriorPipeline.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.KandinskyV22PriorPipeline.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.KandinskyV22PriorPipeline.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.KandinskyV22PriorPipeline.interpolate.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.KandinskyV22PriorPipeline.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.KandinskyV22PriorPipeline.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.KandinskyV22PriorPipeline.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.KandinskyV22PriorPipeline.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.KandinskyV22PriorPipeline.interpolate.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior.py#L131",returnType:`
<p><code>KandinskyPriorPipelineOutput</code> or <code>tuple</code></p>
`}}),Sn=new ae({props:{anchor:"diffusers.KandinskyV22PriorPipeline.interpolate.example",$$slots:{default:[z2]},$$scope:{ctx:U}}}),ka=new I({props:{name:"enable_model_cpu_offload",anchor:"diffusers.KandinskyV22PriorPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior.py#L358"}}),Ja=new F({}),Ta=new I({props:{name:"class diffusers.KandinskyV22PriorEmb2EmbPipeline",anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline",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.KandinskyV22PriorEmb2EmbPipeline.prior",description:`<strong>prior</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/prior_transformer#diffusers.PriorTransformer">PriorTransformer</a>) &#x2014;
The canonincal unCLIP prior to approximate the image embedding from the text embedding.`,name:"prior"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.image_encoder",description:`<strong>image_encoder</strong> (<code>CLIPVisionModelWithProjection</code>) &#x2014;
Frozen image-encoder.`,name:"image_encoder"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModelWithProjection</code>) &#x2014;
Frozen text-encoder.`,name:"text_encoder"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.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.KandinskyV22PriorEmb2EmbPipeline.scheduler",description:`<strong>scheduler</strong> (<code>UnCLIPScheduler</code>) &#x2014;
A scheduler to be used in combination with <code>prior</code> to generate image embedding.`,name:"scheduler"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior_emb2emb.py#L104"}}),Ia=new I({props:{name:"__call__",anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]]"},{name:"image",val:": typing.Union[torch.Tensor, typing.List[torch.Tensor], PIL.Image.Image, typing.List[PIL.Image.Image]]"},{name:"strength",val:": float = 0.3"},{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.KandinskyV22PriorEmb2EmbPipeline.__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.KandinskyV22PriorEmb2EmbPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 0.8) &#x2014;
Conceptually, indicates how much to transform the reference <code>emb</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.`,name:"strength"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.__call__.emb",description:`<strong>emb</strong> (<code>torch.FloatTensor</code>) &#x2014;
The image embedding.`,name:"emb"},{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.__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.KandinskyV22PriorEmb2EmbPipeline.__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.KandinskyV22PriorEmb2EmbPipeline.__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.KandinskyV22PriorEmb2EmbPipeline.__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.KandinskyV22PriorEmb2EmbPipeline.__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.KandinskyV22PriorEmb2EmbPipeline.__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.KandinskyV22PriorEmb2EmbPipeline.__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.KandinskyV22PriorEmb2EmbPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior_emb2emb.py#L426",returnType:`
<p><code>KandinskyPriorPipelineOutput</code> or <code>tuple</code></p>
`}}),Ln=new ae({props:{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.__call__.example",$$slots:{default:[L2]},$$scope:{ctx:U}}}),Ua=new I({props:{name:"interpolate",anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.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.KandinskyV22PriorEmb2EmbPipeline.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.KandinskyV22PriorEmb2EmbPipeline.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.KandinskyV22PriorEmb2EmbPipeline.interpolate.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.KandinskyV22PriorEmb2EmbPipeline.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.KandinskyV22PriorEmb2EmbPipeline.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.KandinskyV22PriorEmb2EmbPipeline.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.KandinskyV22PriorEmb2EmbPipeline.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.KandinskyV22PriorEmb2EmbPipeline.interpolate.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 4.0) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior_emb2emb.py#L156",returnType:`
<p><code>KandinskyPriorPipelineOutput</code> or <code>tuple</code></p>
`}}),Hn=new ae({props:{anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.interpolate.example",$$slots:{default:[H2]},$$scope:{ctx:U}}}),ja=new I({props:{name:"enable_model_cpu_offload",anchor:"diffusers.KandinskyV22PriorEmb2EmbPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_prior_emb2emb.py#L397"}}),Za=new F({}),Va=new I({props:{name:"class diffusers.KandinskyV22CombinedPipeline",anchor:"diffusers.KandinskyV22CombinedPipeline",parameters:[{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": 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.KandinskyV22CombinedPipeline.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.KandinskyV22CombinedPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyV22CombinedPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ Decoder to generate the image from the latents.`,name:"movq"},{anchor:"diffusers.KandinskyV22CombinedPipeline.prior_prior",description:`<strong>prior_prior</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/prior_transformer#diffusers.PriorTransformer">PriorTransformer</a>) &#x2014;
The canonincal unCLIP prior to approximate the image embedding from the text embedding.`,name:"prior_prior"},{anchor:"diffusers.KandinskyV22CombinedPipeline.prior_image_encoder",description:`<strong>prior_image_encoder</strong> (<code>CLIPVisionModelWithProjection</code>) &#x2014;
Frozen image-encoder.`,name:"prior_image_encoder"},{anchor:"diffusers.KandinskyV22CombinedPipeline.prior_text_encoder",description:`<strong>prior_text_encoder</strong> (<code>CLIPTextModelWithProjection</code>) &#x2014;
Frozen text-encoder.`,name:"prior_text_encoder"},{anchor:"diffusers.KandinskyV22CombinedPipeline.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.KandinskyV22CombinedPipeline.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"},{anchor:"diffusers.KandinskyV22CombinedPipeline.prior_image_processor",description:`<strong>prior_image_processor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
A image_processor to be used to preprocess image from clip.`,name:"prior_image_processor"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py#L110"}}),Ga=new I({props:{name:"__call__",anchor:"diffusers.KandinskyV22CombinedPipeline.__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.KandinskyV22CombinedPipeline.__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.KandinskyV22CombinedPipeline.__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.KandinskyV22CombinedPipeline.__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.KandinskyV22CombinedPipeline.__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.KandinskyV22CombinedPipeline.__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.KandinskyV22CombinedPipeline.__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.KandinskyV22CombinedPipeline.__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.KandinskyV22CombinedPipeline.__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.KandinskyV22CombinedPipeline.__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.KandinskyV22CombinedPipeline.__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.KandinskyV22CombinedPipeline.__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.KandinskyV22CombinedPipeline.__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.KandinskyV22CombinedPipeline.__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.KandinskyV22CombinedPipeline.__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.KandinskyV22CombinedPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py#L199",returnType:`
<p><a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),et=new ae({props:{anchor:"diffusers.KandinskyV22CombinedPipeline.__call__.example",$$slots:{default:[A2]},$$scope:{ctx:U}}}),Wa=new I({props:{name:"enable_model_cpu_offload",anchor:"diffusers.KandinskyV22CombinedPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py#L180"}}),Ca=new F({}),Ea=new I({props:{name:"class diffusers.KandinskyV22Img2ImgCombinedPipeline",anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline",parameters:[{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": 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.KandinskyV22Img2ImgCombinedPipeline.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.KandinskyV22Img2ImgCombinedPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ Decoder to generate the image from the latents.`,name:"movq"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.prior_prior",description:`<strong>prior_prior</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/prior_transformer#diffusers.PriorTransformer">PriorTransformer</a>) &#x2014;
The canonincal unCLIP prior to approximate the image embedding from the text embedding.`,name:"prior_prior"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.prior_image_encoder",description:`<strong>prior_image_encoder</strong> (<code>CLIPVisionModelWithProjection</code>) &#x2014;
Frozen image-encoder.`,name:"prior_image_encoder"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.prior_text_encoder",description:`<strong>prior_text_encoder</strong> (<code>CLIPTextModelWithProjection</code>) &#x2014;
Frozen text-encoder.`,name:"prior_text_encoder"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.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.KandinskyV22Img2ImgCombinedPipeline.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"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.prior_image_processor",description:`<strong>prior_image_processor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
A image_processor to be used to preprocess image from clip.`,name:"prior_image_processor"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py#L311"}}),$a=new I({props:{name:"__call__",anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__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:"strength",val:": float = 0.3"},{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.KandinskyV22Img2ImgCombinedPipeline.__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.KandinskyV22Img2ImgCombinedPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, or <code>List[np.ndarray]</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, that will be used as the starting point for the
process. Can also accpet image latents as <code>image</code>, if passing latents directly, it will not be encoded
again.`,name:"image"},{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__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.KandinskyV22Img2ImgCombinedPipeline.__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.KandinskyV22Img2ImgCombinedPipeline.__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.KandinskyV22Img2ImgCombinedPipeline.__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.KandinskyV22Img2ImgCombinedPipeline.__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.KandinskyV22Img2ImgCombinedPipeline.__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.KandinskyV22Img2ImgCombinedPipeline.__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.KandinskyV22Img2ImgCombinedPipeline.__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.KandinskyV22Img2ImgCombinedPipeline.__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.KandinskyV22Img2ImgCombinedPipeline.__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.KandinskyV22Img2ImgCombinedPipeline.__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.KandinskyV22Img2ImgCombinedPipeline.__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.KandinskyV22Img2ImgCombinedPipeline.__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.KandinskyV22Img2ImgCombinedPipeline.__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.KandinskyV22Img2ImgCombinedPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py#L400",returnType:`
<p><a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),at=new ae({props:{anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.__call__.example",$$slots:{default:[O2]},$$scope:{ctx:U}}}),xa=new I({props:{name:"enable_model_cpu_offload",anchor:"diffusers.KandinskyV22Img2ImgCombinedPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py#L381"}}),Ra=new F({}),Ka=new I({props:{name:"class diffusers.KandinskyV22InpaintCombinedPipeline",anchor:"diffusers.KandinskyV22InpaintCombinedPipeline",parameters:[{name:"unet",val:": UNet2DConditionModel"},{name:"scheduler",val:": 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.KandinskyV22InpaintCombinedPipeline.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.KandinskyV22InpaintCombinedPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
Conditional U-Net architecture to denoise the image embedding.`,name:"unet"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.movq",description:`<strong>movq</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/vq#diffusers.VQModel">VQModel</a>) &#x2014;
MoVQ Decoder to generate the image from the latents.`,name:"movq"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.prior_prior",description:`<strong>prior_prior</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/prior_transformer#diffusers.PriorTransformer">PriorTransformer</a>) &#x2014;
The canonincal unCLIP prior to approximate the image embedding from the text embedding.`,name:"prior_prior"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.prior_image_encoder",description:`<strong>prior_image_encoder</strong> (<code>CLIPVisionModelWithProjection</code>) &#x2014;
Frozen image-encoder.`,name:"prior_image_encoder"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.prior_text_encoder",description:`<strong>prior_text_encoder</strong> (<code>CLIPTextModelWithProjection</code>) &#x2014;
Frozen text-encoder.`,name:"prior_text_encoder"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.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.KandinskyV22InpaintCombinedPipeline.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"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.prior_image_processor",description:`<strong>prior_image_processor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
A image_processor to be used to preprocess image from clip.`,name:"prior_image_processor"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py#L534"}}),Fa=new I({props:{name:"__call__",anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__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.KandinskyV22InpaintCombinedPipeline.__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.KandinskyV22InpaintCombinedPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, or <code>List[np.ndarray]</code>) &#x2014;
<code>Image</code>, or tensor representing an image batch, that will be used as the starting point for the
process. Can also accpet image latents as <code>image</code>, if passing latents directly, it will not be encoded
again.`,name:"image"},{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__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.KandinskyV22InpaintCombinedPipeline.__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.KandinskyV22InpaintCombinedPipeline.__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.KandinskyV22InpaintCombinedPipeline.__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.KandinskyV22InpaintCombinedPipeline.__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.KandinskyV22InpaintCombinedPipeline.__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.KandinskyV22InpaintCombinedPipeline.__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.KandinskyV22InpaintCombinedPipeline.__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.KandinskyV22InpaintCombinedPipeline.__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.KandinskyV22InpaintCombinedPipeline.__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.KandinskyV22InpaintCombinedPipeline.__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.KandinskyV22InpaintCombinedPipeline.__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.KandinskyV22InpaintCombinedPipeline.__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.KandinskyV22InpaintCombinedPipeline.__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.KandinskyV22InpaintCombinedPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput">ImagePipelineOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py#L623",returnType:`
<p><a
  href="/docs/diffusers/v0.19.0/en/api/pipelines/latent_diffusion#diffusers.ImagePipelineOutput"
>ImagePipelineOutput</a> or <code>tuple</code></p>
`}}),it=new ae({props:{anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.__call__.example",$$slots:{default:[e_]},$$scope:{ctx:U}}}),Na=new I({props:{name:"enable_model_cpu_offload",anchor:"diffusers.KandinskyV22InpaintCombinedPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py#L604"}}),{c(){h=a("meta"),v=p(),J=a("h1"),u=a("a"),T=a("span"),y(r.$$.fragment),f=p(),De=a("span"),le=i("Kandinsky 2.2"),un=p(),G=a("p"),re=i("The Kandinsky 2.2 release includes robust new text-to-image models that support text-to-image generation, image-to-image generation, image interpolation, and text-guided image inpainting. The general workflow to perform these tasks using Kandinsky 2.2 is the same as in Kandinsky 2.1. First, you will need to use a prior pipeline to generate image embeddings based on your text prompt, and then use one of the image decoding pipelines to generate the output image. The only difference is that in Kandinsky 2.2, all of the decoding pipelines no longer accept the "),ze=a("code"),rt=i("prompt"),pe=i(" input, and the image generation process is conditioned with only "),Le=a("code"),pt=i("image_embeds"),de=i(" and "),He=a("code"),dt=i("negative_image_embeds"),ce=i("."),fn=p(),me=a("p"),Ae=i("Let\u2019s look at an example of how to perform text-to-image generation using Kandinsky 2.2."),Z=p(),Oe=a("p"),Sa=i("First, let\u2019s create the prior pipeline and text-to-image pipeline with Kandinsky 2.2 checkpoints."),ct=p(),y(ge.$$.fragment),mt=p(),oe=a("p"),Da=i("You can then use "),Ns=a("code"),up=i("pipe_prior"),fp=i(" to generate image embeddings."),cl=p(),y(gt.$$.fragment),ml=p(),yn=a("p"),yp=i("Now you can pass these embeddings to the text-to-image pipeline. When using Kandinsky 2.2 you don\u2019t need to pass the "),Qs=a("code"),_p=i("prompt"),bp=i(" (but you do with the previous version, Kandinsky 2.1)."),gl=p(),y(ht.$$.fragment),hl=p(),za=a("p"),La=a("img"),ul=p(),Ha=a("p"),Mp=i("We used the text-to-image pipeline as an example, but the same process applies to all decoding pipelines in Kandinsky 2.2. For more information, please refer to our API section for each pipeline."),fl=p(),en=a("h3"),_n=a("a"),Ys=a("span"),y(ut.$$.fragment),wp=p(),qs=a("span"),kp=i("Text-to-Image Generation with ControlNet Conditioning"),yl=p(),bn=a("p"),Jp=i("In the following, we give a simple example of how to use "),Aa=a("a"),Tp=i("KandinskyV22ControlnetPipeline"),vp=i(" to add control to the text-to-image generation with a depth image."),_l=p(),Oa=a("p"),Ip=i("First, let\u2019s take an image and extract its depth map."),bl=p(),y(ft.$$.fragment),Ml=p(),es=a("p"),ns=a("img"),wl=p(),Mn=a("p"),Up=i("We can use the "),Ss=a("code"),jp=i("depth-estimation"),Zp=i(" pipeline from transformers to process the image and retrieve its depth map."),kl=p(),y(yt.$$.fragment),Jl=p(),ts=a("p"),Vp=i("Now, we load the prior pipeline and the text-to-image controlnet pipeline"),Tl=p(),y(_t.$$.fragment),vl=p(),as=a("p"),Pp=i("We pass the prompt and negative prompt through the prior to generate image embeddings"),Il=p(),y(bt.$$.fragment),Ul=p(),wn=a("p"),Gp=i("Now we can pass the image embeddings and the depth image we extracted to the controlnet pipeline. With Kandinsky 2.2, only prior pipelines accept "),Ds=a("code"),Wp=i("prompt"),Cp=i(" input. You do not need to pass the prompt to the controlnet pipeline."),jl=p(),y(Mt.$$.fragment),Zl=p(),wt=a("p"),Ep=i(`The output image looks as follow:
`),ss=a("img"),Vl=p(),nn=a("h3"),kn=a("a"),zs=a("span"),y(kt.$$.fragment),Bp=p(),Ls=a("span"),$p=i("Image-to-Image Generation with ControlNet Conditioning"),Pl=p(),he=a("p"),xp=i("Kandinsky 2.2 also includes a "),os=a("a"),Rp=i("KandinskyV22ControlnetImg2ImgPipeline"),Kp=i(" that will allow you to add control to the image generation process with both the image and its depth map. This pipeline works really well with "),is=a("a"),Xp=i("KandinskyV22PriorEmb2EmbPipeline"),Fp=i(", which generates image embeddings based on both a text prompt and an image."),Gl=p(),ls=a("p"),Np=i("For our robot cat example, we will pass the prompt and cat image together to the prior pipeline to generate an image embedding. We will then use that image embedding and the depth map of the cat to further control the image generation process."),Wl=p(),rs=a("p"),Qp=i("We can use the same cat image and its depth map from the last example."),Cl=p(),y(Jt.$$.fragment),El=p(),ps=a("p"),Yp=i("Here is the output. Compared with the output from our text-to-image controlnet example, it kept a lot more cat facial details from the original image and worked into the robot style we asked for."),Bl=p(),ds=a("p"),cs=a("img"),$l=p(),tn=a("h2"),Jn=a("a"),Hs=a("span"),y(Tt.$$.fragment),qp=p(),As=a("span"),Sp=i("Optimization"),xl=p(),N=a("p"),Dp=i("Running Kandinsky in inference requires running both a first prior pipeline: "),ms=a("a"),zp=i("KandinskyPriorPipeline"),Lp=i(`
and a second image decoding pipeline which is one of `),gs=a("a"),Hp=i("KandinskyPipeline"),Ap=i(", "),hs=a("a"),Op=i("KandinskyImg2ImgPipeline"),ed=i(", or "),us=a("a"),nd=i("KandinskyInpaintPipeline"),td=i("."),Rl=p(),fs=a("p"),ad=i(`The bulk of the computation time will always be the second image decoding pipeline, so when looking
into optimizing the model, one should look into the second image decoding pipeline.`),Kl=p(),Tn=a("p"),sd=i("When running with PyTorch < 2.0, we strongly recommend making use of "),vt=a("a"),Os=a("code"),od=i("xformers"),id=i(`
to speed-up the optimization. This can be done by simply running:`),Xl=p(),y(It.$$.fragment),Fl=p(),vn=a("p"),ld=i(`When running on PyTorch >= 2.0, PyTorch\u2019s SDPA attention will automatically be used. For more information on
PyTorch\u2019s SDPA, feel free to have a look at `),Ut=a("a"),rd=i("this blog post"),pd=i("."),Nl=p(),ys=a("p"),dd=i("To have explicit control , you can also manually set the pipeline to use PyTorch\u2019s 2.0 efficient attention:"),Ql=p(),y(jt.$$.fragment),Yl=p(),ue=a("p"),cd=i("The slowest and most memory intense attention processor is the default "),eo=a("code"),md=i("AttnAddedKVProcessor"),gd=i(` processor.
We do `),no=a("strong"),hd=i("not"),ud=i(` recommend using it except for testing purposes or cases where very high determistic behaviour is desired.
You can set it with:`),ql=p(),y(Zt.$$.fragment),Sl=p(),fe=a("p"),fd=i("With PyTorch >= 2.0, you can also use Kandinsky with "),to=a("code"),yd=i("torch.compile"),_d=i(` which depending
on your hardware can signficantly speed-up your inference time once the model is compiled.
To use Kandinsksy with `),ao=a("code"),bd=i("torch.compile"),Md=i(", you can do:"),Dl=p(),y(Vt.$$.fragment),zl=p(),In=a("p"),wd=i(`After compilation you should see a very fast inference time. For more information,
feel free to have a look at `),Pt=a("a"),kd=i("Our PyTorch 2.0 benchmark"),Jd=i("."),Ll=p(),y(Un.$$.fragment),Hl=p(),an=a("h2"),jn=a("a"),so=a("span"),y(Gt.$$.fragment),Td=p(),oo=a("span"),vd=i("Available Pipelines:"),Al=p(),Zn=a("table"),io=a("thead"),Wt=a("tr"),lo=a("th"),Id=i("Pipeline"),Ud=p(),ro=a("th"),jd=i("Tasks"),Zd=p(),W=a("tbody"),Ct=a("tr"),po=a("td"),Et=a("a"),Vd=i("pipeline_kandinsky2_2.py"),Pd=p(),co=a("td"),mo=a("em"),Gd=i("Text-to-Image Generation"),Wd=p(),Bt=a("tr"),go=a("td"),$t=a("a"),Cd=i("pipeline_kandinsky2_2_combined.py"),Ed=p(),ho=a("td"),uo=a("em"),Bd=i("End-to-end Text-to-Image, image-to-image, Inpainting Generation"),$d=p(),xt=a("tr"),fo=a("td"),Rt=a("a"),xd=i("pipeline_kandinsky2_2_inpaint.py"),Rd=p(),yo=a("td"),_o=a("em"),Kd=i("Image-Guided Image Generation"),Xd=p(),Kt=a("tr"),bo=a("td"),Xt=a("a"),Fd=i("pipeline_kandinsky2_2_img2img.py"),Nd=p(),Mo=a("td"),wo=a("em"),Qd=i("Image-Guided Image Generation"),Yd=p(),Ft=a("tr"),ko=a("td"),Nt=a("a"),qd=i("pipeline_kandinsky2_2_controlnet.py"),Sd=p(),Jo=a("td"),To=a("em"),Dd=i("Image-Guided Image Generation"),zd=p(),Qt=a("tr"),vo=a("td"),Yt=a("a"),Ld=i("pipeline_kandinsky2_2_controlnet_img2img.py"),Hd=p(),Io=a("td"),Uo=a("em"),Ad=i("Image-Guided Image Generation"),Ol=p(),sn=a("h3"),Vn=a("a"),jo=a("span"),y(qt.$$.fragment),Od=p(),Zo=a("span"),ec=i("KandinskyV22Pipeline"),er=p(),C=a("div"),y(St.$$.fragment),nc=p(),Vo=a("p"),tc=i("Pipeline for text-to-image generation using Kandinsky"),ac=p(),Dt=a("p"),sc=i("This model inherits from "),_s=a("a"),oc=i("DiffusionPipeline"),ic=i(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),lc=p(),ye=a("div"),y(zt.$$.fragment),rc=p(),Po=a("p"),pc=i("Function invoked when calling the pipeline for generation."),dc=p(),y(Pn.$$.fragment),cc=p(),Gn=a("div"),y(Lt.$$.fragment),mc=p(),Q=a("p"),gc=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Go=a("code"),hc=i("enable_sequential_cpu_offload"),uc=i(", this method moves one whole model at a time to the GPU when its "),Wo=a("code"),fc=i("forward"),yc=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Co=a("code"),_c=i("enable_sequential_cpu_offload"),bc=i(", but performance is much better due to the iterative execution of the "),Eo=a("code"),Mc=i("unet"),wc=i("."),nr=p(),on=a("h3"),Wn=a("a"),Bo=a("span"),y(Ht.$$.fragment),kc=p(),$o=a("span"),Jc=i("KandinskyV22ControlnetPipeline"),tr=p(),E=a("div"),y(At.$$.fragment),Tc=p(),xo=a("p"),vc=i("Pipeline for text-to-image generation using Kandinsky"),Ic=p(),Ot=a("p"),Uc=i("This model inherits from "),bs=a("a"),jc=i("DiffusionPipeline"),Zc=i(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Vc=p(),_e=a("div"),y(ea.$$.fragment),Pc=p(),Ro=a("p"),Gc=i("Function invoked when calling the pipeline for generation."),Wc=p(),y(Cn.$$.fragment),Cc=p(),En=a("div"),y(na.$$.fragment),Ec=p(),Y=a("p"),Bc=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Ko=a("code"),$c=i("enable_sequential_cpu_offload"),xc=i(", this method moves one whole model at a time to the GPU when its "),Xo=a("code"),Rc=i("forward"),Kc=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Fo=a("code"),Xc=i("enable_sequential_cpu_offload"),Fc=i(", but performance is much better due to the iterative execution of the "),No=a("code"),Nc=i("unet"),Qc=i("."),ar=p(),ln=a("h3"),Bn=a("a"),Qo=a("span"),y(ta.$$.fragment),Yc=p(),Yo=a("span"),qc=i("KandinskyV22ControlnetImg2ImgPipeline"),sr=p(),B=a("div"),y(aa.$$.fragment),Sc=p(),qo=a("p"),Dc=i("Pipeline for image-to-image generation using Kandinsky"),zc=p(),sa=a("p"),Lc=i("This model inherits from "),Ms=a("a"),Hc=i("DiffusionPipeline"),Ac=i(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Oc=p(),be=a("div"),y(oa.$$.fragment),em=p(),So=a("p"),nm=i("Function invoked when calling the pipeline for generation."),tm=p(),y($n.$$.fragment),am=p(),xn=a("div"),y(ia.$$.fragment),sm=p(),q=a("p"),om=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Do=a("code"),im=i("enable_sequential_cpu_offload"),lm=i(", this method moves one whole model at a time to the GPU when its "),zo=a("code"),rm=i("forward"),pm=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Lo=a("code"),dm=i("enable_sequential_cpu_offload"),cm=i(", but performance is much better due to the iterative execution of the "),Ho=a("code"),mm=i("unet"),gm=i("."),or=p(),rn=a("h3"),Rn=a("a"),Ao=a("span"),y(la.$$.fragment),hm=p(),Oo=a("span"),um=i("KandinskyV22Img2ImgPipeline"),ir=p(),$=a("div"),y(ra.$$.fragment),fm=p(),ei=a("p"),ym=i("Pipeline for image-to-image generation using Kandinsky"),_m=p(),pa=a("p"),bm=i("This model inherits from "),ws=a("a"),Mm=i("DiffusionPipeline"),wm=i(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),km=p(),Me=a("div"),y(da.$$.fragment),Jm=p(),ni=a("p"),Tm=i("Function invoked when calling the pipeline for generation."),vm=p(),y(Kn.$$.fragment),Im=p(),Xn=a("div"),y(ca.$$.fragment),Um=p(),S=a("p"),jm=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),ti=a("code"),Zm=i("enable_sequential_cpu_offload"),Vm=i(", this method moves one whole model at a time to the GPU when its "),ai=a("code"),Pm=i("forward"),Gm=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),si=a("code"),Wm=i("enable_sequential_cpu_offload"),Cm=i(", but performance is much better due to the iterative execution of the "),oi=a("code"),Em=i("unet"),Bm=i("."),lr=p(),pn=a("h3"),Fn=a("a"),ii=a("span"),y(ma.$$.fragment),$m=p(),li=a("span"),xm=i("KandinskyV22InpaintPipeline"),rr=p(),x=a("div"),y(ga.$$.fragment),Rm=p(),ri=a("p"),Km=i("Pipeline for text-guided image inpainting using Kandinsky2.1"),Xm=p(),ha=a("p"),Fm=i("This model inherits from "),ks=a("a"),Nm=i("DiffusionPipeline"),Qm=i(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Ym=p(),we=a("div"),y(ua.$$.fragment),qm=p(),pi=a("p"),Sm=i("Function invoked when calling the pipeline for generation."),Dm=p(),y(Nn.$$.fragment),zm=p(),Qn=a("div"),y(fa.$$.fragment),Lm=p(),D=a("p"),Hm=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),di=a("code"),Am=i("enable_sequential_cpu_offload"),Om=i(", this method moves one whole model at a time to the GPU when its "),ci=a("code"),eg=i("forward"),ng=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),mi=a("code"),tg=i("enable_sequential_cpu_offload"),ag=i(", but performance is much better due to the iterative execution of the "),gi=a("code"),sg=i("unet"),og=i("."),pr=p(),dn=a("h3"),Yn=a("a"),hi=a("span"),y(ya.$$.fragment),ig=p(),ui=a("span"),lg=i("KandinskyV22PriorPipeline"),dr=p(),V=a("div"),y(_a.$$.fragment),rg=p(),fi=a("p"),pg=i("Pipeline for generating image prior for Kandinsky"),dg=p(),ba=a("p"),cg=i("This model inherits from "),Js=a("a"),mg=i("DiffusionPipeline"),gg=i(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),hg=p(),ke=a("div"),y(Ma.$$.fragment),ug=p(),yi=a("p"),fg=i("Function invoked when calling the pipeline for generation."),yg=p(),y(qn.$$.fragment),_g=p(),Je=a("div"),y(wa.$$.fragment),bg=p(),_i=a("p"),Mg=i("Function invoked when using the prior pipeline for interpolation."),wg=p(),y(Sn.$$.fragment),kg=p(),Dn=a("div"),y(ka.$$.fragment),Jg=p(),z=a("p"),Tg=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),bi=a("code"),vg=i("enable_sequential_cpu_offload"),Ig=i(", this method moves one whole model at a time to the GPU when its "),Mi=a("code"),Ug=i("forward"),jg=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),wi=a("code"),Zg=i("enable_sequential_cpu_offload"),Vg=i(", but performance is much better due to the iterative execution of the "),ki=a("code"),Pg=i("unet"),Gg=i("."),cr=p(),cn=a("h3"),zn=a("a"),Ji=a("span"),y(Ja.$$.fragment),Wg=p(),Ti=a("span"),Cg=i("KandinskyV22PriorEmb2EmbPipeline"),mr=p(),P=a("div"),y(Ta.$$.fragment),Eg=p(),vi=a("p"),Bg=i("Pipeline for generating image prior for Kandinsky"),$g=p(),va=a("p"),xg=i("This model inherits from "),Ts=a("a"),Rg=i("DiffusionPipeline"),Kg=i(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Xg=p(),Te=a("div"),y(Ia.$$.fragment),Fg=p(),Ii=a("p"),Ng=i("Function invoked when calling the pipeline for generation."),Qg=p(),y(Ln.$$.fragment),Yg=p(),ve=a("div"),y(Ua.$$.fragment),qg=p(),Ui=a("p"),Sg=i("Function invoked when using the prior pipeline for interpolation."),Dg=p(),y(Hn.$$.fragment),zg=p(),An=a("div"),y(ja.$$.fragment),Lg=p(),L=a("p"),Hg=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),ji=a("code"),Ag=i("enable_sequential_cpu_offload"),Og=i(", this method moves one whole model at a time to the GPU when its "),Zi=a("code"),eh=i("forward"),nh=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Vi=a("code"),th=i("enable_sequential_cpu_offload"),ah=i(", but performance is much better due to the iterative execution of the "),Pi=a("code"),sh=i("unet"),oh=i("."),gr=p(),mn=a("h3"),On=a("a"),Gi=a("span"),y(Za.$$.fragment),ih=p(),Wi=a("span"),lh=i("KandinskyV22CombinedPipeline"),hr=p(),R=a("div"),y(Va.$$.fragment),rh=p(),Ci=a("p"),ph=i("Combined Pipeline for text-to-image generation using Kandinsky"),dh=p(),Pa=a("p"),ch=i("This model inherits from "),vs=a("a"),mh=i("DiffusionPipeline"),gh=i(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),hh=p(),Ie=a("div"),y(Ga.$$.fragment),uh=p(),Ei=a("p"),fh=i("Function invoked when calling the pipeline for generation."),yh=p(),y(et.$$.fragment),_h=p(),nt=a("div"),y(Wa.$$.fragment),bh=p(),H=a("p"),Mh=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Bi=a("code"),wh=i("enable_sequential_cpu_offload"),kh=i(", this method moves one whole model at a time to the GPU when its "),$i=a("code"),Jh=i("forward"),Th=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),xi=a("code"),vh=i("enable_sequential_cpu_offload"),Ih=i(", but performance is much better due to the iterative execution of the "),Ri=a("code"),Uh=i("unet"),jh=i("."),ur=p(),gn=a("h3"),tt=a("a"),Ki=a("span"),y(Ca.$$.fragment),Zh=p(),Xi=a("span"),Vh=i("KandinskyV22Img2ImgCombinedPipeline"),fr=p(),K=a("div"),y(Ea.$$.fragment),Ph=p(),Fi=a("p"),Gh=i("Combined Pipeline for image-to-image generation using Kandinsky"),Wh=p(),Ba=a("p"),Ch=i("This model inherits from "),Is=a("a"),Eh=i("DiffusionPipeline"),Bh=i(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),$h=p(),Ue=a("div"),y($a.$$.fragment),xh=p(),Ni=a("p"),Rh=i("Function invoked when calling the pipeline for generation."),Kh=p(),y(at.$$.fragment),Xh=p(),st=a("div"),y(xa.$$.fragment),Fh=p(),A=a("p"),Nh=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Qi=a("code"),Qh=i("enable_sequential_cpu_offload"),Yh=i(", this method moves one whole model at a time to the GPU when its "),Yi=a("code"),qh=i("forward"),Sh=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),qi=a("code"),Dh=i("enable_sequential_cpu_offload"),zh=i(", but performance is much better due to the iterative execution of the "),Si=a("code"),Lh=i("unet"),Hh=i("."),yr=p(),hn=a("h3"),ot=a("a"),Di=a("span"),y(Ra.$$.fragment),Ah=p(),zi=a("span"),Oh=i("KandinskyV22InpaintCombinedPipeline"),_r=p(),X=a("div"),y(Ka.$$.fragment),eu=p(),Li=a("p"),nu=i("Combined Pipeline for inpainting generation using Kandinsky"),tu=p(),Xa=a("p"),au=i("This model inherits from "),Us=a("a"),su=i("DiffusionPipeline"),ou=i(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),iu=p(),je=a("div"),y(Fa.$$.fragment),lu=p(),Hi=a("p"),ru=i("Function invoked when calling the pipeline for generation."),pu=p(),y(it.$$.fragment),du=p(),lt=a("div"),y(Na.$$.fragment),cu=p(),O=a("p"),mu=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Ai=a("code"),gu=i("enable_sequential_cpu_offload"),hu=i(", this method moves one whole model at a time to the GPU when its "),Oi=a("code"),uu=i("forward"),fu=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),el=a("code"),yu=i("enable_sequential_cpu_offload"),_u=i(", but performance is much better due to the iterative execution of the "),nl=a("code"),bu=i("unet"),Mu=i("."),this.h()},l(n){const c=R2('[data-svelte="svelte-1phssyn"]',document.head);h=s(c,"META",{name:!0,content:!0}),c.forEach(t),v=d(n),J=s(n,"H1",{class:!0});var Qa=o(J);u=s(Qa,"A",{id:!0,class:!0,href:!0});var tl=o(u);T=s(tl,"SPAN",{});var al=o(T);_(r.$$.fragment,al),al.forEach(t),tl.forEach(t),f=d(Qa),De=s(Qa,"SPAN",{});var sl=o(De);le=l(sl,"Kandinsky 2.2"),sl.forEach(t),Qa.forEach(t),un=d(n),G=s(n,"P",{});var ie=o(G);re=l(ie,"The Kandinsky 2.2 release includes robust new text-to-image models that support text-to-image generation, image-to-image generation, image interpolation, and text-guided image inpainting. The general workflow to perform these tasks using Kandinsky 2.2 is the same as in Kandinsky 2.1. First, you will need to use a prior pipeline to generate image embeddings based on your text prompt, and then use one of the image decoding pipelines to generate the output image. The only difference is that in Kandinsky 2.2, all of the decoding pipelines no longer accept the "),ze=s(ie,"CODE",{});var ol=o(ze);rt=l(ol,"prompt"),ol.forEach(t),pe=l(ie," input, and the image generation process is conditioned with only "),Le=s(ie,"CODE",{});var il=o(Le);pt=l(il,"image_embeds"),il.forEach(t),de=l(ie," and "),He=s(ie,"CODE",{});var ll=o(He);dt=l(ll,"negative_image_embeds"),ll.forEach(t),ce=l(ie,"."),ie.forEach(t),fn=d(n),me=s(n,"P",{});var rl=o(me);Ae=l(rl,"Let\u2019s look at an example of how to perform text-to-image generation using Kandinsky 2.2."),rl.forEach(t),Z=d(n),Oe=s(n,"P",{});var pl=o(Oe);Sa=l(pl,"First, let\u2019s create the prior pipeline and text-to-image pipeline with Kandinsky 2.2 checkpoints."),pl.forEach(t),ct=d(n),_(ge.$$.fragment,n),mt=d(n),oe=s(n,"P",{});var Ya=o(oe);Da=l(Ya,"You can then use "),Ns=s(Ya,"CODE",{});var dl=o(Ns);up=l(dl,"pipe_prior"),dl.forEach(t),fp=l(Ya," to generate image embeddings."),Ya.forEach(t),cl=d(n),_(gt.$$.fragment,n),ml=d(n),yn=s(n,"P",{});var qa=o(yn);yp=l(qa,"Now you can pass these embeddings to the text-to-image pipeline. When using Kandinsky 2.2 you don\u2019t need to pass the "),Qs=s(qa,"CODE",{});var Iu=o(Qs);_p=l(Iu,"prompt"),Iu.forEach(t),bp=l(qa," (but you do with the previous version, Kandinsky 2.1)."),qa.forEach(t),gl=d(n),_(ht.$$.fragment,n),hl=d(n),za=s(n,"P",{});var Uu=o(za);La=s(Uu,"IMG",{src:!0,alt:!0}),Uu.forEach(t),ul=d(n),Ha=s(n,"P",{});var ju=o(Ha);Mp=l(ju,"We used the text-to-image pipeline as an example, but the same process applies to all decoding pipelines in Kandinsky 2.2. For more information, please refer to our API section for each pipeline."),ju.forEach(t),fl=d(n),en=s(n,"H3",{class:!0});var Mr=o(en);_n=s(Mr,"A",{id:!0,class:!0,href:!0});var Zu=o(_n);Ys=s(Zu,"SPAN",{});var Vu=o(Ys);_(ut.$$.fragment,Vu),Vu.forEach(t),Zu.forEach(t),wp=d(Mr),qs=s(Mr,"SPAN",{});var Pu=o(qs);kp=l(Pu,"Text-to-Image Generation with ControlNet Conditioning"),Pu.forEach(t),Mr.forEach(t),yl=d(n),bn=s(n,"P",{});var wr=o(bn);Jp=l(wr,"In the following, we give a simple example of how to use "),Aa=s(wr,"A",{href:!0});var Gu=o(Aa);Tp=l(Gu,"KandinskyV22ControlnetPipeline"),Gu.forEach(t),vp=l(wr," to add control to the text-to-image generation with a depth image."),wr.forEach(t),_l=d(n),Oa=s(n,"P",{});var Wu=o(Oa);Ip=l(Wu,"First, let\u2019s take an image and extract its depth map."),Wu.forEach(t),bl=d(n),_(ft.$$.fragment,n),Ml=d(n),es=s(n,"P",{});var Cu=o(es);ns=s(Cu,"IMG",{src:!0,alt:!0}),Cu.forEach(t),wl=d(n),Mn=s(n,"P",{});var kr=o(Mn);Up=l(kr,"We can use the "),Ss=s(kr,"CODE",{});var Eu=o(Ss);jp=l(Eu,"depth-estimation"),Eu.forEach(t),Zp=l(kr," pipeline from transformers to process the image and retrieve its depth map."),kr.forEach(t),kl=d(n),_(yt.$$.fragment,n),Jl=d(n),ts=s(n,"P",{});var Bu=o(ts);Vp=l(Bu,"Now, we load the prior pipeline and the text-to-image controlnet pipeline"),Bu.forEach(t),Tl=d(n),_(_t.$$.fragment,n),vl=d(n),as=s(n,"P",{});var $u=o(as);Pp=l($u,"We pass the prompt and negative prompt through the prior to generate image embeddings"),$u.forEach(t),Il=d(n),_(bt.$$.fragment,n),Ul=d(n),wn=s(n,"P",{});var Jr=o(wn);Gp=l(Jr,"Now we can pass the image embeddings and the depth image we extracted to the controlnet pipeline. With Kandinsky 2.2, only prior pipelines accept "),Ds=s(Jr,"CODE",{});var xu=o(Ds);Wp=l(xu,"prompt"),xu.forEach(t),Cp=l(Jr," input. You do not need to pass the prompt to the controlnet pipeline."),Jr.forEach(t),jl=d(n),_(Mt.$$.fragment,n),Zl=d(n),wt=s(n,"P",{});var wu=o(wt);Ep=l(wu,`The output image looks as follow:
`),ss=s(wu,"IMG",{src:!0,alt:!0}),wu.forEach(t),Vl=d(n),nn=s(n,"H3",{class:!0});var Tr=o(nn);kn=s(Tr,"A",{id:!0,class:!0,href:!0});var Ru=o(kn);zs=s(Ru,"SPAN",{});var Ku=o(zs);_(kt.$$.fragment,Ku),Ku.forEach(t),Ru.forEach(t),Bp=d(Tr),Ls=s(Tr,"SPAN",{});var Xu=o(Ls);$p=l(Xu,"Image-to-Image Generation with ControlNet Conditioning"),Xu.forEach(t),Tr.forEach(t),Pl=d(n),he=s(n,"P",{});var js=o(he);xp=l(js,"Kandinsky 2.2 also includes a "),os=s(js,"A",{href:!0});var Fu=o(os);Rp=l(Fu,"KandinskyV22ControlnetImg2ImgPipeline"),Fu.forEach(t),Kp=l(js," that will allow you to add control to the image generation process with both the image and its depth map. This pipeline works really well with "),is=s(js,"A",{href:!0});var Nu=o(is);Xp=l(Nu,"KandinskyV22PriorEmb2EmbPipeline"),Nu.forEach(t),Fp=l(js,", which generates image embeddings based on both a text prompt and an image."),js.forEach(t),Gl=d(n),ls=s(n,"P",{});var Qu=o(ls);Np=l(Qu,"For our robot cat example, we will pass the prompt and cat image together to the prior pipeline to generate an image embedding. We will then use that image embedding and the depth map of the cat to further control the image generation process."),Qu.forEach(t),Wl=d(n),rs=s(n,"P",{});var Yu=o(rs);Qp=l(Yu,"We can use the same cat image and its depth map from the last example."),Yu.forEach(t),Cl=d(n),_(Jt.$$.fragment,n),El=d(n),ps=s(n,"P",{});var qu=o(ps);Yp=l(qu,"Here is the output. Compared with the output from our text-to-image controlnet example, it kept a lot more cat facial details from the original image and worked into the robot style we asked for."),qu.forEach(t),Bl=d(n),ds=s(n,"P",{});var Su=o(ds);cs=s(Su,"IMG",{src:!0,alt:!0}),Su.forEach(t),$l=d(n),tn=s(n,"H2",{class:!0});var vr=o(tn);Jn=s(vr,"A",{id:!0,class:!0,href:!0});var Du=o(Jn);Hs=s(Du,"SPAN",{});var zu=o(Hs);_(Tt.$$.fragment,zu),zu.forEach(t),Du.forEach(t),qp=d(vr),As=s(vr,"SPAN",{});var Lu=o(As);Sp=l(Lu,"Optimization"),Lu.forEach(t),vr.forEach(t),xl=d(n),N=s(n,"P",{});var Ze=o(N);Dp=l(Ze,"Running Kandinsky in inference requires running both a first prior pipeline: "),ms=s(Ze,"A",{href:!0});var Hu=o(ms);zp=l(Hu,"KandinskyPriorPipeline"),Hu.forEach(t),Lp=l(Ze,`
and a second image decoding pipeline which is one of `),gs=s(Ze,"A",{href:!0});var Au=o(gs);Hp=l(Au,"KandinskyPipeline"),Au.forEach(t),Ap=l(Ze,", "),hs=s(Ze,"A",{href:!0});var Ou=o(hs);Op=l(Ou,"KandinskyImg2ImgPipeline"),Ou.forEach(t),ed=l(Ze,", or "),us=s(Ze,"A",{href:!0});var ef=o(us);nd=l(ef,"KandinskyInpaintPipeline"),ef.forEach(t),td=l(Ze,"."),Ze.forEach(t),Rl=d(n),fs=s(n,"P",{});var nf=o(fs);ad=l(nf,`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.`),nf.forEach(t),Kl=d(n),Tn=s(n,"P",{});var Ir=o(Tn);sd=l(Ir,"When running with PyTorch < 2.0, we strongly recommend making use of "),vt=s(Ir,"A",{href:!0,rel:!0});var tf=o(vt);Os=s(tf,"CODE",{});var af=o(Os);od=l(af,"xformers"),af.forEach(t),tf.forEach(t),id=l(Ir,`
to speed-up the optimization. This can be done by simply running:`),Ir.forEach(t),Xl=d(n),_(It.$$.fragment,n),Fl=d(n),vn=s(n,"P",{});var Ur=o(vn);ld=l(Ur,`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 `),Ut=s(Ur,"A",{href:!0,rel:!0});var sf=o(Ut);rd=l(sf,"this blog post"),sf.forEach(t),pd=l(Ur,"."),Ur.forEach(t),Nl=d(n),ys=s(n,"P",{});var of=o(ys);dd=l(of,"To have explicit control , you can also manually set the pipeline to use PyTorch\u2019s 2.0 efficient attention:"),of.forEach(t),Ql=d(n),_(jt.$$.fragment,n),Yl=d(n),ue=s(n,"P",{});var Zs=o(ue);cd=l(Zs,"The slowest and most memory intense attention processor is the default "),eo=s(Zs,"CODE",{});var lf=o(eo);md=l(lf,"AttnAddedKVProcessor"),lf.forEach(t),gd=l(Zs,` processor.
We do `),no=s(Zs,"STRONG",{});var rf=o(no);hd=l(rf,"not"),rf.forEach(t),ud=l(Zs,` recommend using it except for testing purposes or cases where very high determistic behaviour is desired.
You can set it with:`),Zs.forEach(t),ql=d(n),_(Zt.$$.fragment,n),Sl=d(n),fe=s(n,"P",{});var Vs=o(fe);fd=l(Vs,"With PyTorch >= 2.0, you can also use Kandinsky with "),to=s(Vs,"CODE",{});var pf=o(to);yd=l(pf,"torch.compile"),pf.forEach(t),_d=l(Vs,` which depending
on your hardware can signficantly speed-up your inference time once the model is compiled.
To use Kandinsksy with `),ao=s(Vs,"CODE",{});var df=o(ao);bd=l(df,"torch.compile"),df.forEach(t),Md=l(Vs,", you can do:"),Vs.forEach(t),Dl=d(n),_(Vt.$$.fragment,n),zl=d(n),In=s(n,"P",{});var jr=o(In);wd=l(jr,`After compilation you should see a very fast inference time. For more information,
feel free to have a look at `),Pt=s(jr,"A",{href:!0,rel:!0});var cf=o(Pt);kd=l(cf,"Our PyTorch 2.0 benchmark"),cf.forEach(t),Jd=l(jr,"."),jr.forEach(t),Ll=d(n),_(Un.$$.fragment,n),Hl=d(n),an=s(n,"H2",{class:!0});var Zr=o(an);jn=s(Zr,"A",{id:!0,class:!0,href:!0});var mf=o(jn);so=s(mf,"SPAN",{});var gf=o(so);_(Gt.$$.fragment,gf),gf.forEach(t),mf.forEach(t),Td=d(Zr),oo=s(Zr,"SPAN",{});var hf=o(oo);vd=l(hf,"Available Pipelines:"),hf.forEach(t),Zr.forEach(t),Al=d(n),Zn=s(n,"TABLE",{});var Vr=o(Zn);io=s(Vr,"THEAD",{});var uf=o(io);Wt=s(uf,"TR",{});var Pr=o(Wt);lo=s(Pr,"TH",{});var ff=o(lo);Id=l(ff,"Pipeline"),ff.forEach(t),Ud=d(Pr),ro=s(Pr,"TH",{});var yf=o(ro);jd=l(yf,"Tasks"),yf.forEach(t),Pr.forEach(t),uf.forEach(t),Zd=d(Vr),W=s(Vr,"TBODY",{});var ee=o(W);Ct=s(ee,"TR",{});var Gr=o(Ct);po=s(Gr,"TD",{});var _f=o(po);Et=s(_f,"A",{href:!0,rel:!0});var bf=o(Et);Vd=l(bf,"pipeline_kandinsky2_2.py"),bf.forEach(t),_f.forEach(t),Pd=d(Gr),co=s(Gr,"TD",{});var Mf=o(co);mo=s(Mf,"EM",{});var wf=o(mo);Gd=l(wf,"Text-to-Image Generation"),wf.forEach(t),Mf.forEach(t),Gr.forEach(t),Wd=d(ee),Bt=s(ee,"TR",{});var Wr=o(Bt);go=s(Wr,"TD",{});var kf=o(go);$t=s(kf,"A",{href:!0,rel:!0});var Jf=o($t);Cd=l(Jf,"pipeline_kandinsky2_2_combined.py"),Jf.forEach(t),kf.forEach(t),Ed=d(Wr),ho=s(Wr,"TD",{});var Tf=o(ho);uo=s(Tf,"EM",{});var vf=o(uo);Bd=l(vf,"End-to-end Text-to-Image, image-to-image, Inpainting Generation"),vf.forEach(t),Tf.forEach(t),Wr.forEach(t),$d=d(ee),xt=s(ee,"TR",{});var Cr=o(xt);fo=s(Cr,"TD",{});var If=o(fo);Rt=s(If,"A",{href:!0,rel:!0});var Uf=o(Rt);xd=l(Uf,"pipeline_kandinsky2_2_inpaint.py"),Uf.forEach(t),If.forEach(t),Rd=d(Cr),yo=s(Cr,"TD",{});var jf=o(yo);_o=s(jf,"EM",{});var Zf=o(_o);Kd=l(Zf,"Image-Guided Image Generation"),Zf.forEach(t),jf.forEach(t),Cr.forEach(t),Xd=d(ee),Kt=s(ee,"TR",{});var Er=o(Kt);bo=s(Er,"TD",{});var Vf=o(bo);Xt=s(Vf,"A",{href:!0,rel:!0});var Pf=o(Xt);Fd=l(Pf,"pipeline_kandinsky2_2_img2img.py"),Pf.forEach(t),Vf.forEach(t),Nd=d(Er),Mo=s(Er,"TD",{});var Gf=o(Mo);wo=s(Gf,"EM",{});var Wf=o(wo);Qd=l(Wf,"Image-Guided Image Generation"),Wf.forEach(t),Gf.forEach(t),Er.forEach(t),Yd=d(ee),Ft=s(ee,"TR",{});var Br=o(Ft);ko=s(Br,"TD",{});var Cf=o(ko);Nt=s(Cf,"A",{href:!0,rel:!0});var Ef=o(Nt);qd=l(Ef,"pipeline_kandinsky2_2_controlnet.py"),Ef.forEach(t),Cf.forEach(t),Sd=d(Br),Jo=s(Br,"TD",{});var Bf=o(Jo);To=s(Bf,"EM",{});var $f=o(To);Dd=l($f,"Image-Guided Image Generation"),$f.forEach(t),Bf.forEach(t),Br.forEach(t),zd=d(ee),Qt=s(ee,"TR",{});var $r=o(Qt);vo=s($r,"TD",{});var xf=o(vo);Yt=s(xf,"A",{href:!0,rel:!0});var Rf=o(Yt);Ld=l(Rf,"pipeline_kandinsky2_2_controlnet_img2img.py"),Rf.forEach(t),xf.forEach(t),Hd=d($r),Io=s($r,"TD",{});var Kf=o(Io);Uo=s(Kf,"EM",{});var Xf=o(Uo);Ad=l(Xf,"Image-Guided Image Generation"),Xf.forEach(t),Kf.forEach(t),$r.forEach(t),ee.forEach(t),Vr.forEach(t),Ol=d(n),sn=s(n,"H3",{class:!0});var xr=o(sn);Vn=s(xr,"A",{id:!0,class:!0,href:!0});var Ff=o(Vn);jo=s(Ff,"SPAN",{});var Nf=o(jo);_(qt.$$.fragment,Nf),Nf.forEach(t),Ff.forEach(t),Od=d(xr),Zo=s(xr,"SPAN",{});var Qf=o(Zo);ec=l(Qf,"KandinskyV22Pipeline"),Qf.forEach(t),xr.forEach(t),er=d(n),C=s(n,"DIV",{class:!0});var Ve=o(C);_(St.$$.fragment,Ve),nc=d(Ve),Vo=s(Ve,"P",{});var Yf=o(Vo);tc=l(Yf,"Pipeline for text-to-image generation using Kandinsky"),Yf.forEach(t),ac=d(Ve),Dt=s(Ve,"P",{});var Rr=o(Dt);sc=l(Rr,"This model inherits from "),_s=s(Rr,"A",{href:!0});var qf=o(_s);oc=l(qf,"DiffusionPipeline"),qf.forEach(t),ic=l(Rr,`. 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.)`),Rr.forEach(t),lc=d(Ve),ye=s(Ve,"DIV",{class:!0});var Ps=o(ye);_(zt.$$.fragment,Ps),rc=d(Ps),Po=s(Ps,"P",{});var Sf=o(Po);pc=l(Sf,"Function invoked when calling the pipeline for generation."),Sf.forEach(t),dc=d(Ps),_(Pn.$$.fragment,Ps),Ps.forEach(t),cc=d(Ve),Gn=s(Ve,"DIV",{class:!0});var Kr=o(Gn);_(Lt.$$.fragment,Kr),mc=d(Kr),Q=s(Kr,"P",{});var Pe=o(Q);gc=l(Pe,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Go=s(Pe,"CODE",{});var Df=o(Go);hc=l(Df,"enable_sequential_cpu_offload"),Df.forEach(t),uc=l(Pe,", this method moves one whole model at a time to the GPU when its "),Wo=s(Pe,"CODE",{});var zf=o(Wo);fc=l(zf,"forward"),zf.forEach(t),yc=l(Pe,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Co=s(Pe,"CODE",{});var Lf=o(Co);_c=l(Lf,"enable_sequential_cpu_offload"),Lf.forEach(t),bc=l(Pe,", but performance is much better due to the iterative execution of the "),Eo=s(Pe,"CODE",{});var Hf=o(Eo);Mc=l(Hf,"unet"),Hf.forEach(t),wc=l(Pe,"."),Pe.forEach(t),Kr.forEach(t),Ve.forEach(t),nr=d(n),on=s(n,"H3",{class:!0});var Xr=o(on);Wn=s(Xr,"A",{id:!0,class:!0,href:!0});var Af=o(Wn);Bo=s(Af,"SPAN",{});var Of=o(Bo);_(Ht.$$.fragment,Of),Of.forEach(t),Af.forEach(t),kc=d(Xr),$o=s(Xr,"SPAN",{});var ey=o($o);Jc=l(ey,"KandinskyV22ControlnetPipeline"),ey.forEach(t),Xr.forEach(t),tr=d(n),E=s(n,"DIV",{class:!0});var Ge=o(E);_(At.$$.fragment,Ge),Tc=d(Ge),xo=s(Ge,"P",{});var ny=o(xo);vc=l(ny,"Pipeline for text-to-image generation using Kandinsky"),ny.forEach(t),Ic=d(Ge),Ot=s(Ge,"P",{});var Fr=o(Ot);Uc=l(Fr,"This model inherits from "),bs=s(Fr,"A",{href:!0});var ty=o(bs);jc=l(ty,"DiffusionPipeline"),ty.forEach(t),Zc=l(Fr,`. 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.)`),Fr.forEach(t),Vc=d(Ge),_e=s(Ge,"DIV",{class:!0});var Gs=o(_e);_(ea.$$.fragment,Gs),Pc=d(Gs),Ro=s(Gs,"P",{});var ay=o(Ro);Gc=l(ay,"Function invoked when calling the pipeline for generation."),ay.forEach(t),Wc=d(Gs),_(Cn.$$.fragment,Gs),Gs.forEach(t),Cc=d(Ge),En=s(Ge,"DIV",{class:!0});var Nr=o(En);_(na.$$.fragment,Nr),Ec=d(Nr),Y=s(Nr,"P",{});var We=o(Y);Bc=l(We,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Ko=s(We,"CODE",{});var sy=o(Ko);$c=l(sy,"enable_sequential_cpu_offload"),sy.forEach(t),xc=l(We,", this method moves one whole model at a time to the GPU when its "),Xo=s(We,"CODE",{});var oy=o(Xo);Rc=l(oy,"forward"),oy.forEach(t),Kc=l(We,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Fo=s(We,"CODE",{});var iy=o(Fo);Xc=l(iy,"enable_sequential_cpu_offload"),iy.forEach(t),Fc=l(We,", but performance is much better due to the iterative execution of the "),No=s(We,"CODE",{});var ly=o(No);Nc=l(ly,"unet"),ly.forEach(t),Qc=l(We,"."),We.forEach(t),Nr.forEach(t),Ge.forEach(t),ar=d(n),ln=s(n,"H3",{class:!0});var Qr=o(ln);Bn=s(Qr,"A",{id:!0,class:!0,href:!0});var ry=o(Bn);Qo=s(ry,"SPAN",{});var py=o(Qo);_(ta.$$.fragment,py),py.forEach(t),ry.forEach(t),Yc=d(Qr),Yo=s(Qr,"SPAN",{});var dy=o(Yo);qc=l(dy,"KandinskyV22ControlnetImg2ImgPipeline"),dy.forEach(t),Qr.forEach(t),sr=d(n),B=s(n,"DIV",{class:!0});var Ce=o(B);_(aa.$$.fragment,Ce),Sc=d(Ce),qo=s(Ce,"P",{});var cy=o(qo);Dc=l(cy,"Pipeline for image-to-image generation using Kandinsky"),cy.forEach(t),zc=d(Ce),sa=s(Ce,"P",{});var Yr=o(sa);Lc=l(Yr,"This model inherits from "),Ms=s(Yr,"A",{href:!0});var my=o(Ms);Hc=l(my,"DiffusionPipeline"),my.forEach(t),Ac=l(Yr,`. 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.)`),Yr.forEach(t),Oc=d(Ce),be=s(Ce,"DIV",{class:!0});var Ws=o(be);_(oa.$$.fragment,Ws),em=d(Ws),So=s(Ws,"P",{});var gy=o(So);nm=l(gy,"Function invoked when calling the pipeline for generation."),gy.forEach(t),tm=d(Ws),_($n.$$.fragment,Ws),Ws.forEach(t),am=d(Ce),xn=s(Ce,"DIV",{class:!0});var qr=o(xn);_(ia.$$.fragment,qr),sm=d(qr),q=s(qr,"P",{});var Ee=o(q);om=l(Ee,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Do=s(Ee,"CODE",{});var hy=o(Do);im=l(hy,"enable_sequential_cpu_offload"),hy.forEach(t),lm=l(Ee,", this method moves one whole model at a time to the GPU when its "),zo=s(Ee,"CODE",{});var uy=o(zo);rm=l(uy,"forward"),uy.forEach(t),pm=l(Ee,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Lo=s(Ee,"CODE",{});var fy=o(Lo);dm=l(fy,"enable_sequential_cpu_offload"),fy.forEach(t),cm=l(Ee,", but performance is much better due to the iterative execution of the "),Ho=s(Ee,"CODE",{});var yy=o(Ho);mm=l(yy,"unet"),yy.forEach(t),gm=l(Ee,"."),Ee.forEach(t),qr.forEach(t),Ce.forEach(t),or=d(n),rn=s(n,"H3",{class:!0});var Sr=o(rn);Rn=s(Sr,"A",{id:!0,class:!0,href:!0});var _y=o(Rn);Ao=s(_y,"SPAN",{});var by=o(Ao);_(la.$$.fragment,by),by.forEach(t),_y.forEach(t),hm=d(Sr),Oo=s(Sr,"SPAN",{});var My=o(Oo);um=l(My,"KandinskyV22Img2ImgPipeline"),My.forEach(t),Sr.forEach(t),ir=d(n),$=s(n,"DIV",{class:!0});var Be=o($);_(ra.$$.fragment,Be),fm=d(Be),ei=s(Be,"P",{});var wy=o(ei);ym=l(wy,"Pipeline for image-to-image generation using Kandinsky"),wy.forEach(t),_m=d(Be),pa=s(Be,"P",{});var Dr=o(pa);bm=l(Dr,"This model inherits from "),ws=s(Dr,"A",{href:!0});var ky=o(ws);Mm=l(ky,"DiffusionPipeline"),ky.forEach(t),wm=l(Dr,`. 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.)`),Dr.forEach(t),km=d(Be),Me=s(Be,"DIV",{class:!0});var Cs=o(Me);_(da.$$.fragment,Cs),Jm=d(Cs),ni=s(Cs,"P",{});var Jy=o(ni);Tm=l(Jy,"Function invoked when calling the pipeline for generation."),Jy.forEach(t),vm=d(Cs),_(Kn.$$.fragment,Cs),Cs.forEach(t),Im=d(Be),Xn=s(Be,"DIV",{class:!0});var zr=o(Xn);_(ca.$$.fragment,zr),Um=d(zr),S=s(zr,"P",{});var $e=o(S);jm=l($e,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),ti=s($e,"CODE",{});var Ty=o(ti);Zm=l(Ty,"enable_sequential_cpu_offload"),Ty.forEach(t),Vm=l($e,", this method moves one whole model at a time to the GPU when its "),ai=s($e,"CODE",{});var vy=o(ai);Pm=l(vy,"forward"),vy.forEach(t),Gm=l($e,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),si=s($e,"CODE",{});var Iy=o(si);Wm=l(Iy,"enable_sequential_cpu_offload"),Iy.forEach(t),Cm=l($e,", but performance is much better due to the iterative execution of the "),oi=s($e,"CODE",{});var Uy=o(oi);Em=l(Uy,"unet"),Uy.forEach(t),Bm=l($e,"."),$e.forEach(t),zr.forEach(t),Be.forEach(t),lr=d(n),pn=s(n,"H3",{class:!0});var Lr=o(pn);Fn=s(Lr,"A",{id:!0,class:!0,href:!0});var jy=o(Fn);ii=s(jy,"SPAN",{});var Zy=o(ii);_(ma.$$.fragment,Zy),Zy.forEach(t),jy.forEach(t),$m=d(Lr),li=s(Lr,"SPAN",{});var Vy=o(li);xm=l(Vy,"KandinskyV22InpaintPipeline"),Vy.forEach(t),Lr.forEach(t),rr=d(n),x=s(n,"DIV",{class:!0});var xe=o(x);_(ga.$$.fragment,xe),Rm=d(xe),ri=s(xe,"P",{});var Py=o(ri);Km=l(Py,"Pipeline for text-guided image inpainting using Kandinsky2.1"),Py.forEach(t),Xm=d(xe),ha=s(xe,"P",{});var Hr=o(ha);Fm=l(Hr,"This model inherits from "),ks=s(Hr,"A",{href:!0});var Gy=o(ks);Nm=l(Gy,"DiffusionPipeline"),Gy.forEach(t),Qm=l(Hr,`. 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.)`),Hr.forEach(t),Ym=d(xe),we=s(xe,"DIV",{class:!0});var Es=o(we);_(ua.$$.fragment,Es),qm=d(Es),pi=s(Es,"P",{});var Wy=o(pi);Sm=l(Wy,"Function invoked when calling the pipeline for generation."),Wy.forEach(t),Dm=d(Es),_(Nn.$$.fragment,Es),Es.forEach(t),zm=d(xe),Qn=s(xe,"DIV",{class:!0});var Ar=o(Qn);_(fa.$$.fragment,Ar),Lm=d(Ar),D=s(Ar,"P",{});var Re=o(D);Hm=l(Re,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),di=s(Re,"CODE",{});var Cy=o(di);Am=l(Cy,"enable_sequential_cpu_offload"),Cy.forEach(t),Om=l(Re,", this method moves one whole model at a time to the GPU when its "),ci=s(Re,"CODE",{});var Ey=o(ci);eg=l(Ey,"forward"),Ey.forEach(t),ng=l(Re,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),mi=s(Re,"CODE",{});var By=o(mi);tg=l(By,"enable_sequential_cpu_offload"),By.forEach(t),ag=l(Re,", but performance is much better due to the iterative execution of the "),gi=s(Re,"CODE",{});var $y=o(gi);sg=l($y,"unet"),$y.forEach(t),og=l(Re,"."),Re.forEach(t),Ar.forEach(t),xe.forEach(t),pr=d(n),dn=s(n,"H3",{class:!0});var Or=o(dn);Yn=s(Or,"A",{id:!0,class:!0,href:!0});var xy=o(Yn);hi=s(xy,"SPAN",{});var Ry=o(hi);_(ya.$$.fragment,Ry),Ry.forEach(t),xy.forEach(t),ig=d(Or),ui=s(Or,"SPAN",{});var Ky=o(ui);lg=l(Ky,"KandinskyV22PriorPipeline"),Ky.forEach(t),Or.forEach(t),dr=d(n),V=s(n,"DIV",{class:!0});var ne=o(V);_(_a.$$.fragment,ne),rg=d(ne),fi=s(ne,"P",{});var Xy=o(fi);pg=l(Xy,"Pipeline for generating image prior for Kandinsky"),Xy.forEach(t),dg=d(ne),ba=s(ne,"P",{});var ep=o(ba);cg=l(ep,"This model inherits from "),Js=s(ep,"A",{href:!0});var Fy=o(Js);mg=l(Fy,"DiffusionPipeline"),Fy.forEach(t),gg=l(ep,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),ep.forEach(t),hg=d(ne),ke=s(ne,"DIV",{class:!0});var Bs=o(ke);_(Ma.$$.fragment,Bs),ug=d(Bs),yi=s(Bs,"P",{});var Ny=o(yi);fg=l(Ny,"Function invoked when calling the pipeline for generation."),Ny.forEach(t),yg=d(Bs),_(qn.$$.fragment,Bs),Bs.forEach(t),_g=d(ne),Je=s(ne,"DIV",{class:!0});var $s=o(Je);_(wa.$$.fragment,$s),bg=d($s),_i=s($s,"P",{});var Qy=o(_i);Mg=l(Qy,"Function invoked when using the prior pipeline for interpolation."),Qy.forEach(t),wg=d($s),_(Sn.$$.fragment,$s),$s.forEach(t),kg=d(ne),Dn=s(ne,"DIV",{class:!0});var np=o(Dn);_(ka.$$.fragment,np),Jg=d(np),z=s(np,"P",{});var Ke=o(z);Tg=l(Ke,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),bi=s(Ke,"CODE",{});var Yy=o(bi);vg=l(Yy,"enable_sequential_cpu_offload"),Yy.forEach(t),Ig=l(Ke,", this method moves one whole model at a time to the GPU when its "),Mi=s(Ke,"CODE",{});var qy=o(Mi);Ug=l(qy,"forward"),qy.forEach(t),jg=l(Ke,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),wi=s(Ke,"CODE",{});var Sy=o(wi);Zg=l(Sy,"enable_sequential_cpu_offload"),Sy.forEach(t),Vg=l(Ke,", but performance is much better due to the iterative execution of the "),ki=s(Ke,"CODE",{});var Dy=o(ki);Pg=l(Dy,"unet"),Dy.forEach(t),Gg=l(Ke,"."),Ke.forEach(t),np.forEach(t),ne.forEach(t),cr=d(n),cn=s(n,"H3",{class:!0});var tp=o(cn);zn=s(tp,"A",{id:!0,class:!0,href:!0});var zy=o(zn);Ji=s(zy,"SPAN",{});var Ly=o(Ji);_(Ja.$$.fragment,Ly),Ly.forEach(t),zy.forEach(t),Wg=d(tp),Ti=s(tp,"SPAN",{});var Hy=o(Ti);Cg=l(Hy,"KandinskyV22PriorEmb2EmbPipeline"),Hy.forEach(t),tp.forEach(t),mr=d(n),P=s(n,"DIV",{class:!0});var te=o(P);_(Ta.$$.fragment,te),Eg=d(te),vi=s(te,"P",{});var Ay=o(vi);Bg=l(Ay,"Pipeline for generating image prior for Kandinsky"),Ay.forEach(t),$g=d(te),va=s(te,"P",{});var ap=o(va);xg=l(ap,"This model inherits from "),Ts=s(ap,"A",{href:!0});var Oy=o(Ts);Rg=l(Oy,"DiffusionPipeline"),Oy.forEach(t),Kg=l(ap,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),ap.forEach(t),Xg=d(te),Te=s(te,"DIV",{class:!0});var xs=o(Te);_(Ia.$$.fragment,xs),Fg=d(xs),Ii=s(xs,"P",{});var e2=o(Ii);Ng=l(e2,"Function invoked when calling the pipeline for generation."),e2.forEach(t),Qg=d(xs),_(Ln.$$.fragment,xs),xs.forEach(t),Yg=d(te),ve=s(te,"DIV",{class:!0});var Rs=o(ve);_(Ua.$$.fragment,Rs),qg=d(Rs),Ui=s(Rs,"P",{});var n2=o(Ui);Sg=l(n2,"Function invoked when using the prior pipeline for interpolation."),n2.forEach(t),Dg=d(Rs),_(Hn.$$.fragment,Rs),Rs.forEach(t),zg=d(te),An=s(te,"DIV",{class:!0});var sp=o(An);_(ja.$$.fragment,sp),Lg=d(sp),L=s(sp,"P",{});var Xe=o(L);Hg=l(Xe,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),ji=s(Xe,"CODE",{});var t2=o(ji);Ag=l(t2,"enable_sequential_cpu_offload"),t2.forEach(t),Og=l(Xe,", this method moves one whole model at a time to the GPU when its "),Zi=s(Xe,"CODE",{});var a2=o(Zi);eh=l(a2,"forward"),a2.forEach(t),nh=l(Xe,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Vi=s(Xe,"CODE",{});var s2=o(Vi);th=l(s2,"enable_sequential_cpu_offload"),s2.forEach(t),ah=l(Xe,", but performance is much better due to the iterative execution of the "),Pi=s(Xe,"CODE",{});var o2=o(Pi);sh=l(o2,"unet"),o2.forEach(t),oh=l(Xe,"."),Xe.forEach(t),sp.forEach(t),te.forEach(t),gr=d(n),mn=s(n,"H3",{class:!0});var op=o(mn);On=s(op,"A",{id:!0,class:!0,href:!0});var i2=o(On);Gi=s(i2,"SPAN",{});var l2=o(Gi);_(Za.$$.fragment,l2),l2.forEach(t),i2.forEach(t),ih=d(op),Wi=s(op,"SPAN",{});var r2=o(Wi);lh=l(r2,"KandinskyV22CombinedPipeline"),r2.forEach(t),op.forEach(t),hr=d(n),R=s(n,"DIV",{class:!0});var Fe=o(R);_(Va.$$.fragment,Fe),rh=d(Fe),Ci=s(Fe,"P",{});var p2=o(Ci);ph=l(p2,"Combined Pipeline for text-to-image generation using Kandinsky"),p2.forEach(t),dh=d(Fe),Pa=s(Fe,"P",{});var ip=o(Pa);ch=l(ip,"This model inherits from "),vs=s(ip,"A",{href:!0});var d2=o(vs);mh=l(d2,"DiffusionPipeline"),d2.forEach(t),gh=l(ip,`. 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.)`),ip.forEach(t),hh=d(Fe),Ie=s(Fe,"DIV",{class:!0});var Ks=o(Ie);_(Ga.$$.fragment,Ks),uh=d(Ks),Ei=s(Ks,"P",{});var c2=o(Ei);fh=l(c2,"Function invoked when calling the pipeline for generation."),c2.forEach(t),yh=d(Ks),_(et.$$.fragment,Ks),Ks.forEach(t),_h=d(Fe),nt=s(Fe,"DIV",{class:!0});var lp=o(nt);_(Wa.$$.fragment,lp),bh=d(lp),H=s(lp,"P",{});var Ne=o(H);Mh=l(Ne,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Bi=s(Ne,"CODE",{});var m2=o(Bi);wh=l(m2,"enable_sequential_cpu_offload"),m2.forEach(t),kh=l(Ne,", this method moves one whole model at a time to the GPU when its "),$i=s(Ne,"CODE",{});var g2=o($i);Jh=l(g2,"forward"),g2.forEach(t),Th=l(Ne,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),xi=s(Ne,"CODE",{});var h2=o(xi);vh=l(h2,"enable_sequential_cpu_offload"),h2.forEach(t),Ih=l(Ne,", but performance is much better due to the iterative execution of the "),Ri=s(Ne,"CODE",{});var u2=o(Ri);Uh=l(u2,"unet"),u2.forEach(t),jh=l(Ne,"."),Ne.forEach(t),lp.forEach(t),Fe.forEach(t),ur=d(n),gn=s(n,"H3",{class:!0});var rp=o(gn);tt=s(rp,"A",{id:!0,class:!0,href:!0});var f2=o(tt);Ki=s(f2,"SPAN",{});var y2=o(Ki);_(Ca.$$.fragment,y2),y2.forEach(t),f2.forEach(t),Zh=d(rp),Xi=s(rp,"SPAN",{});var _2=o(Xi);Vh=l(_2,"KandinskyV22Img2ImgCombinedPipeline"),_2.forEach(t),rp.forEach(t),fr=d(n),K=s(n,"DIV",{class:!0});var Qe=o(K);_(Ea.$$.fragment,Qe),Ph=d(Qe),Fi=s(Qe,"P",{});var b2=o(Fi);Gh=l(b2,"Combined Pipeline for image-to-image generation using Kandinsky"),b2.forEach(t),Wh=d(Qe),Ba=s(Qe,"P",{});var pp=o(Ba);Ch=l(pp,"This model inherits from "),Is=s(pp,"A",{href:!0});var M2=o(Is);Eh=l(M2,"DiffusionPipeline"),M2.forEach(t),Bh=l(pp,`. 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.)`),pp.forEach(t),$h=d(Qe),Ue=s(Qe,"DIV",{class:!0});var Xs=o(Ue);_($a.$$.fragment,Xs),xh=d(Xs),Ni=s(Xs,"P",{});var w2=o(Ni);Rh=l(w2,"Function invoked when calling the pipeline for generation."),w2.forEach(t),Kh=d(Xs),_(at.$$.fragment,Xs),Xs.forEach(t),Xh=d(Qe),st=s(Qe,"DIV",{class:!0});var dp=o(st);_(xa.$$.fragment,dp),Fh=d(dp),A=s(dp,"P",{});var Ye=o(A);Nh=l(Ye,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Qi=s(Ye,"CODE",{});var k2=o(Qi);Qh=l(k2,"enable_sequential_cpu_offload"),k2.forEach(t),Yh=l(Ye,", this method moves one whole model at a time to the GPU when its "),Yi=s(Ye,"CODE",{});var J2=o(Yi);qh=l(J2,"forward"),J2.forEach(t),Sh=l(Ye,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),qi=s(Ye,"CODE",{});var T2=o(qi);Dh=l(T2,"enable_sequential_cpu_offload"),T2.forEach(t),zh=l(Ye,", but performance is much better due to the iterative execution of the "),Si=s(Ye,"CODE",{});var v2=o(Si);Lh=l(v2,"unet"),v2.forEach(t),Hh=l(Ye,"."),Ye.forEach(t),dp.forEach(t),Qe.forEach(t),yr=d(n),hn=s(n,"H3",{class:!0});var cp=o(hn);ot=s(cp,"A",{id:!0,class:!0,href:!0});var I2=o(ot);Di=s(I2,"SPAN",{});var U2=o(Di);_(Ra.$$.fragment,U2),U2.forEach(t),I2.forEach(t),Ah=d(cp),zi=s(cp,"SPAN",{});var j2=o(zi);Oh=l(j2,"KandinskyV22InpaintCombinedPipeline"),j2.forEach(t),cp.forEach(t),_r=d(n),X=s(n,"DIV",{class:!0});var qe=o(X);_(Ka.$$.fragment,qe),eu=d(qe),Li=s(qe,"P",{});var Z2=o(Li);nu=l(Z2,"Combined Pipeline for inpainting generation using Kandinsky"),Z2.forEach(t),tu=d(qe),Xa=s(qe,"P",{});var mp=o(Xa);au=l(mp,"This model inherits from "),Us=s(mp,"A",{href:!0});var V2=o(Us);su=l(V2,"DiffusionPipeline"),V2.forEach(t),ou=l(mp,`. 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.)`),mp.forEach(t),iu=d(qe),je=s(qe,"DIV",{class:!0});var Fs=o(je);_(Fa.$$.fragment,Fs),lu=d(Fs),Hi=s(Fs,"P",{});var P2=o(Hi);ru=l(P2,"Function invoked when calling the pipeline for generation."),P2.forEach(t),pu=d(Fs),_(it.$$.fragment,Fs),Fs.forEach(t),du=d(qe),lt=s(qe,"DIV",{class:!0});var gp=o(lt);_(Na.$$.fragment,gp),cu=d(gp),O=s(gp,"P",{});var Se=o(O);mu=l(Se,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Ai=s(Se,"CODE",{});var G2=o(Ai);gu=l(G2,"enable_sequential_cpu_offload"),G2.forEach(t),hu=l(Se,", this method moves one whole model at a time to the GPU when its "),Oi=s(Se,"CODE",{});var W2=o(Oi);uu=l(W2,"forward"),W2.forEach(t),fu=l(Se,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),el=s(Se,"CODE",{});var C2=o(el);yu=l(C2,"enable_sequential_cpu_offload"),C2.forEach(t),_u=l(Se,", but performance is much better due to the iterative execution of the "),nl=s(Se,"CODE",{});var E2=o(nl);bu=l(E2,"unet"),E2.forEach(t),Mu=l(Se,"."),Se.forEach(t),gp.forEach(t),qe.forEach(t),this.h()},h(){g(h,"name","hf:doc:metadata"),g(h,"content",JSON.stringify(t_)),g(u,"id","kandinsky-22"),g(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"),g(u,"href","#kandinsky-22"),g(J,"class","relative group"),hp(La.src,ku="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinskyv22/%20blue%20eyes.png")||g(La,"src",ku),g(La,"alt","img"),g(_n,"id","texttoimage-generation-with-controlnet-conditioning"),g(_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"),g(_n,"href","#texttoimage-generation-with-controlnet-conditioning"),g(en,"class","relative group"),g(Aa,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22ControlnetPipeline"),hp(ns.src,Ju="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinskyv22/cat.png")||g(ns,"src",Ju),g(ns,"alt","img"),hp(ss.src,Tu="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinskyv22/robot_cat_text2img.png")||g(ss,"src",Tu),g(ss,"alt","img"),g(kn,"id","imagetoimage-generation-with-controlnet-conditioning"),g(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"),g(kn,"href","#imagetoimage-generation-with-controlnet-conditioning"),g(nn,"class","relative group"),g(os,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22ControlnetImg2ImgPipeline"),g(is,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22PriorEmb2EmbPipeline"),hp(cs.src,vu="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinskyv22/robot_cat.png")||g(cs,"src",vu),g(cs,"alt","img"),g(Jn,"id","optimization"),g(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"),g(Jn,"href","#optimization"),g(tn,"class","relative group"),g(ms,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyPriorPipeline"),g(gs,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyPipeline"),g(hs,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyImg2ImgPipeline"),g(us,"href","/docs/diffusers/v0.19.0/en/api/pipelines/kandinsky#diffusers.KandinskyInpaintPipeline"),g(vt,"href","https://github.com/facebookresearch/xformers"),g(vt,"rel","nofollow"),g(Ut,"href","https://pytorch.org/blog/accelerated-diffusers-pt-20/"),g(Ut,"rel","nofollow"),g(Pt,"href","https://huggingface.co/docs/diffusers/main/en/optimization/torch2.0"),g(Pt,"rel","nofollow"),g(jn,"id","available-pipelines"),g(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"),g(jn,"href","#available-pipelines"),g(an,"class","relative group"),g(Et,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2.py"),g(Et,"rel","nofollow"),g($t,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_combined.py"),g($t,"rel","nofollow"),g(Rt,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_inpaint.py"),g(Rt,"rel","nofollow"),g(Xt,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_img2img.py"),g(Xt,"rel","nofollow"),g(Nt,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet.py"),g(Nt,"rel","nofollow"),g(Yt,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/kandinsky2_2/pipeline_kandinsky2_2_controlnet_img2img.py"),g(Yt,"rel","nofollow"),g(Vn,"id","diffusers.KandinskyV22Pipeline"),g(Vn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(Vn,"href","#diffusers.KandinskyV22Pipeline"),g(sn,"class","relative group"),g(_s,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Gn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Wn,"id","diffusers.KandinskyV22ControlnetPipeline"),g(Wn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(Wn,"href","#diffusers.KandinskyV22ControlnetPipeline"),g(on,"class","relative group"),g(bs,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(En,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Bn,"id","diffusers.KandinskyV22ControlnetImg2ImgPipeline"),g(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"),g(Bn,"href","#diffusers.KandinskyV22ControlnetImg2ImgPipeline"),g(ln,"class","relative group"),g(Ms,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(xn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Rn,"id","diffusers.KandinskyV22Img2ImgPipeline"),g(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"),g(Rn,"href","#diffusers.KandinskyV22Img2ImgPipeline"),g(rn,"class","relative group"),g(ws,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Xn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Fn,"id","diffusers.KandinskyV22InpaintPipeline"),g(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"),g(Fn,"href","#diffusers.KandinskyV22InpaintPipeline"),g(pn,"class","relative group"),g(ks,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Qn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Yn,"id","diffusers.KandinskyV22PriorPipeline"),g(Yn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(Yn,"href","#diffusers.KandinskyV22PriorPipeline"),g(dn,"class","relative group"),g(Js,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Dn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(zn,"id","diffusers.KandinskyV22PriorEmb2EmbPipeline"),g(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"),g(zn,"href","#diffusers.KandinskyV22PriorEmb2EmbPipeline"),g(cn,"class","relative group"),g(Ts,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(An,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(On,"id","diffusers.KandinskyV22CombinedPipeline"),g(On,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(On,"href","#diffusers.KandinskyV22CombinedPipeline"),g(mn,"class","relative group"),g(vs,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(tt,"id","diffusers.KandinskyV22Img2ImgCombinedPipeline"),g(tt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(tt,"href","#diffusers.KandinskyV22Img2ImgCombinedPipeline"),g(gn,"class","relative group"),g(Is,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ot,"id","diffusers.KandinskyV22InpaintCombinedPipeline"),g(ot,"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"),g(ot,"href","#diffusers.KandinskyV22InpaintCombinedPipeline"),g(hn,"class","relative group"),g(Us,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(n,c){e(document.head,h),m(n,v,c),m(n,J,c),e(J,u),e(u,T),b(r,T,null),e(J,f),e(J,De),e(De,le),m(n,un,c),m(n,G,c),e(G,re),e(G,ze),e(ze,rt),e(G,pe),e(G,Le),e(Le,pt),e(G,de),e(G,He),e(He,dt),e(G,ce),m(n,fn,c),m(n,me,c),e(me,Ae),m(n,Z,c),m(n,Oe,c),e(Oe,Sa),m(n,ct,c),b(ge,n,c),m(n,mt,c),m(n,oe,c),e(oe,Da),e(oe,Ns),e(Ns,up),e(oe,fp),m(n,cl,c),b(gt,n,c),m(n,ml,c),m(n,yn,c),e(yn,yp),e(yn,Qs),e(Qs,_p),e(yn,bp),m(n,gl,c),b(ht,n,c),m(n,hl,c),m(n,za,c),e(za,La),m(n,ul,c),m(n,Ha,c),e(Ha,Mp),m(n,fl,c),m(n,en,c),e(en,_n),e(_n,Ys),b(ut,Ys,null),e(en,wp),e(en,qs),e(qs,kp),m(n,yl,c),m(n,bn,c),e(bn,Jp),e(bn,Aa),e(Aa,Tp),e(bn,vp),m(n,_l,c),m(n,Oa,c),e(Oa,Ip),m(n,bl,c),b(ft,n,c),m(n,Ml,c),m(n,es,c),e(es,ns),m(n,wl,c),m(n,Mn,c),e(Mn,Up),e(Mn,Ss),e(Ss,jp),e(Mn,Zp),m(n,kl,c),b(yt,n,c),m(n,Jl,c),m(n,ts,c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q,yc),e(Q,Co),e(Co,_c),e(Q,bc),e(Q,Eo),e(Eo,Mc),e(Q,wc),m(n,nr,c),m(n,on,c),e(on,Wn),e(Wn,Bo),b(Ht,Bo,null),e(on,kc),e(on,$o),e($o,Jc),m(n,tr,c),m(n,E,c),b(At,E,null),e(E,Tc),e(E,xo),e(xo,vc),e(E,Ic),e(E,Ot),e(Ot,Uc),e(Ot,bs),e(bs,jc),e(Ot,Zc),e(E,Vc),e(E,_e),b(ea,_e,null),e(_e,Pc),e(_e,Ro),e(Ro,Gc),e(_e,Wc),b(Cn,_e,null),e(E,Cc),e(E,En),b(na,En,null),e(En,Ec),e(En,Y),e(Y,Bc),e(Y,Ko),e(Ko,$c),e(Y,xc),e(Y,Xo),e(Xo,Rc),e(Y,Kc),e(Y,Fo),e(Fo,Xc),e(Y,Fc),e(Y,No),e(No,Nc),e(Y,Qc),m(n,ar,c),m(n,ln,c),e(ln,Bn),e(Bn,Qo),b(ta,Qo,null),e(ln,Yc),e(ln,Yo),e(Yo,qc),m(n,sr,c),m(n,B,c),b(aa,B,null),e(B,Sc),e(B,qo),e(qo,Dc),e(B,zc),e(B,sa),e(sa,Lc),e(sa,Ms),e(Ms,Hc),e(sa,Ac),e(B,Oc),e(B,be),b(oa,be,null),e(be,em),e(be,So),e(So,nm),e(be,tm),b($n,be,null),e(B,am),e(B,xn),b(ia,xn,null),e(xn,sm),e(xn,q),e(q,om),e(q,Do),e(Do,im),e(q,lm),e(q,zo),e(zo,rm),e(q,pm),e(q,Lo),e(Lo,dm),e(q,cm),e(q,Ho),e(Ho,mm),e(q,gm),m(n,or,c),m(n,rn,c),e(rn,Rn),e(Rn,Ao),b(la,Ao,null),e(rn,hm),e(rn,Oo),e(Oo,um),m(n,ir,c),m(n,$,c),b(ra,$,null),e($,fm),e($,ei),e(ei,ym),e($,_m),e($,pa),e(pa,bm),e(pa,ws),e(ws,Mm),e(pa,wm),e($,km),e($,Me),b(da,Me,null),e(Me,Jm),e(Me,ni),e(ni,Tm),e(Me,vm),b(Kn,Me,null),e($,Im),e($,Xn),b(ca,Xn,null),e(Xn,Um),e(Xn,S),e(S,jm),e(S,ti),e(ti,Zm),e(S,Vm),e(S,ai),e(ai,Pm),e(S,Gm),e(S,si),e(si,Wm),e(S,Cm),e(S,oi),e(oi,Em),e(S,Bm),m(n,lr,c),m(n,pn,c),e(pn,Fn),e(Fn,ii),b(ma,ii,null),e(pn,$m),e(pn,li),e(li,xm),m(n,rr,c),m(n,x,c),b(ga,x,null),e(x,Rm),e(x,ri),e(ri,Km),e(x,Xm),e(x,ha),e(ha,Fm),e(ha,ks),e(ks,Nm),e(ha,Qm),e(x,Ym),e(x,we),b(ua,we,null),e(we,qm),e(we,pi),e(pi,Sm),e(we,Dm),b(Nn,we,null),e(x,zm),e(x,Qn),b(fa,Qn,null),e(Qn,Lm),e(Qn,D),e(D,Hm),e(D,di),e(di,Am),e(D,Om),e(D,ci),e(ci,eg),e(D,ng),e(D,mi),e(mi,tg),e(D,ag),e(D,gi),e(gi,sg),e(D,og),m(n,pr,c),m(n,dn,c),e(dn,Yn),e(Yn,hi),b(ya,hi,null),e(dn,ig),e(dn,ui),e(ui,lg),m(n,dr,c),m(n,V,c),b(_a,V,null),e(V,rg),e(V,fi),e(fi,pg),e(V,dg),e(V,ba),e(ba,cg),e(ba,Js),e(Js,mg),e(ba,gg),e(V,hg),e(V,ke),b(Ma,ke,null),e(ke,ug),e(ke,yi),e(yi,fg),e(ke,yg),b(qn,ke,null),e(V,_g),e(V,Je),b(wa,Je,null),e(Je,bg),e(Je,_i),e(_i,Mg),e(Je,wg),b(Sn,Je,null),e(V,kg),e(V,Dn),b(ka,Dn,null),e(Dn,Jg),e(Dn,z),e(z,Tg),e(z,bi),e(bi,vg),e(z,Ig),e(z,Mi),e(Mi,Ug),e(z,jg),e(z,wi),e(wi,Zg),e(z,Vg),e(z,ki),e(ki,Pg),e(z,Gg),m(n,cr,c),m(n,cn,c),e(cn,zn),e(zn,Ji),b(Ja,Ji,null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(Ni,Rh),e(Ue,Kh),b(at,Ue,null),e(K,Xh),e(K,st),b(xa,st,null),e(st,Fh),e(st,A),e(A,Nh),e(A,Qi),e(Qi,Qh),e(A,Yh),e(A,Yi),e(Yi,qh),e(A,Sh),e(A,qi),e(qi,Dh),e(A,zh),e(A,Si),e(Si,Lh),e(A,Hh),m(n,yr,c),m(n,hn,c),e(hn,ot),e(ot,Di),b(Ra,Di,null),e(hn,Ah),e(hn,zi),e(zi,Oh),m(n,_r,c),m(n,X,c),b(Ka,X,null),e(X,eu),e(X,Li),e(Li,nu),e(X,tu),e(X,Xa),e(Xa,au),e(Xa,Us),e(Us,su),e(Xa,ou),e(X,iu),e(X,je),b(Fa,je,null),e(je,lu),e(je,Hi),e(Hi,ru),e(je,pu),b(it,je,null),e(X,du),e(X,lt),b(Na,lt,null),e(lt,cu),e(lt,O),e(O,mu),e(O,Ai),e(Ai,gu),e(O,hu),e(O,Oi),e(Oi,uu),e(O,fu),e(O,el),e(el,yu),e(O,_u),e(O,nl),e(nl,bu),e(O,Mu),br=!0},p(n,[c]){const Qa={};c&2&&(Qa.$$scope={dirty:c,ctx:n}),Un.$set(Qa);const tl={};c&2&&(tl.$$scope={dirty:c,ctx:n}),Pn.$set(tl);const al={};c&2&&(al.$$scope={dirty:c,ctx:n}),Cn.$set(al);const sl={};c&2&&(sl.$$scope={dirty:c,ctx:n}),$n.$set(sl);const ie={};c&2&&(ie.$$scope={dirty:c,ctx:n}),Kn.$set(ie);const ol={};c&2&&(ol.$$scope={dirty:c,ctx:n}),Nn.$set(ol);const il={};c&2&&(il.$$scope={dirty:c,ctx:n}),qn.$set(il);const ll={};c&2&&(ll.$$scope={dirty:c,ctx:n}),Sn.$set(ll);const rl={};c&2&&(rl.$$scope={dirty:c,ctx:n}),Ln.$set(rl);const pl={};c&2&&(pl.$$scope={dirty:c,ctx:n}),Hn.$set(pl);const Ya={};c&2&&(Ya.$$scope={dirty:c,ctx:n}),et.$set(Ya);const dl={};c&2&&(dl.$$scope={dirty:c,ctx:n}),at.$set(dl);const qa={};c&2&&(qa.$$scope={dirty:c,ctx:n}),it.$set(qa)},i(n){br||(M(r.$$.fragment,n),M(ge.$$.fragment,n),M(gt.$$.fragment,n),M(ht.$$.fragment,n),M(ut.$$.fragment,n),M(ft.$$.fragment,n),M(yt.$$.fragment,n),M(_t.$$.fragment,n),M(bt.$$.fragment,n),M(Mt.$$.fragment,n),M(kt.$$.fragment,n),M(Jt.$$.fragment,n),M(Tt.$$.fragment,n),M(It.$$.fragment,n),M(jt.$$.fragment,n),M(Zt.$$.fragment,n),M(Vt.$$.fragment,n),M(Un.$$.fragment,n),M(Gt.$$.fragment,n),M(qt.$$.fragment,n),M(St.$$.fragment,n),M(zt.$$.fragment,n),M(Pn.$$.fragment,n),M(Lt.$$.fragment,n),M(Ht.$$.fragment,n),M(At.$$.fragment,n),M(ea.$$.fragment,n),M(Cn.$$.fragment,n),M(na.$$.fragment,n),M(ta.$$.fragment,n),M(aa.$$.fragment,n),M(oa.$$.fragment,n),M($n.$$.fragment,n),M(ia.$$.fragment,n),M(la.$$.fragment,n),M(ra.$$.fragment,n),M(da.$$.fragment,n),M(Kn.$$.fragment,n),M(ca.$$.fragment,n),M(ma.$$.fragment,n),M(ga.$$.fragment,n),M(ua.$$.fragment,n),M(Nn.$$.fragment,n),M(fa.$$.fragment,n),M(ya.$$.fragment,n),M(_a.$$.fragment,n),M(Ma.$$.fragment,n),M(qn.$$.fragment,n),M(wa.$$.fragment,n),M(Sn.$$.fragment,n),M(ka.$$.fragment,n),M(Ja.$$.fragment,n),M(Ta.$$.fragment,n),M(Ia.$$.fragment,n),M(Ln.$$.fragment,n),M(Ua.$$.fragment,n),M(Hn.$$.fragment,n),M(ja.$$.fragment,n),M(Za.$$.fragment,n),M(Va.$$.fragment,n),M(Ga.$$.fragment,n),M(et.$$.fragment,n),M(Wa.$$.fragment,n),M(Ca.$$.fragment,n),M(Ea.$$.fragment,n),M($a.$$.fragment,n),M(at.$$.fragment,n),M(xa.$$.fragment,n),M(Ra.$$.fragment,n),M(Ka.$$.fragment,n),M(Fa.$$.fragment,n),M(it.$$.fragment,n),M(Na.$$.fragment,n),br=!0)},o(n){w(r.$$.fragment,n),w(ge.$$.fragment,n),w(gt.$$.fragment,n),w(ht.$$.fragment,n),w(ut.$$.fragment,n),w(ft.$$.fragment,n),w(yt.$$.fragment,n),w(_t.$$.fragment,n),w(bt.$$.fragment,n),w(Mt.$$.fragment,n),w(kt.$$.fragment,n),w(Jt.$$.fragment,n),w(Tt.$$.fragment,n),w(It.$$.fragment,n),w(jt.$$.fragment,n),w(Zt.$$.fragment,n),w(Vt.$$.fragment,n),w(Un.$$.fragment,n),w(Gt.$$.fragment,n),w(qt.$$.fragment,n),w(St.$$.fragment,n),w(zt.$$.fragment,n),w(Pn.$$.fragment,n),w(Lt.$$.fragment,n),w(Ht.$$.fragment,n),w(At.$$.fragment,n),w(ea.$$.fragment,n),w(Cn.$$.fragment,n),w(na.$$.fragment,n),w(ta.$$.fragment,n),w(aa.$$.fragment,n),w(oa.$$.fragment,n),w($n.$$.fragment,n),w(ia.$$.fragment,n),w(la.$$.fragment,n),w(ra.$$.fragment,n),w(da.$$.fragment,n),w(Kn.$$.fragment,n),w(ca.$$.fragment,n),w(ma.$$.fragment,n),w(ga.$$.fragment,n),w(ua.$$.fragment,n),w(Nn.$$.fragment,n),w(fa.$$.fragment,n),w(ya.$$.fragment,n),w(_a.$$.fragment,n),w(Ma.$$.fragment,n),w(qn.$$.fragment,n),w(wa.$$.fragment,n),w(Sn.$$.fragment,n),w(ka.$$.fragment,n),w(Ja.$$.fragment,n),w(Ta.$$.fragment,n),w(Ia.$$.fragment,n),w(Ln.$$.fragment,n),w(Ua.$$.fragment,n),w(Hn.$$.fragment,n),w(ja.$$.fragment,n),w(Za.$$.fragment,n),w(Va.$$.fragment,n),w(Ga.$$.fragment,n),w(et.$$.fragment,n),w(Wa.$$.fragment,n),w(Ca.$$.fragment,n),w(Ea.$$.fragment,n),w($a.$$.fragment,n),w(at.$$.fragment,n),w(xa.$$.fragment,n),w(Ra.$$.fragment,n),w(Ka.$$.fragment,n),w(Fa.$$.fragment,n),w(it.$$.fragment,n),w(Na.$$.fragment,n),br=!1},d(n){t(h),n&&t(v),n&&t(J),k(r),n&&t(un),n&&t(G),n&&t(fn),n&&t(me),n&&t(Z),n&&t(Oe),n&&t(ct),k(ge,n),n&&t(mt),n&&t(oe),n&&t(cl),k(gt,n),n&&t(ml),n&&t(yn),n&&t(gl),k(ht,n),n&&t(hl),n&&t(za),n&&t(ul),n&&t(Ha),n&&t(fl),n&&t(en),k(ut),n&&t(yl),n&&t(bn),n&&t(_l),n&&t(Oa),n&&t(bl),k(ft,n),n&&t(Ml),n&&t(es),n&&t(wl),n&&t(Mn),n&&t(kl),k(yt,n),n&&t(Jl),n&&t(ts),n&&t(Tl),k(_t,n),n&&t(vl),n&&t(as),n&&t(Il),k(bt,n),n&&t(Ul),n&&t(wn),n&&t(jl),k(Mt,n),n&&t(Zl),n&&t(wt),n&&t(Vl),n&&t(nn),k(kt),n&&t(Pl),n&&t(he),n&&t(Gl),n&&t(ls),n&&t(Wl),n&&t(rs),n&&t(Cl),k(Jt,n),n&&t(El),n&&t(ps),n&&t(Bl),n&&t(ds),n&&t($l),n&&t(tn),k(Tt),n&&t(xl),n&&t(N),n&&t(Rl),n&&t(fs),n&&t(Kl),n&&t(Tn),n&&t(Xl),k(It,n),n&&t(Fl),n&&t(vn),n&&t(Nl),n&&t(ys),n&&t(Ql),k(jt,n),n&&t(Yl),n&&t(ue),n&&t(ql),k(Zt,n),n&&t(Sl),n&&t(fe),n&&t(Dl),k(Vt,n),n&&t(zl),n&&t(In),n&&t(Ll),k(Un,n),n&&t(Hl),n&&t(an),k(Gt),n&&t(Al),n&&t(Zn),n&&t(Ol),n&&t(sn),k(qt),n&&t(er),n&&t(C),k(St),k(zt),k(Pn),k(Lt),n&&t(nr),n&&t(on),k(Ht),n&&t(tr),n&&t(E),k(At),k(ea),k(Cn),k(na),n&&t(ar),n&&t(ln),k(ta),n&&t(sr),n&&t(B),k(aa),k(oa),k($n),k(ia),n&&t(or),n&&t(rn),k(la),n&&t(ir),n&&t($),k(ra),k(da),k(Kn),k(ca),n&&t(lr),n&&t(pn),k(ma),n&&t(rr),n&&t(x),k(ga),k(ua),k(Nn),k(fa),n&&t(pr),n&&t(dn),k(ya),n&&t(dr),n&&t(V),k(_a),k(Ma),k(qn),k(wa),k(Sn),k(ka),n&&t(cr),n&&t(cn),k(Ja),n&&t(mr),n&&t(P),k(Ta),k(Ia),k(Ln),k(Ua),k(Hn),k(ja),n&&t(gr),n&&t(mn),k(Za),n&&t(hr),n&&t(R),k(Va),k(Ga),k(et),k(Wa),n&&t(ur),n&&t(gn),k(Ca),n&&t(fr),n&&t(K),k(Ea),k($a),k(at),k(xa),n&&t(yr),n&&t(hn),k(Ra),n&&t(_r),n&&t(X),k(Ka),k(Fa),k(it),k(Na)}}}const t_={local:"kandinsky-22",sections:[{local:null,sections:[{local:"texttoimage-generation-with-controlnet-conditioning",title:"Text-to-Image Generation with ControlNet Conditioning"},{local:"imagetoimage-generation-with-controlnet-conditioning",title:"Image-to-Image Generation with ControlNet Conditioning"}],title:null},{local:"optimization",title:"Optimization"},{local:"available-pipelines",sections:[{local:"diffusers.KandinskyV22Pipeline",title:"KandinskyV22Pipeline"},{local:"diffusers.KandinskyV22ControlnetPipeline",title:"KandinskyV22ControlnetPipeline"},{local:"diffusers.KandinskyV22ControlnetImg2ImgPipeline",title:"KandinskyV22ControlnetImg2ImgPipeline"},{local:"diffusers.KandinskyV22Img2ImgPipeline",title:"KandinskyV22Img2ImgPipeline"},{local:"diffusers.KandinskyV22InpaintPipeline",title:"KandinskyV22InpaintPipeline"},{local:"diffusers.KandinskyV22PriorPipeline",title:"KandinskyV22PriorPipeline"},{local:"diffusers.KandinskyV22PriorEmb2EmbPipeline",title:"KandinskyV22PriorEmb2EmbPipeline"},{local:"diffusers.KandinskyV22CombinedPipeline",title:"KandinskyV22CombinedPipeline"},{local:"diffusers.KandinskyV22Img2ImgCombinedPipeline",title:"KandinskyV22Img2ImgCombinedPipeline"},{local:"diffusers.KandinskyV22InpaintCombinedPipeline",title:"KandinskyV22InpaintCombinedPipeline"}],title:"Available Pipelines:"}],title:"Kandinsky 2.2"};function a_(U){return K2(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class d_ extends B2{constructor(h){super();$2(this,h,a_,n_,x2,{})}}export{d_ as default,t_ as metadata};
