import{s as nn,o as an,n as $}from"../chunks/scheduler.23542ac5.js";import{S as pn,i as mn,e as T,s as o,c as M,h as rn,a as k,d as p,b as c,f as Os,g as d,j as Z,k as G,l as lt,m as i,n as J,t as u,o as f,p as b}from"../chunks/index.9b1f405b.js";import{C as on,H as _,E as cn}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.ccdc6aab.js";import{C as w}from"../chunks/CodeBlock.cef191d3.js";import{D as yn}from"../chunks/DocNotebookDropdown.1788fe48.js";import{H as I,a as j}from"../chunks/HfOption.ea0ad09a.js";function Mn(h){let s,m,e,y="이제 모든 프롬프트와 임베딩을 <code>KandinskyPipeline</code>에 전달하여 이미지를 생성합니다:",t,n,r,U,V='<img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/kandinsky-docs/cheeseburger.png"/>',W;return s=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUlMkMlMjBLYW5kaW5za3lQaXBlbGluZSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBcHJpb3JfcGlwZWxpbmUlMjAlM0QlMjBLYW5kaW5za3lQcmlvclBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMS1wcmlvciUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMiklMEFwaXBlbGluZSUyMCUzRCUyMEthbmRpbnNreVBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMiklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwYWxpZW4lMjBjaGVlc2VidXJnZXIlMjBjcmVhdHVyZSUyMGVhdGluZyUyMGl0c2VsZiUyQyUyMGNsYXltYXRpb24lMkMlMjBjaW5lbWF0aWMlMkMlMjBtb29keSUyMGxpZ2h0aW5nJTIyJTBBbmVnYXRpdmVfcHJvbXB0JTIwJTNEJTIwJTIybG93JTIwcXVhbGl0eSUyQyUyMGJhZCUyMHF1YWxpdHklMjIlMjAlMjMlMjBuZWdhdGl2ZSUyMCVFRCU5NCU4NCVFQiVBMSVBQyVFRCU5NCU4NCVFRCU4QSVCOCUyMCVFRCU4RiVBQyVFRCU5NSVBOCVFQyU5RCU4MCUyMCVFQyU4NCVBMCVFRCU4MyU5RCVFQyVBMCU4MSVFQyU5RCVCNCVFQyVBNyU4MCVFQiVBNyU4QyUyQyUyMCVFQiVCMyVCNCVFRCU4NiVCNSUyMCVFQSVCMiVCMCVFQSVCMyVCQyVFQiU4QSU5NCUyMCVFQiU4RCU5NCUyMCVFQyVBMiU4QiVFQyU4QSVCNSVFQiU4QiU4OCVFQiU4QiVBNCUwQWltYWdlX2VtYmVkcyUyQyUyMG5lZ2F0aXZlX2ltYWdlX2VtYmVkcyUyMCUzRCUyMHByaW9yX3BpcGVsaW5lKHByb21wdCUyQyUyMG5lZ2F0aXZlX3Byb21wdCUyQyUyMGd1aWRhbmNlX3NjYWxlJTNEMS4wKS50b190dXBsZSgp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyPriorPipeline, KandinskyPipeline
<span class="hljs-keyword">import</span> torch

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

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> <span class="hljs-comment"># negative 프롬프트 포함은 선택적이지만, 보통 결과는 더 좋습니다</span>
image_embeds, negative_image_embeds = prior_pipeline(prompt, negative_prompt, guidance_scale=<span class="hljs-number">1.0</span>).to_tuple()`,wrap:!1}}),n=new w({props:{code:"aW1hZ2UlMjAlM0QlMjBwaXBlbGluZShwcm9tcHQlMkMlMjBpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWJlZHMlMkMlMjBuZWdhdGl2ZV9wcm9tcHQlM0RuZWdhdGl2ZV9wcm9tcHQlMkMlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0RuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlMkMlMjBoZWlnaHQlM0Q3NjglMkMlMjB3aWR0aCUzRDc2OCkuaW1hZ2VzJTVCMCU1RCUwQWltYWdl",highlighted:`image = pipeline(prompt, image_embeds=image_embeds, negative_prompt=negative_prompt, negative_image_embeds=negative_image_embeds, height=<span class="hljs-number">768</span>, width=<span class="hljs-number">768</span>).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),{c(){M(s.$$.fragment),m=o(),e=T("p"),e.innerHTML=y,t=o(),M(n.$$.fragment),r=o(),U=T("div"),U.innerHTML=V,this.h()},l(g){d(s.$$.fragment,g),m=c(g),e=k(g,"P",{"data-svelte-h":!0}),Z(e)!=="svelte-1t17459"&&(e.innerHTML=y),t=c(g),d(n.$$.fragment,g),r=c(g),U=k(g,"DIV",{class:!0,"data-svelte-h":!0}),Z(U)!=="svelte-i75i2v"&&(U.innerHTML=V),this.h()},h(){G(U,"class","flex justify-center")},m(g,B){J(s,g,B),i(g,m,B),i(g,e,B),i(g,t,B),J(n,g,B),i(g,r,B),i(g,U,B),W=!0},p:$,i(g){W||(u(s.$$.fragment,g),u(n.$$.fragment,g),W=!0)},o(g){f(s.$$.fragment,g),f(n.$$.fragment,g),W=!1},d(g){g&&(p(m),p(e),p(t),p(r),p(U)),b(s,g),b(n,g)}}}function dn(h){let s,m,e,y="이미지 생성을 위해 <code>image_embeds</code>와 <code>negative_image_embeds</code>를 <code>KandinskyV22Pipeline</code>에 전달합니다:",t,n,r,U,V='<img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/kandinsky-text-to-image.png"/>',W;return s=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUlMkMlMjBLYW5kaW5za3lWMjJQaXBlbGluZSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBcHJpb3JfcGlwZWxpbmUlMjAlM0QlMjBLYW5kaW5za3lWMjJQcmlvclBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMi1wcmlvciUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMiklMEFwaXBlbGluZSUyMCUzRCUyMEthbmRpbnNreVYyMlBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMi1kZWNvZGVyJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KS50byglMjJjdWRhJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkElMjBhbGllbiUyMGNoZWVzZWJ1cmdlciUyMGNyZWF0dXJlJTIwZWF0aW5nJTIwaXRzZWxmJTJDJTIwY2xheW1hdGlvbiUyQyUyMGNpbmVtYXRpYyUyQyUyMG1vb2R5JTIwbGlnaHRpbmclMjIlMEFuZWdhdGl2ZV9wcm9tcHQlMjAlM0QlMjAlMjJsb3clMjBxdWFsaXR5JTJDJTIwYmFkJTIwcXVhbGl0eSUyMiUyMCUyMyUyMG5lZ2F0aXZlJTIwJUVEJTk0JTg0JUVCJUExJUFDJUVEJTk0JTg0JUVEJThBJUI4JTIwJUVEJThGJUFDJUVEJTk1JUE4JUVDJTlEJTgwJTIwJUVDJTg0JUEwJUVEJTgzJTlEJUVDJUEwJTgxJUVDJTlEJUI0JUVDJUE3JTgwJUVCJUE3JThDJTJDJTIwJUVCJUIzJUI0JUVEJTg2JUI1JTIwJUVBJUIyJUIwJUVBJUIzJUJDJUVCJThBJTk0JTIwJUVCJThEJTk0JTIwJUVDJUEyJThCJUVDJThBJUI1JUVCJThCJTg4JUVCJThCJUE0JTBBaW1hZ2VfZW1iZWRzJTJDJTIwbmVnYXRpdmVfaW1hZ2VfZW1iZWRzJTIwJTNEJTIwcHJpb3JfcGlwZWxpbmUocHJvbXB0JTJDJTIwZ3VpZGFuY2Vfc2NhbGUlM0QxLjApLnRvX3R1cGxlKCk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22PriorPipeline, KandinskyV22Pipeline
<span class="hljs-keyword">import</span> torch

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

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> <span class="hljs-comment"># negative 프롬프트 포함은 선택적이지만, 보통 결과는 더 좋습니다</span>
image_embeds, negative_image_embeds = prior_pipeline(prompt, guidance_scale=<span class="hljs-number">1.0</span>).to_tuple()`,wrap:!1}}),n=new w({props:{code:"aW1hZ2UlMjAlM0QlMjBwaXBlbGluZShpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWJlZHMlMkMlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0RuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlMkMlMjBoZWlnaHQlM0Q3NjglMkMlMjB3aWR0aCUzRDc2OCkuaW1hZ2VzJTVCMCU1RCUwQWltYWdl",highlighted:`image = pipeline(image_embeds=image_embeds, negative_image_embeds=negative_image_embeds, height=<span class="hljs-number">768</span>, width=<span class="hljs-number">768</span>).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),{c(){M(s.$$.fragment),m=o(),e=T("p"),e.innerHTML=y,t=o(),M(n.$$.fragment),r=o(),U=T("div"),U.innerHTML=V,this.h()},l(g){d(s.$$.fragment,g),m=c(g),e=k(g,"P",{"data-svelte-h":!0}),Z(e)!=="svelte-sgv3t4"&&(e.innerHTML=y),t=c(g),d(n.$$.fragment,g),r=c(g),U=k(g,"DIV",{class:!0,"data-svelte-h":!0}),Z(U)!=="svelte-kkab9k"&&(U.innerHTML=V),this.h()},h(){G(U,"class","flex justify-center")},m(g,B){J(s,g,B),i(g,m,B),i(g,e,B),i(g,t,B),J(n,g,B),i(g,r,B),i(g,U,B),W=!0},p:$,i(g){W||(u(s.$$.fragment,g),u(n.$$.fragment,g),W=!0)},o(g){f(s.$$.fragment,g),f(n.$$.fragment,g),W=!1},d(g){g&&(p(m),p(e),p(t),p(r),p(U)),b(s,g),b(n,g)}}}function Jn(h){let s,m="Kandinsky 3는 prior 모델이 필요하지 않으므로 <code>Kandinsky3Pipeline</code>을 직접 불러오고 이미지 생성 프롬프트를 전달할 수 있습니다:",e,y,t;return y=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreTNQaXBlbGluZSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBLYW5kaW5za3kzUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMyUyMiUyQyUyMHZhcmlhbnQlM0QlMjJmcDE2JTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXBpcGVsaW5lLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMGFsaWVuJTIwY2hlZXNlYnVyZ2VyJTIwY3JlYXR1cmUlMjBlYXRpbmclMjBpdHNlbGYlMkMlMjBjbGF5bWF0aW9uJTJDJTIwY2luZW1hdGljJTJDJTIwbW9vZHklMjBsaWdodGluZyUyMiUwQWltYWdlJTIwJTNEJTIwcGlwZWxpbmUocHJvbXB0KS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2U=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> Kandinsky3Pipeline
<span class="hljs-keyword">import</span> torch

pipeline = Kandinsky3Pipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-3&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16)
pipeline.enable_model_cpu_offload()

prompt = <span class="hljs-string">&quot;A alien cheeseburger creature eating itself, claymation, cinematic, moody lighting&quot;</span>
image = pipeline(prompt).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),{c(){s=T("p"),s.innerHTML=m,e=o(),M(y.$$.fragment)},l(n){s=k(n,"P",{"data-svelte-h":!0}),Z(s)!=="svelte-8t9irm"&&(s.innerHTML=m),e=c(n),d(y.$$.fragment,n)},m(n,r){i(n,s,r),i(n,e,r),J(y,n,r),t=!0},p:$,i(n){t||(u(y.$$.fragment,n),t=!0)},o(n){f(y.$$.fragment,n),t=!1},d(n){n&&(p(s),p(e)),b(y,n)}}}function un(h){let s,m,e,y,t,n;return s=new j({props:{id:"text-to-image",option:"Kandinsky 2.1",$$slots:{default:[Mn]},$$scope:{ctx:h}}}),e=new j({props:{id:"text-to-image",option:"Kandinsky 2.2",$$slots:{default:[dn]},$$scope:{ctx:h}}}),t=new j({props:{id:"text-to-image",option:"Kandinsky 3",$$slots:{default:[Jn]},$$scope:{ctx:h}}}),{c(){M(s.$$.fragment),m=o(),M(e.$$.fragment),y=o(),M(t.$$.fragment)},l(r){d(s.$$.fragment,r),m=c(r),d(e.$$.fragment,r),y=c(r),d(t.$$.fragment,r)},m(r,U){J(s,r,U),i(r,m,U),J(e,r,U),i(r,y,U),J(t,r,U),n=!0},p(r,U){const V={};U&2&&(V.$$scope={dirty:U,ctx:r}),s.$set(V);const W={};U&2&&(W.$$scope={dirty:U,ctx:r}),e.$set(W);const g={};U&2&&(g.$$scope={dirty:U,ctx:r}),t.$set(g)},i(r){n||(u(s.$$.fragment,r),u(e.$$.fragment,r),u(t.$$.fragment,r),n=!0)},o(r){f(s.$$.fragment,r),f(e.$$.fragment,r),f(t.$$.fragment,r),n=!1},d(r){r&&(p(m),p(y)),b(s,r),b(e,r),b(t,r)}}}function fn(h){let s,m;return s=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvclRleHQySW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwQXV0b1BpcGVsaW5lRm9yVGV4dDJJbWFnZS5mcm9tX3ByZXRyYWluZWQoJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTElMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBcGlwZWxpbmUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJBJTIwYWxpZW4lMjBjaGVlc2VidXJnZXIlMjBjcmVhdHVyZSUyMGVhdGluZyUyMGl0c2VsZiUyQyUyMGNsYXltYXRpb24lMkMlMjBjaW5lbWF0aWMlMkMlMjBtb29keSUyMGxpZ2h0aW5nJTIyJTBBbmVnYXRpdmVfcHJvbXB0JTIwJTNEJTIwJTIybG93JTIwcXVhbGl0eSUyQyUyMGJhZCUyMHF1YWxpdHklMjIlMEElMEFpbWFnZSUyMCUzRCUyMHBpcGVsaW5lKHByb21wdCUzRHByb21wdCUyQyUyMG5lZ2F0aXZlX3Byb21wdCUzRG5lZ2F0aXZlX3Byb21wdCUyQyUyMHByaW9yX2d1aWRhbmNlX3NjYWxlJTNEMS4wJTJDJTIwZ3VpZGFuY2Vfc2NhbGUlM0Q0LjAlMkMlMjBoZWlnaHQlM0Q3NjglMkMlMjB3aWR0aCUzRDc2OCkuaW1hZ2VzJTVCMCU1RCUwQWltYWdl",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForText2Image
<span class="hljs-keyword">import</span> torch

pipeline = AutoPipelineForText2Image.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1&quot;</span>, torch_dtype=torch.float16)
pipeline.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 = pipeline(prompt=prompt, negative_prompt=negative_prompt, prior_guidance_scale=<span class="hljs-number">1.0</span>, guidance_scale=<span class="hljs-number">4.0</span>, height=<span class="hljs-number">768</span>, width=<span class="hljs-number">768</span>).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),{c(){M(s.$$.fragment)},l(e){d(s.$$.fragment,e)},m(e,y){J(s,e,y),m=!0},p:$,i(e){m||(u(s.$$.fragment,e),m=!0)},o(e){f(s.$$.fragment,e),m=!1},d(e){b(s,e)}}}function bn(h){let s,m;return s=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvclRleHQySW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwQXV0b1BpcGVsaW5lRm9yVGV4dDJJbWFnZS5mcm9tX3ByZXRyYWluZWQoJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTItZGVjb2RlciUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlbGluZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkElMjBhbGllbiUyMGNoZWVzZWJ1cmdlciUyMGNyZWF0dXJlJTIwZWF0aW5nJTIwaXRzZWxmJTJDJTIwY2xheW1hdGlvbiUyQyUyMGNpbmVtYXRpYyUyQyUyMG1vb2R5JTIwbGlnaHRpbmclMjIlMEFuZWdhdGl2ZV9wcm9tcHQlMjAlM0QlMjAlMjJsb3clMjBxdWFsaXR5JTJDJTIwYmFkJTIwcXVhbGl0eSUyMiUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZWxpbmUocHJvbXB0JTNEcHJvbXB0JTJDJTIwbmVnYXRpdmVfcHJvbXB0JTNEbmVnYXRpdmVfcHJvbXB0JTJDJTIwcHJpb3JfZ3VpZGFuY2Vfc2NhbGUlM0QxLjAlMkMlMjBndWlkYW5jZV9zY2FsZSUzRDQuMCUyQyUyMGhlaWdodCUzRDc2OCUyQyUyMHdpZHRoJTNENzY4KS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2U=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForText2Image
<span class="hljs-keyword">import</span> torch

pipeline = AutoPipelineForText2Image.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder&quot;</span>, torch_dtype=torch.float16)
pipeline.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 = pipeline(prompt=prompt, negative_prompt=negative_prompt, prior_guidance_scale=<span class="hljs-number">1.0</span>, guidance_scale=<span class="hljs-number">4.0</span>, height=<span class="hljs-number">768</span>, width=<span class="hljs-number">768</span>).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),{c(){M(s.$$.fragment)},l(e){d(s.$$.fragment,e)},m(e,y){J(s,e,y),m=!0},p:$,i(e){m||(u(s.$$.fragment,e),m=!0)},o(e){f(s.$$.fragment,e),m=!1},d(e){b(s,e)}}}function Un(h){let s,m,e,y;return s=new j({props:{id:"text-to-image",option:"Kandinsky 2.1",$$slots:{default:[fn]},$$scope:{ctx:h}}}),e=new j({props:{id:"text-to-image",option:"Kandinsky 2.2",$$slots:{default:[bn]},$$scope:{ctx:h}}}),{c(){M(s.$$.fragment),m=o(),M(e.$$.fragment)},l(t){d(s.$$.fragment,t),m=c(t),d(e.$$.fragment,t)},m(t,n){J(s,t,n),i(t,m,n),J(e,t,n),y=!0},p(t,n){const r={};n&2&&(r.$$scope={dirty:n,ctx:t}),s.$set(r);const U={};n&2&&(U.$$scope={dirty:n,ctx:t}),e.$set(U)},i(t){y||(u(s.$$.fragment,t),u(e.$$.fragment,t),y=!0)},o(t){f(s.$$.fragment,t),f(e.$$.fragment,t),y=!1},d(t){t&&p(m),b(s,t),b(e,t)}}}function hn(h){let s,m;return s=new w({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwS2FuZGluc2t5SW1nMkltZ1BpcGVsaW5lJTJDJTIwS2FuZGluc2t5UHJpb3JQaXBlbGluZSUwQSUwQXByaW9yX3BpcGVsaW5lJTIwJTNEJTIwS2FuZGluc2t5UHJpb3JQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTEtcHJpb3IlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlKS50byglMjJjdWRhJTIyKSUwQXBpcGVsaW5lJTIwJTNEJTIwS2FuZGluc2t5SW1nMkltZ1BpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUpLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyImg2ImgPipeline, KandinskyPriorPipeline

prior_pipeline = KandinskyPriorPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1-prior&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)
pipeline = KandinskyImg2ImgPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),{c(){M(s.$$.fragment)},l(e){d(s.$$.fragment,e)},m(e,y){J(s,e,y),m=!0},p:$,i(e){m||(u(s.$$.fragment,e),m=!0)},o(e){f(s.$$.fragment,e),m=!1},d(e){b(s,e)}}}function gn(h){let s,m;return s=new w({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwS2FuZGluc2t5VjIySW1nMkltZ1BpcGVsaW5lJTJDJTIwS2FuZGluc2t5UHJpb3JQaXBlbGluZSUwQSUwQXByaW9yX3BpcGVsaW5lJTIwJTNEJTIwS2FuZGluc2t5UHJpb3JQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTItcHJpb3IlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlKS50byglMjJjdWRhJTIyKSUwQXBpcGVsaW5lJTIwJTNEJTIwS2FuZGluc2t5VjIySW1nMkltZ1BpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMi1kZWNvZGVyJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSkudG8oJTIyY3VkYSUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22Img2ImgPipeline, KandinskyPriorPipeline

prior_pipeline = KandinskyPriorPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-prior&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)
pipeline = KandinskyV22Img2ImgPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),{c(){M(s.$$.fragment)},l(e){d(s.$$.fragment,e)},m(e,y){J(s,e,y),m=!0},p:$,i(e){m||(u(s.$$.fragment,e),m=!0)},o(e){f(s.$$.fragment,e),m=!1},d(e){b(s,e)}}}function Tn(h){let s,m="Kandinsky 3는 prior 모델이 필요하지 않으므로 image-to-image 파이프라인을 직접 불러올 수 있습니다:",e,y,t;return y=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreTNJbWcySW1nUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQWltcG9ydCUyMHRvcmNoJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBLYW5kaW5za3kzSW1nMkltZ1BpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTMlMjIlMkMlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlbGluZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> Kandinsky3Img2ImgPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">import</span> torch

pipeline = Kandinsky3Img2ImgPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-3&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16)
pipeline.enable_model_cpu_offload()`,wrap:!1}}),{c(){s=T("p"),s.textContent=m,e=o(),M(y.$$.fragment)},l(n){s=k(n,"P",{"data-svelte-h":!0}),Z(s)!=="svelte-1ojs3r5"&&(s.textContent=m),e=c(n),d(y.$$.fragment,n)},m(n,r){i(n,s,r),i(n,e,r),J(y,n,r),t=!0},p:$,i(n){t||(u(y.$$.fragment,n),t=!0)},o(n){f(y.$$.fragment,n),t=!1},d(n){n&&(p(s),p(e)),b(y,n)}}}function kn(h){let s,m,e,y,t,n;return s=new j({props:{id:"image-to-image",option:"Kandinsky 2.1",$$slots:{default:[hn]},$$scope:{ctx:h}}}),e=new j({props:{id:"image-to-image",option:"Kandinsky 2.2",$$slots:{default:[gn]},$$scope:{ctx:h}}}),t=new j({props:{id:"image-to-image",option:"Kandinsky 3",$$slots:{default:[Tn]},$$scope:{ctx:h}}}),{c(){M(s.$$.fragment),m=o(),M(e.$$.fragment),y=o(),M(t.$$.fragment)},l(r){d(s.$$.fragment,r),m=c(r),d(e.$$.fragment,r),y=c(r),d(t.$$.fragment,r)},m(r,U){J(s,r,U),i(r,m,U),J(e,r,U),i(r,y,U),J(t,r,U),n=!0},p(r,U){const V={};U&2&&(V.$$scope={dirty:U,ctx:r}),s.$set(V);const W={};U&2&&(W.$$scope={dirty:U,ctx:r}),e.$set(W);const g={};U&2&&(g.$$scope={dirty:U,ctx:r}),t.$set(g)},i(r){n||(u(s.$$.fragment,r),u(e.$$.fragment,r),u(t.$$.fragment,r),n=!0)},o(r){f(s.$$.fragment,r),f(e.$$.fragment,r),f(t.$$.fragment,r),n=!1},d(r){r&&(p(m),p(y)),b(s,r),b(e,r),b(t,r)}}}function Zn(h){let s,m,e,y='<img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/kandinsky-docs/img2img_fantasyland.png"/>',t;return s=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMG1ha2VfaW1hZ2VfZ3JpZCUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZWxpbmUocHJvbXB0JTJDJTIwbmVnYXRpdmVfcHJvbXB0JTNEbmVnYXRpdmVfcHJvbXB0JTJDJTIwaW1hZ2UlM0RvcmlnaW5hbF9pbWFnZSUyQyUyMGltYWdlX2VtYmVkcyUzRGltYWdlX2VtYmVkcyUyQyUyMG5lZ2F0aXZlX2ltYWdlX2VtYmVkcyUzRG5lZ2F0aXZlX2ltYWdlX2VtYmVkcyUyQyUyMGhlaWdodCUzRDc2OCUyQyUyMHdpZHRoJTNENzY4JTJDJTIwc3RyZW5ndGglM0QwLjMpLmltYWdlcyU1QjAlNUQlMEFtYWtlX2ltYWdlX2dyaWQoJTVCb3JpZ2luYWxfaW1hZ2UucmVzaXplKCg1MTIlMkMlMjA1MTIpKSUyQyUyMGltYWdlLnJlc2l6ZSgoNTEyJTJDJTIwNTEyKSklNUQlMkMlMjByb3dzJTNEMSUyQyUyMGNvbHMlM0QyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> make_image_grid

image = pipeline(prompt, negative_prompt=negative_prompt, image=original_image, image_embeds=image_embeds, negative_image_embeds=negative_image_embeds, height=<span class="hljs-number">768</span>, width=<span class="hljs-number">768</span>, strength=<span class="hljs-number">0.3</span>).images[<span class="hljs-number">0</span>]
make_image_grid([original_image.resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>)), image.resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>))], rows=<span class="hljs-number">1</span>, cols=<span class="hljs-number">2</span>)`,wrap:!1}}),{c(){M(s.$$.fragment),m=o(),e=T("div"),e.innerHTML=y,this.h()},l(n){d(s.$$.fragment,n),m=c(n),e=k(n,"DIV",{class:!0,"data-svelte-h":!0}),Z(e)!=="svelte-1vh4dwd"&&(e.innerHTML=y),this.h()},h(){G(e,"class","flex justify-center")},m(n,r){J(s,n,r),i(n,m,r),i(n,e,r),t=!0},p:$,i(n){t||(u(s.$$.fragment,n),t=!0)},o(n){f(s.$$.fragment,n),t=!1},d(n){n&&(p(m),p(e)),b(s,n)}}}function wn(h){let s,m,e,y='<img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/kandinsky-image-to-image.png"/>',t;return s=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMG1ha2VfaW1hZ2VfZ3JpZCUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZWxpbmUoaW1hZ2UlM0RvcmlnaW5hbF9pbWFnZSUyQyUyMGltYWdlX2VtYmVkcyUzRGltYWdlX2VtYmVkcyUyQyUyMG5lZ2F0aXZlX2ltYWdlX2VtYmVkcyUzRG5lZ2F0aXZlX2ltYWdlX2VtYmVkcyUyQyUyMGhlaWdodCUzRDc2OCUyQyUyMHdpZHRoJTNENzY4JTJDJTIwc3RyZW5ndGglM0QwLjMpLmltYWdlcyU1QjAlNUQlMEFtYWtlX2ltYWdlX2dyaWQoJTVCb3JpZ2luYWxfaW1hZ2UucmVzaXplKCg1MTIlMkMlMjA1MTIpKSUyQyUyMGltYWdlLnJlc2l6ZSgoNTEyJTJDJTIwNTEyKSklNUQlMkMlMjByb3dzJTNEMSUyQyUyMGNvbHMlM0QyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> make_image_grid

image = pipeline(image=original_image, image_embeds=image_embeds, negative_image_embeds=negative_image_embeds, height=<span class="hljs-number">768</span>, width=<span class="hljs-number">768</span>, strength=<span class="hljs-number">0.3</span>).images[<span class="hljs-number">0</span>]
make_image_grid([original_image.resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>)), image.resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>))], rows=<span class="hljs-number">1</span>, cols=<span class="hljs-number">2</span>)`,wrap:!1}}),{c(){M(s.$$.fragment),m=o(),e=T("div"),e.innerHTML=y,this.h()},l(n){d(s.$$.fragment,n),m=c(n),e=k(n,"DIV",{class:!0,"data-svelte-h":!0}),Z(e)!=="svelte-1vux4a0"&&(e.innerHTML=y),this.h()},h(){G(e,"class","flex justify-center")},m(n,r){J(s,n,r),i(n,m,r),i(n,e,r),t=!0},p:$,i(n){t||(u(s.$$.fragment,n),t=!0)},o(n){f(s.$$.fragment,n),t=!1},d(n){n&&(p(m),p(e)),b(s,n)}}}function Wn(h){let s,m;return s=new w({props:{code:"aW1hZ2UlMjAlM0QlMjBwaXBlbGluZShwcm9tcHQlMkMlMjBuZWdhdGl2ZV9wcm9tcHQlM0RuZWdhdGl2ZV9wcm9tcHQlMkMlMjBpbWFnZSUzRGltYWdlJTJDJTIwc3RyZW5ndGglM0QwLjc1JTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDI1KS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2U=",highlighted:`image = pipeline(prompt, negative_prompt=negative_prompt, image=image, strength=<span class="hljs-number">0.75</span>, num_inference_steps=<span class="hljs-number">25</span>).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),{c(){M(s.$$.fragment)},l(e){d(s.$$.fragment,e)},m(e,y){J(s,e,y),m=!0},p:$,i(e){m||(u(s.$$.fragment,e),m=!0)},o(e){f(s.$$.fragment,e),m=!1},d(e){b(s,e)}}}function jn(h){let s,m,e,y,t,n;return s=new j({props:{id:"image-to-image",option:"Kandinsky 2.1",$$slots:{default:[Zn]},$$scope:{ctx:h}}}),e=new j({props:{id:"image-to-image",option:"Kandinsky 2.2",$$slots:{default:[wn]},$$scope:{ctx:h}}}),t=new j({props:{id:"image-to-image",option:"Kandinsky 3",$$slots:{default:[Wn]},$$scope:{ctx:h}}}),{c(){M(s.$$.fragment),m=o(),M(e.$$.fragment),y=o(),M(t.$$.fragment)},l(r){d(s.$$.fragment,r),m=c(r),d(e.$$.fragment,r),y=c(r),d(t.$$.fragment,r)},m(r,U){J(s,r,U),i(r,m,U),J(e,r,U),i(r,y,U),J(t,r,U),n=!0},p(r,U){const V={};U&2&&(V.$$scope={dirty:U,ctx:r}),s.$set(V);const W={};U&2&&(W.$$scope={dirty:U,ctx:r}),e.$set(W);const g={};U&2&&(g.$$scope={dirty:U,ctx:r}),t.$set(g)},i(r){n||(u(s.$$.fragment,r),u(e.$$.fragment,r),u(t.$$.fragment,r),n=!0)},o(r){f(s.$$.fragment,r),f(e.$$.fragment,r),f(t.$$.fragment,r),n=!1},d(r){r&&(p(m),p(y)),b(s,r),b(e,r),b(t,r)}}}function $n(h){let s,m;return s=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvckltYWdlMkltYWdlJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMG1ha2VfaW1hZ2VfZ3JpZCUyQyUyMGxvYWRfaW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwQXV0b1BpcGVsaW5lRm9ySW1hZ2UySW1hZ2UuZnJvbV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lMkMlMjByb3dzJTNEMSUyQyUyMGNvbHMlM0QyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForImage2Image
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> make_image_grid, load_image
<span class="hljs-keyword">import</span> torch

pipeline = AutoPipelineForImage2Image.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>)
pipeline.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>
original_image = load_image(url)

original_image.thumbnail((<span class="hljs-number">768</span>, <span class="hljs-number">768</span>))

image = pipeline(prompt=prompt, negative_prompt=negative_prompt, image=original_image, strength=<span class="hljs-number">0.3</span>).images[<span class="hljs-number">0</span>]
make_image_grid([original_image.resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>)), image.resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>))], rows=<span class="hljs-number">1</span>, cols=<span class="hljs-number">2</span>)`,wrap:!1}}),{c(){M(s.$$.fragment)},l(e){d(s.$$.fragment,e)},m(e,y){J(s,e,y),m=!0},p:$,i(e){m||(u(s.$$.fragment,e),m=!0)},o(e){f(s.$$.fragment,e),m=!1},d(e){b(s,e)}}}function Vn(h){let s,m;return s=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUZvckltYWdlMkltYWdlJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMG1ha2VfaW1hZ2VfZ3JpZCUyQyUyMGxvYWRfaW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCU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jBpbWFnZS5yZXNpemUoKDUxMiUyQyUyMDUxMikpJTVEJTJDJTIwcm93cyUzRDElMkMlMjBjb2xzJTNEMik=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForImage2Image
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> make_image_grid, load_image
<span class="hljs-keyword">import</span> torch

pipeline = AutoPipelineForImage2Image.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder&quot;</span>, torch_dtype=torch.float16)
pipeline.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>
original_image = load_image(url)

original_image.thumbnail((<span class="hljs-number">768</span>, <span class="hljs-number">768</span>))

image = pipeline(prompt=prompt, negative_prompt=negative_prompt, image=original_image, strength=<span class="hljs-number">0.3</span>).images[<span class="hljs-number">0</span>]
make_image_grid([original_image.resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>)), image.resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>))], rows=<span class="hljs-number">1</span>, cols=<span class="hljs-number">2</span>)`,wrap:!1}}),{c(){M(s.$$.fragment)},l(e){d(s.$$.fragment,e)},m(e,y){J(s,e,y),m=!0},p:$,i(e){m||(u(s.$$.fragment,e),m=!0)},o(e){f(s.$$.fragment,e),m=!1},d(e){b(s,e)}}}function Gn(h){let s,m,e,y;return s=new j({props:{id:"image-to-image",option:"Kandinsky 2.1",$$slots:{default:[$n]},$$scope:{ctx:h}}}),e=new j({props:{id:"image-to-image",option:"Kandinsky 2.2",$$slots:{default:[Vn]},$$scope:{ctx:h}}}),{c(){M(s.$$.fragment),m=o(),M(e.$$.fragment)},l(t){d(s.$$.fragment,t),m=c(t),d(e.$$.fragment,t)},m(t,n){J(s,t,n),i(t,m,n),J(e,t,n),y=!0},p(t,n){const r={};n&2&&(r.$$scope={dirty:n,ctx:t}),s.$set(r);const U={};n&2&&(U.$$scope={dirty:n,ctx:t}),e.$set(U)},i(t){y||(u(s.$$.fragment,t),u(e.$$.fragment,t),y=!0)},o(t){f(s.$$.fragment,t),f(e.$$.fragment,t),y=!1},d(t){t&&p(m),b(s,t),b(e,t)}}}function Bn(h){let s,m;return s=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreUlucGFpbnRQaXBlbGluZSUyQyUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUyQyUyMG1ha2VfaW1hZ2VfZ3JpZCUwQWltcG9ydCUyMHRvcmNoJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBJTBBcHJpb3JfcGlwZWxpbmUlMjAlM0QlMjBLYW5kaW5za3lQcmlvclBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMS1wcmlvciUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUpLnRvKCUyMmN1ZGElMjIpJTBBcGlwZWxpbmUlMjAlM0QlMjBLYW5kaW5za3lJbnBhaW50UGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLWlucGFpbnQlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlKS50byglMjJjdWRhJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyInpaintPipeline, KandinskyPriorPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image, make_image_grid
<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> PIL <span class="hljs-keyword">import</span> Image

prior_pipeline = KandinskyPriorPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1-prior&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)
pipeline = KandinskyInpaintPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1-inpaint&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),{c(){M(s.$$.fragment)},l(e){d(s.$$.fragment,e)},m(e,y){J(s,e,y),m=!0},p:$,i(e){m||(u(s.$$.fragment,e),m=!0)},o(e){f(s.$$.fragment,e),m=!1},d(e){b(s,e)}}}function In(h){let s,m;return s=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMklucGFpbnRQaXBlbGluZSUyQyUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUyQyUyMG1ha2VfaW1hZ2VfZ3JpZCUwQWltcG9ydCUyMHRvcmNoJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBJTBBcHJpb3JfcGlwZWxpbmUlMjAlM0QlMjBLYW5kaW5za3lWMjJQcmlvclBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMi1wcmlvciUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUpLnRvKCUyMmN1ZGElMjIpJTBBcGlwZWxpbmUlMjAlM0QlMjBLYW5kaW5za3lWMjJJbnBhaW50UGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLWRlY29kZXItaW5wYWludCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUpLnRvKCUyMmN1ZGElMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22InpaintPipeline, KandinskyV22PriorPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image, make_image_grid
<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> PIL <span class="hljs-keyword">import</span> Image

prior_pipeline = KandinskyV22PriorPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-prior&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)
pipeline = KandinskyV22InpaintPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder-inpaint&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),{c(){M(s.$$.fragment)},l(e){d(s.$$.fragment,e)},m(e,y){J(s,e,y),m=!0},p:$,i(e){m||(u(s.$$.fragment,e),m=!0)},o(e){f(s.$$.fragment,e),m=!1},d(e){b(s,e)}}}function Rn(h){let s,m,e,y;return s=new j({props:{id:"inpaint",option:"Kandinsky 2.1",$$slots:{default:[Bn]},$$scope:{ctx:h}}}),e=new j({props:{id:"inpaint",option:"Kandinsky 2.2",$$slots:{default:[In]},$$scope:{ctx:h}}}),{c(){M(s.$$.fragment),m=o(),M(e.$$.fragment)},l(t){d(s.$$.fragment,t),m=c(t),d(e.$$.fragment,t)},m(t,n){J(s,t,n),i(t,m,n),J(e,t,n),y=!0},p(t,n){const r={};n&2&&(r.$$scope={dirty:n,ctx:t}),s.$set(r);const U={};n&2&&(U.$$scope={dirty:n,ctx:t}),e.$set(U)},i(t){y||(u(s.$$.fragment,t),u(e.$$.fragment,t),y=!0)},o(t){f(s.$$.fragment,t),f(e.$$.fragment,t),y=!1},d(t){t&&p(m),b(s,t),b(e,t)}}}function _n(h){let s,m,e,y='<img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/kandinsky-docs/inpaint_cat_hat.png"/>',t;return s=new w({props:{code:"b3V0cHV0X2ltYWdlJTIwJTNEJTIwcGlwZWxpbmUocHJvbXB0JTJDJTIwaW1hZ2UlM0Rpbml0X2ltYWdlJTJDJTIwbWFza19pbWFnZSUzRG1hc2slMkMlMjAqKnByaW9yX291dHB1dCUyQyUyMGhlaWdodCUzRDc2OCUyQyUyMHdpZHRoJTNENzY4JTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDE1MCkuaW1hZ2VzJTVCMCU1RCUwQW1hc2slMjAlM0QlMjBJbWFnZS5mcm9tYXJyYXkoKG1hc2sqMjU1KS5hc3R5cGUoJ3VpbnQ4JyklMkMlMjAnTCcpJTBBbWFrZV9pbWFnZV9ncmlkKCU1QmluaXRfaW1hZ2UlMkMlMjBtYXNrJTJDJTIwb3V0cHV0X2ltYWdlJTVEJTJDJTIwcm93cyUzRDElMkMlMjBjb2xzJTNEMyk=",highlighted:`output_image = pipeline(prompt, image=init_image, mask_image=mask, **prior_output, height=<span class="hljs-number">768</span>, width=<span class="hljs-number">768</span>, num_inference_steps=<span class="hljs-number">150</span>).images[<span class="hljs-number">0</span>]
mask = Image.fromarray((mask*<span class="hljs-number">255</span>).astype(<span class="hljs-string">&#x27;uint8&#x27;</span>), <span class="hljs-string">&#x27;L&#x27;</span>)
make_image_grid([init_image, mask, output_image], rows=<span class="hljs-number">1</span>, cols=<span class="hljs-number">3</span>)`,wrap:!1}}),{c(){M(s.$$.fragment),m=o(),e=T("div"),e.innerHTML=y,this.h()},l(n){d(s.$$.fragment,n),m=c(n),e=k(n,"DIV",{class:!0,"data-svelte-h":!0}),Z(e)!=="svelte-1d04i1f"&&(e.innerHTML=y),this.h()},h(){G(e,"class","flex justify-center")},m(n,r){J(s,n,r),i(n,m,r),i(n,e,r),t=!0},p:$,i(n){t||(u(s.$$.fragment,n),t=!0)},o(n){f(s.$$.fragment,n),t=!1},d(n){n&&(p(m),p(e)),b(s,n)}}}function Cn(h){let s,m,e,y='<img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/kandinskyv22-inpaint.png"/>',t;return s=new w({props:{code:"b3V0cHV0X2ltYWdlJTIwJTNEJTIwcGlwZWxpbmUoaW1hZ2UlM0Rpbml0X2ltYWdlJTJDJTIwbWFza19pbWFnZSUzRG1hc2slMkMlMjAqKnByaW9yX291dHB1dCUyQyUyMGhlaWdodCUzRDc2OCUyQyUyMHdpZHRoJTNENzY4JTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDE1MCkuaW1hZ2VzJTVCMCU1RCUwQW1hc2slMjAlM0QlMjBJbWFnZS5mcm9tYXJyYXkoKG1hc2sqMjU1KS5hc3R5cGUoJ3VpbnQ4JyklMkMlMjAnTCcpJTBBbWFrZV9pbWFnZV9ncmlkKCU1QmluaXRfaW1hZ2UlMkMlMjBtYXNrJTJDJTIwb3V0cHV0X2ltYWdlJTVEJTJDJTIwcm93cyUzRDElMkMlMjBjb2xzJTNEMyk=",highlighted:`output_image = pipeline(image=init_image, mask_image=mask, **prior_output, height=<span class="hljs-number">768</span>, width=<span class="hljs-number">768</span>, num_inference_steps=<span class="hljs-number">150</span>).images[<span class="hljs-number">0</span>]
mask = Image.fromarray((mask*<span class="hljs-number">255</span>).astype(<span class="hljs-string">&#x27;uint8&#x27;</span>), <span class="hljs-string">&#x27;L&#x27;</span>)
make_image_grid([init_image, mask, output_image], rows=<span class="hljs-number">1</span>, cols=<span class="hljs-number">3</span>)`,wrap:!1}}),{c(){M(s.$$.fragment),m=o(),e=T("div"),e.innerHTML=y,this.h()},l(n){d(s.$$.fragment,n),m=c(n),e=k(n,"DIV",{class:!0,"data-svelte-h":!0}),Z(e)!=="svelte-1ajezuw"&&(e.innerHTML=y),this.h()},h(){G(e,"class","flex justify-center")},m(n,r){J(s,n,r),i(n,m,r),i(n,e,r),t=!0},p:$,i(n){t||(u(s.$$.fragment,n),t=!0)},o(n){f(s.$$.fragment,n),t=!1},d(n){n&&(p(m),p(e)),b(s,n)}}}function Qn(h){let s,m,e,y;return s=new j({props:{id:"inpaint",option:"Kandinsky 2.1",$$slots:{default:[_n]},$$scope:{ctx:h}}}),e=new j({props:{id:"inpaint",option:"Kandinsky 2.2",$$slots:{default:[Cn]},$$scope:{ctx:h}}}),{c(){M(s.$$.fragment),m=o(),M(e.$$.fragment)},l(t){d(s.$$.fragment,t),m=c(t),d(e.$$.fragment,t)},m(t,n){J(s,t,n),i(t,m,n),J(e,t,n),y=!0},p(t,n){const r={};n&2&&(r.$$scope={dirty:n,ctx:t}),s.$set(r);const U={};n&2&&(U.$$scope={dirty:n,ctx:t}),e.$set(U)},i(t){y||(u(s.$$.fragment,t),u(e.$$.fragment,t),y=!0)},o(t){f(s.$$.fragment,t),f(e.$$.fragment,t),y=!1},d(t){t&&p(m),b(s,t),b(e,t)}}}function Xn(h){let s,m;return s=new w({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFmcm9tJTIwUElMJTIwaW1wb3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faW1hZ2UlMkMlMjBtYXNrX2ltYWdlJTNEbWFzaykuaW1hZ2VzJTVCMCU1RCUwQW1hc2slMjAlM0QlMjBJbWFnZS5mcm9tYXJyYXkoKG1hc2sqMjU1KS5hc3R5cGUoJ3VpbnQ4JyklMkMlMjAnTCcpJTBBbWFrZV9pbWFnZV9ncmlkKCU1QmluaXRfaW1hZ2UlMkMlMjBtYXNrJTJDJTIwb3V0cHV0X2ltYWdlJTVEJTJDJTIwcm93cyUzRDElMkMlMjBjb2xzJTNEMyk=",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> PIL <span class="hljs-keyword">import</span> Image
<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, make_image_grid

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

init_image = load_image(<span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/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"># 고양이 머리 위 마스크 지역</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>
prompt = <span class="hljs-string">&quot;a hat&quot;</span>

output_image = pipe(prompt=prompt, image=init_image, mask_image=mask).images[<span class="hljs-number">0</span>]
mask = Image.fromarray((mask*<span class="hljs-number">255</span>).astype(<span class="hljs-string">&#x27;uint8&#x27;</span>), <span class="hljs-string">&#x27;L&#x27;</span>)
make_image_grid([init_image, mask, output_image], rows=<span class="hljs-number">1</span>, cols=<span class="hljs-number">3</span>)`,wrap:!1}}),{c(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U4OCVFQyU4QSVBNCVFRCU4MSVBQyUyMCVFQyU5OCU4MSVFQyU5NyVBRCUwQW1hc2slNUIlM0EyNTAlMkMlMjAyNTAlM0EtMjUwJTVEJTIwJTNEJTIwMSUwQXByb21wdCUyMCUzRCUyMCUyMmElMjBoYXQlMjIlMEElMEFvdXRwdXRfaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUzRHByb21wdCUyQyUyMGltYWdlJTNEb3JpZ2luYWxfaW1hZ2UlMkMlMjBtYXNrX2ltYWdlJTNEbWFzaykuaW1hZ2VzJTVCMCU1RCUwQW1hc2slMjAlM0QlMjBJbWFnZS5mcm9tYXJyYXkoKG1hc2sqMjU1KS5hc3R5cGUoJ3VpbnQ4JyklMkMlMjAnTCcpJTBBbWFrZV9pbWFnZV9ncmlkKCU1QmluaXRfaW1hZ2UlMkMlMjBtYXNrJTJDJTIwb3V0cHV0X2ltYWdlJTVEJTJDJTIwcm93cyUzRDElMkMlMjBjb2xzJTNEMyk=",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> PIL <span class="hljs-keyword">import</span> Image
<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, make_image_grid

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()

init_image = load_image(<span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/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"># 고양이 머리 위 마스크 영역</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>
prompt = <span class="hljs-string">&quot;a hat&quot;</span>

output_image = pipe(prompt=prompt, image=original_image, mask_image=mask).images[<span class="hljs-number">0</span>]
mask = Image.fromarray((mask*<span class="hljs-number">255</span>).astype(<span class="hljs-string">&#x27;uint8&#x27;</span>), <span class="hljs-string">&#x27;L&#x27;</span>)
make_image_grid([init_image, mask, output_image], rows=<span class="hljs-number">1</span>, cols=<span class="hljs-number">3</span>)`,wrap:!1}}),{c(){M(s.$$.fragment)},l(e){d(s.$$.fragment,e)},m(e,y){J(s,e,y),m=!0},p:$,i(e){m||(u(s.$$.fragment,e),m=!0)},o(e){f(s.$$.fragment,e),m=!1},d(e){b(s,e)}}}function Yn(h){let s,m,e,y;return s=new j({props:{id:"inpaint",option:"Kandinsky 2.1",$$slots:{default:[Xn]},$$scope:{ctx:h}}}),e=new j({props:{id:"inpaint",option:"Kandinsky 2.2",$$slots:{default:[vn]},$$scope:{ctx:h}}}),{c(){M(s.$$.fragment),m=o(),M(e.$$.fragment)},l(t){d(s.$$.fragment,t),m=c(t),d(e.$$.fragment,t)},m(t,n){J(s,t,n),i(t,m,n),J(e,t,n),y=!0},p(t,n){const r={};n&2&&(r.$$scope={dirty:n,ctx:t}),s.$set(r);const U={};n&2&&(U.$$scope={dirty:n,ctx:t}),e.$set(U)},i(t){y||(u(s.$$.fragment,t),u(e.$$.fragment,t),y=!0)},o(t){f(s.$$.fragment,t),f(e.$$.fragment,t),y=!1},d(t){t&&p(m),b(s,t),b(e,t)}}}function Nn(h){let s,m;return s=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUlMkMlMjBLYW5kaW5za3lQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTJDJTIwbWFrZV9pbWFnZV9ncmlkJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwcmlvcl9waXBlbGluZSUyMCUzRCUyMEthbmRpbnNreVByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSkudG8oJTIyY3VkYSUyMiklMEFpbWdfMSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGaGYtaW50ZXJuYWwtdGVzdGluZyUyRmRpZmZ1c2Vycy1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyRmthbmRpbnNreSUyRmNhdC5wbmclMjIpJTBBaW1nXzIlMjAlM0QlMjBsb2FkX2ltYWdlKCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmhmLWludGVybmFsLXRlc3RpbmclMkZkaWZmdXNlcnMtaW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZrYW5kaW5za3klMkZzdGFycnlfbmlnaHQuanBlZyUyMiklMEFtYWtlX2ltYWdlX2dyaWQoJTVCaW1nXzEucmVzaXplKCg1MTIlMkM1MTIpKSUyQyUyMGltZ18yLnJlc2l6ZSgoNTEyJTJDNTEyKSklNUQlMkMlMjByb3dzJTNEMSUyQyUyMGNvbHMlM0QyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyPriorPipeline, KandinskyPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image, make_image_grid
<span class="hljs-keyword">import</span> torch

prior_pipeline = KandinskyPriorPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1-prior&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)
img_1 = load_image(<span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinsky/cat.png&quot;</span>)
img_2 = load_image(<span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinsky/starry_night.jpeg&quot;</span>)
make_image_grid([img_1.resize((<span class="hljs-number">512</span>,<span class="hljs-number">512</span>)), img_2.resize((<span class="hljs-number">512</span>,<span class="hljs-number">512</span>))], rows=<span class="hljs-number">1</span>, cols=<span class="hljs-number">2</span>)`,wrap:!1}}),{c(){M(s.$$.fragment)},l(e){d(s.$$.fragment,e)},m(e,y){J(s,e,y),m=!0},p:$,i(e){m||(u(s.$$.fragment,e),m=!0)},o(e){f(s.$$.fragment,e),m=!1},d(e){b(s,e)}}}function Fn(h){let s,m;return s=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUlMkMlMjBLYW5kaW5za3lWMjJQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTJDJTIwbWFrZV9pbWFnZV9ncmlkJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwcmlvcl9waXBlbGluZSUyMCUzRCUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSkudG8oJTIyY3VkYSUyMiklMEFpbWdfMSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGaGYtaW50ZXJuYWwtdGVzdGluZyUyRmRpZmZ1c2Vycy1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyRmthbmRpbnNreSUyRmNhdC5wbmclMjIpJTBBaW1nXzIlMjAlM0QlMjBsb2FkX2ltYWdlKCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmhmLWludGVybmFsLXRlc3RpbmclMkZkaWZmdXNlcnMtaW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZrYW5kaW5za3klMkZzdGFycnlfbmlnaHQuanBlZyUyMiklMEFtYWtlX2ltYWdlX2dyaWQoJTVCaW1nXzEucmVzaXplKCg1MTIlMkM1MTIpKSUyQyUyMGltZ18yLnJlc2l6ZSgoNTEyJTJDNTEyKSklNUQlMkMlMjByb3dzJTNEMSUyQyUyMGNvbHMlM0QyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22PriorPipeline, KandinskyV22Pipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image, make_image_grid
<span class="hljs-keyword">import</span> torch

prior_pipeline = KandinskyV22PriorPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-prior&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)
img_1 = load_image(<span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinsky/cat.png&quot;</span>)
img_2 = load_image(<span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinsky/starry_night.jpeg&quot;</span>)
make_image_grid([img_1.resize((<span class="hljs-number">512</span>,<span class="hljs-number">512</span>)), img_2.resize((<span class="hljs-number">512</span>,<span class="hljs-number">512</span>))], rows=<span class="hljs-number">1</span>, cols=<span class="hljs-number">2</span>)`,wrap:!1}}),{c(){M(s.$$.fragment)},l(e){d(s.$$.fragment,e)},m(e,y){J(s,e,y),m=!0},p:$,i(e){m||(u(s.$$.fragment,e),m=!0)},o(e){f(s.$$.fragment,e),m=!1},d(e){b(s,e)}}}function Hn(h){let s,m,e,y;return s=new j({props:{id:"interpolate",option:"Kandinsky 2.1",$$slots:{default:[Nn]},$$scope:{ctx:h}}}),e=new j({props:{id:"interpolate",option:"Kandinsky 2.2",$$slots:{default:[Fn]},$$scope:{ctx:h}}}),{c(){M(s.$$.fragment),m=o(),M(e.$$.fragment)},l(t){d(s.$$.fragment,t),m=c(t),d(e.$$.fragment,t)},m(t,n){J(s,t,n),i(t,m,n),J(e,t,n),y=!0},p(t,n){const r={};n&2&&(r.$$scope={dirty:n,ctx:t}),s.$set(r);const U={};n&2&&(U.$$scope={dirty:n,ctx:t}),e.$set(U)},i(t){y||(u(s.$$.fragment,t),u(e.$$.fragment,t),y=!0)},o(t){f(s.$$.fragment,t),f(e.$$.fragment,t),y=!1},d(t){t&&p(m),b(s,t),b(e,t)}}}function En(h){let s,m,e,y='<img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/kandinsky-docs/starry_cat.png"/>',t;return s=new w({props:{code:"JTIzJTIwJUVEJTk0JTg0JUVCJUExJUFDJUVEJTk0JTg0JUVEJThBJUI4JUVCJThBJTk0JTIwJUVCJUI5JTg4JUVDJUI5JUI4JUVDJTlDJUJDJUVCJUExJTlDJTIwJUVCJTgyJUE4JUVBJUIyJUE4JUVCJThGJTg0JTIwJUVCJTkwJUE5JUVCJThCJTg4JUVCJThCJUE0JTBBcHJvbXB0JTIwJTNEJTIwJTIyJTIyJTBBcHJpb3Jfb3V0JTIwJTNEJTIwcHJpb3JfcGlwZWxpbmUuaW50ZXJwb2xhdGUoaW1hZ2VzX3RleHRzJTJDJTIwd2VpZ2h0cyklMEElMEFwaXBlbGluZSUyMCUzRCUyMEthbmRpbnNreVBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUpLnRvKCUyMmN1ZGElMjIpJTBBJTBBaW1hZ2UlMjAlM0QlMjBwaXBlbGluZShwcm9tcHQlMkMlMjAqKnByaW9yX291dCUyQyUyMGhlaWdodCUzRDc2OCUyQyUyMHdpZHRoJTNENzY4KS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2U=",highlighted:`<span class="hljs-comment"># 프롬프트는 빈칸으로 남겨도 됩니다</span>
prompt = <span class="hljs-string">&quot;&quot;</span>
prior_out = prior_pipeline.interpolate(images_texts, weights)

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

image = pipeline(prompt, **prior_out, height=<span class="hljs-number">768</span>, width=<span class="hljs-number">768</span>).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),{c(){M(s.$$.fragment),m=o(),e=T("div"),e.innerHTML=y,this.h()},l(n){d(s.$$.fragment,n),m=c(n),e=k(n,"DIV",{class:!0,"data-svelte-h":!0}),Z(e)!=="svelte-twgci5"&&(e.innerHTML=y),this.h()},h(){G(e,"class","flex justify-center")},m(n,r){J(s,n,r),i(n,m,r),i(n,e,r),t=!0},p:$,i(n){t||(u(s.$$.fragment,n),t=!0)},o(n){f(s.$$.fragment,n),t=!1},d(n){n&&(p(m),p(e)),b(s,n)}}}function zn(h){let s,m,e,y='<img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/kandinskyv22-interpolate.png"/>',t;return s=new w({props:{code:"JTIzJTIwJUVEJTk0JTg0JUVCJUExJUFDJUVEJTk0JTg0JUVEJThBJUI4JUVCJThBJTk0JTIwJUVCJUI5JTg4JUVDJUI5JUI4JUVDJTlDJUJDJUVCJUExJTlDJTIwJUVCJTgyJUE4JUVBJUIyJUE4JUVCJThGJTg0JTIwJUVCJTkwJUE5JUVCJThCJTg4JUVCJThCJUE0JTBBcHJvbXB0JTIwJTNEJTIwJTIyJTIyJTBBcHJpb3Jfb3V0JTIwJTNEJTIwcHJpb3JfcGlwZWxpbmUuaW50ZXJwb2xhdGUoaW1hZ2VzX3RleHRzJTJDJTIwd2VpZ2h0cyklMEElMEFwaXBlbGluZSUyMCUzRCUyMEthbmRpbnNreVYyMlBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMi1kZWNvZGVyJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSkudG8oJTIyY3VkYSUyMiklMEElMEFpbWFnZSUyMCUzRCUyMHBpcGVsaW5lKHByb21wdCUyQyUyMCoqcHJpb3Jfb3V0JTJDJTIwaGVpZ2h0JTNENzY4JTJDJTIwd2lkdGglM0Q3NjgpLmltYWdlcyU1QjAlNUQlMEFpbWFnZQ==",highlighted:`<span class="hljs-comment"># 프롬프트는 빈칸으로 남겨도 됩니다</span>
prompt = <span class="hljs-string">&quot;&quot;</span>
prior_out = prior_pipeline.interpolate(images_texts, weights)

pipeline = KandinskyV22Pipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-decoder&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)

image = pipeline(prompt, **prior_out, height=<span class="hljs-number">768</span>, width=<span class="hljs-number">768</span>).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),{c(){M(s.$$.fragment),m=o(),e=T("div"),e.innerHTML=y,this.h()},l(n){d(s.$$.fragment,n),m=c(n),e=k(n,"DIV",{class:!0,"data-svelte-h":!0}),Z(e)!=="svelte-2ur4ou"&&(e.innerHTML=y),this.h()},h(){G(e,"class","flex justify-center")},m(n,r){J(s,n,r),i(n,m,r),i(n,e,r),t=!0},p:$,i(n){t||(u(s.$$.fragment,n),t=!0)},o(n){f(s.$$.fragment,n),t=!1},d(n){n&&(p(m),p(e)),b(s,n)}}}function Sn(h){let s,m,e,y;return s=new j({props:{id:"interpolate",option:"Kandinsky 2.1",$$slots:{default:[En]},$$scope:{ctx:h}}}),e=new j({props:{id:"interpolate",option:"Kandinsky 2.2",$$slots:{default:[zn]},$$scope:{ctx:h}}}),{c(){M(s.$$.fragment),m=o(),M(e.$$.fragment)},l(t){d(s.$$.fragment,t),m=c(t),d(e.$$.fragment,t)},m(t,n){J(s,t,n),i(t,m,n),J(e,t,n),y=!0},p(t,n){const r={};n&2&&(r.$$scope={dirty:n,ctx:t}),s.$set(r);const U={};n&2&&(U.$$scope={dirty:n,ctx:t}),e.$set(U)},i(t){y||(u(s.$$.fragment,t),u(e.$$.fragment,t),y=!0)},o(t){f(s.$$.fragment,t),f(e.$$.fragment,t),y=!1},d(t){t&&p(m),b(s,t),b(e,t)}}}function xn(h){let s,m,e,y,t,n,r,U,V,W,g,B="Kandinsky 모델은 일련의 다국어 text-to-image 생성 모델입니다. Kandinsky 2.0 모델은 두 개의 다국어 텍스트 인코더를 사용하고 그 결과를 연결해 UNet에 사용됩니다.",fe,el,et='<a href="../api/pipelines/kandinsky">Kandinsky 2.1</a>은 텍스트와 이미지 임베딩 간의 매핑을 생성하는 image prior 모델(<a href="https://huggingface.co/docs/transformers/model_doc/clip" rel="nofollow"><code>CLIP</code></a>)을 포함하도록 아키텍처를 변경했습니다. 이 매핑은 더 나은 text-image alignment를 제공하며, 학습 중에 텍스트 임베딩과 함께 사용되어 더 높은 품질의 결과를 가져옵니다. 마지막으로, Kandinsky 2.1은 spatial conditional 정규화 레이어를 추가하여 사실감을 높여주는 <a href="https://huggingface.co/papers/2209.09002" rel="nofollow">Modulating Quantized Vectors (MoVQ)</a> 디코더를 사용하여 latents를 이미지로 디코딩합니다.',be,sl,st='<a href="../api/pipelines/kandinsky_v22">Kandinsky 2.2</a>는 image prior 모델의 이미지 인코더를 더 큰 CLIP-ViT-G 모델로 교체하여 품질을 개선함으로써 이전 모델을 개선했습니다. 또한 image prior 모델은 해상도와 종횡비가 다른 이미지로 재훈련되어 더 높은 해상도의 이미지와 다양한 이미지 크기를 생성합니다.',Ue,tl,tt='<a href="../api/pipelines/kandinsky3">Kandinsky 3</a>는 아키텍처를 단순화하고 prior 모델과 diffusion 모델을 포함하는 2단계 생성 프로세스에서 벗어나고 있습니다. 대신, Kandinsky 3는 <a href="https://huggingface.co/google/flan-ul2" rel="nofollow">Flan-UL2</a>를 사용하여 텍스트를 인코딩하고, <a href="https://hf.co/papers/1809.11096" rel="nofollow">BigGan-deep</a> 블록이 포함된 UNet을 사용하며, <a href="https://github.com/ai-forever/MoVQGAN" rel="nofollow">Sber-MoVQGAN</a>을 사용하여 latents를 이미지로 디코딩합니다. 텍스트 이해와 생성된 이미지 품질은 주로 더 큰 텍스트 인코더와 UNet을 사용함으로써 달성됩니다.',he,nl,nt="이 가이드에서는 text-to-image, image-to-image, 인페인팅, 보간 등을 위해 Kandinsky 모델을 사용하는 방법을 설명합니다.",ge,al,at="시작하기 전에 다음 라이브러리가 설치되어 있는지 확인하세요:",Te,pl,ke,C,pt='<p>Kandinsky 2.1과 2.2의 사용법은 매우 유사합니다! 유일한 차이점은 Kandinsky 2.2는 latents를 디코딩할 때 <code>프롬프트</code>를 입력으로 받지 않는다는 것입니다. 대신, Kandinsky 2.2는 디코딩 중에는 <code>image_embeds</code>만 받아들입니다.</p> <br/> <p>Kandinsky 3는 더 간결한 아키텍처를 가지고 있으며 prior 모델이 필요하지 않습니다. 즉, <a href="sdxl">Stable Diffusion XL</a>과 같은 다른 diffusion 모델과 사용법이 동일합니다.</p>',Ze,il,we,ml,it="모든 작업에 Kandinsky 모델을 사용하려면 항상 프롬프트를 인코딩하고 이미지 임베딩을 생성하는 prior 파이프라인을 설정하는 것부터 시작해야 합니다. 이전 파이프라인은 negative 프롬프트 <code>&quot;&quot;</code>에 해당하는 <code>negative_image_embeds</code>도 생성합니다. 더 나은 결과를 얻으려면 이전 파이프라인에 실제 <code>negative_prompt</code>를 전달할 수 있지만, 이렇게 하면 prior 파이프라인의 유효 배치 크기가 2배로 증가합니다.",We,Q,je,rl,mt="🤗 Diffusers는 또한 <code>KandinskyCombinedPipeline</code> 및 <code>KandinskyV22CombinedPipeline</code>이 포함된 end-to-end API를 제공하므로 prior 파이프라인과 text-to-image 변환 파이프라인을 별도로 불러올 필요가 없습니다. 결합된 파이프라인은 prior 모델과 디코더를 모두 자동으로 불러옵니다. 원하는 경우 <code>prior_guidance_scale</code> 및 <code>prior_num_inference_steps</code> 매개 변수를 사용하여 prior 파이프라인에 대해 다른 값을 설정할 수 있습니다.",$e,ol,rt="내부에서 결합된 파이프라인을 자동으로 호출하려면 <code>AutoPipelineForText2Image</code>를 사용합니다:",Ve,X,Ge,cl,Be,yl,ot="Image-to-image 경우, 초기 이미지와 텍스트 프롬프트를 전달하여 파이프라인에 이미지를 conditioning합니다. Prior 파이프라인을 불러오는 것으로 시작합니다:",Ie,v,Re,Ml,ct="Conditioning할 이미지를 다운로드합니다:",_e,dl,Ce,Y,yt='<img class="rounded-xl" src="https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"/>',Qe,Jl,Mt="Prior 파이프라인으로 <code>image_embeds</code>와 <code>negative_image_embeds</code>를 생성합니다:",Xe,ul,ve,fl,dt="이제 원본 이미지와 모든 프롬프트 및 임베딩을 파이프라인으로 전달하여 이미지를 생성합니다:",Ye,N,Ne,bl,Jt="또한 🤗 Diffusers에서는 <code>KandinskyImg2ImgCombinedPipeline</code> 및 <code>KandinskyV22Img2ImgCombinedPipeline</code>이 포함된 end-to-end API를 제공하므로 prior 파이프라인과 image-to-image 파이프라인을 별도로 불러올 필요가 없습니다. 결합된 파이프라인은 prior 모델과 디코더를 모두 자동으로 불러옵니다. 원하는 경우 <code>prior_guidance_scale</code> 및 <code>prior_num_inference_steps</code> 매개 변수를 사용하여 이전 파이프라인에 대해 다른 값을 설정할 수 있습니다.",Fe,Ul,ut="내부에서 결합된 파이프라인을 자동으로 호출하려면 <code>AutoPipelineForImage2Image</code>를 사용합니다:",He,F,Ee,hl,ze,R,Je,ft="⚠️ Kandinsky 모델은 이제 검은색 픽셀 대신 ⬜️ <strong>흰색 픽셀</strong>을 사용하여 마스크 영역을 표현합니다. 프로덕션에서 <code>KandinskyInpaintPipeline</code>을 사용하는 경우 흰색 픽셀을 사용하도록 마스크를 변경해야 합니다:",As,gl,Se,Tl,bt="인페인팅에서는 원본 이미지, 원본 이미지에서 대체할 영역의 마스크, 인페인팅할 내용에 대한 텍스트 프롬프트가 필요합니다. Prior 파이프라인을 불러옵니다:",xe,H,Ke,kl,Ut="초기 이미지를 불러오고 마스크를 생성합니다:",De,Zl,qe,wl,ht="Prior 파이프라인으로 임베딩을 생성합니다:",Le,Wl,Pe,jl,gt="이제 이미지 생성을 위해 초기 이미지, 마스크, 프롬프트와 임베딩을 파이프라인에 전달합니다:",Ae,E,Oe,$l,Tt="<code>KandinskyInpaintCombinedPipeline</code> 및 <code>KandinskyV22InpaintCombinedPipeline</code>을 사용하여 내부에서 prior 및 디코더 파이프라인을 함께 호출할 수 있습니다. 이를 위해 <code>AutoPipelineForInpainting</code>을 사용합니다:",ls,z,es,Vl,ss,Gl,kt="Interpolation(보간)을 사용하면 이미지와 텍스트 임베딩 사이의 latent space를 탐색할 수 있어 prior 모델의 중간 결과물을 볼 수 있는 멋진 방법입니다. Prior 파이프라인과 보간하려는 두 개의 이미지를 불러옵니다:",ts,S,ns,x,Zt='<div><img class="rounded-xl" src="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinsky/cat.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">a cat</figcaption></div> <div><img class="rounded-xl" src="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinsky/starry_night.jpeg"/> <figcaption class="mt-2 text-center text-sm text-gray-500">Van Gogh&#39;s Starry Night painting</figcaption></div>',as,Bl,wt="보간할 텍스트 또는 이미지를 지정하고 각 텍스트 또는 이미지에 대한 가중치를 설정합니다. 가중치를 실험하여 보간에 어떤 영향을 미치는지 확인하세요!",ps,Il,is,Rl,Wt="<code>interpolate</code> 함수를 호출하여 임베딩을 생성한 다음, 파이프라인으로 전달하여 이미지를 생성합니다:",ms,K,rs,_l,os,D,jt="<p>⚠️ ControlNet은 Kandinsky 2.2에서만 지원됩니다!</p>",cs,Cl,$t="ControlNet을 사용하면 depth map이나 edge detection와 같은 추가 입력을 통해 사전학습된 large diffusion 모델을 conditioning할 수 있습니다. 예를 들어, 모델이 depth map의 구조를 이해하고 보존할 수 있도록 깊이 맵으로 Kandinsky 2.2를 conditioning할 수 있습니다.",ys,Ql,Vt="이미지를 불러오고 depth map을 추출해 보겠습니다:",Ms,Xl,ds,q,Gt='<img class="rounded-xl" src="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinskyv22/cat.png"/>',Js,vl,Bt="그런 다음 🤗 Transformers의 <code>depth-estimation</code> <code>Pipeline</code>을 사용하여 이미지를 처리해 depth map을 구할 수 있습니다:",us,Yl,fs,Nl,bs,Fl,It="Prior 파이프라인과 <code>KandinskyV22ControlnetPipeline</code>를 불러옵니다:",Us,Hl,hs,El,Rt="프롬프트와 negative 프롬프트로 이미지 임베딩을 생성합니다:",gs,zl,Ts,Sl,_t="마지막으로 이미지 임베딩과 depth 이미지를 <code>KandinskyV22ControlnetPipeline</code>에 전달하여 이미지를 생성합니다:",ks,xl,Zs,L,Ct='<img class="rounded-xl" src="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinskyv22/robot_cat_text2img.png"/>',ws,Kl,Ws,Dl,Qt="ControlNet을 사용한 image-to-image의 경우, 다음을 사용할 필요가 있습니다:",js,ql,Xt="<li><code>KandinskyV22PriorEmb2EmbPipeline</code>로 텍스트 프롬프트와 이미지에서 이미지 임베딩을 생성합니다.</li> <li><code>KandinskyV22ControlnetImg2ImgPipeline</code>로 초기 이미지와 이미지 임베딩에서 이미지를 생성합니다.</li>",$s,Ll,vt="🤗 Transformers에서 <code>depth-estimation</code> <code>Pipeline</code>을 사용하여 고양이의 초기 이미지의 depth map을 처리해 추출합니다:",Vs,Pl,Gs,Al,Yt="Prior 파이프라인과 <code>KandinskyV22ControlnetImg2ImgPipeline</code>을 불러옵니다:",Bs,Ol,Is,le,Nt="텍스트 프롬프트와 초기 이미지를 이전 파이프라인에 전달하여 이미지 임베딩을 생성합니다:",Rs,ee,_s,se,Ft="이제 <code>KandinskyV22ControlnetImg2ImgPipeline</code>을 실행하여 초기 이미지와 이미지 임베딩으로부터 이미지를 생성할 수 있습니다:",Cs,te,Qs,P,Ht='<img class="rounded-xl" src="https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/kandinskyv22/robot_cat.png"/>',Xs,ne,vs,ae,Et="Kandinsky는 mapping을 생성하기 위한 prior 파이프라인과 latents를 이미지로 디코딩하기 위한 두 번째 파이프라인이 필요하다는 점에서 독특합니다. 대부분의 계산이 두 번째 파이프라인에서 이루어지므로 최적화의 노력은 두 번째 파이프라인에 집중되어야 합니다. 다음은 추론 중 Kandinsky키를 개선하기 위한 몇 가지 팁입니다.",Ys,pe,zt='<li>PyTorch &lt; 2.0을 사용할 경우 <a href="../optimization/xformers">xFormers</a>을 활성화합니다.</li>',Ns,ie,Fs,A,St="<li>PyTorch &gt;= 2.0을 사용할 경우 <code>torch.compile</code>을 활성화하여 scaled dot-product attention (SDPA)를 자동으로 사용하도록 합니다:</li>",Hs,me,Es,re,xt="이는 attention processor를 명시적으로 <code>AttnAddedKVProcessor2_0</code>을 사용하도록 설정하는 것과 동일합니다:",zs,oe,Ss,O,Kt="<li>메모리 부족 오류를 방지하기 위해 <code>enable_model_cpu_offload()</code>를 사용하여 모델을 CPU로 오프로드합니다:</li>",xs,ce,Ks,ll,Dt="<li>기본적으로 text-to-image 파이프라인은 <code>DDIMScheduler</code>를 사용하지만, <code>DDPMScheduler</code>와 같은 다른 스케줄러로 대체하여 추론 속도와 이미지 품질 간의 균형에 어떤 영향을 미치는지 확인할 수 있습니다:</li>",Ds,ye,qs,Me,Ls,ue,Ps;return t=new on({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),r=new _({props:{title:"Kandinsky",local:"kandinsky",headingTag:"h1"}}),V=new yn({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/ko/kandinsky.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/ko/pytorch/kandinsky.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/ko/tensorflow/kandinsky.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/ko/kandinsky.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/ko/pytorch/kandinsky.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/ko/tensorflow/kandinsky.ipynb"}]}}),pl=new w({props:{code:"JTIzJTIwQ29sYWIlRUMlOTclOTAlRUMlODQlOUMlMjAlRUQlOTUlODQlRUMlOUElOTQlRUQlOTUlOUMlMjAlRUIlOUQlQkMlRUMlOUQlQjQlRUIlQjglOEMlRUIlOUYlQUMlRUIlQTYlQUMlRUIlQTUlQkMlMjAlRUMlODQlQTQlRUMlQjklOTglRUQlOTUlOTglRUElQjglQjAlMjAlRUMlOUMlODQlRUQlOTUlQjQlMjAlRUMlQTMlQkMlRUMlODQlOUQlRUMlOUQlODQlMjAlRUMlQTAlOUMlRUMlOTklQjglRUQlOTUlOTglRUMlODQlQjglRUMlOUElOTQlMEElMjMhcGlwJTIwaW5zdGFsbCUyMC1xJTIwZGlmZnVzZXJzJTIwdHJhbnNmb3JtZXJzJTIwYWNjZWxlcmF0ZQ==",highlighted:`<span class="hljs-comment"># Colab에서 필요한 라이브러리를 설치하기 위해 주석을 제외하세요</span>
<span class="hljs-comment">#!pip install -q diffusers transformers accelerate</span>`,wrap:!1}}),il=new _({props:{title:"Text-to-image",local:"text-to-image",headingTag:"h2"}}),Q=new I({props:{id:"text-to-image",options:["Kandinsky 2.1","Kandinsky 2.2","Kandinsky 3"],$$slots:{default:[un]},$$scope:{ctx:h}}}),X=new I({props:{id:"text-to-image",options:["Kandinsky 2.1","Kandinsky 2.2"],$$slots:{default:[Un]},$$scope:{ctx:h}}}),cl=new _({props:{title:"Image-to-image",local:"image-to-image",headingTag:"h2"}}),v=new I({props:{id:"image-to-image",options:["Kandinsky 2.1","Kandinsky 2.2","Kandinsky 3"],$$slots:{default:[kn]},$$scope:{ctx:h}}}),dl=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEElMEElMjMlMjAlRUMlOUQlQjQlRUIlQUYlQjglRUMlQTclODAlMjAlRUIlOEIlQTQlRUMlOUElQjQlRUIlQTElOUMlRUIlOTMlOUMlMEF1cmwlMjAlM0QlMjAlMjJodHRwcyUzQSUyRiUyRnJhdy5naXRodWJ1c2VyY29udGVudC5jb20lMkZDb21wVmlzJTJGc3RhYmxlLWRpZmZ1c2lvbiUyRm1haW4lMkZhc3NldHMlMkZzdGFibGUtc2FtcGxlcyUyRmltZzJpbWclMkZza2V0Y2gtbW91bnRhaW5zLWlucHV0LmpwZyUyMiUwQW9yaWdpbmFsX2ltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSh1cmwpJTBBb3JpZ2luYWxfaW1hZ2UlMjAlM0QlMjBvcmlnaW5hbF9pbWFnZS5yZXNpemUoKDc2OCUyQyUyMDUxMikp",highlighted:`<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

<span class="hljs-comment"># 이미지 다운로드</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>
original_image = load_image(url)
original_image = original_image.resize((<span class="hljs-number">768</span>, <span class="hljs-number">512</span>))`,wrap:!1}}),ul=new w({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMGZhbnRhc3klMjBsYW5kc2NhcGUlMkMlMjBDaW5lbWF0aWMlMjBsaWdodGluZyUyMiUwQW5lZ2F0aXZlX3Byb21wdCUyMCUzRCUyMCUyMmxvdyUyMHF1YWxpdHklMkMlMjBiYWQlMjBxdWFsaXR5JTIyJTBBJTBBaW1hZ2VfZW1iZWRzJTJDJTIwbmVnYXRpdmVfaW1hZ2VfZW1iZWRzJTIwJTNEJTIwcHJpb3JfcGlwZWxpbmUocHJvbXB0JTJDJTIwbmVnYXRpdmVfcHJvbXB0KS50b190dXBsZSgp",highlighted:`prompt = <span class="hljs-string">&quot;A fantasy landscape, Cinematic lighting&quot;</span>
negative_prompt = <span class="hljs-string">&quot;low quality, bad quality&quot;</span>

image_embeds, negative_image_embeds = prior_pipeline(prompt, negative_prompt).to_tuple()`,wrap:!1}}),N=new I({props:{id:"image-to-image",options:["Kandinsky 2.1","Kandinsky 2.2","Kandinsky 3"],$$slots:{default:[jn]},$$scope:{ctx:h}}}),F=new I({props:{id:"image-to-image",options:["Kandinsky 2.1","Kandinsky 2.2"],$$slots:{default:[Gn]},$$scope:{ctx:h}}}),hl=new _({props:{title:"Inpainting",local:"inpainting",headingTag:"h2"}}),gl=new w({props:{code:"JTIzJTIwUElMJTIwJUVDJTlFJTg1JUVCJUEwJUE1JUVDJTk3JTkwJTIwJUVCJThDJTgwJUVEJTk1JUI0JTBBaW1wb3J0JTIwUElMLkltYWdlT3BzJTBBbWFzayUyMCUzRCUyMFBJTC5JbWFnZU9wcy5pbnZlcnQobWFzayklMEElMEElMjMlMjBQeVRvcmNoJUVDJTk5JTgwJTIwTnVtUHklMjAlRUMlOUUlODUlRUIlQTAlQTUlRUMlOTclOTAlMjAlRUIlOEMlODAlRUQlOTUlQjQlMEFtYXNrJTIwJTNEJTIwMSUyMC0lMjBtYXNr",highlighted:`<span class="hljs-comment"># PIL 입력에 대해</span>
<span class="hljs-keyword">import</span> PIL.ImageOps
mask = PIL.ImageOps.invert(mask)

<span class="hljs-comment"># PyTorch와 NumPy 입력에 대해</span>
mask = <span class="hljs-number">1</span> - mask`,wrap:!1}}),H=new I({props:{id:"inpaint",options:["Kandinsky 2.1","Kandinsky 2.2"],$$slots:{default:[Rn]},$$scope:{ctx:h}}}),Zl=new w({props:{code:"aW5pdF9pbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGaGYtaW50ZXJuYWwtdGVzdGluZyUyRmRpZmZ1c2Vycy1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyRmthbmRpbnNreSUyRmNhdC5wbmclMjIpJTBBbWFzayUyMCUzRCUyMG5wLnplcm9zKCg3NjglMkMlMjA3NjgpJTJDJTIwZHR5cGUlM0RucC5mbG9hdDMyKSUwQSUyMyUyMG1hc2slMjBhcmVhJTIwYWJvdmUlMjBjYXQncyUyMGhlYWQlMEFtYXNrJTVCJTNBMjUwJTJDJTIwMjUwJTNBLTI1MCU1RCUyMCUzRCUyMDE=",highlighted:`init_image = load_image(<span class="hljs-string">&quot;https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/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"># mask area above 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>`,wrap:!1}}),Wl=new w({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyYSUyMGhhdCUyMiUwQXByaW9yX291dHB1dCUyMCUzRCUyMHByaW9yX3BpcGVsaW5lKHByb21wdCk=",highlighted:`prompt = <span class="hljs-string">&quot;a hat&quot;</span>
prior_output = prior_pipeline(prompt)`,wrap:!1}}),E=new I({props:{id:"inpaint",options:["Kandinsky 2.1","Kandinsky 2.2"],$$slots:{default:[Qn]},$$scope:{ctx:h}}}),z=new I({props:{id:"inpaint",options:["Kandinsky 2.1","Kandinsky 2.2"],$$slots:{default:[Yn]},$$scope:{ctx:h}}}),Vl=new _({props:{title:"Interpolation (보간)",local:"interpolation-보간",headingTag:"h2"}}),S=new I({props:{id:"interpolate",options:["Kandinsky 2.1","Kandinsky 2.2"],$$slots:{default:[Hn]},$$scope:{ctx:h}}}),Il=new w({props:{code:"aW1hZ2VzX3RleHRzJTIwJTNEJTIwJTVCJTIyYSUyMGNhdCUyMiUyQyUyMGltZ18xJTJDJTIwaW1nXzIlNUQlMEF3ZWlnaHRzJTIwJTNEJTIwJTVCMC4zJTJDJTIwMC4zJTJDJTIwMC40JTVE",highlighted:`images_texts = [<span class="hljs-string">&quot;a cat&quot;</span>, img_1, img_2]
weights = [<span class="hljs-number">0.3</span>, <span class="hljs-number">0.3</span>, <span class="hljs-number">0.4</span>]`,wrap:!1}}),K=new I({props:{id:"interpolate",options:["Kandinsky 2.1","Kandinsky 2.2"],$$slots:{default:[Sn]},$$scope:{ctx:h}}}),_l=new _({props:{title:"ControlNet",local:"controlnet",headingTag:"h2"}}),Xl=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEElMEFpbWclMjAlM0QlMjBsb2FkX2ltYWdlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmhmLWludGVybmFsLXRlc3RpbmclMkZkaWZmdXNlcnMtaW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZrYW5kaW5za3l2MjIlMkZjYXQucG5nJTIyJTBBKS5yZXNpemUoKDc2OCUyQyUyMDc2OCkpJTBBaW1n",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>))
img`,wrap:!1}}),Yl=new w({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEElMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwcGlwZWxpbmUlMEElMEFkZWYlMjBtYWtlX2hpbnQoaW1hZ2UlMkMlMjBkZXB0aF9lc3RpbWF0b3IpJTNBJTBBJTIwJTIwJTIwJTIwaW1hZ2UlMjAlM0QlMjBkZXB0aF9lc3RpbWF0b3IoaW1hZ2UpJTVCJTIyZGVwdGglMjIlNUQlMEElMjAlMjAlMjAlMjBpbWFnZSUyMCUzRCUyMG5wLmFycmF5KGltYWdlKSUwQSUyMCUyMCUyMCUyMGltYWdlJTIwJTNEJTIwaW1hZ2UlNUIlM0ElMkMlMjAlM0ElMkMlMjBOb25lJTVEJTBBJTIwJTIwJTIwJTIwaW1hZ2UlMjAlM0QlMjBucC5jb25jYXRlbmF0ZSglNUJpbWFnZSUyQyUyMGltYWdlJTJDJTIwaW1hZ2UlNUQlMkMlMjBheGlzJTNEMiklMEElMjAlMjAlMjAlMjBkZXRlY3RlZF9tYXAlMjAlM0QlMjB0b3JjaC5mcm9tX251bXB5KGltYWdlKS5mbG9hdCgpJTIwJTJGJTIwMjU1LjAlMEElMjAlMjAlMjAlMjBoaW50JTIwJTNEJTIwZGV0ZWN0ZWRfbWFwLnBlcm11dGUoMiUyQyUyMDAlMkMlMjAxKSUwQSUyMCUyMCUyMCUyMHJldHVybiUyMGhpbnQlMEElMEFkZXB0aF9lc3RpbWF0b3IlMjAlM0QlMjBwaXBlbGluZSglMjJkZXB0aC1lc3RpbWF0aW9uJTIyKSUwQWhpbnQlMjAlM0QlMjBtYWtlX2hpbnQoaW1nJTJDJTIwZGVwdGhfZXN0aW1hdG9yKS51bnNxdWVlemUoMCkuaGFsZigpLnRvKCUyMmN1ZGElMjIp",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">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>)`,wrap:!1}}),Nl=new _({props:{title:"Text-to-image",local:"controlnet-text-to-image",headingTag:"h3"}}),Hl=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUlMkMlMjBLYW5kaW5za3lWMjJDb250cm9sbmV0UGlwZWxpbmUlMEElMEFwcmlvcl9waXBlbGluZSUyMCUzRCUyMEthbmRpbnNreVYyMlByaW9yUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0yLXByaW9yJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUwQSkudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlbGluZSUyMCUzRCUyMEthbmRpbnNreVYyMkNvbnRyb2xuZXRQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTItY29udHJvbG5ldC1kZXB0aCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSkudG8oJTIyY3VkYSUyMik=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> KandinskyV22PriorPipeline, KandinskyV22ControlnetPipeline

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

pipeline = KandinskyV22ControlnetPipeline.from_pretrained(
    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-controlnet-depth&quot;</span>, torch_dtype=torch.float16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),zl=new w({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMHJvYm90JTJDJTIwNGslMjBwaG90byUyMiUwQW5lZ2F0aXZlX3ByaW9yX3Byb21wdCUyMCUzRCUyMCUyMmxvd3JlcyUyQyUyMHRleHQlMkMlMjBlcnJvciUyQyUyMGNyb3BwZWQlMkMlMjB3b3JzdCUyM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UzRG5lZ2F0aXZlX3ByaW9yX3Byb21wdCUyQyUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUwQSkudG9fdHVwbGUoKQ==",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 = prior_pipeline(
    prompt=prompt, negative_prompt=negative_prior_prompt, generator=generator
).to_tuple()`,wrap:!1}}),xl=new w({props:{code:"aW1hZ2UlMjAlM0QlMjBwaXBlbGluZShpbWFnZV9lbWJlZHMlM0RpbWFnZV9lbWIlMkMlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0R6ZXJvX2ltYWdlX2VtYiUyQyUyMGhpbnQlM0RoaW50JTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTIwaGVpZ2h0JTNENzY4JTJDJTIwd2lkdGglM0Q3NjgpLmltYWdlcyU1QjAlNUQlMEFpbWFnZQ==",highlighted:`image = pipeline(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[<span class="hljs-number">0</span>]
image`,wrap:!1}}),Kl=new _({props:{title:"Image-to-image",local:"controlnet-image-to-image",headingTag:"h3"}}),Pl=new w({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjB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kuZmxvYXQoKSUyMCUyRiUyMDI1NS4wJTBBJTIwJTIwJTIwJTIwaGludCUyMCUzRCUyMGRldGVjdGVkX21hcC5wZXJtdXRlKDIlMkMlMjAwJTJDJTIwMSklMEElMjAlMjAlMjAlMjByZXR1cm4lMjBoaW50JTBBJTBBZGVwdGhfZXN0aW1hdG9yJTIwJTNEJTIwcGlwZWxpbmUoJTIyZGVwdGgtZXN0aW1hdGlvbiUyMiklMEFoaW50JTIwJTNEJTIwbWFrZV9oaW50KGltZyUyQyUyMGRlcHRoX2VzdGltYXRvcikudW5zcXVlZXplKDApLmhhbGYoKS50byglMjJjdWRhJTIyKQ==",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/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>)`,wrap:!1}}),Ol=new w({props:{code:"cHJpb3JfcGlwZWxpbmUlMjAlM0QlMjBLYW5kaW5za3lWMjJQcmlvckVtYjJFbWJQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTItcHJpb3IlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlJTBBKS50byglMjJjdWRhJTIyKSUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwS2FuZGluc2t5VjIyQ29udHJvbG5ldEltZzJJbWdQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTItY29udHJvbG5ldC1kZXB0aCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSkudG8oJTIyY3VkYSUyMik=",highlighted:`prior_pipeline = KandinskyV22PriorEmb2EmbPipeline.from_pretrained(
    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-prior&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipeline = KandinskyV22ControlnetImg2ImgPipeline.from_pretrained(
    <span class="hljs-string">&quot;kandinsky-community/kandinsky-2-2-controlnet-depth&quot;</span>, torch_dtype=torch.float16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),ee=new w({props:{code:"cHJvbXB0JTIwJTNEJTIwJTIyQSUyMHJvYm90JTJDJTIwNGslMjBwaG90byUyMiUwQW5lZ2F0aXZlX3ByaW9yX3Byb21wdCUyMCUzRCUyMCUyMmxvd3JlcyUyQ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M0RpbWclMkMlMjBzdHJlbmd0aCUzRDAuODUlMkMlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3IpJTBBbmVnYXRpdmVfZW1iJTIwJTNEJTIwcHJpb3JfcGlwZWxpbmUocHJvbXB0JTNEbmVnYXRpdmVfcHJpb3JfcHJvbXB0JTJDJTIwaW1hZ2UlM0RpbWclMkMlMjBzdHJlbmd0aCUzRDElMkMlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3Ip",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>)

img_emb = prior_pipeline(prompt=prompt, image=img, strength=<span class="hljs-number">0.85</span>, generator=generator)
negative_emb = prior_pipeline(prompt=negative_prior_prompt, image=img, strength=<span class="hljs-number">1</span>, generator=generator)`,wrap:!1}}),te=new w({props:{code:"aW1hZ2UlMjAlM0QlMjBwaXBlbGluZShpbWFnZSUzRGltZyUyQyUyMHN0cmVuZ3RoJTNEMC41JTJDJTIwaW1hZ2VfZW1iZWRzJTNEaW1nX2VtYi5pbWFnZV9lbWJlZHMlMkMlMjBuZWdhdGl2ZV9pbWFnZV9lbWJlZHMlM0RuZWdhdGl2ZV9lbWIuaW1hZ2VfZW1iZWRzJTJDJTIwaGludCUzRGhpbnQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTAlMkMlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3IlMkMlMjBoZWlnaHQlM0Q3NjglMkMlMjB3aWR0aCUzRDc2OCkuaW1hZ2VzJTVCMCU1RCUwQW1ha2VfaW1hZ2VfZ3JpZCglNUJpbWcucmVzaXplKCg1MTIlMkMlMjA1MTIpKSUyQyUyMGltYWdlLnJlc2l6ZSgoNTEyJTJDJTIwNTEyKSklNUQlMkMlMjByb3dzJTNEMSUyQyUyMGNvbHMlM0QyKQ==",highlighted:`image = pipeline(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[<span class="hljs-number">0</span>]
make_image_grid([img.resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>)), image.resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>))], rows=<span class="hljs-number">1</span>, cols=<span class="hljs-number">2</span>)`,wrap:!1}}),ne=new _({props:{title:"최적화",local:"최적화",headingTag:"h2"}}),ie=new w({props:{code:"JTIwJTIwZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTIwJTIwaW1wb3J0JTIwdG9yY2glMEElMEElMjAlMjBwaXBlJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQSUyQiUyMHBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKCk=",highlighted:`  from diffusers import DiffusionPipeline
  import torch

  pipe = DiffusionPipeline.from_pretrained(&quot;kandinsky-community/kandinsky-2-1&quot;, torch_dtype=torch.float16)
<span class="hljs-addition">+ pipe.enable_xformers_memory_efficient_attention()</span>`,wrap:!1}}),me=new w({props:{code:"JTIwJTIwcGlwZS51bmV0LnRvKG1lbW9yeV9mb3JtYXQlM0R0b3JjaC5jaGFubmVsc19sYXN0KSUwQSUyQiUyMHBpcGUudW5ldCUyMCUzRCUyMHRvcmNoLmNvbXBpbGUocGlwZS51bmV0JTJDJTIwbW9kZSUzRCUyMnJlZHVjZS1vdmVyaGVhZCUyMiUyQyUyMGZ1bGxncmFwaCUzRFRydWUp",highlighted:`  pipe.unet.to(memory_format=torch.channels_last)
<span class="hljs-addition">+ pipe.unet = torch.compile(pipe.unet, mode=&quot;reduce-overhead&quot;, fullgraph=True)</span>`,wrap:!1}}),oe=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy5tb2RlbHMuYXR0ZW50aW9uX3Byb2Nlc3NvciUyMGltcG9ydCUyMEF0dG5BZGRlZEtWUHJvY2Vzc29yMl8wJTBBJTBBcGlwZS51bmV0LnNldF9hdHRuX3Byb2Nlc3NvcihBdHRuQWRkZWRLVlByb2Nlc3NvcjJfMCgpKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers.models.attention_processor <span class="hljs-keyword">import</span> AttnAddedKVProcessor2_0

pipe.unet.set_attn_processor(AttnAddedKVProcessor2_0())`,wrap:!1}}),ce=new w({props:{code:"JTIwJTIwZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTIwJTIwaW1wb3J0JTIwdG9yY2glMEElMEElMjAlMjBwaXBlJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMmthbmRpbnNreS1jb21tdW5pdHklMkZrYW5kaW5za3ktMi0xJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQSUyQiUyMHBpcGUuZW5hYmxlX21vZGVsX2NwdV9vZmZsb2FkKCk=",highlighted:`  from diffusers import DiffusionPipeline
  import torch

  pipe = DiffusionPipeline.from_pretrained(&quot;kandinsky-community/kandinsky-2-1&quot;, torch_dtype=torch.float16)
<span class="hljs-addition">+ pipe.enable_model_cpu_offload()</span>`,wrap:!1}}),ye=new w({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEREUE1TY2hlZHVsZXIlMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFzY2hlZHVsZXIlMjAlM0QlMjBERFBNU2NoZWR1bGVyLmZyb21fcHJldHJhaW5lZCglMjJrYW5kaW5za3ktY29tbXVuaXR5JTJGa2FuZGluc2t5LTItMSUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMmRkcG1fc2NoZWR1bGVyJTIyKSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIya2FuZGluc2t5LWNvbW11bml0eSUyRmthbmRpbnNreS0yLTElMjIlMkMlMjBzY2hlZHVsZXIlM0RzY2hlZHVsZXIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlKS50byglMjJjdWRhJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DDPMScheduler
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

scheduler = DDPMScheduler.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1&quot;</span>, subfolder=<span class="hljs-string">&quot;ddpm_scheduler&quot;</span>)
pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;kandinsky-community/kandinsky-2-1&quot;</span>, scheduler=scheduler, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),Me=new cn({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/ko/using-diffusers/kandinsky.md"}}),{c(){s=T("meta"),m=o(),e=T("p"),y=o(),M(t.$$.fragment),n=o(),M(r.$$.fragment),U=o(),M(V.$$.fragment),W=o(),g=T("p"),g.textContent=B,fe=o(),el=T("p"),el.innerHTML=et,be=o(),sl=T("p"),sl.innerHTML=st,Ue=o(),tl=T("p"),tl.innerHTML=tt,he=o(),nl=T("p"),nl.textContent=nt,ge=o(),al=T("p"),al.textContent=at,Te=o(),M(pl.$$.fragment),ke=o(),C=T("blockquote"),C.innerHTML=pt,Ze=o(),M(il.$$.fragment),we=o(),ml=T("p"),ml.innerHTML=it,We=o(),M(Q.$$.fragment),je=o(),rl=T("p"),rl.innerHTML=mt,$e=o(),ol=T("p"),ol.innerHTML=rt,Ve=o(),M(X.$$.fragment),Ge=o(),M(cl.$$.fragment),Be=o(),yl=T("p"),yl.textContent=ot,Ie=o(),M(v.$$.fragment),Re=o(),Ml=T("p"),Ml.textContent=ct,_e=o(),M(dl.$$.fragment),Ce=o(),Y=T("div"),Y.innerHTML=yt,Qe=o(),Jl=T("p"),Jl.innerHTML=Mt,Xe=o(),M(ul.$$.fragment),ve=o(),fl=T("p"),fl.textContent=dt,Ye=o(),M(N.$$.fragment),Ne=o(),bl=T("p"),bl.innerHTML=Jt,Fe=o(),Ul=T("p"),Ul.innerHTML=ut,He=o(),M(F.$$.fragment),Ee=o(),M(hl.$$.fragment),ze=o(),R=T("blockquote"),Je=T("p"),Je.innerHTML=ft,As=o(),M(gl.$$.fragment),Se=o(),Tl=T("p"),Tl.textContent=bt,xe=o(),M(H.$$.fragment),Ke=o(),kl=T("p"),kl.textContent=Ut,De=o(),M(Zl.$$.fragment),qe=o(),wl=T("p"),wl.textContent=ht,Le=o(),M(Wl.$$.fragment),Pe=o(),jl=T("p"),jl.textContent=gt,Ae=o(),M(E.$$.fragment),Oe=o(),$l=T("p"),$l.innerHTML=Tt,ls=o(),M(z.$$.fragment),es=o(),M(Vl.$$.fragment),ss=o(),Gl=T("p"),Gl.textContent=kt,ts=o(),M(S.$$.fragment),ns=o(),x=T("div"),x.innerHTML=Zt,as=o(),Bl=T("p"),Bl.textContent=wt,ps=o(),M(Il.$$.fragment),is=o(),Rl=T("p"),Rl.innerHTML=Wt,ms=o(),M(K.$$.fragment),rs=o(),M(_l.$$.fragment),os=o(),D=T("blockquote"),D.innerHTML=jt,cs=o(),Cl=T("p"),Cl.textContent=$t,ys=o(),Ql=T("p"),Ql.textContent=Vt,Ms=o(),M(Xl.$$.fragment),ds=o(),q=T("div"),q.innerHTML=Gt,Js=o(),vl=T("p"),vl.innerHTML=Bt,us=o(),M(Yl.$$.fragment),fs=o(),M(Nl.$$.fragment),bs=o(),Fl=T("p"),Fl.innerHTML=It,Us=o(),M(Hl.$$.fragment),hs=o(),El=T("p"),El.textContent=Rt,gs=o(),M(zl.$$.fragment),Ts=o(),Sl=T("p"),Sl.innerHTML=_t,ks=o(),M(xl.$$.fragment),Zs=o(),L=T("div"),L.innerHTML=Ct,ws=o(),M(Kl.$$.fragment),Ws=o(),Dl=T("p"),Dl.textContent=Qt,js=o(),ql=T("ul"),ql.innerHTML=Xt,$s=o(),Ll=T("p"),Ll.innerHTML=vt,Vs=o(),M(Pl.$$.fragment),Gs=o(),Al=T("p"),Al.innerHTML=Yt,Bs=o(),M(Ol.$$.fragment),Is=o(),le=T("p"),le.textContent=Nt,Rs=o(),M(ee.$$.fragment),_s=o(),se=T("p"),se.innerHTML=Ft,Cs=o(),M(te.$$.fragment),Qs=o(),P=T("div"),P.innerHTML=Ht,Xs=o(),M(ne.$$.fragment),vs=o(),ae=T("p"),ae.textContent=Et,Ys=o(),pe=T("ol"),pe.innerHTML=zt,Ns=o(),M(ie.$$.fragment),Fs=o(),A=T("ol"),A.innerHTML=St,Hs=o(),M(me.$$.fragment),Es=o(),re=T("p"),re.innerHTML=xt,zs=o(),M(oe.$$.fragment),Ss=o(),O=T("ol"),O.innerHTML=Kt,xs=o(),M(ce.$$.fragment),Ks=o(),ll=T("ol"),ll.innerHTML=Dt,Ds=o(),M(ye.$$.fragment),qs=o(),M(Me.$$.fragment),Ls=o(),ue=T("p"),this.h()},l(l){const a=rn("svelte-u9bgzb",document.head);s=k(a,"META",{name:!0,content:!0}),a.forEach(p),m=c(l),e=k(l,"P",{}),Os(e).forEach(p),y=c(l),d(t.$$.fragment,l),n=c(l),d(r.$$.fragment,l),U=c(l),d(V.$$.fragment,l),W=c(l),g=k(l,"P",{"data-svelte-h":!0}),Z(g)!=="svelte-1bko70a"&&(g.textContent=B),fe=c(l),el=k(l,"P",{"data-svelte-h":!0}),Z(el)!=="svelte-18b8tlp"&&(el.innerHTML=et),be=c(l),sl=k(l,"P",{"data-svelte-h":!0}),Z(sl)!=="svelte-1wcte0b"&&(sl.innerHTML=st),Ue=c(l),tl=k(l,"P",{"data-svelte-h":!0}),Z(tl)!=="svelte-ckpv5f"&&(tl.innerHTML=tt),he=c(l),nl=k(l,"P",{"data-svelte-h":!0}),Z(nl)!=="svelte-1sy3nlp"&&(nl.textContent=nt),ge=c(l),al=k(l,"P",{"data-svelte-h":!0}),Z(al)!=="svelte-1dydg7a"&&(al.textContent=at),Te=c(l),d(pl.$$.fragment,l),ke=c(l),C=k(l,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),Z(C)!=="svelte-wlpsgx"&&(C.innerHTML=pt),Ze=c(l),d(il.$$.fragment,l),we=c(l),ml=k(l,"P",{"data-svelte-h":!0}),Z(ml)!=="svelte-1sefbph"&&(ml.innerHTML=it),We=c(l),d(Q.$$.fragment,l),je=c(l),rl=k(l,"P",{"data-svelte-h":!0}),Z(rl)!=="svelte-12j62dc"&&(rl.innerHTML=mt),$e=c(l),ol=k(l,"P",{"data-svelte-h":!0}),Z(ol)!=="svelte-pukajh"&&(ol.innerHTML=rt),Ve=c(l),d(X.$$.fragment,l),Ge=c(l),d(cl.$$.fragment,l),Be=c(l),yl=k(l,"P",{"data-svelte-h":!0}),Z(yl)!=="svelte-1aianu4"&&(yl.textContent=ot),Ie=c(l),d(v.$$.fragment,l),Re=c(l),Ml=k(l,"P",{"data-svelte-h":!0}),Z(Ml)!=="svelte-1eewmqm"&&(Ml.textContent=ct),_e=c(l),d(dl.$$.fragment,l),Ce=c(l),Y=k(l,"DIV",{class:!0,"data-svelte-h":!0}),Z(Y)!=="svelte-1w2zk95"&&(Y.innerHTML=yt),Qe=c(l),Jl=k(l,"P",{"data-svelte-h":!0}),Z(Jl)!=="svelte-1sj0kef"&&(Jl.innerHTML=Mt),Xe=c(l),d(ul.$$.fragment,l),ve=c(l),fl=k(l,"P",{"data-svelte-h":!0}),Z(fl)!=="svelte-1uxnltd"&&(fl.textContent=dt),Ye=c(l),d(N.$$.fragment,l),Ne=c(l),bl=k(l,"P",{"data-svelte-h":!0}),Z(bl)!=="svelte-hzxa8q"&&(bl.innerHTML=Jt),Fe=c(l),Ul=k(l,"P",{"data-svelte-h":!0}),Z(Ul)!=="svelte-12ry8vz"&&(Ul.innerHTML=ut),He=c(l),d(F.$$.fragment,l),Ee=c(l),d(hl.$$.fragment,l),ze=c(l),R=k(l,"BLOCKQUOTE",{class:!0});var de=Os(R);Je=k(de,"P",{"data-svelte-h":!0}),Z(Je)!=="svelte-19cj2ra"&&(Je.innerHTML=ft),As=c(de),d(gl.$$.fragment,de),de.forEach(p),Se=c(l),Tl=k(l,"P",{"data-svelte-h":!0}),Z(Tl)!=="svelte-qsp91m"&&(Tl.textContent=bt),xe=c(l),d(H.$$.fragment,l),Ke=c(l),kl=k(l,"P",{"data-svelte-h":!0}),Z(kl)!=="svelte-1nfserr"&&(kl.textContent=Ut),De=c(l),d(Zl.$$.fragment,l),qe=c(l),wl=k(l,"P",{"data-svelte-h":!0}),Z(wl)!=="svelte-339bbm"&&(wl.textContent=ht),Le=c(l),d(Wl.$$.fragment,l),Pe=c(l),jl=k(l,"P",{"data-svelte-h":!0}),Z(jl)!=="svelte-dajjv4"&&(jl.textContent=gt),Ae=c(l),d(E.$$.fragment,l),Oe=c(l),$l=k(l,"P",{"data-svelte-h":!0}),Z($l)!=="svelte-y29dku"&&($l.innerHTML=Tt),ls=c(l),d(z.$$.fragment,l),es=c(l),d(Vl.$$.fragment,l),ss=c(l),Gl=k(l,"P",{"data-svelte-h":!0}),Z(Gl)!=="svelte-p80btz"&&(Gl.textContent=kt),ts=c(l),d(S.$$.fragment,l),ns=c(l),x=k(l,"DIV",{class:!0,"data-svelte-h":!0}),Z(x)!=="svelte-1c7h32m"&&(x.innerHTML=Zt),as=c(l),Bl=k(l,"P",{"data-svelte-h":!0}),Z(Bl)!=="svelte-1ct3lji"&&(Bl.textContent=wt),ps=c(l),d(Il.$$.fragment,l),is=c(l),Rl=k(l,"P",{"data-svelte-h":!0}),Z(Rl)!=="svelte-1rcm9me"&&(Rl.innerHTML=Wt),ms=c(l),d(K.$$.fragment,l),rs=c(l),d(_l.$$.fragment,l),os=c(l),D=k(l,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),Z(D)!=="svelte-5x8iov"&&(D.innerHTML=jt),cs=c(l),Cl=k(l,"P",{"data-svelte-h":!0}),Z(Cl)!=="svelte-re8j87"&&(Cl.textContent=$t),ys=c(l),Ql=k(l,"P",{"data-svelte-h":!0}),Z(Ql)!=="svelte-bnaxe4"&&(Ql.textContent=Vt),Ms=c(l),d(Xl.$$.fragment,l),ds=c(l),q=k(l,"DIV",{class:!0,"data-svelte-h":!0}),Z(q)!=="svelte-11gtyyz"&&(q.innerHTML=Gt),Js=c(l),vl=k(l,"P",{"data-svelte-h":!0}),Z(vl)!=="svelte-1xmggyl"&&(vl.innerHTML=Bt),us=c(l),d(Yl.$$.fragment,l),fs=c(l),d(Nl.$$.fragment,l),bs=c(l),Fl=k(l,"P",{"data-svelte-h":!0}),Z(Fl)!=="svelte-1c5fsic"&&(Fl.innerHTML=It),Us=c(l),d(Hl.$$.fragment,l),hs=c(l),El=k(l,"P",{"data-svelte-h":!0}),Z(El)!=="svelte-1ta47o3"&&(El.textContent=Rt),gs=c(l),d(zl.$$.fragment,l),Ts=c(l),Sl=k(l,"P",{"data-svelte-h":!0}),Z(Sl)!=="svelte-abo9el"&&(Sl.innerHTML=_t),ks=c(l),d(xl.$$.fragment,l),Zs=c(l),L=k(l,"DIV",{class:!0,"data-svelte-h":!0}),Z(L)!=="svelte-1oo0se1"&&(L.innerHTML=Ct),ws=c(l),d(Kl.$$.fragment,l),Ws=c(l),Dl=k(l,"P",{"data-svelte-h":!0}),Z(Dl)!=="svelte-1qtubr7"&&(Dl.textContent=Qt),js=c(l),ql=k(l,"UL",{"data-svelte-h":!0}),Z(ql)!=="svelte-6td1jn"&&(ql.innerHTML=Xt),$s=c(l),Ll=k(l,"P",{"data-svelte-h":!0}),Z(Ll)!=="svelte-ya90bw"&&(Ll.innerHTML=vt),Vs=c(l),d(Pl.$$.fragment,l),Gs=c(l),Al=k(l,"P",{"data-svelte-h":!0}),Z(Al)!=="svelte-1mw2wdw"&&(Al.innerHTML=Yt),Bs=c(l),d(Ol.$$.fragment,l),Is=c(l),le=k(l,"P",{"data-svelte-h":!0}),Z(le)!=="svelte-7am2u1"&&(le.textContent=Nt),Rs=c(l),d(ee.$$.fragment,l),_s=c(l),se=k(l,"P",{"data-svelte-h":!0}),Z(se)!=="svelte-yn34s8"&&(se.innerHTML=Ft),Cs=c(l),d(te.$$.fragment,l),Qs=c(l),P=k(l,"DIV",{class:!0,"data-svelte-h":!0}),Z(P)!=="svelte-eey5ka"&&(P.innerHTML=Ht),Xs=c(l),d(ne.$$.fragment,l),vs=c(l),ae=k(l,"P",{"data-svelte-h":!0}),Z(ae)!=="svelte-1wfpj8q"&&(ae.textContent=Et),Ys=c(l),pe=k(l,"OL",{"data-svelte-h":!0}),Z(pe)!=="svelte-6zsdp2"&&(pe.innerHTML=zt),Ns=c(l),d(ie.$$.fragment,l),Fs=c(l),A=k(l,"OL",{start:!0,"data-svelte-h":!0}),Z(A)!=="svelte-1g7sf05"&&(A.innerHTML=St),Hs=c(l),d(me.$$.fragment,l),Es=c(l),re=k(l,"P",{"data-svelte-h":!0}),Z(re)!=="svelte-sptkvy"&&(re.innerHTML=xt),zs=c(l),d(oe.$$.fragment,l),Ss=c(l),O=k(l,"OL",{start:!0,"data-svelte-h":!0}),Z(O)!=="svelte-12qj1et"&&(O.innerHTML=Kt),xs=c(l),d(ce.$$.fragment,l),Ks=c(l),ll=k(l,"OL",{start:!0,"data-svelte-h":!0}),Z(ll)!=="svelte-1y5yjap"&&(ll.innerHTML=Dt),Ds=c(l),d(ye.$$.fragment,l),qs=c(l),d(Me.$$.fragment,l),Ls=c(l),ue=k(l,"P",{}),Os(ue).forEach(p),this.h()},h(){G(s,"name","hf:doc:metadata"),G(s,"content",Kn),G(C,"class","warning"),G(Y,"class","flex justify-center"),G(R,"class","warning"),G(x,"class","flex gap-4"),G(D,"class","warning"),G(q,"class","flex justify-center"),G(L,"class","flex justify-center"),G(P,"class","flex justify-center"),G(A,"start","2"),G(O,"start","3"),G(ll,"start","4")},m(l,a){lt(document.head,s),i(l,m,a),i(l,e,a),i(l,y,a),J(t,l,a),i(l,n,a),J(r,l,a),i(l,U,a),J(V,l,a),i(l,W,a),i(l,g,a),i(l,fe,a),i(l,el,a),i(l,be,a),i(l,sl,a),i(l,Ue,a),i(l,tl,a),i(l,he,a),i(l,nl,a),i(l,ge,a),i(l,al,a),i(l,Te,a),J(pl,l,a),i(l,ke,a),i(l,C,a),i(l,Ze,a),J(il,l,a),i(l,we,a),i(l,ml,a),i(l,We,a),J(Q,l,a),i(l,je,a),i(l,rl,a),i(l,$e,a),i(l,ol,a),i(l,Ve,a),J(X,l,a),i(l,Ge,a),J(cl,l,a),i(l,Be,a),i(l,yl,a),i(l,Ie,a),J(v,l,a),i(l,Re,a),i(l,Ml,a),i(l,_e,a),J(dl,l,a),i(l,Ce,a),i(l,Y,a),i(l,Qe,a),i(l,Jl,a),i(l,Xe,a),J(ul,l,a),i(l,ve,a),i(l,fl,a),i(l,Ye,a),J(N,l,a),i(l,Ne,a),i(l,bl,a),i(l,Fe,a),i(l,Ul,a),i(l,He,a),J(F,l,a),i(l,Ee,a),J(hl,l,a),i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,a),i(l,Ss,a),i(l,O,a),i(l,xs,a),J(ce,l,a),i(l,Ks,a),i(l,ll,a),i(l,Ds,a),J(ye,l,a),i(l,qs,a),J(Me,l,a),i(l,Ls,a),i(l,ue,a),Ps=!0},p(l,[a]){const de={};a&2&&(de.$$scope={dirty:a,ctx:l}),Q.$set(de);const qt={};a&2&&(qt.$$scope={dirty:a,ctx:l}),X.$set(qt);const Lt={};a&2&&(Lt.$$scope={dirty:a,ctx:l}),v.$set(Lt);const Pt={};a&2&&(Pt.$$scope={dirty:a,ctx:l}),N.$set(Pt);const At={};a&2&&(At.$$scope={dirty:a,ctx:l}),F.$set(At);const Ot={};a&2&&(Ot.$$scope={dirty:a,ctx:l}),H.$set(Ot);const ln={};a&2&&(ln.$$scope={dirty:a,ctx:l}),E.$set(ln);const en={};a&2&&(en.$$scope={dirty:a,ctx:l}),z.$set(en);const sn={};a&2&&(sn.$$scope={dirty:a,ctx:l}),S.$set(sn);const tn={};a&2&&(tn.$$scope={dirty:a,ctx:l}),K.$set(tn)},i(l){Ps||(u(t.$$.fragment,l),u(r.$$.fragment,l),u(V.$$.fragment,l),u(pl.$$.fragment,l),u(il.$$.fragment,l),u(Q.$$.fragment,l),u(X.$$.fragment,l),u(cl.$$.fragment,l),u(v.$$.fragment,l),u(dl.$$.fragment,l),u(ul.$$.fragment,l),u(N.$$.fragment,l),u(F.$$.fragment,l),u(hl.$$.fragment,l),u(gl.$$.fragment,l),u(H.$$.fragment,l),u(Zl.$$.fragment,l),u(Wl.$$.fragment,l),u(E.$$.fragment,l),u(z.$$.fragment,l),u(Vl.$$.fragment,l),u(S.$$.fragment,l),u(Il.$$.fragment,l),u(K.$$.fragment,l),u(_l.$$.fragment,l),u(Xl.$$.fragment,l),u(Yl.$$.fragment,l),u(Nl.$$.fragment,l),u(Hl.$$.fragment,l),u(zl.$$.fragment,l),u(xl.$$.fragment,l),u(Kl.$$.fragment,l),u(Pl.$$.fragment,l),u(Ol.$$.fragment,l),u(ee.$$.fragment,l),u(te.$$.fragment,l),u(ne.$$.fragment,l),u(ie.$$.fragment,l),u(me.$$.fragment,l),u(oe.$$.fragment,l),u(ce.$$.fragment,l),u(ye.$$.fragment,l),u(Me.$$.fragment,l),Ps=!0)},o(l){f(t.$$.fragment,l),f(r.$$.fragment,l),f(V.$$.fragment,l),f(pl.$$.fragment,l),f(il.$$.fragment,l),f(Q.$$.fragment,l),f(X.$$.fragment,l),f(cl.$$.fragment,l),f(v.$$.fragment,l),f(dl.$$.fragment,l),f(ul.$$.fragment,l),f(N.$$.fragment,l),f(F.$$.fragment,l),f(hl.$$.fragment,l),f(gl.$$.fragment,l),f(H.$$.fragment,l),f(Zl.$$.fragment,l),f(Wl.$$.fragment,l),f(E.$$.fragment,l),f(z.$$.fragment,l),f(Vl.$$.fragment,l),f(S.$$.fragment,l),f(Il.$$.fragment,l),f(K.$$.fragment,l),f(_l.$$.fragment,l),f(Xl.$$.fragment,l),f(Yl.$$.fragment,l),f(Nl.$$.fragment,l),f(Hl.$$.fragment,l),f(zl.$$.fragment,l),f(xl.$$.fragment,l),f(Kl.$$.fragment,l),f(Pl.$$.fragment,l),f(Ol.$$.fragment,l),f(ee.$$.fragment,l),f(te.$$.fragment,l),f(ne.$$.fragment,l),f(ie.$$.fragment,l),f(me.$$.fragment,l),f(oe.$$.fragment,l),f(ce.$$.fragment,l),f(ye.$$.fragment,l),f(Me.$$.fragment,l),Ps=!1},d(l){l&&(p(m),p(e),p(y),p(n),p(U),p(W),p(g),p(fe),p(el),p(be),p(sl),p(Ue),p(tl),p(he),p(nl),p(ge),p(al),p(Te),p(ke),p(C),p(Ze),p(we),p(ml),p(We),p(je),p(rl),p($e),p(ol),p(Ve),p(Ge),p(Be),p(yl),p(Ie),p(Re),p(Ml),p(_e),p(Ce),p(Y),p(Qe),p(Jl),p(Xe),p(ve),p(fl),p(Ye),p(Ne),p(bl),p(Fe),p(Ul),p(He),p(Ee),p(ze),p(R),p(Se),p(Tl),p(xe),p(Ke),p(kl),p(De),p(qe),p(wl),p(Le),p(Pe),p(jl),p(Ae),p(Oe),p($l),p(ls),p(es),p(ss),p(Gl),p(ts),p(ns),p(x),p(as),p(Bl),p(ps),p(is),p(Rl),p(ms),p(rs),p(os),p(D),p(cs),p(Cl),p(ys),p(Ql),p(Ms),p(ds),p(q),p(Js),p(vl),p(us),p(fs),p(bs),p(Fl),p(Us),p(hs),p(El),p(gs),p(Ts),p(Sl),p(ks),p(Zs),p(L),p(ws),p(Ws),p(Dl),p(js),p(ql),p($s),p(Ll),p(Vs),p(Gs),p(Al),p(Bs),p(Is),p(le),p(Rs),p(_s),p(se),p(Cs),p(Qs),p(P),p(Xs),p(vs),p(ae),p(Ys),p(pe),p(Ns),p(Fs),p(A),p(Hs),p(Es),p(re),p(zs),p(Ss),p(O),p(xs),p(Ks),p(ll),p(Ds),p(qs),p(Ls),p(ue)),p(s),b(t,l),b(r,l),b(V,l),b(pl,l),b(il,l),b(Q,l),b(X,l),b(cl,l),b(v,l),b(dl,l),b(ul,l),b(N,l),b(F,l),b(hl,l),b(gl),b(H,l),b(Zl,l),b(Wl,l),b(E,l),b(z,l),b(Vl,l),b(S,l),b(Il,l),b(K,l),b(_l,l),b(Xl,l),b(Yl,l),b(Nl,l),b(Hl,l),b(zl,l),b(xl,l),b(Kl,l),b(Pl,l),b(Ol,l),b(ee,l),b(te,l),b(ne,l),b(ie,l),b(me,l),b(oe,l),b(ce,l),b(ye,l),b(Me,l)}}}const Kn='{"title":"Kandinsky","local":"kandinsky","sections":[{"title":"Text-to-image","local":"text-to-image","sections":[],"depth":2},{"title":"Image-to-image","local":"image-to-image","sections":[],"depth":2},{"title":"Inpainting","local":"inpainting","sections":[],"depth":2},{"title":"Interpolation (보간)","local":"interpolation-보간","sections":[],"depth":2},{"title":"ControlNet","local":"controlnet","sections":[{"title":"Text-to-image","local":"controlnet-text-to-image","sections":[],"depth":3},{"title":"Image-to-image","local":"controlnet-image-to-image","sections":[],"depth":3}],"depth":2},{"title":"최적화","local":"최적화","sections":[],"depth":2}],"depth":1}';function Dn(h){return an(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ea extends pn{constructor(s){super(),mn(this,s,Dn,xn,nn,{})}}export{ea as component};
