import{S as F2,i as N2,s as Q2,e as a,k as p,w as y,t as i,M as Y2,c as s,d as t,m as d,a as o,x as _,h as l,b as g,N as bp,G as e,g as m,y as b,q as M,o as w,B as k,v as q2,L as se}from"../../../chunks/vendor-hf-doc-builder.js";import{T as S2}from"../../../chunks/Tip-hf-doc-builder.js";import{D as v}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 D2(U){let h,I,J,u,T,r,f,Se,ie,un,W,le,De,pt,re,ze,dt,pe,He,ct,de,fn,ce;return{c(){h=a("p"),I=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"),Se=i(", "),ie=a("a"),un=i("KandinskyV22InpaintCombinedPipeline"),W=i(`.
These combined pipelines wrap the `),le=a("a"),De=i("KandinskyV22PriorPipeline"),pt=i(" and "),re=a("a"),ze=i("KandinskyV22Pipeline"),dt=i(", "),pe=a("a"),He=i("KandinskyV22Img2ImgPipeline"),ct=i(", "),de=a("a"),fn=i("KandinskyV22InpaintPipeline"),ce=i(` respectively into a single
pipeline for a simpler user experience`),this.h()},l(Ae){h=s(Ae,"P",{});var Z=o(h);I=l(Z,"To generate images directly from a single pipeline, you can use "),J=s(Z,"A",{href:!0});var me=o(J);u=l(me,"KandinskyV22CombinedPipeline"),me.forEach(t),T=l(Z,", "),r=s(Z,"A",{href:!0});var mt=o(r);f=l(mt,"KandinskyV22Img2ImgCombinedPipeline"),mt.forEach(t),Se=l(Z,", "),ie=s(Z,"A",{href:!0});var Le=o(ie);un=l(Le,"KandinskyV22InpaintCombinedPipeline"),Le.forEach(t),W=l(Z,`.
These combined pipelines wrap the `),le=s(Z,"A",{href:!0});var Da=o(le);De=l(Da,"KandinskyV22PriorPipeline"),Da.forEach(t),pt=l(Z," and "),re=s(Z,"A",{href:!0});var gt=o(re);ze=l(gt,"KandinskyV22Pipeline"),gt.forEach(t),dt=l(Z,", "),pe=s(Z,"A",{href:!0});var Oe=o(pe);He=l(Oe,"KandinskyV22Img2ImgPipeline"),Oe.forEach(t),ct=l(Z,", "),de=s(Z,"A",{href:!0});var za=o(de);fn=l(za,"KandinskyV22InpaintPipeline"),za.forEach(t),ce=l(Z,` respectively into a single
pipeline for a simpler user experience`),Z.forEach(t),this.h()},h(){g(J,"href","/docs/diffusers/main/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22CombinedPipeline"),g(r,"href","/docs/diffusers/main/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22Img2ImgCombinedPipeline"),g(ie,"href","/docs/diffusers/main/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22InpaintCombinedPipeline"),g(le,"href","/docs/diffusers/main/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22PriorPipeline"),g(re,"href","/docs/diffusers/main/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22Pipeline"),g(pe,"href","/docs/diffusers/main/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22Img2ImgPipeline"),g(de,"href","/docs/diffusers/main/en/api/pipelines/kandinsky_v22#diffusers.KandinskyV22InpaintPipeline")},m(Ae,Z){m(Ae,h,Z),e(h,I),e(h,J),e(J,u),e(h,T),e(h,r),e(r,f),e(h,Se),e(h,ie),e(ie,un),e(h,W),e(h,le),e(le,De),e(h,pt),e(h,re),e(re,ze),e(h,dt),e(h,pe),e(pe,He),e(h,ct),e(h,de),e(de,fn),e(h,ce)},d(Ae){Ae&&t(h)}}}function z2(U){let h,I,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"),I=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);I=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,I),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)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MjB6ZXJvX2ltYWdlX2VtYiUyMCUzRCUyMHBpcGVfcHJpb3IoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTIwbmVnYXRpdmVfcHJvbXB0JTNEbmVnYXRpdmVfcHJpb3JfcHJvbXB0JTJDJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTBBKS50b190dXBsZSgpJTBBJTBBaW1hZ2VzJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWIlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0R6ZXJvX2ltYWdlX2VtYiUyQyUwQSUyMCUyMCUyMCUyMGhpbnQlM0RoaW50JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEEpLmltYWdlcyUwQSUwQWltYWdlcyU1QjAlNUQuc2F2ZSglMjJyb2JvdF9jYXQucG5nJTIyKQ==",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"),I=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);I=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,I),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,I,J,u,T;return u=new j({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwS2FuZGluc2t5VjIyUHJpb3JFbWIyRW1iUGlwZWxpbmUlMkMlMjBLYW5kaW5za3lWMjJDb250cm9sbmV0SW1nMkltZ1BpcGVsaW5lJTBBZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEElMEElMEFkZWYlMjBtYWtlX2hpbnQoaW1hZ2UlMkMlMjBkZXB0aF9lc3RpbWF0b3IpJTNBJTBBJTIwJTIwJTIwJTIwaW1hZ2UlMjAlM0QlMjBkZXB0aF9lc3RpbWF0b3IoaW1hZ2UpJTVCJTIyZGVwdGglMjIlNUQlMEElMjAlMjAlMjAlMjBpbWFnZSUyMCUzRCUyMG5wLmFycmF5KGltYWdlKSUwQSUyMCUyMCUyMCUyMGltYWdlJTIwJTNEJTIwaW1hZ2UlNUIlM0ElMkMlMjAlM0ElMkMlMjBOb25lJTVEJTBBJTIwJTIwJTIwJTIwaW1hZ2UlMjAlM0QlMjBucC5jb25jYXRlbmF0ZSglNUJpbWFnZSUyQyUyMGltYWdlJTJDJTIwaW1hZ2UlNUQlMkMlMjBheGlzJTNEMiklMEElMjAlMjAlMjAlMjBkZXRlY3RlZF9tYXAlMjAlM0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MHdpZHRoJTNENzY4JTJDJTBBKS5pbWFnZXMlMEElMEFpbWFnZXMlNUIwJTVELnNhdmUoJTIycm9ib3RfY2F0LnBuZyUyMik=",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"),I=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);I=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,I),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,I,J,u,T;return u=new j({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMkltZzJJbWdQaXBlbGluZSUyQyUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQWltcG9ydCUyMHRv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IwJTIwJTIwaW1hZ2VfZW1iZWRzJTNEaW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfaW1hZ2VfZW1iZWRzJTNEemVyb19pbWFnZV9lbWIlMkMlMEElMjAlMjAlMjAlMjBoZWlnaHQlM0Q3NjglMkMlMEElMjAlMjAlMjAlMjB3aWR0aCUzRDc2OCUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QxMDAlMkMlMEElMjAlMjAlMjAlMjBzdHJlbmd0aCUzRDAuMiUyQyUwQSkuaW1hZ2VzJTBBJTBBaW1hZ2UlNUIwJTVELnNhdmUoJTIycmVkX2Zyb2cucG5nJTIyKQ==",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"),I=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);I=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,I),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,I,J,u,T;return u=new j({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMklucGFpbnRQaXBlbGluZSUyQyUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aW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2OCUyQyUyMDc2OCklMkMlMjBkdHlwZSUzRG5wLmZsb2F0MzIpJTBBbWFzayU1QiUzQTI1MCUyQyUyMDI1MCUzQS0yNTAlNUQlMjAlM0QlMjAxJTBBJTBBb3V0JTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBpbWFnZSUzRGluaXRfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBtYXNrX2ltYWdlJTNEbWFzayUyQyUwQSUyMCUyMCUyMCUyMGltYWdlX2VtYmVkcyUzRGltYWdlX2VtYiUyQyUwQSUyMCUyMCUyMCUyMG5lZ2F0aXZlX2ltYWdlX2VtYmVkcyUzRHplcm9faW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTAlMkMlMEEpJTBBJTBBaW1hZ2UlMjAlM0QlMjBvdXQuaW1hZ2VzJTVCMCU1RCUwQWltYWdlLnNhdmUoJTIyY2F0X3dpdGhfaGF0LnBuZyUyMik=",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"),I=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);I=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,I),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,I,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"),I=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);I=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,I),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,I,J,u,T;return u=new j({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUlMkMlMjBLYW5kaW5za3lWMjJQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBaW1wb3J0JTIwUElMJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdG9yY2h2aXNpb24lMjBpbXBvcnQlMjB0cmFuc2Zvcm1zJTBBJTBBcGlwZV9wcmlvciUyMCUzRCUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGVfcHJpb3IudG8oJTIyY3VkYSUyMiklMEFpbWcxJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZoZi1pbnRlcm5hbC10ZXN0aW5nJT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CUyMGhlaWdodCUzRDc2OCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTBBKS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2Uuc2F2ZSglMjJzdGFycnlfY2F0LnBuZyUyMik=",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"),I=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);I=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,I),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 t_(U){let h,I,J,u,T;return u=new j({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyM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klMEElMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwaW1hZ2VfZW1iZWRzJTNEaW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfaW1hZ2VfZW1iZWRzJTNEbmVnYXRpdmVfaW1hZ2VfZW1iJTJDJTBBJTIwJTIwJTIwJTIwaGVpZ2h0JTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwd2lkdGglM0Q3NjglMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMTAwJTJDJTBBKS5pbWFnZXMlMEElMEFpbWFnZSU1QjAlNUQuc2F2ZSglMjJjYXQucG5nJTIyKQ==",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"),I=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);I=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,I),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 a_(U){let h,I,J,u,T;return u=new j({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMlByaW9yRW1iMkVtYlBpcGVsaW5lJTJDJTIwS2FuZGluc2t5VjIyUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQWltcG9ydCUyMFBJTCUwQSUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMHRvcmNodmlzaW9uJTIwaW1wb3J0JTIwdHJhbnNmb3J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TJDJTIwd2VpZ2h0cyklMEElMEFwaXBlJTIwJTNEJTIwS2FuZGluc2t5VjIyUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLWRlY29kZXIlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTBBcGlwZS50byglMjJjdWRhJTIyKSUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWIlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0R6ZXJvX2ltYWdlX2VtYiUyQyUwQSUyMCUyMCUyMCUyMGhlaWdodCUzRDc2OCUyQyUwQSUyMCUyMCUyMCUyMHdpZHRoJTNENzY4JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDE1MCUyQyUwQSkuaW1hZ2VzJTVCMCU1RCUwQSUwQWltYWdlLnNhdmUoJTIyc3RhcnJ5X2NhdC5wbmclMjIp",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"),I=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);I=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,I),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 s_(U){let h,I,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"),I=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);I=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,I),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 o_(U){let h,I,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"),I=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);I=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,I),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 i_(U){let h,I,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"),I=i("Examples:"),J=p(),y(u.$$.fragment)},l(r){h=s(r,"P",{});var f=o(h);I=l(f,"Examples:"),f.forEach(t),J=d(r),_(u.$$.fragment,r)},m(r,f){m(r,h,f),e(h,I),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 l_(U){let h,I,J,u,T,r,f,Se,ie,un,W,le,De,pt,re,ze,dt,pe,He,ct,de,fn,ce,Ae,Z,me,mt,Le,Da,gt,Oe,za,gl,ht,hl,yn,Mp,Qs,wp,kp,ul,ut,fl,_n,Jp,Ys,Tp,Ip,yl,ft,_l,Ha,Aa,ju,bl,La,vp,Ml,en,bn,qs,yt,Up,Ss,jp,wl,Mn,Zp,Oa,Vp,Gp,kl,es,Wp,Jl,_t,Tl,ns,ts,Zu,Il,wn,Pp,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">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 alien cheeseburger creature eating itself, claymation, cinematic, moody lighting&quot;</span>
negative_prompt = <span class="hljs-string">&quot;low quality, bad quality&quot;</span>

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