import{S as Kk,i as e$,s as t$,e as o,k as c,w as g,t as i,M as n$,c as a,d as t,m as d,a as l,x as _,h as r,b as s,N as J,f as W,G as e,g as m,y as b,q as v,o as y,B as w,v as o$,L as _e}from"../../../chunks/vendor-hf-doc-builder.js";import{T as x_}from"../../../chunks/Tip-hf-doc-builder.js";import{D as C}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as S}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as P}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ge}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function a$(N){let u,I,M,h,U;return h=new S({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjBvcGVuY3YtcHl0aG9uJTIwdHJhbnNmb3JtZXJzJTIwYWNjZWxlcmF0ZSUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBTdGFibGVEaWZmdXNpb25Db250cm9sTmV0UGlwZWxpbmUlMkMlMjBDb250cm9sTmV0TW9kZWwlMkMlMjBVbmlQQ011bHRpc3RlcFNjaGVkdWxlciUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBaW1wb3J0JTIwdG9yY2glMEElMEFpbXBvcnQlMjBjdjIlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEElMjMlMjBkb3dubG9hZCUyMGFuJTIwaW1hZ2UlMEFpbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZoZi5jbyUyRmRhdGFzZXRzJTJGaHVnZ2luZ2ZhY2UlMkZkb2N1bWVudGF0aW9uLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGZGlmZnVzZXJzJTJGaW5wdXRfaW1hZ2VfdmVybWVlci5wbmclMjIlMEEpJTBBaW1hZ2UlM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VbmlQQ011bHRpc3RlcFNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlLnNjaGVkdWxlci5jb25maWcpJTBBJTIzJTIwcmVtb3ZlJTIwZm9sbG93aW5nJTIwbGluZSUyMGlmJTIweGZvcm1lcnMlMjBpcyUyMG5vdCUyMGluc3RhbGxlZCUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKCklMEElMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBJTIzJTIwZ2VuZXJhdGUlMjBpbWFnZSUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLm1hbnVhbF9zZWVkKDApJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMCUyMmZ1dHVyaXN0aWMtbG9va2luZyUyMHdvbWFuJTIyJTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTIwaW1hZ2UlM0RjYW5ueV9pbWFnZSUwQSkuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># !pip install opencv-python transformers accelerate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> cv2
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># download an image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://hf.co/datasets/huggingface/documentation-images/resolve/main/diffusers/input_image_vermeer.png&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = np.array(image)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># get canny image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = cv2.Canny(image, <span class="hljs-number">100</span>, <span class="hljs-number">200</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = image[:, :, <span class="hljs-literal">None</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>image = np.concatenate([image, image, image], axis=<span class="hljs-number">2</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>canny_image = Image.fromarray(image)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># load control net and stable diffusion v1-5</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>controlnet = ControlNetModel.from_pretrained(<span class="hljs-string">&quot;lllyasviel/sd-controlnet-canny&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionControlNetPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, controlnet=controlnet, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># speed up diffusion process with faster scheduler and memory optimization</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># remove following line if xformers is not installed</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_xformers_memory_efficient_attention()

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># generate image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generator = torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;futuristic-looking woman&quot;</span>, num_inference_steps=<span class="hljs-number">20</span>, generator=generator, image=canny_image
<span class="hljs-meta">... </span>).images[<span class="hljs-number">0</span>]`}}),{c(){u=o("p"),I=i("Examples:"),M=c(),g(h.$$.fragment)},l(p){u=a(p,"P",{});var T=l(u);I=r(T,"Examples:"),T.forEach(t),M=d(p),_(h.$$.fragment,p)},m(p,T){m(p,u,T),e(u,I),m(p,M,T),b(h,p,T),U=!0},p:_e,i(p){U||(v(h.$$.fragment,p),U=!0)},o(p){y(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(M),w(h,p)}}}function l$(N){let u,I;return{c(){u=o("p"),I=i(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(M){u=a(M,"P",{});var h=l(u);I=r(h,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),h.forEach(t)},m(M,h){m(M,u,h),e(u,I)},d(M){M&&t(u)}}}function s$(N){let u,I,M,h,U;return h=new S({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIweGZvcm1lcnMub3BzJTIwaW1wb3J0JTIwTWVtb3J5RWZmaWNpZW50QXR0ZW50aW9uRmxhc2hBdHRlbnRpb25PcCUwQSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKGF0dGVudGlvbl9vcCUzRE1lbW9yeUVmZmljaWVudEF0dGVudGlvbkZsYXNoQXR0ZW50aW9uT3ApJTBBJTIzJTIwV29ya2Fyb3VuZCUyMGZvciUyMG5vdCUyMGFjY2VwdGluZyUyMGF0dGVudGlvbiUyMHNoYXBlJTIwdXNpbmclMjBWQUUlMjBmb3IlMjBGbGFzaCUyMEF0dGVudGlvbiUwQXBpcGUudmFlLmVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbihhdHRlbnRpb25fb3AlM0ROb25lKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Workaround for not accepting attention shape using VAE for Flash Attention</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_xformers_memory_efficient_attention(attention_op=<span class="hljs-literal">None</span>)`}}),{c(){u=o("p"),I=i("Examples:"),M=c(),g(h.$$.fragment)},l(p){u=a(p,"P",{});var T=l(u);I=r(T,"Examples:"),T.forEach(t),M=d(p),_(h.$$.fragment,p)},m(p,T){m(p,u,T),e(u,I),m(p,M,T),b(h,p,T),U=!0},p:_e,i(p){U||(v(h.$$.fragment,p),U=!0)},o(p){y(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(M),w(h,p)}}}function i$(N){let u,I,M,h,U;return h=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlLmxvYWRfdGV4dHVhbF9pbnZlcnNpb24oJTIyc2QtY29uY2VwdHMtbGlicmFyeSUyRmNhdC10b3klMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMCUzQ2NhdC10b3klM0UlMjBiYWNrcGFjayUyMiUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNhdC1iYWNrcGFjay5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipe.load_textual_inversion(<span class="hljs-string">&quot;sd-concepts-library/cat-toy&quot;</span>)

prompt = <span class="hljs-string">&quot;A &lt;cat-toy&gt; backpack&quot;</span>

image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;cat-backpack.png&quot;</span>)`}}),{c(){u=o("p"),I=i("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),M=c(),g(h.$$.fragment)},l(p){u=a(p,"P",{});var T=l(u);I=r(T,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),T.forEach(t),M=d(p),_(h.$$.fragment,p)},m(p,T){m(p,u,T),e(u,I),m(p,M,T),b(h,p,T),U=!0},p:_e,i(p){U||(v(h.$$.fragment,p),U=!0)},o(p){y(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(M),w(h,p)}}}function r$(N){let u,I,M,h,U;return h=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlLmxvYWRfdGV4dHVhbF9pbnZlcnNpb24oJTIyLiUyRmNoYXJ0dXJuZXJ2Mi5wdCUyMiUyQyUyMHRva2VuJTNEJTIyY2hhcnR1cm5lcnYyJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMmNoYXJ0dXJuZXJ2MiUyQyUyMG11bHRpcGxlJTIwdmlld3MlMjBvZiUyMHRoZSUyMHNhbWUlMjBjaGFyYWN0ZXIlMjBpbiUyMHRoZSUyMHNhbWUlMjBvdXRmaXQlMkMlMjBhJTIwY2hhcmFjdGVyJTIwdHVybmFyb3VuZCUyMG9mJTIwYSUyMHdvbWFuJTIwd2VhcmluZyUyMGElMjBibGFjayUyMGphY2tldCUyMGFuZCUyMHJlZCUyMHNoaXJ0JTJDJTIwYmVzdCUyMHF1YWxpdHklMkMlMjBpbnRyaWNhdGUlMjBkZXRhaWxzLiUyMiUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNoYXJhY3Rlci5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipe.load_textual_inversion(<span class="hljs-string">&quot;./charturnerv2.pt&quot;</span>, token=<span class="hljs-string">&quot;charturnerv2&quot;</span>)

prompt = <span class="hljs-string">&quot;charturnerv2, multiple views of the same character in the same outfit, a character turnaround of a woman wearing a black jacket and red shirt, best quality, intricate details.&quot;</span>

image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;character.png&quot;</span>)`}}),{c(){u=o("p"),I=i("locally:"),M=c(),g(h.$$.fragment)},l(p){u=a(p,"P",{});var T=l(u);I=r(T,"locally:"),T.forEach(t),M=d(p),_(h.$$.fragment,p)},m(p,T){m(p,u,T),e(u,I),m(p,M,T),b(h,p,T),U=!0},p:_e,i(p){U||(v(h.$$.fragment,p),U=!0)},o(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DApJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMCUyMmZ1dHVyaXN0aWMtbG9va2luZyUyMHdvbWFuJTIyJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0RpbWFnZSUyQyUwQSUyMCUyMCUyMCUyMGNvbnRyb2xfaW1hZ2UlM0RjYW5ueV9pbWFnZSUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># !pip install opencv-python transformers accelerate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetImg2ImgPipeline, ControlNetModel, UniPCMultistepScheduler
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> cv2
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># download an image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://hf.co/datasets/huggingface/documentation-images/resolve/main/diffusers/input_image_vermeer.png&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>np_image = np.array(image)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># get canny image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>np_image = cv2.Canny(np_image, <span class="hljs-number">100</span>, <span class="hljs-number">200</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>np_image = np_image[:, :, <span class="hljs-literal">None</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>np_image = np.concatenate([np_image, np_image, np_image], axis=<span class="hljs-number">2</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>canny_image = Image.fromarray(np_image)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># load control net and stable diffusion v1-5</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>controlnet = ControlNetModel.from_pretrained(<span class="hljs-string">&quot;lllyasviel/sd-controlnet-canny&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionControlNetImg2ImgPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, controlnet=controlnet, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># speed up diffusion process with faster scheduler and memory optimization</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># generate image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generator = torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;futuristic-looking woman&quot;</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">20</span>,
<span class="hljs-meta">... </span>    generator=generator,
<span class="hljs-meta">... </span>    image=image,
<span class="hljs-meta">... </span>    control_image=canny_image,
<span class="hljs-meta">... </span>).images[<span class="hljs-number">0</span>]`}}),{c(){u=o("p"),I=i("Examples:"),M=c(),g(h.$$.fragment)},l(p){u=a(p,"P",{});var T=l(u);I=r(T,"Examples:"),T.forEach(t),M=d(p),_(h.$$.fragment,p)},m(p,T){m(p,u,T),e(u,I),m(p,M,T),b(h,p,T),U=!0},p:_e,i(p){U||(v(h.$$.fragment,p),U=!0)},o(p){y(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(M),w(h,p)}}}function d$(N){let u,I;return{c(){u=o("p"),I=i(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(M){u=a(M,"P",{});var h=l(u);I=r(h,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),h.forEach(t)},m(M,h){m(M,u,h),e(u,I)},d(M){M&&t(u)}}}function p$(N){let u,I,M,h,U;return h=new S({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIweGZvcm1lcnMub3BzJTIwaW1wb3J0JTIwTWVtb3J5RWZmaWNpZW50QXR0ZW50aW9uRmxhc2hBdHRlbnRpb25PcCUwQSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKGF0dGVudGlvbl9vcCUzRE1lbW9yeUVmZmljaWVudEF0dGVudGlvbkZsYXNoQXR0ZW50aW9uT3ApJTBBJTIzJTIwV29ya2Fyb3VuZCUyMGZvciUyMG5vdCUyMGFjY2VwdGluZyUyMGF0dGVudGlvbiUyMHNoYXBlJTIwdXNpbmclMjBWQUUlMjBmb3IlMjBGbGFzaCUyMEF0dGVudGlvbiUwQXBpcGUudmFlLmVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbihhdHRlbnRpb25fb3AlM0ROb25lKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Workaround for not accepting attention shape using VAE for Flash Attention</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_xformers_memory_efficient_attention(attention_op=<span class="hljs-literal">None</span>)`}}),{c(){u=o("p"),I=i("Examples:"),M=c(),g(h.$$.fragment)},l(p){u=a(p,"P",{});var T=l(u);I=r(T,"Examples:"),T.forEach(t),M=d(p),_(h.$$.fragment,p)},m(p,T){m(p,u,T),e(u,I),m(p,M,T),b(h,p,T),U=!0},p:_e,i(p){U||(v(h.$$.fragment,p),U=!0)},o(p){y(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(M),w(h,p)}}}function f$(N){let u,I,M,h,U;return h=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlLmxvYWRfdGV4dHVhbF9pbnZlcnNpb24oJTIyc2QtY29uY2VwdHMtbGlicmFyeSUyRmNhdC10b3klMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMCUzQ2NhdC10b3klM0UlMjBiYWNrcGFjayUyMiUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNhdC1iYWNrcGFjay5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipe.load_textual_inversion(<span class="hljs-string">&quot;sd-concepts-library/cat-toy&quot;</span>)

prompt = <span class="hljs-string">&quot;A &lt;cat-toy&gt; backpack&quot;</span>

image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;cat-backpack.png&quot;</span>)`}}),{c(){u=o("p"),I=i("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),M=c(),g(h.$$.fragment)},l(p){u=a(p,"P",{});var T=l(u);I=r(T,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),T.forEach(t),M=d(p),_(h.$$.fragment,p)},m(p,T){m(p,u,T),e(u,I),m(p,M,T),b(h,p,T),U=!0},p:_e,i(p){U||(v(h.$$.fragment,p),U=!0)},o(p){y(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(M),w(h,p)}}}function m$(N){let u,I,M,h,U;return h=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlLmxvYWRfdGV4dHVhbF9pbnZlcnNpb24oJTIyLiUyRmNoYXJ0dXJuZXJ2Mi5wdCUyMiUyQyUyMHRva2VuJTNEJTIyY2hhcnR1cm5lcnYyJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMmNoYXJ0dXJuZXJ2MiUyQyUyMG11bHRpcGxlJTIwdmlld3MlMjBvZiUyMHRoZSUyMHNhbWUlMjBjaGFyYWN0ZXIlMjBpbiUyMHRoZSUyMHNhbWUlMjBvdXRmaXQlMkMlMjBhJTIwY2hhcmFjdGVyJTIwdHVybmFyb3VuZCUyMG9mJTIwYSUyMHdvbWFuJTIwd2VhcmluZyUyMGElMjBibGFjayUyMGphY2tldCUyMGFuZCUyMHJlZCUyMHNoaXJ0JTJDJTIwYmVzdCUyMHF1YWxpdHklMkMlMjBpbnRyaWNhdGUlMjBkZXRhaWxzLiUyMiUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNoYXJhY3Rlci5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipe.load_textual_inversion(<span class="hljs-string">&quot;./charturnerv2.pt&quot;</span>, token=<span class="hljs-string">&quot;charturnerv2&quot;</span>)

prompt = <span class="hljs-string">&quot;charturnerv2, multiple views of the same character in the same outfit, a character turnaround of a woman wearing a black jacket and red shirt, best quality, intricate details.&quot;</span>

image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;character.png&quot;</span>)`}}),{c(){u=o("p"),I=i("locally:"),M=c(),g(h.$$.fragment)},l(p){u=a(p,"P",{});var T=l(u);I=r(T,"locally:"),T.forEach(t),M=d(p),_(h.$$.fragment,p)},m(p,T){m(p,u,T),e(u,I),m(p,M,T),b(h,p,T),U=!0},p:_e,i(p){U||(v(h.$$.fragment,p),U=!0)},o(p){y(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(M),w(h,p)}}}function u$(N){let u,I,M,h,U,p,T,_t,Me,Xt,H;return{c(){u=o("p"),I=i(`This pipeline can be used both with checkpoints that have been specifically fine-tuned for inpainting, such as
`),M=o("a"),h=i("runwayml/stable-diffusion-inpainting"),U=i(`
as well as default text-to-image stable diffusion checkpoints, such as
`),p=o("a"),T=i("runwayml/stable-diffusion-v1-5"),_t=i(`.
Default text-to-image stable diffusion checkpoints might be preferable for controlnets that have been fine-tuned on
those, such as `),Me=o("a"),Xt=i("lllyasviel/control_v11p_sd15_inpaint"),H=i("."),this.h()},l(Y){u=a(Y,"P",{});var F=l(u);I=r(F,`This pipeline can be used both with checkpoints that have been specifically fine-tuned for inpainting, such as
`),M=a(F,"A",{href:!0,rel:!0});var xe=l(M);h=r(xe,"runwayml/stable-diffusion-inpainting"),xe.forEach(t),U=r(F,`
as well as default text-to-image stable diffusion checkpoints, such as
`),p=a(F,"A",{href:!0,rel:!0});var Ds=l(p);T=r(Ds,"runwayml/stable-diffusion-v1-5"),Ds.forEach(t),_t=r(F,`.
Default text-to-image stable diffusion checkpoints might be preferable for controlnets that have been fine-tuned on
those, such as `),Me=a(F,"A",{href:!0,rel:!0});var Yt=l(Me);Xt=r(Yt,"lllyasviel/control_v11p_sd15_inpaint"),Yt.forEach(t),H=r(F,"."),F.forEach(t),this.h()},h(){s(M,"href","https://huggingface.co/runwayml/stable-diffusion-inpainting"),s(M,"rel","nofollow"),s(p,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5"),s(p,"rel","nofollow"),s(Me,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint"),s(Me,"rel","nofollow")},m(Y,F){m(Y,u,F),e(u,I),e(u,M),e(M,h),e(u,U),e(u,p),e(p,T),e(u,_t),e(u,Me),e(Me,Xt),e(u,H)},d(Y){Y&&t(u)}}}function h$(N){let u,I,M,h,U;return h=new S({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjB0cmFuc2Zvcm1lcnMlMjBhY2NlbGVyYXRlJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRJbnBhaW50UGlwZWxpbmUlMkMlMjBDb250cm9sTmV0TW9kZWwlMkMlMjBERElNU2NoZWR1bGVyJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEFpbXBvcnQlMjB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haW5lZCglMEElMjAlMjAlMjAlMjAlMjJydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUyQyUyMGNvbnRyb2xuZXQlM0Rjb250cm9sbmV0JTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQSUwQXBpcGUuc2NoZWR1bGVyJTIwJTNEJTIwRERJTVNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlLnNjaGVkdWxlci5jb25maWcpJTBBcGlwZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQSUwQSUyMyUyMGdlbmVyYXRlJTIwaW1hZ2UlMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwJTIyYSUyMGhhbmRzb21lJTIwbWFuJTIwd2l0aCUyMHJheS1iYW4lMjBzdW5nbGFzc2VzJTIyJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTBBJTIwJTIwJTIwJTIwZXRhJTNEMS4wJTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0Rpbml0X2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwbWFza19pbWFnZSUzRG1hc2tfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBjb250cm9sX2ltYWdlJTNEY29udHJvbF9pbWFnZSUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># !pip install transformers accelerate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetInpaintPipeline, ControlNetModel, DDIMScheduler
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>init_image = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/diffusers/test-arrays/resolve/main/stable_diffusion_inpaint/boy.png&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>init_image = init_image.resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>))

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

<span class="hljs-meta">&gt;&gt;&gt; </span>mask_image = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/diffusers/test-arrays/resolve/main/stable_diffusion_inpaint/boy_mask.png&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>mask_image = mask_image.resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>))


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">make_inpaint_condition</span>(<span class="hljs-params">image, image_mask</span>):
<span class="hljs-meta">... </span>    image = np.array(image.convert(<span class="hljs-string">&quot;RGB&quot;</span>)).astype(np.float32) / <span class="hljs-number">255.0</span>
<span class="hljs-meta">... </span>    image_mask = np.array(image_mask.convert(<span class="hljs-string">&quot;L&quot;</span>)).astype(np.float32) / <span class="hljs-number">255.0</span>

<span class="hljs-meta">... </span>    <span class="hljs-keyword">assert</span> image.shape[<span class="hljs-number">0</span>:<span class="hljs-number">1</span>] == image_mask.shape[<span class="hljs-number">0</span>:<span class="hljs-number">1</span>], <span class="hljs-string">&quot;image and image_mask must have the same image size&quot;</span>
<span class="hljs-meta">... </span>    image[image_mask &gt; <span class="hljs-number">0.5</span>] = -<span class="hljs-number">1.0</span>  <span class="hljs-comment"># set as masked pixel</span>
<span class="hljs-meta">... </span>    image = np.expand_dims(image, <span class="hljs-number">0</span>).transpose(<span class="hljs-number">0</span>, <span class="hljs-number">3</span>, <span class="hljs-number">1</span>, <span class="hljs-number">2</span>)
<span class="hljs-meta">... </span>    image = torch.from_numpy(image)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> image


<span class="hljs-meta">&gt;&gt;&gt; </span>control_image = make_inpaint_condition(init_image, mask_image)

<span class="hljs-meta">&gt;&gt;&gt; </span>controlnet = ControlNetModel.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;lllyasviel/control_v11p_sd15_inpaint&quot;</span>, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionControlNetInpaintPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, controlnet=controlnet, torch_dtype=torch.float16
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.scheduler = DDIMScheduler.from_config(pipe.scheduler.config)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_model_cpu_offload()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># generate image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;a handsome man with ray-ban sunglasses&quot;</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">20</span>,
<span class="hljs-meta">... </span>    generator=generator,
<span class="hljs-meta">... </span>    eta=<span class="hljs-number">1.0</span>,
<span class="hljs-meta">... </span>    image=init_image,
<span class="hljs-meta">... </span>    mask_image=mask_image,
<span class="hljs-meta">... </span>    control_image=control_image,
<span class="hljs-meta">... </span>).images[<span class="hljs-number">0</span>]`}}),{c(){u=o("p"),I=i("Examples:"),M=c(),g(h.$$.fragment)},l(p){u=a(p,"P",{});var T=l(u);I=r(T,"Examples:"),T.forEach(t),M=d(p),_(h.$$.fragment,p)},m(p,T){m(p,u,T),e(u,I),m(p,M,T),b(h,p,T),U=!0},p:_e,i(p){U||(v(h.$$.fragment,p),U=!0)},o(p){y(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(M),w(h,p)}}}function g$(N){let u,I;return{c(){u=o("p"),I=i(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(M){u=a(M,"P",{});var h=l(u);I=r(h,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),h.forEach(t)},m(M,h){m(M,u,h),e(u,I)},d(M){M&&t(u)}}}function _$(N){let u,I,M,h,U;return h=new S({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIweGZvcm1lcnMub3BzJTIwaW1wb3J0JTIwTWVtb3J5RWZmaWNpZW50QXR0ZW50aW9uRmxhc2hBdHRlbnRpb25PcCUwQSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKGF0dGVudGlvbl9vcCUzRE1lbW9yeUVmZmljaWVudEF0dGVudGlvbkZsYXNoQXR0ZW50aW9uT3ApJTBBJTIzJTIwV29ya2Fyb3VuZCUyMGZvciUyMG5vdCUyMGFjY2VwdGluZyUyMGF0dGVudGlvbiUyMHNoYXBlJTIwdXNpbmclMjBWQUUlMjBmb3IlMjBGbGFzaCUyMEF0dGVudGlvbiUwQXBpcGUudmFlLmVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbihhdHRlbnRpb25fb3AlM0ROb25lKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Workaround for not accepting attention shape using VAE for Flash Attention</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_xformers_memory_efficient_attention(attention_op=<span class="hljs-literal">None</span>)`}}),{c(){u=o("p"),I=i("Examples:"),M=c(),g(h.$$.fragment)},l(p){u=a(p,"P",{});var T=l(u);I=r(T,"Examples:"),T.forEach(t),M=d(p),_(h.$$.fragment,p)},m(p,T){m(p,u,T),e(u,I),m(p,M,T),b(h,p,T),U=!0},p:_e,i(p){U||(v(h.$$.fragment,p),U=!0)},o(p){y(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(M),w(h,p)}}}function b$(N){let u,I,M,h,U;return h=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlLmxvYWRfdGV4dHVhbF9pbnZlcnNpb24oJTIyc2QtY29uY2VwdHMtbGlicmFyeSUyRmNhdC10b3klMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMCUzQ2NhdC10b3klM0UlMjBiYWNrcGFjayUyMiUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNhdC1iYWNrcGFjay5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipe.load_textual_inversion(<span class="hljs-string">&quot;sd-concepts-library/cat-toy&quot;</span>)

prompt = <span class="hljs-string">&quot;A &lt;cat-toy&gt; backpack&quot;</span>

image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;cat-backpack.png&quot;</span>)`}}),{c(){u=o("p"),I=i("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),M=c(),g(h.$$.fragment)},l(p){u=a(p,"P",{});var T=l(u);I=r(T,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),T.forEach(t),M=d(p),_(h.$$.fragment,p)},m(p,T){m(p,u,T),e(u,I),m(p,M,T),b(h,p,T),U=!0},p:_e,i(p){U||(v(h.$$.fragment,p),U=!0)},o(p){y(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(M),w(h,p)}}}function v$(N){let u,I,M,h,U;return h=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNikudG8oJTIyY3VkYSUyMiklMEElMEFwaXBlLmxvYWRfdGV4dHVhbF9pbnZlcnNpb24oJTIyLiUyRmNoYXJ0dXJuZXJ2Mi5wdCUyMiUyQyUyMHRva2VuJTNEJTIyY2hhcnR1cm5lcnYyJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMmNoYXJ0dXJuZXJ2MiUyQyUyMG11bHRpcGxlJTIwdmlld3MlMjBvZiUyMHRoZSUyMHNhbWUlMjBjaGFyYWN0ZXIlMjBpbiUyMHRoZSUyMHNhbWUlMjBvdXRmaXQlMkMlMjBhJTIwY2hhcmFjdGVyJTIwdHVybmFyb3VuZCUyMG9mJTIwYSUyMHdvbWFuJTIwd2VhcmluZyUyMGElMjBibGFjayUyMGphY2tldCUyMGFuZCUyMHJlZCUyMHNoaXJ0JTJDJTIwYmVzdCUyMHF1YWxpdHklMkMlMjBpbnRyaWNhdGUlMjBkZXRhaWxzLiUyMiUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmNoYXJhY3Rlci5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipe.load_textual_inversion(<span class="hljs-string">&quot;./charturnerv2.pt&quot;</span>, token=<span class="hljs-string">&quot;charturnerv2&quot;</span>)

prompt = <span class="hljs-string">&quot;charturnerv2, multiple views of the same character in the same outfit, a character turnaround of a woman wearing a black jacket and red shirt, best quality, intricate details.&quot;</span>

image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;character.png&quot;</span>)`}}),{c(){u=o("p"),I=i("locally:"),M=c(),g(h.$$.fragment)},l(p){u=a(p,"P",{});var T=l(u);I=r(T,"locally:"),T.forEach(t),M=d(p),_(h.$$.fragment,p)},m(p,T){m(p,u,T),e(u,I),m(p,M,T),b(h,p,T),U=!0},p:_e,i(p){U||(v(h.$$.fragment,p),U=!0)},o(p){y(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(M),w(h,p)}}}function y$(N){let u,I,M,h,U;return h=new S({props:{code:"aW1wb3J0JTIwamF4JTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBaW1wb3J0JTIwamF4Lm51bXB5JTIwYXMlMjBqbnAlMEFmcm9tJTIwZmxheC5qYXhfdXRpbHMlMjBpbXBvcnQlMjByZXBsaWNhdGUlMEFmcm9tJTIwZmxheC50cmFpbmluZy5jb21tb25fdXRpbHMlMjBpbXBvcnQlMjBzaGFyZCUwQWZyb20lMjBkaWZmdXNl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aWRzJTNEbmVnYXRpdmVfcHJvbXB0X2lkcyUyQyUwQSUyMCUyMCUyMCUyMGppdCUzRFRydWUlMkMlMEEpLmltYWdlcyUwQSUwQW91dHB1dF9pbWFnZXMlMjAlM0QlMjBwaXBlLm51bXB5X3RvX3BpbChucC5hc2FycmF5KG91dHB1dC5yZXNoYXBlKChudW1fc2FtcGxlcyUyQyklMjAlMkIlMjBvdXRwdXQuc2hhcGUlNUItMyUzQSU1RCkpKSUwQW91dHB1dF9pbWFnZXMlMjAlM0QlMjBpbWFnZV9ncmlkKG91dHB1dF9pbWFnZXMlMkMlMjBudW1fc2FtcGxlcyUyMCUyRiUyRiUyMDQlMkMlMjA0KSUwQW91dHB1dF9pbWFnZXMuc2F2ZSglMjJnZW5lcmF0ZWRfaW1hZ2UucG5nJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax.jax_utils <span class="hljs-keyword">import</span> replicate
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax.training.common_utils <span class="hljs-keyword">import</span> shard
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlaxStableDiffusionControlNetPipeline, FlaxControlNetModel


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">image_grid</span>(<span class="hljs-params">imgs, rows, cols</span>):
<span class="hljs-meta">... </span>    w, h = imgs[<span class="hljs-number">0</span>].size
<span class="hljs-meta">... </span>    grid = Image.new(<span class="hljs-string">&quot;RGB&quot;</span>, size=(cols * w, rows * h))
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> i, img <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(imgs):
<span class="hljs-meta">... </span>        grid.paste(img, box=(i % cols * w, i // cols * h))
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> grid


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">create_key</span>(<span class="hljs-params">seed=<span class="hljs-number">0</span></span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> jax.random.PRNGKey(seed)


<span class="hljs-meta">&gt;&gt;&gt; </span>rng = create_key(<span class="hljs-number">0</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># get canny image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>canny_image = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/YiYiXu/test-doc-assets/resolve/main/blog_post_cell_10_output_0.jpeg&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompts = <span class="hljs-string">&quot;best quality, extremely detailed&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>negative_prompts = <span class="hljs-string">&quot;monochrome, lowres, bad anatomy, worst quality, low quality&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># load control net and stable diffusion v1-5</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>controlnet, controlnet_params = FlaxControlNetModel.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;lllyasviel/sd-controlnet-canny&quot;</span>, from_pt=<span class="hljs-literal">True</span>, dtype=jnp.float32
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe, params = FlaxStableDiffusionControlNetPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, controlnet=controlnet, revision=<span class="hljs-string">&quot;flax&quot;</span>, dtype=jnp.float32
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>params[<span class="hljs-string">&quot;controlnet&quot;</span>] = controlnet_params

<span class="hljs-meta">&gt;&gt;&gt; </span>num_samples = jax.device_count()
<span class="hljs-meta">&gt;&gt;&gt; </span>rng = jax.random.split(rng, jax.device_count())

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt_ids = pipe.prepare_text_inputs([prompts] * num_samples)
<span class="hljs-meta">&gt;&gt;&gt; </span>negative_prompt_ids = pipe.prepare_text_inputs([negative_prompts] * num_samples)
<span class="hljs-meta">&gt;&gt;&gt; </span>processed_image = pipe.prepare_image_inputs([canny_image] * num_samples)

<span class="hljs-meta">&gt;&gt;&gt; </span>p_params = replicate(params)
<span class="hljs-meta">&gt;&gt;&gt; </span>prompt_ids = shard(prompt_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>negative_prompt_ids = shard(negative_prompt_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>processed_image = shard(processed_image)

<span class="hljs-meta">&gt;&gt;&gt; </span>output = pipe(
<span class="hljs-meta">... </span>    prompt_ids=prompt_ids,
<span class="hljs-meta">... </span>    image=processed_image,
<span class="hljs-meta">... </span>    params=p_params,
<span class="hljs-meta">... </span>    prng_seed=rng,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">50</span>,
<span class="hljs-meta">... </span>    neg_prompt_ids=negative_prompt_ids,
<span class="hljs-meta">... </span>    jit=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>).images

<span class="hljs-meta">&gt;&gt;&gt; </span>output_images = pipe.numpy_to_pil(np.asarray(output.reshape((num_samples,) + output.shape[-<span class="hljs-number">3</span>:])))
<span class="hljs-meta">&gt;&gt;&gt; </span>output_images = image_grid(output_images, num_samples // <span class="hljs-number">4</span>, <span class="hljs-number">4</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>output_images.save(<span class="hljs-string">&quot;generated_image.png&quot;</span>)`}}),{c(){u=o("p"),I=i("Examples:"),M=c(),g(h.$$.fragment)},l(p){u=a(p,"P",{});var T=l(u);I=r(T,"Examples:"),T.forEach(t),M=d(p),_(h.$$.fragment,p)},m(p,T){m(p,u,T),e(u,I),m(p,M,T),b(h,p,T),U=!0},p:_e,i(p){U||(v(h.$$.fragment,p),U=!0)},o(p){y(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(M),w(h,p)}}}function w$(N){let u,I,M,h,U,p,T,_t,Me,Xt,H,Y,F,xe,Ds,Yt,k_,Zu,Fo,Ro,$_,G_,Nu,Ss,W_,xu,Bs,D_,ku,Ps,Gc,S_,$u,Qt,B_,Vo,P_,F_,Gu,Fs,R_,Wu,Lt,Wc,Ao,V_,A_,Dc,Xo,X_,Du,bt,zt,Sc,Yo,Y_,Bc,Q_,Su,Ht,Pc,vt,Fc,L_,z_,Rc,H_,q_,Rs,O_,K_,yt,wt,Vc,Qo,eb,tb,Ac,Xc,nb,ob,Vs,Lo,ab,lb,Mt,Yc,zo,sb,ib,Qc,Lc,rb,cb,zc,db,Tt,Hc,Ho,pb,fb,qc,Oc,mb,ub,Kc,Bu,Ut,qt,ed,qo,hb,td,gb,Pu,Ot,_b,nd,bb,vb,Fu,Kt,od,ad,ld,yb,wb,sd,As,Oo,Mb,Xs,Tb,Ub,Ru,en,Ib,Ko,Jb,Eb,Vu,ea,Au,Ys,Qs,qJ,Xu,ke,Cb,id,jb,Zb,Ls,Nb,xb,Yu,zs,kb,Qu,ta,Lu,Hs,$b,zu,na,Hu,qs,Gb,qu,oa,Ou,Os,Wb,Ku,Ks,ei,OJ,eh,tn,Db,ti,Sb,Bb,th,aa,nh,nn,Pb,ni,Fb,Rb,oh,la,ah,oi,Vb,lh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J,vJ,yJ,Le,js,wJ,tu,MJ,TJ,nu,UJ,Kh,At,Co,ou,Zs,IJ,au,JJ,eg,he,Ns,EJ,lu,CJ,jJ,xs,ZJ,su,NJ,xJ,kJ,ze,ks,$J,iu,GJ,WJ,jo,tg;return p=new P({}),xe=new P({}),Yo=new P({}),qo=new P({}),ea=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBJTBBJTIzJTIwTGV0J3MlMjBsb2FkJTIwdGhlJTIwcG9wdWxhciUyMHZlcm1lZXIlMjBpbWFnZSUwQWltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmhmLmNvJTJGZGF0YXNldHMlMkZodWdnaW5nZmFjZSUyRmRvY3VtZW50YXRpb24taW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZkaWZmdXNlcnMlMkZpbnB1dF9pbWFnZV92ZXJtZWVyLnBuZyUyMiUwQSk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

<span class="hljs-comment"># Let&#x27;s load the popular vermeer image</span>
image = load_image(
    <span class="hljs-string">&quot;https://hf.co/datasets/huggingface/documentation-images/resolve/main/diffusers/input_image_vermeer.png&quot;</span>
)`}}),ta=new S({props:{code:"cGlwJTIwaW5zdGFsbCUyMG9wZW5jdi1jb250cmliLXB5dGhvbg==",highlighted:'pip <span class="hljs-keyword">install</span> opencv-contrib-python'}}),na=new S({props:{code:"cGlwJTIwaW5zdGFsbCUyMGRpZmZ1c2VycyUyMHRyYW5zZm9ybWVycyUyMGdpdCUyQmh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmh1Z2dpbmdmYWNlJTJGYWNjZWxlcmF0ZS5naXQ=",highlighted:'pip install diffusers transformers git+https:<span class="hljs-regexp">//gi</span>thub.com<span class="hljs-regexp">/huggingface/</span>accelerate.git'}}),oa=new S({props:{code:"aW1wb3J0JTIwY3YyJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBaW1hZ2UlMjAlM0QlMjBucC5hcnJheShpbWFnZSklMEElMEFsb3dfdGhyZXNob2xkJTIwJTNEJTIwMTAwJTBBaGlnaF90aHJlc2hvbGQlMjAlM0QlMjAyMDAlMEElMEFpbWFnZSUyMCUzRCUyMGN2Mi5DYW5ueShpbWFnZSUyQyUyMGxvd190aHJlc2hvbGQlMkMlMjBoaWdoX3RocmVzaG9sZCklMEFpbWFnZSUyMCUzRCUyMGltYWdlJTVCJTNBJTJDJTIwJTNBJTJDJTIwTm9uZSU1RCUwQWltYWdlJTIwJTNEJTIwbnAuY29uY2F0ZW5hdGUoJTVCaW1hZ2UlMkMlMjBpbWFnZSUyQyUyMGltYWdlJTVEJTJDJTIwYXhpcyUzRDIpJTBBY2FubnlfaW1hZ2UlMjAlM0QlMjBJbWFnZS5mcm9tYXJyYXkoaW1hZ2Up",highlighted:`<span class="hljs-keyword">import</span> cv2
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

image = np.array(image)

low_threshold = <span class="hljs-number">100</span>
high_threshold = <span class="hljs-number">200</span>

image = cv2.Canny(image, low_threshold, high_threshold)
image = image[:, :, <span class="hljs-literal">None</span>]
image = np.concatenate([image, image, image], axis=<span class="hljs-number">2</span>)
canny_image = Image.fromarray(image)`}}),aa=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZSUyQyUyMENvbnRyb2xOZXRNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBY29udHJvbG5ldCUyMCUzRCUyMENvbnRyb2xOZXRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIybGxseWFzdmllbCUyRnNkLWNvbnRyb2xuZXQtY2FubnklMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMkMlMjBjb250cm9sbmV0JTNEY29udHJvbG5ldCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline, ControlNetModel
<span class="hljs-keyword">import</span> torch

controlnet = ControlNetModel.from_pretrained(<span class="hljs-string">&quot;lllyasviel/sd-controlnet-canny&quot;</span>, torch_dtype=torch.float16)
pipe = StableDiffusionControlNetPipeline.from_pretrained(
    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, controlnet=controlnet, torch_dtype=torch.float16
)`}}),la=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFVuaVBDTXVsdGlzdGVwU2NoZWR1bGVyJTBBJTBBcGlwZS5zY2hlZHVsZXIlMjAlM0QlMjBVbmlQQ011bHRpc3RlcFNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlLnNjaGVkdWxlci5jb25maWcpJTBBJTBBJTIzJTIwdGhpcyUyMGNvbW1hbmQlMjBsb2FkcyUyMHRoZSUyMGluZGl2aWR1YWwlMjBtb2RlbCUyMGNvbXBvbmVudHMlMjBvbiUyMEdQVSUyMG9uLWRlbWFuZC4lMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UniPCMultistepScheduler

pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)

<span class="hljs-comment"># this command loads the individual model components on GPU on-demand.</span>
pipe.enable_model_cpu_offload()`}}),sa=new S({props:{code:"Z2VuZXJhdG9yJTIwJTNEJTIwdG9yY2gubWFudWFsX3NlZWQoMCklMEElMEFvdXRfaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMCUyMmRpc2NvJTIwZGFuY2VyJTIwd2l0aCUyMGNvbG9yZnVsJTIwbGlnaHRzJTIyJTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTIwaW1hZ2UlM0RjYW5ueV9pbWFnZSUwQSkuaW1hZ2VzJTVCMCU1RA==",highlighted:`generator = torch.manual_seed(<span class="hljs-number">0</span>)

out_image = pipe(
    <span class="hljs-string">&quot;disco dancer with colorful lights&quot;</span>, num_inference_steps=<span class="hljs-number">20</span>, generator=generator, image=canny_image
).images[<span class="hljs-number">0</span>]`}}),ia=new P({}),ra=new P({}),ca=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjBjdjIlMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQSUwQWNhbm55X2ltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNld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ltYWdlKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> cv2
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

canny_image = load_image(
    <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/landscape.png&quot;</span>
)
canny_image = np.array(canny_image)

low_threshold = <span class="hljs-number">100</span>
high_threshold = <span class="hljs-number">200</span>

canny_image = cv2.Canny(canny_image, low_threshold, high_threshold)

<span class="hljs-comment"># zero out middle columns of image where pose will be overlayed</span>
zero_start = canny_image.shape[<span class="hljs-number">1</span>] // <span class="hljs-number">4</span>
zero_end = zero_start + canny_image.shape[<span class="hljs-number">1</span>] // <span class="hljs-number">2</span>
canny_image[:, zero_start:zero_end] = <span class="hljs-number">0</span>

canny_image = canny_image[:, :, <span class="hljs-literal">None</span>]
canny_image = np.concatenate([canny_image, canny_image, canny_image], axis=<span class="hljs-number">2</span>)
canny_image = Image.fromarray(canny_image)`}}),da=new P({}),fa=new S({props:{code:"ZnJvbSUyMGNvbnRyb2xuZXRfYXV4JTIwaW1wb3J0JTIwT3BlbnBvc2VEZXRlY3RvciUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBJTBBb3BlbnBvc2UlMjAlM0QlMjBPcGVucG9zZURldGVjdG9yLmZyb21fcHJldHJhaW5lZCglMjJsbGx5YXN2aWVsJTJGQ29udHJvbE5ldCUyMiklMEElMEFvcGVucG9zZV9pbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGaHVnZ2luZ2ZhY2UlMkZkb2N1bWVudGF0aW9uLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGZGlmZnVzZXJzJTJGcGVyc29uLnBuZyUyMiUwQSklMEFvcGVucG9zZV9pbWFnZSUyMCUzRCUyMG9wZW5wb3NlKG9wZW5wb3NlX2ltYWdlKQ==",highlighted:`<span class="hljs-keyword">from</span> controlnet_aux <span class="hljs-keyword">import</span> OpenposeDetector
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

openpose = OpenposeDetector.from_pretrained(<span class="hljs-string">&quot;lllyasviel/ControlNet&quot;</span>)

openpose_image = load_image(
    <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/person.png&quot;</span>
)
openpose_image = openpose(openpose_image)`}}),ua=new P({}),ha=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZSUyQyUyMENvbnRyb2xOZXRNb2RlbCUyQyUyMFVuaVBDTXVsdGlzdGVwU2NoZWR1bGVyJTBBaW1wb3J0JTIwdG9yY2glMEElMEFjb250cm9sbmV0JTIwJTNEJTIwJTVCJTBBJTIwJTIwJTIwJTIwQ29udHJvbE5ldE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJsbGx5YXN2aWVsJTJGc2QtY29udHJvbG5ldC1vcGVucG9zZSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMkMlMEElMjAlMjAlMjAlMjBDb250cm9sTmV0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmxsbHlhc3ZpZWwlMkZzZC1jb250cm9sbmV0LWNhbm55JTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUyQyUwQSU1RCUwQSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25Db250cm9sTmV0UGlwZWxpbmUuZnJvbV9wcmV0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mF0b3IlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9wcm9tcHQlM0RuZWdhdGl2ZV9wcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBjb250cm9sbmV0X2NvbmRpdGlvbmluZ19zY2FsZSUzRCU1QjEuMCUyQyUyMDAuOCU1RCUyQyUwQSkuaW1hZ2VzJTVCMCU1RCUwQSUwQWltYWdlLnNhdmUoJTIyLiUyRm11bHRpX2NvbnRyb2xuZXRfb3V0cHV0LnBuZyUyMik=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler
<span class="hljs-keyword">import</span> torch

controlnet = [
    ControlNetModel.from_pretrained(<span class="hljs-string">&quot;lllyasviel/sd-controlnet-openpose&quot;</span>, torch_dtype=torch.float16),
    ControlNetModel.from_pretrained(<span class="hljs-string">&quot;lllyasviel/sd-controlnet-canny&quot;</span>, torch_dtype=torch.float16),
]

pipe = StableDiffusionControlNetPipeline.from_pretrained(
    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, controlnet=controlnet, torch_dtype=torch.float16
)
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)

pipe.enable_xformers_memory_efficient_attention()
pipe.enable_model_cpu_offload()

prompt = <span class="hljs-string">&quot;a giant standing in a fantasy landscape, best quality&quot;</span>
negative_prompt = <span class="hljs-string">&quot;monochrome, lowres, bad anatomy, worst quality, low quality&quot;</span>

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

images = [openpose_image, canny_image]

image = pipe(
    prompt,
    images,
    num_inference_steps=<span class="hljs-number">20</span>,
    generator=generator,
    negative_prompt=negative_prompt,
    controlnet_conditioning_scale=[<span class="hljs-number">1.0</span>, <span class="hljs-number">0.8</span>],
).images[<span class="hljs-number">0</span>]

image.save(<span class="hljs-string">&quot;./multi_controlnet_output.png&quot;</span>)`}}),_a=new P({}),ya=new P({}),wa=new P({}),Ta=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZSUyQyUyMENvbnRyb2xOZXRNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBY29udHJvbG5ldCUyMCUzRCUyMENvbnRyb2xOZXRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIybGxseWFzdmllbCUyRnNkLWNvbnRyb2xuZXQtY2FubnklMjIpJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMkMlMjBjb250cm9sbmV0JTNEY29udHJvbG5ldCkudG8oJTBBJTIwJTIwJTIwJTIwJTIyY3VkYSUyMiUwQSklMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTIyJTIyJTJDJTIwaW1hZ2UlM0RjYW5ueV9pbWFnZSUyQyUyMGd1ZXNzX21vZGUlM0RUcnVlJTJDJTIwZ3VpZGFuY2Vfc2NhbGUlM0QzLjApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmd1ZXNzX21vZGVfZ2VuZXJhdGVkLnBuZyUyMik=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline, ControlNetModel
<span class="hljs-keyword">import</span> torch

controlnet = ControlNetModel.from_pretrained(<span class="hljs-string">&quot;lllyasviel/sd-controlnet-canny&quot;</span>)
pipe = StableDiffusionControlNetPipeline.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, controlnet=controlnet).to(
    <span class="hljs-string">&quot;cuda&quot;</span>
)
image = pipe(<span class="hljs-string">&quot;&quot;</span>, image=canny_image, guess_mode=<span class="hljs-literal">True</span>, guidance_scale=<span class="hljs-number">3.0</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;guess_mode_generated.png&quot;</span>)`}}),Ua=new P({}),Ea=new P({}),ja=new P({}),Xa=new P({}),sl=new P({}),il=new C({props:{name:"class diffusers.StableDiffusionControlNetPipeline",anchor:"diffusers.StableDiffusionControlNetPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"controlnet",val:": typing.Union[diffusers.models.controlnet.ControlNetModel, typing.List[diffusers.models.controlnet.ControlNetModel], typing.Tuple[diffusers.models.controlnet.ControlNetModel], diffusers.pipelines.controlnet.multicontrolnet.MultiControlNetModel]"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionControlNetPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionControlNetPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code>) &#x2014;
Provides additional conditioning to the unet during the denoising process. If you set multiple ControlNets
as a list, the outputs from each ControlNet are added together to create one combined additional
conditioning.`,name:"controlnet"},{anchor:"diffusers.StableDiffusionControlNetPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.18.2/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.18.2/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.18.2/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.18.2/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionControlNetPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionControlNetPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L93"}}),dl=new C({props:{name:"__call__",anchor:"diffusers.StableDiffusionControlNetPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, numpy.ndarray, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image], typing.List[numpy.ndarray]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 1.0"},{name:"guess_mode",val:": bool = False"},{name:"control_guidance_start",val:": typing.Union[float, typing.List[float]] = 0.0"},{name:"control_guidance_end",val:": typing.Union[float, typing.List[float]] = 1.0"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, <code>List[List[np.ndarray]]</code> or <code>List[List[PIL.Image.Image]]</code>):
The ControlNet input condition. ControlNet uses this input condition to generate guidance to Unet. If
the type is specified as <code>Torch.FloatTensor</code>, it is passed to ControlNet as is. <code>PIL.Image.Image</code> can
also be accepted as an image. The dimensions of the output image defaults to <code>image</code>&#x2019;s dimensions. If
height and/or width are passed, <code>image</code> is resized according to them. If multiple ControlNets are
specified in init, images must be passed as a list such that each element of the list can be correctly
batched for input to a single controlnet.`,name:"image"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.18.2/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet. If multiple ControlNets are specified in init, you can set the
corresponding scale as a list.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.guess_mode",description:`<strong>guess_mode</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
In this mode, the ControlNet encoder will try best to recognize the content of the input image even if
you remove all prompts. The <code>guidance_scale</code> between 3.0 and 5.0 is recommended.`,name:"guess_mode"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.control_guidance_start",description:`<strong>control_guidance_start</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The percentage of total steps at which the controlnet starts applying.`,name:"control_guidance_start"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.control_guidance_end",description:`<strong>control_guidance_end</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The percentage of total steps at which the controlnet stops applying.`,name:"control_guidance_end"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L704",returnDescription:`
<p><a
  href="/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Xn=new ge({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.example",$$slots:{default:[a$]},$$scope:{ctx:N}}}),pl=new C({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1470"}}),fl=new C({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1486"}}),ul=new C({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L180"}}),hl=new C({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L190"}}),_l=new C({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1408"}}),Ln=new x_({props:{warning:!0,$$slots:{default:[l$]},$$scope:{ctx:N}}}),zn=new ge({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[s$]},$$scope:{ctx:N}}}),yl=new C({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1444"}}),Tl=new C({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.List[str], typing.Dict[str, torch.Tensor], typing.List[typing.Dict[str, torch.Tensor]]]"},{name:"token",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/loaders.py#L469"}}),qn=new ge({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.example",$$slots:{default:[i$]},$$scope:{ctx:N}}}),On=new ge({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.example-2",$$slots:{default:[r$]},$$scope:{ctx:N}}}),El=new C({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L208"}}),jl=new C({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L236"}}),Zl=new C({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L215"}}),Nl=new C({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L198"}}),xl=new P({}),kl=new C({props:{name:"class diffusers.StableDiffusionControlNetImg2ImgPipeline",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"controlnet",val:": typing.Union[diffusers.models.controlnet.ControlNetModel, typing.List[diffusers.models.controlnet.ControlNetModel], typing.Tuple[diffusers.models.controlnet.ControlNetModel], diffusers.pipelines.controlnet.multicontrolnet.MultiControlNetModel]"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code>) &#x2014;
Provides additional conditioning to the unet during the denoising process. If you set multiple ControlNets
as a list, the outputs from each ControlNet are added together to create one combined additional
conditioning.`,name:"controlnet"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.18.2/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.18.2/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.18.2/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.18.2/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L119"}}),Wl=new C({props:{name:"__call__",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, numpy.ndarray, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image], typing.List[numpy.ndarray]] = None"},{name:"control_image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, numpy.ndarray, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image], typing.List[numpy.ndarray]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"strength",val:": float = 0.8"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 0.8"},{name:"guess_mode",val:": bool = False"},{name:"control_guidance_start",val:": typing.Union[float, typing.List[float]] = 0.0"},{name:"control_guidance_end",val:": typing.Union[float, typing.List[float]] = 1.0"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, <code>List[List[np.ndarray]]</code> or <code>List[List[PIL.Image.Image]]</code>):
The initial image will be used as the starting point for the image generation process. Can also accpet
image latents as <code>image</code>, if passing latents directly, it will not be encoded again.`,name:"image"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.control_image",description:`<strong>control_image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, <code>List[List[np.ndarray]]</code> or <code>List[List[PIL.Image.Image]]</code>):
The ControlNet input condition. ControlNet uses this input condition to generate guidance to Unet. If
the type is specified as <code>Torch.FloatTensor</code>, it is passed to ControlNet as is. <code>PIL.Image.Image</code> can
also be accepted as an image. The dimensions of the output image defaults to <code>image</code>&#x2019;s dimensions. If
height and/or width are passed, <code>image</code> is resized according to them. If multiple ControlNets are
specified in init, images must be passed as a list such that each element of the list can be correctly
batched for input to a single controlnet.`,name:"control_image"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.18.2/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet. If multiple ControlNets are specified in init, you can set the
corresponding scale as a list. Note that by default, we use a smaller conditioning scale for inpainting
than for <a href="/docs/diffusers/v0.18.2/en/api/pipelines/controlnet#diffusers.StableDiffusionControlNetPipeline.__call__"><strong>call</strong>()</a>.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.guess_mode",description:`<strong>guess_mode</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
In this mode, the ControlNet encoder will try best to recognize the content of the input image even if
you remove all prompts. The <code>guidance_scale</code> between 3.0 and 5.0 is recommended.`,name:"guess_mode"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.control_guidance_start",description:`<strong>control_guidance_start</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The percentage of total steps at which the controlnet starts applying.`,name:"control_guidance_start"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.control_guidance_end",description:`<strong>control_guidance_end</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The percentage of total steps at which the controlnet stops applying.`,name:"control_guidance_end"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L782",returnDescription:`
<p><a
  href="/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),oo=new ge({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.example",$$slots:{default:[c$]},$$scope:{ctx:N}}}),Dl=new C({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1470"}}),Sl=new C({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1486"}}),Pl=new C({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L206"}}),Fl=new C({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L216"}}),Vl=new C({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1408"}}),so=new x_({props:{warning:!0,$$slots:{default:[d$]},$$scope:{ctx:N}}}),io=new ge({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[p$]},$$scope:{ctx:N}}}),Yl=new C({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1444"}}),zl=new C({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.List[str], typing.Dict[str, torch.Tensor], typing.List[typing.Dict[str, torch.Tensor]]]"},{name:"token",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/loaders.py#L469"}}),co=new ge({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.example",$$slots:{default:[f$]},$$scope:{ctx:N}}}),po=new ge({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.example-2",$$slots:{default:[m$]},$$scope:{ctx:N}}}),Kl=new C({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L234"}}),ts=new C({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L262"}}),ns=new C({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L241"}}),os=new C({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L224"}}),as=new P({}),ls=new C({props:{name:"class diffusers.StableDiffusionControlNetInpaintPipeline",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"controlnet",val:": typing.Union[diffusers.models.controlnet.ControlNetModel, typing.List[diffusers.models.controlnet.ControlNetModel], typing.Tuple[diffusers.models.controlnet.ControlNetModel], diffusers.pipelines.controlnet.multicontrolnet.MultiControlNetModel]"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code>) &#x2014;
Provides additional conditioning to the unet during the denoising process. If you set multiple ControlNets
as a list, the outputs from each ControlNet are added together to create one combined additional
conditioning.`,name:"controlnet"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.18.2/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.18.2/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.18.2/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.18.2/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L225"}}),go=new x_({props:{$$slots:{default:[u$]},$$scope:{ctx:N}}}),rs=new C({props:{name:"__call__",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[torch.Tensor, PIL.Image.Image] = None"},{name:"mask_image",val:": typing.Union[torch.Tensor, PIL.Image.Image] = None"},{name:"control_image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, numpy.ndarray, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image], typing.List[numpy.ndarray]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"strength",val:": float = 1.0"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 0.5"},{name:"guess_mode",val:": bool = False"},{name:"control_guidance_start",val:": typing.Union[float, typing.List[float]] = 0.0"},{name:"control_guidance_end",val:": typing.Union[float, typing.List[float]] = 1.0"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, or <code>List[List[PIL.Image.Image]]</code>):
The ControlNet input condition. ControlNet uses this input condition to generate guidance to Unet. If
the type is specified as <code>Torch.FloatTensor</code>, it is passed to ControlNet as is. <code>PIL.Image.Image</code> can
also be accepted as an image. The dimensions of the output image defaults to <code>image</code>&#x2019;s dimensions. If
height and/or width are passed, <code>image</code> is resized according to them. If multiple ControlNets are
specified in init, images must be passed as a list such that each element of the list can be correctly
batched for input to a single controlnet.`,name:"image"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 1.) &#x2014;
Conceptually, indicates how much to transform the masked portion of the reference <code>image</code>. Must be
between 0 and 1. <code>image</code> will be used as a starting point, adding more noise to it the larger the
<code>strength</code>. The number of denoising steps depends on the amount of noise initially added. When
<code>strength</code> is 1, added noise will be maximum and the denoising process will run for the full number of
iterations specified in <code>num_inference_steps</code>. A value of 1, therefore, essentially ignores the masked
portion of the reference <code>image</code>.`,name:"strength"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.18.2/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.5) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet. If multiple ControlNets are specified in init, you can set the
corresponding scale as a list. Note that by default, we use a smaller conditioning scale for inpainting
than for <a href="/docs/diffusers/v0.18.2/en/api/pipelines/controlnet#diffusers.StableDiffusionControlNetPipeline.__call__"><strong>call</strong>()</a>.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.guess_mode",description:`<strong>guess_mode</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
In this mode, the ControlNet encoder will try best to recognize the content of the input image even if
you remove all prompts. The <code>guidance_scale</code> between 3.0 and 5.0 is recommended.`,name:"guess_mode"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.control_guidance_start",description:`<strong>control_guidance_start</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The percentage of total steps at which the controlnet starts applying.`,name:"control_guidance_start"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.control_guidance_end",description:`<strong>control_guidance_end</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The percentage of total steps at which the controlnet stops applying.`,name:"control_guidance_end"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L982",returnDescription:`
<p><a
  href="/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),_o=new ge({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.example",$$slots:{default:[h$]},$$scope:{ctx:N}}}),cs=new C({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1470"}}),ds=new C({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1486"}}),fs=new C({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L323"}}),ms=new C({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L333"}}),hs=new C({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1408"}}),yo=new x_({props:{warning:!0,$$slots:{default:[g$]},$$scope:{ctx:N}}}),wo=new ge({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[_$]},$$scope:{ctx:N}}}),bs=new C({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/pipeline_utils.py#L1444"}}),ws=new C({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.List[str], typing.Dict[str, torch.Tensor], typing.List[typing.Dict[str, torch.Tensor]]]"},{name:"token",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/loaders.py#L469"}}),To=new ge({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.example",$$slots:{default:[b$]},$$scope:{ctx:N}}}),Uo=new ge({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.example-2",$$slots:{default:[v$]},$$scope:{ctx:N}}}),Is=new C({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L351"}}),Es=new C({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L379"}}),Cs=new C({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L358"}}),js=new C({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L341"}}),Zs=new P({}),Ns=new C({props:{name:"class diffusers.FlaxStableDiffusionControlNetPipeline",anchor:"diffusers.FlaxStableDiffusionControlNetPipeline",parameters:[{name:"vae",val:": FlaxAutoencoderKL"},{name:"text_encoder",val:": FlaxCLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": FlaxUNet2DConditionModel"},{name:"controlnet",val:": FlaxControlNetModel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim_flax.FlaxDDIMScheduler, diffusers.schedulers.scheduling_pndm_flax.FlaxPNDMScheduler, diffusers.schedulers.scheduling_lms_discrete_flax.FlaxLMSDiscreteScheduler, diffusers.schedulers.scheduling_dpmsolver_multistep_flax.FlaxDPMSolverMultistepScheduler]"},{name:"safety_checker",val:": FlaxStableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPFeatureExtractor"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"}],parametersDescription:[{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/autoencoderkl#diffusers.FlaxAutoencoderKL">FlaxAutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>FlaxCLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.FlaxCLIPTextModel" rel="nofollow">CLIP</a>,
specifically the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/unet2d-cond#diffusers.FlaxUNet2DConditionModel">FlaxUNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/v0.18.2/en/api/models/controlnet#diffusers.FlaxControlNetModel">FlaxControlNetModel</a> &#x2014;
Provides additional conditioning to the unet during the denoising process.`,name:"controlnet"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.18.2/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<code>FlaxDDIMScheduler</code>, <code>FlaxLMSDiscreteScheduler</code>, <code>FlaxPNDMScheduler</code>, or
<code>FlaxDPMSolverMultistepScheduler</code>.`,name:"scheduler"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>FlaxStableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPFeatureExtractor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py#L119"}}),ks=new C({props:{name:"__call__",anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__",parameters:[{name:"prompt_ids",val:": array"},{name:"image",val:": array"},{name:"params",val:": typing.Union[typing.Dict, flax.core.frozen_dict.FrozenDict]"},{name:"prng_seed",val:": PRNGKeyArray"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": typing.Union[float, array] = 7.5"},{name:"latents",val:": array = None"},{name:"neg_prompt_ids",val:": array = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, array] = 1.0"},{name:"return_dict",val:": bool = True"},{name:"jit",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.prompt_ids",description:`<strong>prompt_ids</strong> (<code>jnp.array</code>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt_ids"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.image",description:`<strong>image</strong> (<code>jnp.array</code>) &#x2014;
Array representing the ControlNet input condition. ControlNet use this input condition to generate
guidance to Unet.`,name:"image"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.params",description:"<strong>params</strong> (<code>Dict</code> or <code>FrozenDict</code>) &#x2014; Dictionary containing the model parameters/weights",name:"params"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.prng_seed",description:"<strong>prng_seed</strong> (<code>jax.random.KeyArray</code> or <code>jax.Array</code>) &#x2014; Array containing random number generator key",name:"prng_seed"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.latents",description:`<strong>latents</strong> (<code>jnp.array</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>jnp.array</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <code>FlaxStableDiffusionPipelineOutput</code> instead of
a plain tuple.`,name:"return_dict"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.jit",description:`<strong>jit</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to run <code>pmap</code> versions of the generation and safety scoring functions. NOTE: This argument
exists because <code>__call__</code> is not yet end-to-end pmap-able. It will be removed in a future release.`,name:"jit"}],source:"https://github.com/huggingface/diffusers/blob/v0.18.2/src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py#L357",returnDescription:`
<p><code>FlaxStableDiffusionPipelineOutput</code> if <code>return_dict</code> is True, otherwise a
<code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><code>FlaxStableDiffusionPipelineOutput</code> or <code>tuple</code></p>
`}}),jo=new ge({props:{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.example",$$slots:{default:[y$]},$$scope:{ctx:N}}}),{c(){u=o("meta"),I=c(),M=o("h1"),h=o("a"),U=o("span"),g(p.$$.fragment),T=c(),_t=o("span"),Me=i("Text-to-Image Generation with ControlNet Conditioning"),Xt=c(),H=o("h2"),Y=o("a"),F=o("span"),g(xe.$$.fragment),Ds=c(),Yt=o("span"),k_=i("Overview"),Zu=c(),Fo=o("p"),Ro=o("a"),$_=i("Adding Conditional Control to Text-to-Image Diffusion Models"),G_=i(" by Lvmin Zhang and Maneesh Agrawala."),Nu=c(),Ss=o("p"),W_=i("Using the pretrained models we can provide control images (for example, a depth map) to control Stable Diffusion text-to-image generation so that it follows the structure of the depth image and fills in the details."),xu=c(),Bs=o("p"),D_=i("The abstract of the paper is the following:"),ku=c(),Ps=o("p"),Gc=o("em"),S_=i("We present a neural network structure, ControlNet, to control pretrained large diffusion models to support additional input conditions. The ControlNet learns task-specific conditions in an end-to-end way, and the learning is robust even when the training dataset is small (< 50k). Moreover, training a ControlNet is as fast as fine-tuning a diffusion model, and the model can be trained on a personal devices. Alternatively, if powerful computation clusters are available, the model can scale to large amounts (millions to billions) of data. We report that large diffusion models like Stable Diffusion can be augmented with ControlNets to enable conditional inputs like edge maps, segmentation maps, keypoints, etc. This may enrich the methods to control large diffusion models and further facilitate related applications."),$u=c(),Qt=o("p"),B_=i("This model was contributed by the community contributor "),Vo=o("a"),P_=i("takuma104"),F_=i(" \u2764\uFE0F ."),Gu=c(),Fs=o("p"),R_=i("Resources:"),Wu=c(),Lt=o("ul"),Wc=o("li"),Ao=o("a"),V_=i("Paper"),A_=c(),Dc=o("li"),Xo=o("a"),X_=i("Original Code"),Du=c(),bt=o("h2"),zt=o("a"),Sc=o("span"),g(Yo.$$.fragment),Y_=c(),Bc=o("span"),Q_=i("Available Pipelines:"),Su=c(),Ht=o("table"),Pc=o("thead"),vt=o("tr"),Fc=o("th"),L_=i("Pipeline"),z_=c(),Rc=o("th"),H_=i("Tasks"),q_=c(),Rs=o("th"),O_=i("Demo"),K_=c(),yt=o("tbody"),wt=o("tr"),Vc=o("td"),Qo=o("a"),eb=i("StableDiffusionControlNetPipeline"),tb=c(),Ac=o("td"),Xc=o("em"),nb=i("Text-to-Image Generation with ControlNet Conditioning"),ob=c(),Vs=o("td"),Lo=o("a"),ab=i("Colab Example"),lb=c(),Mt=o("tr"),Yc=o("td"),zo=o("a"),sb=i("StableDiffusionControlNetImg2ImgPipeline"),ib=c(),Qc=o("td"),Lc=o("em"),rb=i("Image-to-Image Generation with ControlNet Conditioning"),cb=c(),zc=o("td"),db=c(),Tt=o("tr"),Hc=o("td"),Ho=o("a"),pb=i("StableDiffusionControlNetInpaintPipeline"),fb=c(),qc=o("td"),Oc=o("em"),mb=i("Inpainting Generation with ControlNet Conditioning"),ub=c(),Kc=o("td"),Bu=c(),Ut=o("h2"),qt=o("a"),ed=o("span"),g(qo.$$.fragment),hb=c(),td=o("span"),gb=i("Usage example"),Pu=c(),Ot=o("p"),_b=i("In the following we give a simple example of how to use a "),nd=o("em"),bb=i("ControlNet"),vb=i(` checkpoint with Diffusers for inference.
The inference pipeline is the same for all pipelines:`),Fu=c(),Kt=o("ul"),od=o("li"),ad=o("ol"),ld=o("li"),yb=i("Take an image and run it through a pre-conditioning processor."),wb=c(),sd=o("li"),As=o("ol"),Oo=o("li"),Mb=i("Run the pre-processed image through the "),Xs=o("a"),Tb=i("StableDiffusionControlNetPipeline"),Ub=i("."),Ru=c(),en=o("p"),Ib=i("Let\u2019s have a look at a simple example using the "),Ko=o("a"),Jb=i("Canny Edge ControlNet"),Eb=i("."),Vu=c(),g(ea.$$.fragment),Au=c(),Ys=o("p"),Qs=o("img"),Xu=c(),ke=o("p"),Cb=i("Next, we process the image to get the canny image. This is step "),id=o("em"),jb=i("1."),Zb=i(" - running the pre-conditioning processor. The pre-conditioning processor is different for every ControlNet. Please see the model cards of the "),Ls=o("a"),Nb=i("official checkpoints"),xb=i(" for more information about other models."),Yu=c(),zs=o("p"),kb=i("First, we need to install opencv:"),Qu=c(),g(ta.$$.fragment),Lu=c(),Hs=o("p"),$b=i("Next, let\u2019s also install all required Hugging Face libraries:"),zu=c(),g(na.$$.fragment),Hu=c(),qs=o("p"),Gb=i("Then we can retrieve the canny edges of the image."),qu=c(),g(oa.$$.fragment),Ou=c(),Os=o("p"),Wb=i("Let\u2019s take a look at the processed image."),Ku=c(),Ks=o("p"),ei=o("img"),eh=c(),tn=o("p"),Db=i("Now, we load the official "),ti=o("a"),Sb=i("Stable Diffusion 1.5 Model"),Bb=i(" as well as the ControlNet for canny edges."),th=c(),g(aa.$$.fragment),nh=c(),nn=o("p"),Pb=i("To speed-up things and reduce memory, let\u2019s enable model offloading and use the fast "),ni=o("a"),Fb=i("UniPCMultistepScheduler"),Rb=i("."),oh=c(),g(la.$$.fragment),ah=c(),oi=o("p"),Vb=i("Finally, we can run the pipeline:"),lh=c(),g(sa.$$.fragment),sh=c(),ai=o("p"),Ab=i("This should take only around 3-4 seconds on GPU (depending on hardware). The output image then looks as follows:"),ih=c(),li=o("p"),si=o("img"),rh=c(),It=o("p"),rd=o("strong"),Xb=i("Note"),Yb=i(": To see how to run all other ControlNet checkpoints, please have a look at "),ii=o("a"),Qb=i("ControlNet with Stable Diffusion 1.5"),Lb=i("."),ch=c(),Jt=o("h2"),on=o("a"),cd=o("span"),g(ia.$$.fragment),zb=c(),dd=o("span"),Hb=i("Combining multiple conditionings"),dh=c(),an=o("p"),qb=i("Multiple ControlNet conditionings can be combined for a single image generation. Pass a list of ControlNets to the pipeline\u2019s constructor and a corresponding list of conditionings to "),pd=o("code"),Ob=i("__call__"),Kb=i("."),ph=c(),ri=o("p"),ev=i("When combining conditionings, it is helpful to mask conditionings such that they do not overlap. In the example, we mask the middle of the canny map where the pose conditioning is located."),fh=c(),ln=o("p"),tv=i("It can also be helpful to vary the "),fd=o("code"),nv=i("controlnet_conditioning_scales"),ov=i(" to emphasize one conditioning over the other."),mh=c(),Et=o("h3"),sn=o("a"),md=o("span"),g(ra.$$.fragment),av=c(),ud=o("span"),lv=i("Canny conditioning"),uh=c(),ci=o("p"),sv=i("The original image:"),hh=c(),di=o("img"),gh=c(),pi=o("p"),iv=i("Prepare the conditioning:"),_h=c(),g(ca.$$.fragment),bh=c(),fi=o("img"),vh=c(),Ct=o("h3"),rn=o("a"),hd=o("span"),g(da.$$.fragment),rv=c(),gd=o("span"),cv=i("Openpose conditioning"),yh=c(),mi=o("p"),dv=i("The original image:"),wh=c(),pa=o("img"),Mh=c(),ui=o("p"),pv=i("Prepare the conditioning:"),Th=c(),g(fa.$$.fragment),Uh=c(),ma=o("img"),Ih=c(),jt=o("h3"),cn=o("a"),_d=o("span"),g(ua.$$.fragment),fv=c(),bd=o("span"),mv=i("Running ControlNet with multiple conditionings"),Jh=c(),g(ha.$$.fragment),Eh=c(),ga=o("img"),Ch=c(),Zt=o("h3"),dn=o("a"),vd=o("span"),g(_a.$$.fragment),uv=c(),yd=o("span"),hv=i("Guess Mode"),jh=c(),$e=o("p"),gv=i("Guess Mode is "),ba=o("a"),_v=i("a ControlNet feature that was implemented"),bv=i(" after the publication of "),va=o("a"),vv=i("the paper"),yv=i(". The description states:"),Zh=c(),hi=o("blockquote"),wd=o("p"),wv=i("In this mode, the ControlNet encoder will try best to recognize the content of the input control map, like depth map, edge map, scribbles, etc, even if you remove all prompts."),Nh=c(),Nt=o("h4"),pn=o("a"),Md=o("span"),g(ya.$$.fragment),Mv=c(),Td=o("span"),Tv=i("The core implementation:"),xh=c(),Ge=o("p"),Uv=i("It adjusts the scale of the output residuals from ControlNet by a fixed ratio depending on the block depth. The shallowest DownBlock corresponds to "),Ud=o("code"),Iv=i("0.1"),Jv=i(". As the blocks get deeper, the scale increases exponentially, and the scale for the output of the MidBlock becomes "),Id=o("code"),Ev=i("1.0"),Cv=i("."),kh=c(),fn=o("p"),jv=i("Since the core implementation is just this, "),Jd=o("strong"),Zv=i("it does not have any impact on prompt conditioning"),Nv=i(". While it is common to use it without specifying any prompts, it is also possible to provide prompts if desired."),$h=c(),xt=o("h4"),mn=o("a"),Ed=o("span"),g(wa.$$.fragment),xv=c(),Cd=o("span"),kv=i("Usage:"),Gh=c(),be=o("p"),$v=i("Just specify "),jd=o("code"),Gv=i("guess_mode=True"),Wv=i(" in the pipe() function. A "),Zd=o("code"),Dv=i("guidance_scale"),Sv=i(" between 3.0 and 5.0 is "),Ma=o("a"),Bv=i("recommended"),Pv=i("."),Wh=c(),g(Ta.$$.fragment),Dh=c(),kt=o("h4"),un=o("a"),Nd=o("span"),g(Ua.$$.fragment),Fv=c(),xd=o("span"),Rv=i("Output image comparison:"),Sh=i(`

Canny Control Example
`),hn=o("table"),kd=o("thead"),Ia=o("tr"),$d=o("th"),Vv=i("no guess_mode with prompt"),Av=c(),Gd=o("th"),Xv=i("guess_mode without prompt"),Yv=c(),Wd=o("tbody"),Ja=o("tr"),Dd=o("td"),gi=o("a"),_i=o("img"),Qv=c(),Sd=o("td"),bi=o("a"),vi=o("img"),Bh=c(),$t=o("h2"),gn=o("a"),Bd=o("span"),g(Ea.$$.fragment),Lv=c(),Pd=o("span"),zv=i("Available checkpoints"),Ph=c(),We=o("p"),Hv=i("ControlNet requires a "),Fd=o("em"),qv=i("control image"),Ov=i(" in addition to the text-to-image "),Rd=o("em"),Kv=i("prompt"),ey=i(`.
Each pretrained model is trained using a different conditioning method that requires different images for conditioning the generated outputs. For example, Canny edge conditioning requires the control image to be the output of a Canny filter, while depth conditioning requires the control image to be a depth map. See the overview and image examples below to know more.`),Fh=c(),_n=o("p"),ty=i("All checkpoints can be found under the authors\u2019 namespace "),Ca=o("a"),ny=i("lllyasviel"),oy=i("."),Rh=c(),Gt=o("p"),Vd=o("strong"),ay=i("13.04.2024 Update"),ly=i(": The author has released improved controlnet checkpoints v1.1 - see "),yi=o("a"),sy=i("here"),iy=i("."),Vh=c(),Wt=o("h3"),bn=o("a"),Ad=o("span"),g(ja.$$.fragment),ry=c(),Xd=o("span"),cy=i("ControlNet v1.0"),Ah=c(),vn=o("table"),Yd=o("thead"),Te=o("tr"),Qd=o("th"),dy=i("Model Name"),py=c(),Ld=o("th"),fy=i("Control Image Overview"),my=c(),zd=o("th"),uy=i("Control Image Example"),hy=c(),Hd=o("th"),gy=i("Generated Image Example"),_y=c(),B=o("tbody"),Ue=o("tr"),yn=o("td"),Za=o("a"),by=i("lllyasviel/sd-controlnet-canny"),vy=o("br"),yy=c(),qd=o("em"),wy=i("Trained with canny edge detection"),My=c(),Od=o("td"),Ty=i("A monochrome image with white edges on a black background."),Uy=c(),Kd=o("td"),wi=o("a"),wn=o("img"),Iy=c(),ep=o("td"),Mi=o("a"),Ti=o("img"),Jy=c(),Ie=o("tr"),Mn=o("td"),Na=o("a"),Ey=i("lllyasviel/sd-controlnet-depth"),Cy=o("br"),jy=c(),tp=o("em"),Zy=i("Trained with Midas depth estimation"),Ny=c(),np=o("td"),xy=i("A grayscale image with black representing deep areas and white representing shallow areas."),ky=c(),op=o("td"),Ui=o("a"),Ii=o("img"),$y=c(),ap=o("td"),Ji=o("a"),Ei=o("img"),Gy=c(),Je=o("tr"),Tn=o("td"),xa=o("a"),Wy=i("lllyasviel/sd-controlnet-hed"),Dy=o("br"),Sy=c(),lp=o("em"),By=i("Trained with HED edge detection (soft edge)"),Py=c(),sp=o("td"),Fy=i("A monochrome image with white soft edges on a black background."),Ry=c(),ip=o("td"),Ci=o("a"),ji=o("img"),Vy=c(),rp=o("td"),Zi=o("a"),Ni=o("img"),Ay=c(),Ee=o("tr"),Un=o("td"),ka=o("a"),Xy=i("lllyasviel/sd-controlnet-mlsd"),Yy=o("br"),Qy=c(),cp=o("em"),Ly=i("Trained with M-LSD line detection"),zy=c(),dp=o("td"),Hy=i("A monochrome image composed only of white straight lines on a black background."),qy=c(),pp=o("td"),xi=o("a"),ki=o("img"),Oy=c(),fp=o("td"),$i=o("a"),Gi=o("img"),Ky=c(),Ce=o("tr"),In=o("td"),$a=o("a"),e1=i("lllyasviel/sd-controlnet-normal"),t1=o("br"),n1=c(),mp=o("em"),o1=i("Trained with normal map"),a1=c(),Ga=o("td"),l1=i("A "),Wa=o("a"),s1=i("normal mapped"),i1=i(" image."),r1=c(),up=o("td"),Wi=o("a"),Di=o("img"),c1=c(),hp=o("td"),Si=o("a"),Bi=o("img"),d1=c(),je=o("tr"),Jn=o("td"),Da=o("a"),p1=i("lllyasviel/sd-controlnet-openpose"),f1=o("br"),m1=c(),gp=o("em"),u1=i("Trained with OpenPose bone image"),h1=c(),Sa=o("td"),g1=i("A "),Ba=o("a"),_1=i("OpenPose bone"),b1=i(" image."),v1=c(),_p=o("td"),Pi=o("a"),Fi=o("img"),y1=c(),bp=o("td"),Ri=o("a"),Vi=o("img"),w1=c(),Ze=o("tr"),En=o("td"),Pa=o("a"),M1=i("lllyasviel/sd-controlnet-scribble"),T1=o("br"),U1=c(),vp=o("em"),I1=i("Trained with human scribbles"),J1=c(),yp=o("td"),E1=i("A hand-drawn monochrome image with white outlines on a black background."),C1=c(),wp=o("td"),Ai=o("a"),Xi=o("img"),j1=c(),Mp=o("td"),Yi=o("a"),Qi=o("img"),Z1=c(),Ne=o("tr"),Fa=o("td"),Ra=o("a"),N1=i("lllyasviel/sd-controlnet-seg"),x1=o("br"),Tp=o("em"),k1=i("Trained with semantic segmentation"),$1=c(),Va=o("td"),G1=i("An "),Aa=o("a"),W1=i("ADE20K"),D1=i("\u2019s segmentation protocol image."),S1=c(),Up=o("td"),Li=o("a"),zi=o("img"),B1=c(),Ip=o("td"),Hi=o("a"),qi=o("img"),Xh=c(),Dt=o("h3"),Cn=o("a"),Jp=o("span"),g(Xa.$$.fragment),P1=c(),Ep=o("span"),F1=i("ControlNet v1.1"),Yh=c(),jn=o("table"),Cp=o("thead"),q=o("tr"),jp=o("th"),R1=i("Model Name"),V1=c(),Zp=o("th"),A1=i("Control Image Overview"),X1=c(),Np=o("th"),Y1=i("Condition Image"),Q1=c(),xp=o("th"),L1=i("Control Image Example"),z1=c(),kp=o("th"),H1=i("Generated Image Example"),q1=c(),G=o("tbody"),O=o("tr"),Oi=o("td"),Ya=o("a"),O1=i("lllyasviel/control_v11p_sd15_canny"),K1=o("br"),ew=c(),$p=o("td"),Gp=o("em"),tw=i("Trained with canny edge detection"),nw=c(),Wp=o("td"),ow=i("A monochrome image with white edges on a black background."),aw=c(),Dp=o("td"),Ki=o("a"),Zn=o("img"),lw=c(),Sp=o("td"),er=o("a"),tr=o("img"),sw=c(),K=o("tr"),nr=o("td"),Qa=o("a"),iw=i("lllyasviel/control_v11e_sd15_ip2p"),rw=o("br"),cw=c(),Bp=o("td"),Pp=o("em"),dw=i("Trained with pixel to pixel instruction"),pw=c(),Fp=o("td"),fw=i("No condition ."),mw=c(),Rp=o("td"),or=o("a"),Nn=o("img"),uw=c(),Vp=o("td"),ar=o("a"),lr=o("img"),hw=c(),ee=o("tr"),sr=o("td"),La=o("a"),gw=i("lllyasviel/control_v11p_sd15_inpaint"),_w=o("br"),bw=c(),Ap=o("td"),vw=i("Trained with image inpainting"),yw=c(),Xp=o("td"),ww=i("No condition."),Mw=c(),Yp=o("td"),ir=o("a"),xn=o("img"),Tw=c(),Qp=o("td"),rr=o("a"),cr=o("img"),Uw=c(),te=o("tr"),dr=o("td"),za=o("a"),Iw=i("lllyasviel/control_v11p_sd15_mlsd"),Jw=o("br"),Ew=c(),Lp=o("td"),Cw=i("Trained with multi-level line segment detection"),jw=c(),zp=o("td"),Zw=i("An image with annotated line segments."),Nw=c(),Hp=o("td"),pr=o("a"),kn=o("img"),xw=c(),qp=o("td"),fr=o("a"),mr=o("img"),kw=c(),ne=o("tr"),ur=o("td"),Ha=o("a"),$w=i("lllyasviel/control_v11f1p_sd15_depth"),Gw=o("br"),Ww=c(),Op=o("td"),Dw=i("Trained with depth estimation"),Sw=c(),Kp=o("td"),Bw=i("An image with depth information, usually represented as a grayscale image."),Pw=c(),ef=o("td"),hr=o("a"),$n=o("img"),Fw=c(),tf=o("td"),gr=o("a"),_r=o("img"),Rw=c(),oe=o("tr"),br=o("td"),qa=o("a"),Vw=i("lllyasviel/control_v11p_sd15_normalbae"),Aw=o("br"),Xw=c(),nf=o("td"),Yw=i("Trained with surface normal estimation"),Qw=c(),of=o("td"),Lw=i("An image with surface normal information, usually represented as a color-coded image."),zw=c(),af=o("td"),vr=o("a"),Gn=o("img"),Hw=c(),lf=o("td"),yr=o("a"),wr=o("img"),qw=c(),ae=o("tr"),Mr=o("td"),Oa=o("a"),Ow=i("lllyasviel/control_v11p_sd15_seg"),Kw=o("br"),e2=c(),sf=o("td"),t2=i("Trained with image segmentation"),n2=c(),rf=o("td"),o2=i("An image with segmented regions, usually represented as a color-coded image."),a2=c(),cf=o("td"),Tr=o("a"),Wn=o("img"),l2=c(),df=o("td"),Ur=o("a"),Ir=o("img"),s2=c(),le=o("tr"),Jr=o("td"),Ka=o("a"),i2=i("lllyasviel/control_v11p_sd15_lineart"),r2=o("br"),c2=c(),pf=o("td"),d2=i("Trained with line art generation"),p2=c(),ff=o("td"),f2=i("An image with line art, usually black lines on a white background."),m2=c(),mf=o("td"),Er=o("a"),Dn=o("img"),u2=c(),uf=o("td"),Cr=o("a"),jr=o("img"),h2=c(),se=o("tr"),Zr=o("td"),el=o("a"),g2=i("lllyasviel/control_v11p_sd15s2_lineart_anime"),_2=o("br"),b2=c(),hf=o("td"),v2=i("Trained with anime line art generation"),y2=c(),gf=o("td"),w2=i("An image with anime-style line art."),M2=c(),_f=o("td"),Nr=o("a"),Sn=o("img"),T2=c(),bf=o("td"),xr=o("a"),kr=o("img"),U2=c(),ie=o("tr"),$r=o("td"),tl=o("a"),I2=i("lllyasviel/control_v11p_sd15_openpose"),J2=o("br"),E2=c(),vf=o("td"),C2=i("Trained with human pose estimation"),j2=c(),yf=o("td"),Z2=i("An image with human poses, usually represented as a set of keypoints or skeletons."),N2=c(),wf=o("td"),Gr=o("a"),Bn=o("img"),x2=c(),Mf=o("td"),Wr=o("a"),Dr=o("img"),k2=c(),re=o("tr"),Sr=o("td"),nl=o("a"),$2=i("lllyasviel/control_v11p_sd15_scribble"),G2=o("br"),W2=c(),Tf=o("td"),D2=i("Trained with scribble-based image generation"),S2=c(),Uf=o("td"),B2=i("An image with scribbles, usually random or user-drawn strokes."),P2=c(),If=o("td"),Br=o("a"),Pn=o("img"),F2=c(),Jf=o("td"),Pr=o("a"),Fr=o("img"),R2=c(),ce=o("tr"),Rr=o("td"),ol=o("a"),V2=i("lllyasviel/control_v11p_sd15_softedge"),A2=o("br"),X2=c(),Ef=o("td"),Y2=i("Trained with soft edge image generation"),Q2=c(),Cf=o("td"),L2=i("An image with soft edges, usually to create a more painterly or artistic effect."),z2=c(),jf=o("td"),Vr=o("a"),Fn=o("img"),H2=c(),Zf=o("td"),Ar=o("a"),Xr=o("img"),q2=c(),de=o("tr"),Yr=o("td"),al=o("a"),O2=i("lllyasviel/control_v11e_sd15_shuffle"),K2=o("br"),eM=c(),Nf=o("td"),tM=i("Trained with image shuffling"),nM=c(),xf=o("td"),oM=i("An image with shuffled patches or regions."),aM=c(),kf=o("td"),Qr=o("a"),Rn=o("img"),lM=c(),$f=o("td"),Lr=o("a"),zr=o("img"),sM=c(),pe=o("tr"),Hr=o("td"),ll=o("a"),iM=i("lllyasviel/control_v11f1e_sd15_tile"),rM=o("br"),cM=c(),Gf=o("td"),dM=i("Trained with image tiling"),pM=c(),Wf=o("td"),fM=i("A blurry image or part of an image ."),mM=c(),Df=o("td"),qr=o("a"),Vn=o("img"),uM=c(),Sf=o("td"),Or=o("a"),Kr=o("img"),Qh=c(),St=o("h2"),An=o("a"),Bf=o("span"),g(sl.$$.fragment),hM=c(),Pf=o("span"),gM=i("StableDiffusionControlNetPipeline"),Lh=c(),j=o("div"),g(il.$$.fragment),_M=c(),Ff=o("p"),bM=i("Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),vM=c(),rl=o("p"),yM=i("This model inherits from "),ec=o("a"),wM=i("DiffusionPipeline"),MM=i(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),TM=c(),Rf=o("p"),UM=i("In addition the pipeline inherits the following loading methods:"),IM=c(),Vf=o("ul"),cl=o("li"),Af=o("em"),JM=i("Textual-Inversion"),EM=i(": "),tc=o("a"),CM=i("loaders.TextualInversionLoaderMixin.load_textual_inversion()"),jM=c(),De=o("div"),g(dl.$$.fragment),ZM=c(),Xf=o("p"),NM=i("Function invoked when calling the pipeline for generation."),xM=c(),g(Xn.$$.fragment),kM=c(),Se=o("div"),g(pl.$$.fragment),$M=c(),Yf=o("p"),GM=i("Enable sliced attention computation."),WM=c(),Qf=o("p"),DM=i(`When this option is enabled, the attention module splits the input tensor in slices to compute attention in
several steps. This is useful to save some memory in exchange for a small speed decrease.`),SM=c(),Yn=o("div"),g(fl.$$.fragment),BM=c(),ml=o("p"),PM=i("Disable sliced attention computation. If "),Lf=o("code"),FM=i("enable_attention_slicing"),RM=i(` was previously called, attention is
computed in one step.`),VM=c(),Be=o("div"),g(ul.$$.fragment),AM=c(),zf=o("p"),XM=i("Enable sliced VAE decoding."),YM=c(),Hf=o("p"),QM=i(`When this option is enabled, the VAE will split the input tensor in slices to compute decoding in several
steps. This is useful to save some memory and allow larger batch sizes.`),LM=c(),Qn=o("div"),g(hl.$$.fragment),zM=c(),gl=o("p"),HM=i("Disable sliced VAE decoding. If "),qf=o("code"),qM=i("enable_vae_slicing"),OM=i(` was previously invoked, this method will go back to
computing decoding in one step.`),KM=c(),Q=o("div"),g(_l.$$.fragment),e0=c(),bl=o("p"),t0=i("Enable memory efficient attention from "),vl=o("a"),n0=i("xFormers"),o0=i("."),a0=c(),Of=o("p"),l0=i(`When this option is enabled, you should observe lower GPU memory usage and a potential speed up during
inference. Speed up during training is not guaranteed.`),s0=c(),g(Ln.$$.fragment),i0=c(),g(zn.$$.fragment),r0=c(),Hn=o("div"),g(yl.$$.fragment),c0=c(),wl=o("p"),d0=i("Disable memory efficient attention from "),Ml=o("a"),p0=i("xFormers"),f0=i("."),m0=c(),R=o("div"),g(Tl.$$.fragment),u0=c(),Ul=o("p"),h0=i("Load textual inversion embeddings into the text encoder of "),nc=o("a"),g0=i("StableDiffusionPipeline"),_0=i(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),b0=c(),Kf=o("p"),v0=i("Example:"),y0=c(),g(qn.$$.fragment),w0=c(),Il=o("p"),M0=i(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Jl=o("a"),T0=i("civitAI"),U0=i(") and then load the vector"),I0=c(),g(On.$$.fragment),J0=c(),Kn=o("div"),g(El.$$.fragment),E0=c(),Cl=o("p"),C0=i("Disable tiled VAE decoding. If "),em=o("code"),j0=i("enable_vae_tiling"),Z0=i(` was previously invoked, this method will go back to
computing decoding in one step.`),N0=c(),eo=o("div"),g(jl.$$.fragment),x0=c(),fe=o("p"),k0=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),tm=o("code"),$0=i("enable_sequential_cpu_offload"),G0=i(", this method moves one whole model at a time to the GPU when its "),nm=o("code"),W0=i("forward"),D0=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),om=o("code"),S0=i("enable_sequential_cpu_offload"),B0=i(", but performance is much better due to the iterative execution of the "),am=o("code"),P0=i("unet"),F0=i("."),R0=c(),to=o("div"),g(Zl.$$.fragment),V0=c(),Bt=o("p"),A0=i(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae, controlnet, and safety checker have their state dicts saved to CPU and then are moved to a
`),lm=o("code"),X0=i("torch.device('meta') and loaded to GPU only when their specific submodule has its "),Y0=i("forward"),sm=o("code"),Q0=i("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),L0=i("enable_model_cpu_offload`, but performance is lower."),z0=c(),Pe=o("div"),g(Nl.$$.fragment),H0=c(),im=o("p"),q0=i("Enable tiled VAE decoding."),O0=c(),rm=o("p"),K0=i(`When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and encoding in
several steps. This is useful to save a large amount of memory and to allow the processing of larger images.`),zh=c(),Pt=o("h2"),no=o("a"),cm=o("span"),g(xl.$$.fragment),eT=c(),dm=o("span"),tT=i("StableDiffusionControlNetImg2ImgPipeline"),Hh=c(),Z=o("div"),g(kl.$$.fragment),nT=c(),pm=o("p"),oT=i("Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),aT=c(),$l=o("p"),lT=i("This model inherits from "),oc=o("a"),sT=i("DiffusionPipeline"),iT=i(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),rT=c(),fm=o("p"),cT=i("In addition the pipeline inherits the following loading methods:"),dT=c(),mm=o("ul"),Gl=o("li"),um=o("em"),pT=i("Textual-Inversion"),fT=i(": "),ac=o("a"),mT=i("loaders.TextualInversionLoaderMixin.load_textual_inversion()"),uT=c(),Fe=o("div"),g(Wl.$$.fragment),hT=c(),hm=o("p"),gT=i("Function invoked when calling the pipeline for generation."),_T=c(),g(oo.$$.fragment),bT=c(),Re=o("div"),g(Dl.$$.fragment),vT=c(),gm=o("p"),yT=i("Enable sliced attention computation."),wT=c(),_m=o("p"),MT=i(`When this option is enabled, the attention module splits the input tensor in slices to compute attention in
several steps. This is useful to save some memory in exchange for a small speed decrease.`),TT=c(),ao=o("div"),g(Sl.$$.fragment),UT=c(),Bl=o("p"),IT=i("Disable sliced attention computation. If "),bm=o("code"),JT=i("enable_attention_slicing"),ET=i(` was previously called, attention is
computed in one step.`),CT=c(),Ve=o("div"),g(Pl.$$.fragment),jT=c(),vm=o("p"),ZT=i("Enable sliced VAE decoding."),NT=c(),ym=o("p"),xT=i(`When this option is enabled, the VAE will split the input tensor in slices to compute decoding in several
steps. This is useful to save some memory and allow larger batch sizes.`),kT=c(),lo=o("div"),g(Fl.$$.fragment),$T=c(),Rl=o("p"),GT=i("Disable sliced VAE decoding. If "),wm=o("code"),WT=i("enable_vae_slicing"),DT=i(` was previously invoked, this method will go back to
computing decoding in one step.`),ST=c(),L=o("div"),g(Vl.$$.fragment),BT=c(),Al=o("p"),PT=i("Enable memory efficient attention from "),Xl=o("a"),FT=i("xFormers"),RT=i("."),VT=c(),Mm=o("p"),AT=i(`When this option is enabled, you should observe lower GPU memory usage and a potential speed up during
inference. Speed up during training is not guaranteed.`),XT=c(),g(so.$$.fragment),YT=c(),g(io.$$.fragment),QT=c(),ro=o("div"),g(Yl.$$.fragment),LT=c(),Ql=o("p"),zT=i("Disable memory efficient attention from "),Ll=o("a"),HT=i("xFormers"),qT=i("."),OT=c(),V=o("div"),g(zl.$$.fragment),KT=c(),Hl=o("p"),eU=i("Load textual inversion embeddings into the text encoder of "),lc=o("a"),tU=i("StableDiffusionPipeline"),nU=i(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),oU=c(),Tm=o("p"),aU=i("Example:"),lU=c(),g(co.$$.fragment),sU=c(),ql=o("p"),iU=i(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Ol=o("a"),rU=i("civitAI"),cU=i(") and then load the vector"),dU=c(),g(po.$$.fragment),pU=c(),fo=o("div"),g(Kl.$$.fragment),fU=c(),es=o("p"),mU=i("Disable tiled VAE decoding. If "),Um=o("code"),uU=i("enable_vae_tiling"),hU=i(` was previously invoked, this method will go back to
computing decoding in one step.`),gU=c(),mo=o("div"),g(ts.$$.fragment),_U=c(),me=o("p"),bU=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Im=o("code"),vU=i("enable_sequential_cpu_offload"),yU=i(", this method moves one whole model at a time to the GPU when its "),Jm=o("code"),wU=i("forward"),MU=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Em=o("code"),TU=i("enable_sequential_cpu_offload"),UU=i(", but performance is much better due to the iterative execution of the "),Cm=o("code"),IU=i("unet"),JU=i("."),EU=c(),uo=o("div"),g(ns.$$.fragment),CU=c(),Ft=o("p"),jU=i(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae, controlnet, and safety checker have their state dicts saved to CPU and then are moved to a
`),jm=o("code"),ZU=i("torch.device('meta') and loaded to GPU only when their specific submodule has its "),NU=i("forward"),Zm=o("code"),xU=i("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),kU=i("enable_model_cpu_offload`, but performance is lower."),$U=c(),Ae=o("div"),g(os.$$.fragment),GU=c(),Nm=o("p"),WU=i("Enable tiled VAE decoding."),DU=c(),xm=o("p"),SU=i(`When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and encoding in
several steps. This is useful to save a large amount of memory and to allow the processing of larger images.`),qh=c(),Rt=o("h2"),ho=o("a"),km=o("span"),g(as.$$.fragment),BU=c(),$m=o("span"),PU=i("StableDiffusionControlNetInpaintPipeline"),Oh=c(),E=o("div"),g(ls.$$.fragment),FU=c(),Gm=o("p"),RU=i("Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),VU=c(),ss=o("p"),AU=i("This model inherits from "),sc=o("a"),XU=i("DiffusionPipeline"),YU=i(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),QU=c(),Wm=o("p"),LU=i("In addition the pipeline inherits the following loading methods:"),zU=c(),Dm=o("ul"),is=o("li"),Sm=o("em"),HU=i("Textual-Inversion"),qU=i(": "),ic=o("a"),OU=i("loaders.TextualInversionLoaderMixin.load_textual_inversion()"),KU=c(),g(go.$$.fragment),eI=c(),Xe=o("div"),g(rs.$$.fragment),tI=c(),Bm=o("p"),nI=i("Function invoked when calling the pipeline for generation."),oI=c(),g(_o.$$.fragment),aI=c(),Ye=o("div"),g(cs.$$.fragment),lI=c(),Pm=o("p"),sI=i("Enable sliced attention computation."),iI=c(),Fm=o("p"),rI=i(`When this option is enabled, the attention module splits the input tensor in slices to compute attention in
several steps. This is useful to save some memory in exchange for a small speed decrease.`),cI=c(),bo=o("div"),g(ds.$$.fragment),dI=c(),ps=o("p"),pI=i("Disable sliced attention computation. If "),Rm=o("code"),fI=i("enable_attention_slicing"),mI=i(` was previously called, attention is
computed in one step.`),uI=c(),Qe=o("div"),g(fs.$$.fragment),hI=c(),Vm=o("p"),gI=i("Enable sliced VAE decoding."),_I=c(),Am=o("p"),bI=i(`When this option is enabled, the VAE will split the input tensor in slices to compute decoding in several
steps. This is useful to save some memory and allow larger batch sizes.`),vI=c(),vo=o("div"),g(ms.$$.fragment),yI=c(),us=o("p"),wI=i("Disable sliced VAE decoding. If "),Xm=o("code"),MI=i("enable_vae_slicing"),TI=i(` was previously invoked, this method will go back to
computing decoding in one step.`),UI=c(),z=o("div"),g(hs.$$.fragment),II=c(),gs=o("p"),JI=i("Enable memory efficient attention from "),_s=o("a"),EI=i("xFormers"),CI=i("."),jI=c(),Ym=o("p"),ZI=i(`When this option is enabled, you should observe lower GPU memory usage and a potential speed up during
inference. Speed up during training is not guaranteed.`),NI=c(),g(yo.$$.fragment),xI=c(),g(wo.$$.fragment),kI=c(),Mo=o("div"),g(bs.$$.fragment),$I=c(),vs=o("p"),GI=i("Disable memory efficient attention from "),ys=o("a"),WI=i("xFormers"),DI=i("."),SI=c(),A=o("div"),g(ws.$$.fragment),BI=c(),Ms=o("p"),PI=i("Load textual inversion embeddings into the text encoder of "),rc=o("a"),FI=i("StableDiffusionPipeline"),RI=i(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),VI=c(),Qm=o("p"),AI=i("Example:"),XI=c(),g(To.$$.fragment),YI=c(),Ts=o("p"),QI=i(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Us=o("a"),LI=i("civitAI"),zI=i(") and then load the vector"),HI=c(),g(Uo.$$.fragment),qI=c(),Io=o("div"),g(Is.$$.fragment),OI=c(),Js=o("p"),KI=i("Disable tiled VAE decoding. If "),Lm=o("code"),eJ=i("enable_vae_tiling"),tJ=i(` was previously invoked, this method will go back to
computing decoding in one step.`),nJ=c(),Jo=o("div"),g(Es.$$.fragment),oJ=c(),ue=o("p"),aJ=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),zm=o("code"),lJ=i("enable_sequential_cpu_offload"),sJ=i(", this method moves one whole model at a time to the GPU when its "),Hm=o("code"),iJ=i("forward"),rJ=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),qm=o("code"),cJ=i("enable_sequential_cpu_offload"),dJ=i(", but performance is much better due to the iterative execution of the "),Om=o("code"),pJ=i("unet"),fJ=i("."),mJ=c(),Eo=o("div"),g(Cs.$$.fragment),uJ=c(),Vt=o("p"),hJ=i(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae, controlnet, and safety checker have their state dicts saved to CPU and then are moved to a
`),Km=o("code"),gJ=i("torch.device('meta') and loaded to GPU only when their specific submodule has its "),_J=i("forward"),eu=o("code"),bJ=i("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),vJ=i("enable_model_cpu_offload`, but performance is lower."),yJ=c(),Le=o("div"),g(js.$$.fragment),wJ=c(),tu=o("p"),MJ=i("Enable tiled VAE decoding."),TJ=c(),nu=o("p"),UJ=i(`When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and encoding in
several steps. This is useful to save a large amount of memory and to allow the processing of larger images.`),Kh=c(),At=o("h2"),Co=o("a"),ou=o("span"),g(Zs.$$.fragment),IJ=c(),au=o("span"),JJ=i("FlaxStableDiffusionControlNetPipeline"),eg=c(),he=o("div"),g(Ns.$$.fragment),EJ=c(),lu=o("p"),CJ=i("Pipeline for text-to-image generation using Stable Diffusion with ControlNet Guidance."),jJ=c(),xs=o("p"),ZJ=i("This model inherits from "),su=o("code"),NJ=i("FlaxDiffusionPipeline"),xJ=i(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),kJ=c(),ze=o("div"),g(ks.$$.fragment),$J=c(),iu=o("p"),GJ=i("Function invoked when calling the pipeline for generation."),WJ=c(),g(jo.$$.fragment),this.h()},l(n){const f=n$('[data-svelte="svelte-1phssyn"]',document.head);u=a(f,"META",{name:!0,content:!0}),f.forEach(t),I=d(n),M=a(n,"H1",{class:!0});var $s=l(M);h=a($s,"A",{id:!0,class:!0,href:!0});var ru=l(h);U=a(ru,"SPAN",{});var cu=l(U);_(p.$$.fragment,cu),cu.forEach(t),ru.forEach(t),T=d($s),_t=a($s,"SPAN",{});var du=l(_t);Me=r(du,"Text-to-Image Generation with ControlNet Conditioning"),du.forEach(t),$s.forEach(t),Xt=d(n),H=a(n,"H2",{class:!0});var Gs=l(H);Y=a(Gs,"A",{id:!0,class:!0,href:!0});var pu=l(Y);F=a(pu,"SPAN",{});var fu=l(F);_(xe.$$.fragment,fu),fu.forEach(t),pu.forEach(t),Ds=d(Gs),Yt=a(Gs,"SPAN",{});var mu=l(Yt);k_=r(mu,"Overview"),mu.forEach(t),Gs.forEach(t),Zu=d(n),Fo=a(n,"P",{});var cc=l(Fo);Ro=a(cc,"A",{href:!0,rel:!0});var uu=l(Ro);$_=r(uu,"Adding Conditional Control to Text-to-Image Diffusion Models"),uu.forEach(t),G_=r(cc," by Lvmin Zhang and Maneesh Agrawala."),cc.forEach(t),Nu=d(n),Ss=a(n,"P",{});var hu=l(Ss);W_=r(hu,"Using the pretrained models we can provide control images (for example, a depth map) to control Stable Diffusion text-to-image generation so that it follows the structure of the depth image and fills in the details."),hu.forEach(t),xu=d(n),Bs=a(n,"P",{});var gu=l(Bs);D_=r(gu,"The abstract of the paper is the following:"),gu.forEach(t),ku=d(n),Ps=a(n,"P",{});var _u=l(Ps);Gc=a(_u,"EM",{});var bu=l(Gc);S_=r(bu,"We present a neural network structure, ControlNet, to control pretrained large diffusion models to support additional input conditions. The ControlNet learns task-specific conditions in an end-to-end way, and the learning is robust even when the training dataset is small (< 50k). Moreover, training a ControlNet is as fast as fine-tuning a diffusion model, and the model can be trained on a personal devices. Alternatively, if powerful computation clusters are available, the model can scale to large amounts (millions to billions) of data. We report that large diffusion models like Stable Diffusion can be augmented with ControlNets to enable conditional inputs like edge maps, segmentation maps, keypoints, etc. This may enrich the methods to control large diffusion models and further facilitate related applications."),bu.forEach(t),_u.forEach(t),$u=d(n),Qt=a(n,"P",{});var Ws=l(Qt);B_=r(Ws,"This model was contributed by the community contributor "),Vo=a(Ws,"A",{href:!0,rel:!0});var vu=l(Vo);P_=r(vu,"takuma104"),vu.forEach(t),F_=r(Ws," \u2764\uFE0F ."),Ws.forEach(t),Gu=d(n),Fs=a(n,"P",{});var yu=l(Fs);R_=r(yu,"Resources:"),yu.forEach(t),Wu=d(n),Lt=a(n,"UL",{});var ng=l(Lt);Wc=a(ng,"LI",{});var qE=l(Wc);Ao=a(qE,"A",{href:!0,rel:!0});var OE=l(Ao);V_=r(OE,"Paper"),OE.forEach(t),qE.forEach(t),A_=d(ng),Dc=a(ng,"LI",{});var KE=l(Dc);Xo=a(KE,"A",{href:!0,rel:!0});var eC=l(Xo);X_=r(eC,"Original Code"),eC.forEach(t),KE.forEach(t),ng.forEach(t),Du=d(n),bt=a(n,"H2",{class:!0});var og=l(bt);zt=a(og,"A",{id:!0,class:!0,href:!0});var tC=l(zt);Sc=a(tC,"SPAN",{});var nC=l(Sc);_(Yo.$$.fragment,nC),nC.forEach(t),tC.forEach(t),Y_=d(og),Bc=a(og,"SPAN",{});var oC=l(Bc);Q_=r(oC,"Available Pipelines:"),oC.forEach(t),og.forEach(t),Su=d(n),Ht=a(n,"TABLE",{});var ag=l(Ht);Pc=a(ag,"THEAD",{});var aC=l(Pc);vt=a(aC,"TR",{});var dc=l(vt);Fc=a(dc,"TH",{});var lC=l(Fc);L_=r(lC,"Pipeline"),lC.forEach(t),z_=d(dc),Rc=a(dc,"TH",{});var sC=l(Rc);H_=r(sC,"Tasks"),sC.forEach(t),q_=d(dc),Rs=a(dc,"TH",{align:!0});var iC=l(Rs);O_=r(iC,"Demo"),iC.forEach(t),dc.forEach(t),aC.forEach(t),K_=d(ag),yt=a(ag,"TBODY",{});var pc=l(yt);wt=a(pc,"TR",{});var fc=l(wt);Vc=a(fc,"TD",{});var rC=l(Vc);Qo=a(rC,"A",{href:!0,rel:!0});var cC=l(Qo);eb=r(cC,"StableDiffusionControlNetPipeline"),cC.forEach(t),rC.forEach(t),tb=d(fc),Ac=a(fc,"TD",{});var dC=l(Ac);Xc=a(dC,"EM",{});var pC=l(Xc);nb=r(pC,"Text-to-Image Generation with ControlNet Conditioning"),pC.forEach(t),dC.forEach(t),ob=d(fc),Vs=a(fc,"TD",{align:!0});var fC=l(Vs);Lo=a(fC,"A",{href:!0,rel:!0});var mC=l(Lo);ab=r(mC,"Colab Example"),mC.forEach(t),fC.forEach(t),fc.forEach(t),lb=d(pc),Mt=a(pc,"TR",{});var mc=l(Mt);Yc=a(mc,"TD",{});var uC=l(Yc);zo=a(uC,"A",{href:!0,rel:!0});var hC=l(zo);sb=r(hC,"StableDiffusionControlNetImg2ImgPipeline"),hC.forEach(t),uC.forEach(t),ib=d(mc),Qc=a(mc,"TD",{});var gC=l(Qc);Lc=a(gC,"EM",{});var _C=l(Lc);rb=r(_C,"Image-to-Image Generation with ControlNet Conditioning"),_C.forEach(t),gC.forEach(t),cb=d(mc),zc=a(mc,"TD",{align:!0}),l(zc).forEach(t),mc.forEach(t),db=d(pc),Tt=a(pc,"TR",{});var uc=l(Tt);Hc=a(uc,"TD",{});var bC=l(Hc);Ho=a(bC,"A",{href:!0,rel:!0});var vC=l(Ho);pb=r(vC,"StableDiffusionControlNetInpaintPipeline"),vC.forEach(t),bC.forEach(t),fb=d(uc),qc=a(uc,"TD",{});var yC=l(qc);Oc=a(yC,"EM",{});var wC=l(Oc);mb=r(wC,"Inpainting Generation with ControlNet Conditioning"),wC.forEach(t),yC.forEach(t),ub=d(uc),Kc=a(uc,"TD",{align:!0}),l(Kc).forEach(t),uc.forEach(t),pc.forEach(t),ag.forEach(t),Bu=d(n),Ut=a(n,"H2",{class:!0});var lg=l(Ut);qt=a(lg,"A",{id:!0,class:!0,href:!0});var MC=l(qt);ed=a(MC,"SPAN",{});var TC=l(ed);_(qo.$$.fragment,TC),TC.forEach(t),MC.forEach(t),hb=d(lg),td=a(lg,"SPAN",{});var UC=l(td);gb=r(UC,"Usage example"),UC.forEach(t),lg.forEach(t),Pu=d(n),Ot=a(n,"P",{});var sg=l(Ot);_b=r(sg,"In the following we give a simple example of how to use a "),nd=a(sg,"EM",{});var IC=l(nd);bb=r(IC,"ControlNet"),IC.forEach(t),vb=r(sg,` checkpoint with Diffusers for inference.
The inference pipeline is the same for all pipelines:`),sg.forEach(t),Fu=d(n),Kt=a(n,"UL",{});var ig=l(Kt);od=a(ig,"LI",{});var JC=l(od);ad=a(JC,"OL",{});var EC=l(ad);ld=a(EC,"LI",{});var CC=l(ld);yb=r(CC,"Take an image and run it through a pre-conditioning processor."),CC.forEach(t),EC.forEach(t),JC.forEach(t),wb=d(ig),sd=a(ig,"LI",{});var jC=l(sd);As=a(jC,"OL",{start:!0});var ZC=l(As);Oo=a(ZC,"LI",{});var rg=l(Oo);Mb=r(rg,"Run the pre-processed image through the "),Xs=a(rg,"A",{href:!0});var NC=l(Xs);Tb=r(NC,"StableDiffusionControlNetPipeline"),NC.forEach(t),Ub=r(rg,"."),rg.forEach(t),ZC.forEach(t),jC.forEach(t),ig.forEach(t),Ru=d(n),en=a(n,"P",{});var cg=l(en);Ib=r(cg,"Let\u2019s have a look at a simple example using the "),Ko=a(cg,"A",{href:!0,rel:!0});var xC=l(Ko);Jb=r(xC,"Canny Edge ControlNet"),xC.forEach(t),Eb=r(cg,"."),cg.forEach(t),Vu=d(n),_(ea.$$.fragment,n),Au=d(n),Ys=a(n,"P",{});var kC=l(Ys);Qs=a(kC,"IMG",{src:!0,alt:!0}),kC.forEach(t),Xu=d(n),ke=a(n,"P",{});var hc=l(ke);Cb=r(hc,"Next, we process the image to get the canny image. This is step "),id=a(hc,"EM",{});var $C=l(id);jb=r($C,"1."),$C.forEach(t),Zb=r(hc," - running the pre-conditioning processor. The pre-conditioning processor is different for every ControlNet. Please see the model cards of the "),Ls=a(hc,"A",{href:!0});var GC=l(Ls);Nb=r(GC,"official checkpoints"),GC.forEach(t),xb=r(hc," for more information about other models."),hc.forEach(t),Yu=d(n),zs=a(n,"P",{});var WC=l(zs);kb=r(WC,"First, we need to install opencv:"),WC.forEach(t),Qu=d(n),_(ta.$$.fragment,n),Lu=d(n),Hs=a(n,"P",{});var DC=l(Hs);$b=r(DC,"Next, let\u2019s also install all required Hugging Face libraries:"),DC.forEach(t),zu=d(n),_(na.$$.fragment,n),Hu=d(n),qs=a(n,"P",{});var SC=l(qs);Gb=r(SC,"Then we can retrieve the canny edges of the image."),SC.forEach(t),qu=d(n),_(oa.$$.fragment,n),Ou=d(n),Os=a(n,"P",{});var BC=l(Os);Wb=r(BC,"Let\u2019s take a look at the processed image."),BC.forEach(t),Ku=d(n),Ks=a(n,"P",{});var PC=l(Ks);ei=a(PC,"IMG",{src:!0,alt:!0}),PC.forEach(t),eh=d(n),tn=a(n,"P",{});var dg=l(tn);Db=r(dg,"Now, we load the official "),ti=a(dg,"A",{href:!0});var FC=l(ti);Sb=r(FC,"Stable Diffusion 1.5 Model"),FC.forEach(t),Bb=r(dg," as well as the ControlNet for canny edges."),dg.forEach(t),th=d(n),_(aa.$$.fragment,n),nh=d(n),nn=a(n,"P",{});var pg=l(nn);Pb=r(pg,"To speed-up things and reduce memory, let\u2019s enable model offloading and use the fast "),ni=a(pg,"A",{href:!0});var RC=l(ni);Fb=r(RC,"UniPCMultistepScheduler"),RC.forEach(t),Rb=r(pg,"."),pg.forEach(t),oh=d(n),_(la.$$.fragment,n),ah=d(n),oi=a(n,"P",{});var VC=l(oi);Vb=r(VC,"Finally, we can run the pipeline:"),VC.forEach(t),lh=d(n),_(sa.$$.fragment,n),sh=d(n),ai=a(n,"P",{});var AC=l(ai);Ab=r(AC,"This should take only around 3-4 seconds on GPU (depending on hardware). The output image then looks as follows:"),AC.forEach(t),ih=d(n),li=a(n,"P",{});var XC=l(li);si=a(XC,"IMG",{src:!0,alt:!0}),XC.forEach(t),rh=d(n),It=a(n,"P",{});var wu=l(It);rd=a(wu,"STRONG",{});var YC=l(rd);Xb=r(YC,"Note"),YC.forEach(t),Yb=r(wu,": To see how to run all other ControlNet checkpoints, please have a look at "),ii=a(wu,"A",{href:!0});var QC=l(ii);Qb=r(QC,"ControlNet with Stable Diffusion 1.5"),QC.forEach(t),Lb=r(wu,"."),wu.forEach(t),ch=d(n),Jt=a(n,"H2",{class:!0});var fg=l(Jt);on=a(fg,"A",{id:!0,class:!0,href:!0});var LC=l(on);cd=a(LC,"SPAN",{});var zC=l(cd);_(ia.$$.fragment,zC),zC.forEach(t),LC.forEach(t),zb=d(fg),dd=a(fg,"SPAN",{});var HC=l(dd);Hb=r(HC,"Combining multiple conditionings"),HC.forEach(t),fg.forEach(t),dh=d(n),an=a(n,"P",{});var mg=l(an);qb=r(mg,"Multiple ControlNet conditionings can be combined for a single image generation. Pass a list of ControlNets to the pipeline\u2019s constructor and a corresponding list of conditionings to "),pd=a(mg,"CODE",{});var qC=l(pd);Ob=r(qC,"__call__"),qC.forEach(t),Kb=r(mg,"."),mg.forEach(t),ph=d(n),ri=a(n,"P",{});var OC=l(ri);ev=r(OC,"When combining conditionings, it is helpful to mask conditionings such that they do not overlap. In the example, we mask the middle of the canny map where the pose conditioning is located."),OC.forEach(t),fh=d(n),ln=a(n,"P",{});var ug=l(ln);tv=r(ug,"It can also be helpful to vary the "),fd=a(ug,"CODE",{});var KC=l(fd);nv=r(KC,"controlnet_conditioning_scales"),KC.forEach(t),ov=r(ug," to emphasize one conditioning over the other."),ug.forEach(t),mh=d(n),Et=a(n,"H3",{class:!0});var hg=l(Et);sn=a(hg,"A",{id:!0,class:!0,href:!0});var e5=l(sn);md=a(e5,"SPAN",{});var t5=l(md);_(ra.$$.fragment,t5),t5.forEach(t),e5.forEach(t),av=d(hg),ud=a(hg,"SPAN",{});var n5=l(ud);lv=r(n5,"Canny conditioning"),n5.forEach(t),hg.forEach(t),uh=d(n),ci=a(n,"P",{});var o5=l(ci);sv=r(o5,"The original image:"),o5.forEach(t),hh=d(n),di=a(n,"IMG",{src:!0}),gh=d(n),pi=a(n,"P",{});var a5=l(pi);iv=r(a5,"Prepare the conditioning:"),a5.forEach(t),_h=d(n),_(ca.$$.fragment,n),bh=d(n),fi=a(n,"IMG",{src:!0}),vh=d(n),Ct=a(n,"H3",{class:!0});var gg=l(Ct);rn=a(gg,"A",{id:!0,class:!0,href:!0});var l5=l(rn);hd=a(l5,"SPAN",{});var s5=l(hd);_(da.$$.fragment,s5),s5.forEach(t),l5.forEach(t),rv=d(gg),gd=a(gg,"SPAN",{});var i5=l(gd);cv=r(i5,"Openpose conditioning"),i5.forEach(t),gg.forEach(t),yh=d(n),mi=a(n,"P",{});var r5=l(mi);dv=r(r5,"The original image:"),r5.forEach(t),wh=d(n),pa=a(n,"IMG",{src:!0,width:!0}),Mh=d(n),ui=a(n,"P",{});var c5=l(ui);pv=r(c5,"Prepare the conditioning:"),c5.forEach(t),Th=d(n),_(fa.$$.fragment,n),Uh=d(n),ma=a(n,"IMG",{src:!0,width:!0}),Ih=d(n),jt=a(n,"H3",{class:!0});var _g=l(jt);cn=a(_g,"A",{id:!0,class:!0,href:!0});var d5=l(cn);_d=a(d5,"SPAN",{});var p5=l(_d);_(ua.$$.fragment,p5),p5.forEach(t),d5.forEach(t),fv=d(_g),bd=a(_g,"SPAN",{});var f5=l(bd);mv=r(f5,"Running ControlNet with multiple conditionings"),f5.forEach(t),_g.forEach(t),Jh=d(n),_(ha.$$.fragment,n),Eh=d(n),ga=a(n,"IMG",{src:!0,width:!0}),Ch=d(n),Zt=a(n,"H3",{class:!0});var bg=l(Zt);dn=a(bg,"A",{id:!0,class:!0,href:!0});var m5=l(dn);vd=a(m5,"SPAN",{});var u5=l(vd);_(_a.$$.fragment,u5),u5.forEach(t),m5.forEach(t),uv=d(bg),yd=a(bg,"SPAN",{});var h5=l(yd);hv=r(h5,"Guess Mode"),h5.forEach(t),bg.forEach(t),jh=d(n),$e=a(n,"P",{});var gc=l($e);gv=r(gc,"Guess Mode is "),ba=a(gc,"A",{href:!0,rel:!0});var g5=l(ba);_v=r(g5,"a ControlNet feature that was implemented"),g5.forEach(t),bv=r(gc," after the publication of "),va=a(gc,"A",{href:!0,rel:!0});var _5=l(va);vv=r(_5,"the paper"),_5.forEach(t),yv=r(gc,". The description states:"),gc.forEach(t),Zh=d(n),hi=a(n,"BLOCKQUOTE",{});var b5=l(hi);wd=a(b5,"P",{});var v5=l(wd);wv=r(v5,"In this mode, the ControlNet encoder will try best to recognize the content of the input control map, like depth map, edge map, scribbles, etc, even if you remove all prompts."),v5.forEach(t),b5.forEach(t),Nh=d(n),Nt=a(n,"H4",{class:!0});var vg=l(Nt);pn=a(vg,"A",{id:!0,class:!0,href:!0});var y5=l(pn);Md=a(y5,"SPAN",{});var w5=l(Md);_(ya.$$.fragment,w5),w5.forEach(t),y5.forEach(t),Mv=d(vg),Td=a(vg,"SPAN",{});var M5=l(Td);Tv=r(M5,"The core implementation:"),M5.forEach(t),vg.forEach(t),xh=d(n),Ge=a(n,"P",{});var _c=l(Ge);Uv=r(_c,"It adjusts the scale of the output residuals from ControlNet by a fixed ratio depending on the block depth. The shallowest DownBlock corresponds to "),Ud=a(_c,"CODE",{});var T5=l(Ud);Iv=r(T5,"0.1"),T5.forEach(t),Jv=r(_c,". As the blocks get deeper, the scale increases exponentially, and the scale for the output of the MidBlock becomes "),Id=a(_c,"CODE",{});var U5=l(Id);Ev=r(U5,"1.0"),U5.forEach(t),Cv=r(_c,"."),_c.forEach(t),kh=d(n),fn=a(n,"P",{});var yg=l(fn);jv=r(yg,"Since the core implementation is just this, "),Jd=a(yg,"STRONG",{});var I5=l(Jd);Zv=r(I5,"it does not have any impact on prompt conditioning"),I5.forEach(t),Nv=r(yg,". While it is common to use it without specifying any prompts, it is also possible to provide prompts if desired."),yg.forEach(t),$h=d(n),xt=a(n,"H4",{class:!0});var wg=l(xt);mn=a(wg,"A",{id:!0,class:!0,href:!0});var J5=l(mn);Ed=a(J5,"SPAN",{});var E5=l(Ed);_(wa.$$.fragment,E5),E5.forEach(t),J5.forEach(t),xv=d(wg),Cd=a(wg,"SPAN",{});var C5=l(Cd);kv=r(C5,"Usage:"),C5.forEach(t),wg.forEach(t),Gh=d(n),be=a(n,"P",{});var Zo=l(be);$v=r(Zo,"Just specify "),jd=a(Zo,"CODE",{});var j5=l(jd);Gv=r(j5,"guess_mode=True"),j5.forEach(t),Wv=r(Zo," in the pipe() function. A "),Zd=a(Zo,"CODE",{});var Z5=l(Zd);Dv=r(Z5,"guidance_scale"),Z5.forEach(t),Sv=r(Zo," between 3.0 and 5.0 is "),Ma=a(Zo,"A",{href:!0,rel:!0});var N5=l(Ma);Bv=r(N5,"recommended"),N5.forEach(t),Pv=r(Zo,"."),Zo.forEach(t),Wh=d(n),_(Ta.$$.fragment,n),Dh=d(n),kt=a(n,"H4",{class:!0});var Mg=l(kt);un=a(Mg,"A",{id:!0,class:!0,href:!0});var x5=l(un);Nd=a(x5,"SPAN",{});var k5=l(Nd);_(Ua.$$.fragment,k5),k5.forEach(t),x5.forEach(t),Fv=d(Mg),xd=a(Mg,"SPAN",{});var $5=l(xd);Rv=r($5,"Output image comparison:"),$5.forEach(t),Mg.forEach(t),Sh=r(n,`

Canny Control Example
`),hn=a(n,"TABLE",{});var Tg=l(hn);kd=a(Tg,"THEAD",{});var G5=l(kd);Ia=a(G5,"TR",{});var Ug=l(Ia);$d=a(Ug,"TH",{});var W5=l($d);Vv=r(W5,"no guess_mode with prompt"),W5.forEach(t),Av=d(Ug),Gd=a(Ug,"TH",{});var D5=l(Gd);Xv=r(D5,"guess_mode without prompt"),D5.forEach(t),Ug.forEach(t),G5.forEach(t),Yv=d(Tg),Wd=a(Tg,"TBODY",{});var S5=l(Wd);Ja=a(S5,"TR",{});var Ig=l(Ja);Dd=a(Ig,"TD",{});var B5=l(Dd);gi=a(B5,"A",{href:!0});var P5=l(gi);_i=a(P5,"IMG",{width:!0,src:!0}),P5.forEach(t),B5.forEach(t),Qv=d(Ig),Sd=a(Ig,"TD",{});var F5=l(Sd);bi=a(F5,"A",{href:!0});var R5=l(bi);vi=a(R5,"IMG",{width:!0,src:!0}),R5.forEach(t),F5.forEach(t),Ig.forEach(t),S5.forEach(t),Tg.forEach(t),Bh=d(n),$t=a(n,"H2",{class:!0});var Jg=l($t);gn=a(Jg,"A",{id:!0,class:!0,href:!0});var V5=l(gn);Bd=a(V5,"SPAN",{});var A5=l(Bd);_(Ea.$$.fragment,A5),A5.forEach(t),V5.forEach(t),Lv=d(Jg),Pd=a(Jg,"SPAN",{});var X5=l(Pd);zv=r(X5,"Available checkpoints"),X5.forEach(t),Jg.forEach(t),Ph=d(n),We=a(n,"P",{});var bc=l(We);Hv=r(bc,"ControlNet requires a "),Fd=a(bc,"EM",{});var Y5=l(Fd);qv=r(Y5,"control image"),Y5.forEach(t),Ov=r(bc," in addition to the text-to-image "),Rd=a(bc,"EM",{});var Q5=l(Rd);Kv=r(Q5,"prompt"),Q5.forEach(t),ey=r(bc,`.
Each pretrained model is trained using a different conditioning method that requires different images for conditioning the generated outputs. For example, Canny edge conditioning requires the control image to be the output of a Canny filter, while depth conditioning requires the control image to be a depth map. See the overview and image examples below to know more.`),bc.forEach(t),Fh=d(n),_n=a(n,"P",{});var Eg=l(_n);ty=r(Eg,"All checkpoints can be found under the authors\u2019 namespace "),Ca=a(Eg,"A",{href:!0,rel:!0});var L5=l(Ca);ny=r(L5,"lllyasviel"),L5.forEach(t),oy=r(Eg,"."),Eg.forEach(t),Rh=d(n),Gt=a(n,"P",{});var Mu=l(Gt);Vd=a(Mu,"STRONG",{});var z5=l(Vd);ay=r(z5,"13.04.2024 Update"),z5.forEach(t),ly=r(Mu,": The author has released improved controlnet checkpoints v1.1 - see "),yi=a(Mu,"A",{href:!0});var H5=l(yi);sy=r(H5,"here"),H5.forEach(t),iy=r(Mu,"."),Mu.forEach(t),Vh=d(n),Wt=a(n,"H3",{class:!0});var Cg=l(Wt);bn=a(Cg,"A",{id:!0,class:!0,href:!0});var q5=l(bn);Ad=a(q5,"SPAN",{});var O5=l(Ad);_(ja.$$.fragment,O5),O5.forEach(t),q5.forEach(t),ry=d(Cg),Xd=a(Cg,"SPAN",{});var K5=l(Xd);cy=r(K5,"ControlNet v1.0"),K5.forEach(t),Cg.forEach(t),Ah=d(n),vn=a(n,"TABLE",{});var jg=l(vn);Yd=a(jg,"THEAD",{});var ej=l(Yd);Te=a(ej,"TR",{});var No=l(Te);Qd=a(No,"TH",{});var tj=l(Qd);dy=r(tj,"Model Name"),tj.forEach(t),py=d(No),Ld=a(No,"TH",{});var nj=l(Ld);fy=r(nj,"Control Image Overview"),nj.forEach(t),my=d(No),zd=a(No,"TH",{});var oj=l(zd);uy=r(oj,"Control Image Example"),oj.forEach(t),hy=d(No),Hd=a(No,"TH",{});var aj=l(Hd);gy=r(aj,"Generated Image Example"),aj.forEach(t),No.forEach(t),ej.forEach(t),_y=d(jg),B=a(jg,"TBODY",{});var X=l(B);Ue=a(X,"TR",{});var xo=l(Ue);yn=a(xo,"TD",{});var Tu=l(yn);Za=a(Tu,"A",{href:!0,rel:!0});var lj=l(Za);by=r(lj,"lllyasviel/sd-controlnet-canny"),lj.forEach(t),vy=a(Tu,"BR",{}),yy=d(Tu),qd=a(Tu,"EM",{});var sj=l(qd);wy=r(sj,"Trained with canny edge detection"),sj.forEach(t),Tu.forEach(t),My=d(xo),Od=a(xo,"TD",{});var ij=l(Od);Ty=r(ij,"A monochrome image with white edges on a black background."),ij.forEach(t),Uy=d(xo),Kd=a(xo,"TD",{});var rj=l(Kd);wi=a(rj,"A",{href:!0});var cj=l(wi);wn=a(cj,"IMG",{width:!0,style:!0,src:!0}),cj.forEach(t),rj.forEach(t),Iy=d(xo),ep=a(xo,"TD",{});var dj=l(ep);Mi=a(dj,"A",{href:!0});var pj=l(Mi);Ti=a(pj,"IMG",{width:!0,src:!0}),pj.forEach(t),dj.forEach(t),xo.forEach(t),Jy=d(X),Ie=a(X,"TR",{});var ko=l(Ie);Mn=a(ko,"TD",{});var Uu=l(Mn);Na=a(Uu,"A",{href:!0,rel:!0});var fj=l(Na);Ey=r(fj,"lllyasviel/sd-controlnet-depth"),fj.forEach(t),Cy=a(Uu,"BR",{}),jy=d(Uu),tp=a(Uu,"EM",{});var mj=l(tp);Zy=r(mj,"Trained with Midas depth estimation"),mj.forEach(t),Uu.forEach(t),Ny=d(ko),np=a(ko,"TD",{});var uj=l(np);xy=r(uj,"A grayscale image with black representing deep areas and white representing shallow areas."),uj.forEach(t),ky=d(ko),op=a(ko,"TD",{});var hj=l(op);Ui=a(hj,"A",{href:!0});var gj=l(Ui);Ii=a(gj,"IMG",{width:!0,src:!0}),gj.forEach(t),hj.forEach(t),$y=d(ko),ap=a(ko,"TD",{});var _j=l(ap);Ji=a(_j,"A",{href:!0});var bj=l(Ji);Ei=a(bj,"IMG",{width:!0,src:!0}),bj.forEach(t),_j.forEach(t),ko.forEach(t),Gy=d(X),Je=a(X,"TR",{});var $o=l(Je);Tn=a($o,"TD",{});var Iu=l(Tn);xa=a(Iu,"A",{href:!0,rel:!0});var vj=l(xa);Wy=r(vj,"lllyasviel/sd-controlnet-hed"),vj.forEach(t),Dy=a(Iu,"BR",{}),Sy=d(Iu),lp=a(Iu,"EM",{});var yj=l(lp);By=r(yj,"Trained with HED edge detection (soft edge)"),yj.forEach(t),Iu.forEach(t),Py=d($o),sp=a($o,"TD",{});var wj=l(sp);Fy=r(wj,"A monochrome image with white soft edges on a black background."),wj.forEach(t),Ry=d($o),ip=a($o,"TD",{});var Mj=l(ip);Ci=a(Mj,"A",{href:!0});var Tj=l(Ci);ji=a(Tj,"IMG",{width:!0,src:!0}),Tj.forEach(t),Mj.forEach(t),Vy=d($o),rp=a($o,"TD",{});var Uj=l(rp);Zi=a(Uj,"A",{href:!0});var Ij=l(Zi);Ni=a(Ij,"IMG",{width:!0,src:!0}),Ij.forEach(t),Uj.forEach(t),$o.forEach(t),Ay=d(X),Ee=a(X,"TR",{});var Go=l(Ee);Un=a(Go,"TD",{});var Ju=l(Un);ka=a(Ju,"A",{href:!0,rel:!0});var Jj=l(ka);Xy=r(Jj,"lllyasviel/sd-controlnet-mlsd"),Jj.forEach(t),Yy=a(Ju,"BR",{}),Qy=d(Ju),cp=a(Ju,"EM",{});var Ej=l(cp);Ly=r(Ej,"Trained with M-LSD line detection"),Ej.forEach(t),Ju.forEach(t),zy=d(Go),dp=a(Go,"TD",{});var Cj=l(dp);Hy=r(Cj,"A monochrome image composed only of white straight lines on a black background."),Cj.forEach(t),qy=d(Go),pp=a(Go,"TD",{});var jj=l(pp);xi=a(jj,"A",{href:!0});var Zj=l(xi);ki=a(Zj,"IMG",{width:!0,src:!0}),Zj.forEach(t),jj.forEach(t),Oy=d(Go),fp=a(Go,"TD",{});var Nj=l(fp);$i=a(Nj,"A",{href:!0});var xj=l($i);Gi=a(xj,"IMG",{width:!0,src:!0}),xj.forEach(t),Nj.forEach(t),Go.forEach(t),Ky=d(X),Ce=a(X,"TR",{});var Wo=l(Ce);In=a(Wo,"TD",{});var Eu=l(In);$a=a(Eu,"A",{href:!0,rel:!0});var kj=l($a);e1=r(kj,"lllyasviel/sd-controlnet-normal"),kj.forEach(t),t1=a(Eu,"BR",{}),n1=d(Eu),mp=a(Eu,"EM",{});var $j=l(mp);o1=r($j,"Trained with normal map"),$j.forEach(t),Eu.forEach(t),a1=d(Wo),Ga=a(Wo,"TD",{});var Zg=l(Ga);l1=r(Zg,"A "),Wa=a(Zg,"A",{href:!0,rel:!0});var Gj=l(Wa);s1=r(Gj,"normal mapped"),Gj.forEach(t),i1=r(Zg," image."),Zg.forEach(t),r1=d(Wo),up=a(Wo,"TD",{});var Wj=l(up);Wi=a(Wj,"A",{href:!0});var Dj=l(Wi);Di=a(Dj,"IMG",{width:!0,src:!0}),Dj.forEach(t),Wj.forEach(t),c1=d(Wo),hp=a(Wo,"TD",{});var Sj=l(hp);Si=a(Sj,"A",{href:!0});var Bj=l(Si);Bi=a(Bj,"IMG",{width:!0,src:!0}),Bj.forEach(t),Sj.forEach(t),Wo.forEach(t),d1=d(X),je=a(X,"TR",{});var Do=l(je);Jn=a(Do,"TD",{});var Cu=l(Jn);Da=a(Cu,"A",{href:!0,rel:!0});var Pj=l(Da);p1=r(Pj,"lllyasviel/sd-controlnet-openpose"),Pj.forEach(t),f1=a(Cu,"BR",{}),m1=d(Cu),gp=a(Cu,"EM",{});var Fj=l(gp);u1=r(Fj,"Trained with OpenPose bone image"),Fj.forEach(t),Cu.forEach(t),h1=d(Do),Sa=a(Do,"TD",{});var Ng=l(Sa);g1=r(Ng,"A "),Ba=a(Ng,"A",{href:!0,rel:!0});var Rj=l(Ba);_1=r(Rj,"OpenPose bone"),Rj.forEach(t),b1=r(Ng," image."),Ng.forEach(t),v1=d(Do),_p=a(Do,"TD",{});var Vj=l(_p);Pi=a(Vj,"A",{href:!0});var Aj=l(Pi);Fi=a(Aj,"IMG",{width:!0,src:!0}),Aj.forEach(t),Vj.forEach(t),y1=d(Do),bp=a(Do,"TD",{});var Xj=l(bp);Ri=a(Xj,"A",{href:!0});var Yj=l(Ri);Vi=a(Yj,"IMG",{width:!0,src:!0}),Yj.forEach(t),Xj.forEach(t),Do.forEach(t),w1=d(X),Ze=a(X,"TR",{});var So=l(Ze);En=a(So,"TD",{});var ju=l(En);Pa=a(ju,"A",{href:!0,rel:!0});var Qj=l(Pa);M1=r(Qj,"lllyasviel/sd-controlnet-scribble"),Qj.forEach(t),T1=a(ju,"BR",{}),U1=d(ju),vp=a(ju,"EM",{});var Lj=l(vp);I1=r(Lj,"Trained with human scribbles"),Lj.forEach(t),ju.forEach(t),J1=d(So),yp=a(So,"TD",{});var zj=l(yp);E1=r(zj,"A hand-drawn monochrome image with white outlines on a black background."),zj.forEach(t),C1=d(So),wp=a(So,"TD",{});var Hj=l(wp);Ai=a(Hj,"A",{href:!0});var qj=l(Ai);Xi=a(qj,"IMG",{width:!0,src:!0}),qj.forEach(t),Hj.forEach(t),j1=d(So),Mp=a(So,"TD",{});var Oj=l(Mp);Yi=a(Oj,"A",{href:!0});var Kj=l(Yi);Qi=a(Kj,"IMG",{width:!0,src:!0}),Kj.forEach(t),Oj.forEach(t),So.forEach(t),Z1=d(X),Ne=a(X,"TR",{});var Bo=l(Ne);Fa=a(Bo,"TD",{});var xg=l(Fa);Ra=a(xg,"A",{href:!0,rel:!0});var eZ=l(Ra);N1=r(eZ,"lllyasviel/sd-controlnet-seg"),eZ.forEach(t),x1=a(xg,"BR",{}),Tp=a(xg,"EM",{});var tZ=l(Tp);k1=r(tZ,"Trained with semantic segmentation"),tZ.forEach(t),xg.forEach(t),$1=d(Bo),Va=a(Bo,"TD",{});var kg=l(Va);G1=r(kg,"An "),Aa=a(kg,"A",{href:!0,rel:!0});var nZ=l(Aa);W1=r(nZ,"ADE20K"),nZ.forEach(t),D1=r(kg,"\u2019s segmentation protocol image."),kg.forEach(t),S1=d(Bo),Up=a(Bo,"TD",{});var oZ=l(Up);Li=a(oZ,"A",{href:!0});var aZ=l(Li);zi=a(aZ,"IMG",{width:!0,src:!0}),aZ.forEach(t),oZ.forEach(t),B1=d(Bo),Ip=a(Bo,"TD",{});var lZ=l(Ip);Hi=a(lZ,"A",{href:!0});var sZ=l(Hi);qi=a(sZ,"IMG",{width:!0,src:!0}),sZ.forEach(t),lZ.forEach(t),Bo.forEach(t),X.forEach(t),jg.forEach(t),Xh=d(n),Dt=a(n,"H3",{class:!0});var $g=l(Dt);Cn=a($g,"A",{id:!0,class:!0,href:!0});var iZ=l(Cn);Jp=a(iZ,"SPAN",{});var rZ=l(Jp);_(Xa.$$.fragment,rZ),rZ.forEach(t),iZ.forEach(t),P1=d($g),Ep=a($g,"SPAN",{});var cZ=l(Ep);F1=r(cZ,"ControlNet v1.1"),cZ.forEach(t),$g.forEach(t),Yh=d(n),jn=a(n,"TABLE",{});var Gg=l(jn);Cp=a(Gg,"THEAD",{});var dZ=l(Cp);q=a(dZ,"TR",{});var He=l(q);jp=a(He,"TH",{});var pZ=l(jp);R1=r(pZ,"Model Name"),pZ.forEach(t),V1=d(He),Zp=a(He,"TH",{});var fZ=l(Zp);A1=r(fZ,"Control Image Overview"),fZ.forEach(t),X1=d(He),Np=a(He,"TH",{});var mZ=l(Np);Y1=r(mZ,"Condition Image"),mZ.forEach(t),Q1=d(He),xp=a(He,"TH",{});var uZ=l(xp);L1=r(uZ,"Control Image Example"),uZ.forEach(t),z1=d(He),kp=a(He,"TH",{});var hZ=l(kp);H1=r(hZ,"Generated Image Example"),hZ.forEach(t),He.forEach(t),dZ.forEach(t),q1=d(Gg),G=a(Gg,"TBODY",{});var D=l(G);O=a(D,"TR",{});var qe=l(O);Oi=a(qe,"TD",{});var DJ=l(Oi);Ya=a(DJ,"A",{href:!0,rel:!0});var gZ=l(Ya);O1=r(gZ,"lllyasviel/control_v11p_sd15_canny"),gZ.forEach(t),K1=a(DJ,"BR",{}),DJ.forEach(t),ew=d(qe),$p=a(qe,"TD",{});var _Z=l($p);Gp=a(_Z,"EM",{});var bZ=l(Gp);tw=r(bZ,"Trained with canny edge detection"),bZ.forEach(t),_Z.forEach(t),nw=d(qe),Wp=a(qe,"TD",{});var vZ=l(Wp);ow=r(vZ,"A monochrome image with white edges on a black background."),vZ.forEach(t),aw=d(qe),Dp=a(qe,"TD",{});var yZ=l(Dp);Ki=a(yZ,"A",{href:!0});var wZ=l(Ki);Zn=a(wZ,"IMG",{width:!0,style:!0,src:!0}),wZ.forEach(t),yZ.forEach(t),lw=d(qe),Sp=a(qe,"TD",{});var MZ=l(Sp);er=a(MZ,"A",{href:!0});var TZ=l(er);tr=a(TZ,"IMG",{width:!0,src:!0}),TZ.forEach(t),MZ.forEach(t),qe.forEach(t),sw=d(D),K=a(D,"TR",{});var Oe=l(K);nr=a(Oe,"TD",{});var SJ=l(nr);Qa=a(SJ,"A",{href:!0,rel:!0});var UZ=l(Qa);iw=r(UZ,"lllyasviel/control_v11e_sd15_ip2p"),UZ.forEach(t),rw=a(SJ,"BR",{}),SJ.forEach(t),cw=d(Oe),Bp=a(Oe,"TD",{});var IZ=l(Bp);Pp=a(IZ,"EM",{});var JZ=l(Pp);dw=r(JZ,"Trained with pixel to pixel instruction"),JZ.forEach(t),IZ.forEach(t),pw=d(Oe),Fp=a(Oe,"TD",{});var EZ=l(Fp);fw=r(EZ,"No condition ."),EZ.forEach(t),mw=d(Oe),Rp=a(Oe,"TD",{});var CZ=l(Rp);or=a(CZ,"A",{href:!0});var jZ=l(or);Nn=a(jZ,"IMG",{width:!0,style:!0,src:!0}),jZ.forEach(t),CZ.forEach(t),uw=d(Oe),Vp=a(Oe,"TD",{});var ZZ=l(Vp);ar=a(ZZ,"A",{href:!0});var NZ=l(ar);lr=a(NZ,"IMG",{width:!0,src:!0}),NZ.forEach(t),ZZ.forEach(t),Oe.forEach(t),hw=d(D),ee=a(D,"TR",{});var Ke=l(ee);sr=a(Ke,"TD",{});var BJ=l(sr);La=a(BJ,"A",{href:!0,rel:!0});var xZ=l(La);gw=r(xZ,"lllyasviel/control_v11p_sd15_inpaint"),xZ.forEach(t),_w=a(BJ,"BR",{}),BJ.forEach(t),bw=d(Ke),Ap=a(Ke,"TD",{});var kZ=l(Ap);vw=r(kZ,"Trained with image inpainting"),kZ.forEach(t),yw=d(Ke),Xp=a(Ke,"TD",{});var $Z=l(Xp);ww=r($Z,"No condition."),$Z.forEach(t),Mw=d(Ke),Yp=a(Ke,"TD",{});var GZ=l(Yp);ir=a(GZ,"A",{href:!0});var WZ=l(ir);xn=a(WZ,"IMG",{width:!0,style:!0,src:!0}),WZ.forEach(t),GZ.forEach(t),Tw=d(Ke),Qp=a(Ke,"TD",{});var DZ=l(Qp);rr=a(DZ,"A",{href:!0});var SZ=l(rr);cr=a(SZ,"IMG",{width:!0,src:!0}),SZ.forEach(t),DZ.forEach(t),Ke.forEach(t),Uw=d(D),te=a(D,"TR",{});var et=l(te);dr=a(et,"TD",{});var PJ=l(dr);za=a(PJ,"A",{href:!0,rel:!0});var BZ=l(za);Iw=r(BZ,"lllyasviel/control_v11p_sd15_mlsd"),BZ.forEach(t),Jw=a(PJ,"BR",{}),PJ.forEach(t),Ew=d(et),Lp=a(et,"TD",{});var PZ=l(Lp);Cw=r(PZ,"Trained with multi-level line segment detection"),PZ.forEach(t),jw=d(et),zp=a(et,"TD",{});var FZ=l(zp);Zw=r(FZ,"An image with annotated line segments."),FZ.forEach(t),Nw=d(et),Hp=a(et,"TD",{});var RZ=l(Hp);pr=a(RZ,"A",{href:!0});var VZ=l(pr);kn=a(VZ,"IMG",{width:!0,style:!0,src:!0}),VZ.forEach(t),RZ.forEach(t),xw=d(et),qp=a(et,"TD",{});var AZ=l(qp);fr=a(AZ,"A",{href:!0});var XZ=l(fr);mr=a(XZ,"IMG",{width:!0,src:!0}),XZ.forEach(t),AZ.forEach(t),et.forEach(t),kw=d(D),ne=a(D,"TR",{});var tt=l(ne);ur=a(tt,"TD",{});var FJ=l(ur);Ha=a(FJ,"A",{href:!0,rel:!0});var YZ=l(Ha);$w=r(YZ,"lllyasviel/control_v11f1p_sd15_depth"),YZ.forEach(t),Gw=a(FJ,"BR",{}),FJ.forEach(t),Ww=d(tt),Op=a(tt,"TD",{});var QZ=l(Op);Dw=r(QZ,"Trained with depth estimation"),QZ.forEach(t),Sw=d(tt),Kp=a(tt,"TD",{});var LZ=l(Kp);Bw=r(LZ,"An image with depth information, usually represented as a grayscale image."),LZ.forEach(t),Pw=d(tt),ef=a(tt,"TD",{});var zZ=l(ef);hr=a(zZ,"A",{href:!0});var HZ=l(hr);$n=a(HZ,"IMG",{width:!0,style:!0,src:!0}),HZ.forEach(t),zZ.forEach(t),Fw=d(tt),tf=a(tt,"TD",{});var qZ=l(tf);gr=a(qZ,"A",{href:!0});var OZ=l(gr);_r=a(OZ,"IMG",{width:!0,src:!0}),OZ.forEach(t),qZ.forEach(t),tt.forEach(t),Rw=d(D),oe=a(D,"TR",{});var nt=l(oe);br=a(nt,"TD",{});var RJ=l(br);qa=a(RJ,"A",{href:!0,rel:!0});var KZ=l(qa);Vw=r(KZ,"lllyasviel/control_v11p_sd15_normalbae"),KZ.forEach(t),Aw=a(RJ,"BR",{}),RJ.forEach(t),Xw=d(nt),nf=a(nt,"TD",{});var eN=l(nf);Yw=r(eN,"Trained with surface normal estimation"),eN.forEach(t),Qw=d(nt),of=a(nt,"TD",{});var tN=l(of);Lw=r(tN,"An image with surface normal information, usually represented as a color-coded image."),tN.forEach(t),zw=d(nt),af=a(nt,"TD",{});var nN=l(af);vr=a(nN,"A",{href:!0});var oN=l(vr);Gn=a(oN,"IMG",{width:!0,style:!0,src:!0}),oN.forEach(t),nN.forEach(t),Hw=d(nt),lf=a(nt,"TD",{});var aN=l(lf);yr=a(aN,"A",{href:!0});var lN=l(yr);wr=a(lN,"IMG",{width:!0,src:!0}),lN.forEach(t),aN.forEach(t),nt.forEach(t),qw=d(D),ae=a(D,"TR",{});var ot=l(ae);Mr=a(ot,"TD",{});var VJ=l(Mr);Oa=a(VJ,"A",{href:!0,rel:!0});var sN=l(Oa);Ow=r(sN,"lllyasviel/control_v11p_sd15_seg"),sN.forEach(t),Kw=a(VJ,"BR",{}),VJ.forEach(t),e2=d(ot),sf=a(ot,"TD",{});var iN=l(sf);t2=r(iN,"Trained with image segmentation"),iN.forEach(t),n2=d(ot),rf=a(ot,"TD",{});var rN=l(rf);o2=r(rN,"An image with segmented regions, usually represented as a color-coded image."),rN.forEach(t),a2=d(ot),cf=a(ot,"TD",{});var cN=l(cf);Tr=a(cN,"A",{href:!0});var dN=l(Tr);Wn=a(dN,"IMG",{width:!0,style:!0,src:!0}),dN.forEach(t),cN.forEach(t),l2=d(ot),df=a(ot,"TD",{});var pN=l(df);Ur=a(pN,"A",{href:!0});var fN=l(Ur);Ir=a(fN,"IMG",{width:!0,src:!0}),fN.forEach(t),pN.forEach(t),ot.forEach(t),s2=d(D),le=a(D,"TR",{});var at=l(le);Jr=a(at,"TD",{});var AJ=l(Jr);Ka=a(AJ,"A",{href:!0,rel:!0});var mN=l(Ka);i2=r(mN,"lllyasviel/control_v11p_sd15_lineart"),mN.forEach(t),r2=a(AJ,"BR",{}),AJ.forEach(t),c2=d(at),pf=a(at,"TD",{});var uN=l(pf);d2=r(uN,"Trained with line art generation"),uN.forEach(t),p2=d(at),ff=a(at,"TD",{});var hN=l(ff);f2=r(hN,"An image with line art, usually black lines on a white background."),hN.forEach(t),m2=d(at),mf=a(at,"TD",{});var gN=l(mf);Er=a(gN,"A",{href:!0});var _N=l(Er);Dn=a(_N,"IMG",{width:!0,style:!0,src:!0}),_N.forEach(t),gN.forEach(t),u2=d(at),uf=a(at,"TD",{});var bN=l(uf);Cr=a(bN,"A",{href:!0});var vN=l(Cr);jr=a(vN,"IMG",{width:!0,src:!0}),vN.forEach(t),bN.forEach(t),at.forEach(t),h2=d(D),se=a(D,"TR",{});var lt=l(se);Zr=a(lt,"TD",{});var XJ=l(Zr);el=a(XJ,"A",{href:!0,rel:!0});var yN=l(el);g2=r(yN,"lllyasviel/control_v11p_sd15s2_lineart_anime"),yN.forEach(t),_2=a(XJ,"BR",{}),XJ.forEach(t),b2=d(lt),hf=a(lt,"TD",{});var wN=l(hf);v2=r(wN,"Trained with anime line art generation"),wN.forEach(t),y2=d(lt),gf=a(lt,"TD",{});var MN=l(gf);w2=r(MN,"An image with anime-style line art."),MN.forEach(t),M2=d(lt),_f=a(lt,"TD",{});var TN=l(_f);Nr=a(TN,"A",{href:!0});var UN=l(Nr);Sn=a(UN,"IMG",{width:!0,style:!0,src:!0}),UN.forEach(t),TN.forEach(t),T2=d(lt),bf=a(lt,"TD",{});var IN=l(bf);xr=a(IN,"A",{href:!0});var JN=l(xr);kr=a(JN,"IMG",{width:!0,src:!0}),JN.forEach(t),IN.forEach(t),lt.forEach(t),U2=d(D),ie=a(D,"TR",{});var st=l(ie);$r=a(st,"TD",{});var YJ=l($r);tl=a(YJ,"A",{href:!0,rel:!0});var EN=l(tl);I2=r(EN,"lllyasviel/control_v11p_sd15_openpose"),EN.forEach(t),J2=a(YJ,"BR",{}),YJ.forEach(t),E2=d(st),vf=a(st,"TD",{});var CN=l(vf);C2=r(CN,"Trained with human pose estimation"),CN.forEach(t),j2=d(st),yf=a(st,"TD",{});var jN=l(yf);Z2=r(jN,"An image with human poses, usually represented as a set of keypoints or skeletons."),jN.forEach(t),N2=d(st),wf=a(st,"TD",{});var ZN=l(wf);Gr=a(ZN,"A",{href:!0});var NN=l(Gr);Bn=a(NN,"IMG",{width:!0,style:!0,src:!0}),NN.forEach(t),ZN.forEach(t),x2=d(st),Mf=a(st,"TD",{});var xN=l(Mf);Wr=a(xN,"A",{href:!0});var kN=l(Wr);Dr=a(kN,"IMG",{width:!0,src:!0}),kN.forEach(t),xN.forEach(t),st.forEach(t),k2=d(D),re=a(D,"TR",{});var it=l(re);Sr=a(it,"TD",{});var QJ=l(Sr);nl=a(QJ,"A",{href:!0,rel:!0});var $N=l(nl);$2=r($N,"lllyasviel/control_v11p_sd15_scribble"),$N.forEach(t),G2=a(QJ,"BR",{}),QJ.forEach(t),W2=d(it),Tf=a(it,"TD",{});var GN=l(Tf);D2=r(GN,"Trained with scribble-based image generation"),GN.forEach(t),S2=d(it),Uf=a(it,"TD",{});var WN=l(Uf);B2=r(WN,"An image with scribbles, usually random or user-drawn strokes."),WN.forEach(t),P2=d(it),If=a(it,"TD",{});var DN=l(If);Br=a(DN,"A",{href:!0});var SN=l(Br);Pn=a(SN,"IMG",{width:!0,style:!0,src:!0}),SN.forEach(t),DN.forEach(t),F2=d(it),Jf=a(it,"TD",{});var BN=l(Jf);Pr=a(BN,"A",{href:!0});var PN=l(Pr);Fr=a(PN,"IMG",{width:!0,src:!0}),PN.forEach(t),BN.forEach(t),it.forEach(t),R2=d(D),ce=a(D,"TR",{});var rt=l(ce);Rr=a(rt,"TD",{});var LJ=l(Rr);ol=a(LJ,"A",{href:!0,rel:!0});var FN=l(ol);V2=r(FN,"lllyasviel/control_v11p_sd15_softedge"),FN.forEach(t),A2=a(LJ,"BR",{}),LJ.forEach(t),X2=d(rt),Ef=a(rt,"TD",{});var RN=l(Ef);Y2=r(RN,"Trained with soft edge image generation"),RN.forEach(t),Q2=d(rt),Cf=a(rt,"TD",{});var VN=l(Cf);L2=r(VN,"An image with soft edges, usually to create a more painterly or artistic effect."),VN.forEach(t),z2=d(rt),jf=a(rt,"TD",{});var AN=l(jf);Vr=a(AN,"A",{href:!0});var XN=l(Vr);Fn=a(XN,"IMG",{width:!0,style:!0,src:!0}),XN.forEach(t),AN.forEach(t),H2=d(rt),Zf=a(rt,"TD",{});var YN=l(Zf);Ar=a(YN,"A",{href:!0});var QN=l(Ar);Xr=a(QN,"IMG",{width:!0,src:!0}),QN.forEach(t),YN.forEach(t),rt.forEach(t),q2=d(D),de=a(D,"TR",{});var ct=l(de);Yr=a(ct,"TD",{});var zJ=l(Yr);al=a(zJ,"A",{href:!0,rel:!0});var LN=l(al);O2=r(LN,"lllyasviel/control_v11e_sd15_shuffle"),LN.forEach(t),K2=a(zJ,"BR",{}),zJ.forEach(t),eM=d(ct),Nf=a(ct,"TD",{});var zN=l(Nf);tM=r(zN,"Trained with image shuffling"),zN.forEach(t),nM=d(ct),xf=a(ct,"TD",{});var HN=l(xf);oM=r(HN,"An image with shuffled patches or regions."),HN.forEach(t),aM=d(ct),kf=a(ct,"TD",{});var qN=l(kf);Qr=a(qN,"A",{href:!0});var ON=l(Qr);Rn=a(ON,"IMG",{width:!0,style:!0,src:!0}),ON.forEach(t),qN.forEach(t),lM=d(ct),$f=a(ct,"TD",{});var KN=l($f);Lr=a(KN,"A",{href:!0});var ex=l(Lr);zr=a(ex,"IMG",{width:!0,src:!0}),ex.forEach(t),KN.forEach(t),ct.forEach(t),sM=d(D),pe=a(D,"TR",{});var dt=l(pe);Hr=a(dt,"TD",{});var HJ=l(Hr);ll=a(HJ,"A",{href:!0,rel:!0});var tx=l(ll);iM=r(tx,"lllyasviel/control_v11f1e_sd15_tile"),tx.forEach(t),rM=a(HJ,"BR",{}),HJ.forEach(t),cM=d(dt),Gf=a(dt,"TD",{});var nx=l(Gf);dM=r(nx,"Trained with image tiling"),nx.forEach(t),pM=d(dt),Wf=a(dt,"TD",{});var ox=l(Wf);fM=r(ox,"A blurry image or part of an image ."),ox.forEach(t),mM=d(dt),Df=a(dt,"TD",{});var ax=l(Df);qr=a(ax,"A",{href:!0});var lx=l(qr);Vn=a(lx,"IMG",{width:!0,style:!0,src:!0}),lx.forEach(t),ax.forEach(t),uM=d(dt),Sf=a(dt,"TD",{});var sx=l(Sf);Or=a(sx,"A",{href:!0});var ix=l(Or);Kr=a(ix,"IMG",{width:!0,src:!0}),ix.forEach(t),sx.forEach(t),dt.forEach(t),D.forEach(t),Gg.forEach(t),Qh=d(n),St=a(n,"H2",{class:!0});var Wg=l(St);An=a(Wg,"A",{id:!0,class:!0,href:!0});var rx=l(An);Bf=a(rx,"SPAN",{});var cx=l(Bf);_(sl.$$.fragment,cx),cx.forEach(t),rx.forEach(t),hM=d(Wg),Pf=a(Wg,"SPAN",{});var dx=l(Pf);gM=r(dx,"StableDiffusionControlNetPipeline"),dx.forEach(t),Wg.forEach(t),Lh=d(n),j=a(n,"DIV",{class:!0});var k=l(j);_(il.$$.fragment,k),_M=d(k),Ff=a(k,"P",{});var px=l(Ff);bM=r(px,"Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),px.forEach(t),vM=d(k),rl=a(k,"P",{});var Dg=l(rl);yM=r(Dg,"This model inherits from "),ec=a(Dg,"A",{href:!0});var fx=l(ec);wM=r(fx,"DiffusionPipeline"),fx.forEach(t),MM=r(Dg,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Dg.forEach(t),TM=d(k),Rf=a(k,"P",{});var mx=l(Rf);UM=r(mx,"In addition the pipeline inherits the following loading methods:"),mx.forEach(t),IM=d(k),Vf=a(k,"UL",{});var ux=l(Vf);cl=a(ux,"LI",{});var Sg=l(cl);Af=a(Sg,"EM",{});var hx=l(Af);JM=r(hx,"Textual-Inversion"),hx.forEach(t),EM=r(Sg,": "),tc=a(Sg,"A",{href:!0});var gx=l(tc);CM=r(gx,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),gx.forEach(t),Sg.forEach(t),ux.forEach(t),jM=d(k),De=a(k,"DIV",{class:!0});var vc=l(De);_(dl.$$.fragment,vc),ZM=d(vc),Xf=a(vc,"P",{});var _x=l(Xf);NM=r(_x,"Function invoked when calling the pipeline for generation."),_x.forEach(t),xM=d(vc),_(Xn.$$.fragment,vc),vc.forEach(t),kM=d(k),Se=a(k,"DIV",{class:!0});var yc=l(Se);_(pl.$$.fragment,yc),$M=d(yc),Yf=a(yc,"P",{});var bx=l(Yf);GM=r(bx,"Enable sliced attention computation."),bx.forEach(t),WM=d(yc),Qf=a(yc,"P",{});var vx=l(Qf);DM=r(vx,`When this option is enabled, the attention module splits the input tensor in slices to compute attention in
several steps. This is useful to save some memory in exchange for a small speed decrease.`),vx.forEach(t),yc.forEach(t),SM=d(k),Yn=a(k,"DIV",{class:!0});var Bg=l(Yn);_(fl.$$.fragment,Bg),BM=d(Bg),ml=a(Bg,"P",{});var Pg=l(ml);PM=r(Pg,"Disable sliced attention computation. If "),Lf=a(Pg,"CODE",{});var yx=l(Lf);FM=r(yx,"enable_attention_slicing"),yx.forEach(t),RM=r(Pg,` was previously called, attention is
computed in one step.`),Pg.forEach(t),Bg.forEach(t),VM=d(k),Be=a(k,"DIV",{class:!0});var wc=l(Be);_(ul.$$.fragment,wc),AM=d(wc),zf=a(wc,"P",{});var wx=l(zf);XM=r(wx,"Enable sliced VAE decoding."),wx.forEach(t),YM=d(wc),Hf=a(wc,"P",{});var Mx=l(Hf);QM=r(Mx,`When this option is enabled, the VAE will split the input tensor in slices to compute decoding in several
steps. This is useful to save some memory and allow larger batch sizes.`),Mx.forEach(t),wc.forEach(t),LM=d(k),Qn=a(k,"DIV",{class:!0});var Fg=l(Qn);_(hl.$$.fragment,Fg),zM=d(Fg),gl=a(Fg,"P",{});var Rg=l(gl);HM=r(Rg,"Disable sliced VAE decoding. If "),qf=a(Rg,"CODE",{});var Tx=l(qf);qM=r(Tx,"enable_vae_slicing"),Tx.forEach(t),OM=r(Rg,` was previously invoked, this method will go back to
computing decoding in one step.`),Rg.forEach(t),Fg.forEach(t),KM=d(k),Q=a(k,"DIV",{class:!0});var pt=l(Q);_(_l.$$.fragment,pt),e0=d(pt),bl=a(pt,"P",{});var Vg=l(bl);t0=r(Vg,"Enable memory efficient attention from "),vl=a(Vg,"A",{href:!0,rel:!0});var Ux=l(vl);n0=r(Ux,"xFormers"),Ux.forEach(t),o0=r(Vg,"."),Vg.forEach(t),a0=d(pt),Of=a(pt,"P",{});var Ix=l(Of);l0=r(Ix,`When this option is enabled, you should observe lower GPU memory usage and a potential speed up during
inference. Speed up during training is not guaranteed.`),Ix.forEach(t),s0=d(pt),_(Ln.$$.fragment,pt),i0=d(pt),_(zn.$$.fragment,pt),pt.forEach(t),r0=d(k),Hn=a(k,"DIV",{class:!0});var Ag=l(Hn);_(yl.$$.fragment,Ag),c0=d(Ag),wl=a(Ag,"P",{});var Xg=l(wl);d0=r(Xg,"Disable memory efficient attention from "),Ml=a(Xg,"A",{href:!0,rel:!0});var Jx=l(Ml);p0=r(Jx,"xFormers"),Jx.forEach(t),f0=r(Xg,"."),Xg.forEach(t),Ag.forEach(t),m0=d(k),R=a(k,"DIV",{class:!0});var ve=l(R);_(Tl.$$.fragment,ve),u0=d(ve),Ul=a(ve,"P",{});var Yg=l(Ul);h0=r(Yg,"Load textual inversion embeddings into the text encoder of "),nc=a(Yg,"A",{href:!0});var Ex=l(nc);g0=r(Ex,"StableDiffusionPipeline"),Ex.forEach(t),_0=r(Yg,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),Yg.forEach(t),b0=d(ve),Kf=a(ve,"P",{});var Cx=l(Kf);v0=r(Cx,"Example:"),Cx.forEach(t),y0=d(ve),_(qn.$$.fragment,ve),w0=d(ve),Il=a(ve,"P",{});var Qg=l(Il);M0=r(Qg,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Jl=a(Qg,"A",{href:!0,rel:!0});var jx=l(Jl);T0=r(jx,"civitAI"),jx.forEach(t),U0=r(Qg,") and then load the vector"),Qg.forEach(t),I0=d(ve),_(On.$$.fragment,ve),ve.forEach(t),J0=d(k),Kn=a(k,"DIV",{class:!0});var Lg=l(Kn);_(El.$$.fragment,Lg),E0=d(Lg),Cl=a(Lg,"P",{});var zg=l(Cl);C0=r(zg,"Disable tiled VAE decoding. If "),em=a(zg,"CODE",{});var Zx=l(em);j0=r(Zx,"enable_vae_tiling"),Zx.forEach(t),Z0=r(zg,` was previously invoked, this method will go back to
computing decoding in one step.`),zg.forEach(t),Lg.forEach(t),N0=d(k),eo=a(k,"DIV",{class:!0});var Hg=l(eo);_(jl.$$.fragment,Hg),x0=d(Hg),fe=a(Hg,"P",{});var ft=l(fe);k0=r(ft,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),tm=a(ft,"CODE",{});var Nx=l(tm);$0=r(Nx,"enable_sequential_cpu_offload"),Nx.forEach(t),G0=r(ft,", this method moves one whole model at a time to the GPU when its "),nm=a(ft,"CODE",{});var xx=l(nm);W0=r(xx,"forward"),xx.forEach(t),D0=r(ft,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),om=a(ft,"CODE",{});var kx=l(om);S0=r(kx,"enable_sequential_cpu_offload"),kx.forEach(t),B0=r(ft,", but performance is much better due to the iterative execution of the "),am=a(ft,"CODE",{});var $x=l(am);P0=r($x,"unet"),$x.forEach(t),F0=r(ft,"."),ft.forEach(t),Hg.forEach(t),R0=d(k),to=a(k,"DIV",{class:!0});var qg=l(to);_(Zl.$$.fragment,qg),V0=d(qg),Bt=a(qg,"P",{});var Mc=l(Bt);A0=r(Mc,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae, controlnet, and safety checker have their state dicts saved to CPU and then are moved to a
`),lm=a(Mc,"CODE",{});var Gx=l(lm);X0=r(Gx,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),Gx.forEach(t),Y0=r(Mc,"forward"),sm=a(Mc,"CODE",{});var Wx=l(sm);Q0=r(Wx,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),Wx.forEach(t),L0=r(Mc,"enable_model_cpu_offload`, but performance is lower."),Mc.forEach(t),qg.forEach(t),z0=d(k),Pe=a(k,"DIV",{class:!0});var Tc=l(Pe);_(Nl.$$.fragment,Tc),H0=d(Tc),im=a(Tc,"P",{});var Dx=l(im);q0=r(Dx,"Enable tiled VAE decoding."),Dx.forEach(t),O0=d(Tc),rm=a(Tc,"P",{});var Sx=l(rm);K0=r(Sx,`When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and encoding in
several steps. This is useful to save a large amount of memory and to allow the processing of larger images.`),Sx.forEach(t),Tc.forEach(t),k.forEach(t),zh=d(n),Pt=a(n,"H2",{class:!0});var Og=l(Pt);no=a(Og,"A",{id:!0,class:!0,href:!0});var Bx=l(no);cm=a(Bx,"SPAN",{});var Px=l(cm);_(xl.$$.fragment,Px),Px.forEach(t),Bx.forEach(t),eT=d(Og),dm=a(Og,"SPAN",{});var Fx=l(dm);tT=r(Fx,"StableDiffusionControlNetImg2ImgPipeline"),Fx.forEach(t),Og.forEach(t),Hh=d(n),Z=a(n,"DIV",{class:!0});var $=l(Z);_(kl.$$.fragment,$),nT=d($),pm=a($,"P",{});var Rx=l(pm);oT=r(Rx,"Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),Rx.forEach(t),aT=d($),$l=a($,"P",{});var Kg=l($l);lT=r(Kg,"This model inherits from "),oc=a(Kg,"A",{href:!0});var Vx=l(oc);sT=r(Vx,"DiffusionPipeline"),Vx.forEach(t),iT=r(Kg,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Kg.forEach(t),rT=d($),fm=a($,"P",{});var Ax=l(fm);cT=r(Ax,"In addition the pipeline inherits the following loading methods:"),Ax.forEach(t),dT=d($),mm=a($,"UL",{});var Xx=l(mm);Gl=a(Xx,"LI",{});var e_=l(Gl);um=a(e_,"EM",{});var Yx=l(um);pT=r(Yx,"Textual-Inversion"),Yx.forEach(t),fT=r(e_,": "),ac=a(e_,"A",{href:!0});var Qx=l(ac);mT=r(Qx,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),Qx.forEach(t),e_.forEach(t),Xx.forEach(t),uT=d($),Fe=a($,"DIV",{class:!0});var Uc=l(Fe);_(Wl.$$.fragment,Uc),hT=d(Uc),hm=a(Uc,"P",{});var Lx=l(hm);gT=r(Lx,"Function invoked when calling the pipeline for generation."),Lx.forEach(t),_T=d(Uc),_(oo.$$.fragment,Uc),Uc.forEach(t),bT=d($),Re=a($,"DIV",{class:!0});var Ic=l(Re);_(Dl.$$.fragment,Ic),vT=d(Ic),gm=a(Ic,"P",{});var zx=l(gm);yT=r(zx,"Enable sliced attention computation."),zx.forEach(t),wT=d(Ic),_m=a(Ic,"P",{});var Hx=l(_m);MT=r(Hx,`When this option is enabled, the attention module splits the input tensor in slices to compute attention in
several steps. This is useful to save some memory in exchange for a small speed decrease.`),Hx.forEach(t),Ic.forEach(t),TT=d($),ao=a($,"DIV",{class:!0});var t_=l(ao);_(Sl.$$.fragment,t_),UT=d(t_),Bl=a(t_,"P",{});var n_=l(Bl);IT=r(n_,"Disable sliced attention computation. If "),bm=a(n_,"CODE",{});var qx=l(bm);JT=r(qx,"enable_attention_slicing"),qx.forEach(t),ET=r(n_,` was previously called, attention is
computed in one step.`),n_.forEach(t),t_.forEach(t),CT=d($),Ve=a($,"DIV",{class:!0});var Jc=l(Ve);_(Pl.$$.fragment,Jc),jT=d(Jc),vm=a(Jc,"P",{});var Ox=l(vm);ZT=r(Ox,"Enable sliced VAE decoding."),Ox.forEach(t),NT=d(Jc),ym=a(Jc,"P",{});var Kx=l(ym);xT=r(Kx,`When this option is enabled, the VAE will split the input tensor in slices to compute decoding in several
steps. This is useful to save some memory and allow larger batch sizes.`),Kx.forEach(t),Jc.forEach(t),kT=d($),lo=a($,"DIV",{class:!0});var o_=l(lo);_(Fl.$$.fragment,o_),$T=d(o_),Rl=a(o_,"P",{});var a_=l(Rl);GT=r(a_,"Disable sliced VAE decoding. If "),wm=a(a_,"CODE",{});var ek=l(wm);WT=r(ek,"enable_vae_slicing"),ek.forEach(t),DT=r(a_,` was previously invoked, this method will go back to
computing decoding in one step.`),a_.forEach(t),o_.forEach(t),ST=d($),L=a($,"DIV",{class:!0});var mt=l(L);_(Vl.$$.fragment,mt),BT=d(mt),Al=a(mt,"P",{});var l_=l(Al);PT=r(l_,"Enable memory efficient attention from "),Xl=a(l_,"A",{href:!0,rel:!0});var tk=l(Xl);FT=r(tk,"xFormers"),tk.forEach(t),RT=r(l_,"."),l_.forEach(t),VT=d(mt),Mm=a(mt,"P",{});var nk=l(Mm);AT=r(nk,`When this option is enabled, you should observe lower GPU memory usage and a potential speed up during
inference. Speed up during training is not guaranteed.`),nk.forEach(t),XT=d(mt),_(so.$$.fragment,mt),YT=d(mt),_(io.$$.fragment,mt),mt.forEach(t),QT=d($),ro=a($,"DIV",{class:!0});var s_=l(ro);_(Yl.$$.fragment,s_),LT=d(s_),Ql=a(s_,"P",{});var i_=l(Ql);zT=r(i_,"Disable memory efficient attention from "),Ll=a(i_,"A",{href:!0,rel:!0});var ok=l(Ll);HT=r(ok,"xFormers"),ok.forEach(t),qT=r(i_,"."),i_.forEach(t),s_.forEach(t),OT=d($),V=a($,"DIV",{class:!0});var ye=l(V);_(zl.$$.fragment,ye),KT=d(ye),Hl=a(ye,"P",{});var r_=l(Hl);eU=r(r_,"Load textual inversion embeddings into the text encoder of "),lc=a(r_,"A",{href:!0});var ak=l(lc);tU=r(ak,"StableDiffusionPipeline"),ak.forEach(t),nU=r(r_,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),r_.forEach(t),oU=d(ye),Tm=a(ye,"P",{});var lk=l(Tm);aU=r(lk,"Example:"),lk.forEach(t),lU=d(ye),_(co.$$.fragment,ye),sU=d(ye),ql=a(ye,"P",{});var c_=l(ql);iU=r(c_,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Ol=a(c_,"A",{href:!0,rel:!0});var sk=l(Ol);rU=r(sk,"civitAI"),sk.forEach(t),cU=r(c_,") and then load the vector"),c_.forEach(t),dU=d(ye),_(po.$$.fragment,ye),ye.forEach(t),pU=d($),fo=a($,"DIV",{class:!0});var d_=l(fo);_(Kl.$$.fragment,d_),fU=d(d_),es=a(d_,"P",{});var p_=l(es);mU=r(p_,"Disable tiled VAE decoding. If "),Um=a(p_,"CODE",{});var ik=l(Um);uU=r(ik,"enable_vae_tiling"),ik.forEach(t),hU=r(p_,` was previously invoked, this method will go back to
computing decoding in one step.`),p_.forEach(t),d_.forEach(t),gU=d($),mo=a($,"DIV",{class:!0});var f_=l(mo);_(ts.$$.fragment,f_),_U=d(f_),me=a(f_,"P",{});var ut=l(me);bU=r(ut,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Im=a(ut,"CODE",{});var rk=l(Im);vU=r(rk,"enable_sequential_cpu_offload"),rk.forEach(t),yU=r(ut,", this method moves one whole model at a time to the GPU when its "),Jm=a(ut,"CODE",{});var ck=l(Jm);wU=r(ck,"forward"),ck.forEach(t),MU=r(ut,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Em=a(ut,"CODE",{});var dk=l(Em);TU=r(dk,"enable_sequential_cpu_offload"),dk.forEach(t),UU=r(ut,", but performance is much better due to the iterative execution of the "),Cm=a(ut,"CODE",{});var pk=l(Cm);IU=r(pk,"unet"),pk.forEach(t),JU=r(ut,"."),ut.forEach(t),f_.forEach(t),EU=d($),uo=a($,"DIV",{class:!0});var m_=l(uo);_(ns.$$.fragment,m_),CU=d(m_),Ft=a(m_,"P",{});var Ec=l(Ft);jU=r(Ec,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae, controlnet, and safety checker have their state dicts saved to CPU and then are moved to a
`),jm=a(Ec,"CODE",{});var fk=l(jm);ZU=r(fk,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),fk.forEach(t),NU=r(Ec,"forward"),Zm=a(Ec,"CODE",{});var mk=l(Zm);xU=r(mk,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),mk.forEach(t),kU=r(Ec,"enable_model_cpu_offload`, but performance is lower."),Ec.forEach(t),m_.forEach(t),$U=d($),Ae=a($,"DIV",{class:!0});var Cc=l(Ae);_(os.$$.fragment,Cc),GU=d(Cc),Nm=a(Cc,"P",{});var uk=l(Nm);WU=r(uk,"Enable tiled VAE decoding."),uk.forEach(t),DU=d(Cc),xm=a(Cc,"P",{});var hk=l(xm);SU=r(hk,`When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and encoding in
several steps. This is useful to save a large amount of memory and to allow the processing of larger images.`),hk.forEach(t),Cc.forEach(t),$.forEach(t),qh=d(n),Rt=a(n,"H2",{class:!0});var u_=l(Rt);ho=a(u_,"A",{id:!0,class:!0,href:!0});var gk=l(ho);km=a(gk,"SPAN",{});var _k=l(km);_(as.$$.fragment,_k),_k.forEach(t),gk.forEach(t),BU=d(u_),$m=a(u_,"SPAN",{});var bk=l($m);PU=r(bk,"StableDiffusionControlNetInpaintPipeline"),bk.forEach(t),u_.forEach(t),Oh=d(n),E=a(n,"DIV",{class:!0});var x=l(E);_(ls.$$.fragment,x),FU=d(x),Gm=a(x,"P",{});var vk=l(Gm);RU=r(vk,"Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),vk.forEach(t),VU=d(x),ss=a(x,"P",{});var h_=l(ss);AU=r(h_,"This model inherits from "),sc=a(h_,"A",{href:!0});var yk=l(sc);XU=r(yk,"DiffusionPipeline"),yk.forEach(t),YU=r(h_,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),h_.forEach(t),QU=d(x),Wm=a(x,"P",{});var wk=l(Wm);LU=r(wk,"In addition the pipeline inherits the following loading methods:"),wk.forEach(t),zU=d(x),Dm=a(x,"UL",{});var Mk=l(Dm);is=a(Mk,"LI",{});var g_=l(is);Sm=a(g_,"EM",{});var Tk=l(Sm);HU=r(Tk,"Textual-Inversion"),Tk.forEach(t),qU=r(g_,": "),ic=a(g_,"A",{href:!0});var Uk=l(ic);OU=r(Uk,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),Uk.forEach(t),g_.forEach(t),Mk.forEach(t),KU=d(x),_(go.$$.fragment,x),eI=d(x),Xe=a(x,"DIV",{class:!0});var jc=l(Xe);_(rs.$$.fragment,jc),tI=d(jc),Bm=a(jc,"P",{});var Ik=l(Bm);nI=r(Ik,"Function invoked when calling the pipeline for generation."),Ik.forEach(t),oI=d(jc),_(_o.$$.fragment,jc),jc.forEach(t),aI=d(x),Ye=a(x,"DIV",{class:!0});var Zc=l(Ye);_(cs.$$.fragment,Zc),lI=d(Zc),Pm=a(Zc,"P",{});var Jk=l(Pm);sI=r(Jk,"Enable sliced attention computation."),Jk.forEach(t),iI=d(Zc),Fm=a(Zc,"P",{});var Ek=l(Fm);rI=r(Ek,`When this option is enabled, the attention module splits the input tensor in slices to compute attention in
several steps. This is useful to save some memory in exchange for a small speed decrease.`),Ek.forEach(t),Zc.forEach(t),cI=d(x),bo=a(x,"DIV",{class:!0});var __=l(bo);_(ds.$$.fragment,__),dI=d(__),ps=a(__,"P",{});var b_=l(ps);pI=r(b_,"Disable sliced attention computation. If "),Rm=a(b_,"CODE",{});var Ck=l(Rm);fI=r(Ck,"enable_attention_slicing"),Ck.forEach(t),mI=r(b_,` was previously called, attention is
computed in one step.`),b_.forEach(t),__.forEach(t),uI=d(x),Qe=a(x,"DIV",{class:!0});var Nc=l(Qe);_(fs.$$.fragment,Nc),hI=d(Nc),Vm=a(Nc,"P",{});var jk=l(Vm);gI=r(jk,"Enable sliced VAE decoding."),jk.forEach(t),_I=d(Nc),Am=a(Nc,"P",{});var Zk=l(Am);bI=r(Zk,`When this option is enabled, the VAE will split the input tensor in slices to compute decoding in several
steps. This is useful to save some memory and allow larger batch sizes.`),Zk.forEach(t),Nc.forEach(t),vI=d(x),vo=a(x,"DIV",{class:!0});var v_=l(vo);_(ms.$$.fragment,v_),yI=d(v_),us=a(v_,"P",{});var y_=l(us);wI=r(y_,"Disable sliced VAE decoding. If "),Xm=a(y_,"CODE",{});var Nk=l(Xm);MI=r(Nk,"enable_vae_slicing"),Nk.forEach(t),TI=r(y_,` was previously invoked, this method will go back to
computing decoding in one step.`),y_.forEach(t),v_.forEach(t),UI=d(x),z=a(x,"DIV",{class:!0});var ht=l(z);_(hs.$$.fragment,ht),II=d(ht),gs=a(ht,"P",{});var w_=l(gs);JI=r(w_,"Enable memory efficient attention from "),_s=a(w_,"A",{href:!0,rel:!0});var xk=l(_s);EI=r(xk,"xFormers"),xk.forEach(t),CI=r(w_,"."),w_.forEach(t),jI=d(ht),Ym=a(ht,"P",{});var kk=l(Ym);ZI=r(kk,`When this option is enabled, you should observe lower GPU memory usage and a potential speed up during
inference. Speed up during training is not guaranteed.`),kk.forEach(t),NI=d(ht),_(yo.$$.fragment,ht),xI=d(ht),_(wo.$$.fragment,ht),ht.forEach(t),kI=d(x),Mo=a(x,"DIV",{class:!0});var M_=l(Mo);_(bs.$$.fragment,M_),$I=d(M_),vs=a(M_,"P",{});var T_=l(vs);GI=r(T_,"Disable memory efficient attention from "),ys=a(T_,"A",{href:!0,rel:!0});var $k=l(ys);WI=r($k,"xFormers"),$k.forEach(t),DI=r(T_,"."),T_.forEach(t),M_.forEach(t),SI=d(x),A=a(x,"DIV",{class:!0});var we=l(A);_(ws.$$.fragment,we),BI=d(we),Ms=a(we,"P",{});var U_=l(Ms);PI=r(U_,"Load textual inversion embeddings into the text encoder of "),rc=a(U_,"A",{href:!0});var Gk=l(rc);FI=r(Gk,"StableDiffusionPipeline"),Gk.forEach(t),RI=r(U_,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),U_.forEach(t),VI=d(we),Qm=a(we,"P",{});var Wk=l(Qm);AI=r(Wk,"Example:"),Wk.forEach(t),XI=d(we),_(To.$$.fragment,we),YI=d(we),Ts=a(we,"P",{});var I_=l(Ts);QI=r(I_,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Us=a(I_,"A",{href:!0,rel:!0});var Dk=l(Us);LI=r(Dk,"civitAI"),Dk.forEach(t),zI=r(I_,") and then load the vector"),I_.forEach(t),HI=d(we),_(Uo.$$.fragment,we),we.forEach(t),qI=d(x),Io=a(x,"DIV",{class:!0});var J_=l(Io);_(Is.$$.fragment,J_),OI=d(J_),Js=a(J_,"P",{});var E_=l(Js);KI=r(E_,"Disable tiled VAE decoding. If "),Lm=a(E_,"CODE",{});var Sk=l(Lm);eJ=r(Sk,"enable_vae_tiling"),Sk.forEach(t),tJ=r(E_,` was previously invoked, this method will go back to
computing decoding in one step.`),E_.forEach(t),J_.forEach(t),nJ=d(x),Jo=a(x,"DIV",{class:!0});var C_=l(Jo);_(Es.$$.fragment,C_),oJ=d(C_),ue=a(C_,"P",{});var gt=l(ue);aJ=r(gt,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),zm=a(gt,"CODE",{});var Bk=l(zm);lJ=r(Bk,"enable_sequential_cpu_offload"),Bk.forEach(t),sJ=r(gt,", this method moves one whole model at a time to the GPU when its "),Hm=a(gt,"CODE",{});var Pk=l(Hm);iJ=r(Pk,"forward"),Pk.forEach(t),rJ=r(gt,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),qm=a(gt,"CODE",{});var Fk=l(qm);cJ=r(Fk,"enable_sequential_cpu_offload"),Fk.forEach(t),dJ=r(gt,", but performance is much better due to the iterative execution of the "),Om=a(gt,"CODE",{});var Rk=l(Om);pJ=r(Rk,"unet"),Rk.forEach(t),fJ=r(gt,"."),gt.forEach(t),C_.forEach(t),mJ=d(x),Eo=a(x,"DIV",{class:!0});var j_=l(Eo);_(Cs.$$.fragment,j_),uJ=d(j_),Vt=a(j_,"P",{});var xc=l(Vt);hJ=r(xc,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae, controlnet, and safety checker have their state dicts saved to CPU and then are moved to a
`),Km=a(xc,"CODE",{});var Vk=l(Km);gJ=r(Vk,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),Vk.forEach(t),_J=r(xc,"forward"),eu=a(xc,"CODE",{});var Ak=l(eu);bJ=r(Ak,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),Ak.forEach(t),vJ=r(xc,"enable_model_cpu_offload`, but performance is lower."),xc.forEach(t),j_.forEach(t),yJ=d(x),Le=a(x,"DIV",{class:!0});var kc=l(Le);_(js.$$.fragment,kc),wJ=d(kc),tu=a(kc,"P",{});var Xk=l(tu);MJ=r(Xk,"Enable tiled VAE decoding."),Xk.forEach(t),TJ=d(kc),nu=a(kc,"P",{});var Yk=l(nu);UJ=r(Yk,`When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and encoding in
several steps. This is useful to save a large amount of memory and to allow the processing of larger images.`),Yk.forEach(t),kc.forEach(t),x.forEach(t),Kh=d(n),At=a(n,"H2",{class:!0});var Z_=l(At);Co=a(Z_,"A",{id:!0,class:!0,href:!0});var Qk=l(Co);ou=a(Qk,"SPAN",{});var Lk=l(ou);_(Zs.$$.fragment,Lk),Lk.forEach(t),Qk.forEach(t),IJ=d(Z_),au=a(Z_,"SPAN",{});var zk=l(au);JJ=r(zk,"FlaxStableDiffusionControlNetPipeline"),zk.forEach(t),Z_.forEach(t),eg=d(n),he=a(n,"DIV",{class:!0});var Po=l(he);_(Ns.$$.fragment,Po),EJ=d(Po),lu=a(Po,"P",{});var Hk=l(lu);CJ=r(Hk,"Pipeline for text-to-image generation using Stable Diffusion with ControlNet Guidance."),Hk.forEach(t),jJ=d(Po),xs=a(Po,"P",{});var N_=l(xs);ZJ=r(N_,"This model inherits from "),su=a(N_,"CODE",{});var qk=l(su);NJ=r(qk,"FlaxDiffusionPipeline"),qk.forEach(t),xJ=r(N_,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),N_.forEach(t),kJ=d(Po),ze=a(Po,"DIV",{class:!0});var $c=l(ze);_(ks.$$.fragment,$c),$J=d($c),iu=a($c,"P",{});var Ok=l(iu);GJ=r(Ok,"Function invoked when calling the pipeline for generation."),Ok.forEach(t),WJ=d($c),_(jo.$$.fragment,$c),$c.forEach(t),Po.forEach(t),this.h()},h(){s(u,"name","hf:doc:metadata"),s(u,"content",JSON.stringify(M$)),s(h,"id","texttoimage-generation-with-controlnet-conditioning"),s(h,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(h,"href","#texttoimage-generation-with-controlnet-conditioning"),s(M,"class","relative group"),s(Y,"id","overview"),s(Y,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(Y,"href","#overview"),s(H,"class","relative group"),s(Ro,"href","https://arxiv.org/abs/2302.05543"),s(Ro,"rel","nofollow"),s(Vo,"href","https://huggingface.co/takuma104"),s(Vo,"rel","nofollow"),s(Ao,"href","https://arxiv.org/abs/2302.05543"),s(Ao,"rel","nofollow"),s(Xo,"href","https://github.com/lllyasviel/ControlNet"),s(Xo,"rel","nofollow"),s(zt,"id","available-pipelines"),s(zt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(zt,"href","#available-pipelines"),s(bt,"class","relative group"),s(Rs,"align","center"),s(Qo,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py"),s(Qo,"rel","nofollow"),s(Lo,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/controlnet.ipynb"),s(Lo,"rel","nofollow"),s(Vs,"align","center"),s(zo,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py"),s(zo,"rel","nofollow"),s(zc,"align","center"),s(Ho,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_controlnet_inpaint.py"),s(Ho,"rel","nofollow"),s(Kc,"align","center"),s(qt,"id","usage-example"),s(qt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(qt,"href","#usage-example"),s(Ut,"class","relative group"),s(Xs,"href","/docs/diffusers/v0.18.2/en/api/pipelines/controlnet#diffusers.StableDiffusionControlNetPipeline"),s(As,"start","2"),s(Ko,"href","https://huggingface.co/lllyasviel/sd-controlnet-canny"),s(Ko,"rel","nofollow"),J(Qs.src,qJ="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/input_image_vermeer.png")||s(Qs,"src",qJ),s(Qs,"alt","img"),s(Ls,"href","#controlnet-with-stable-diffusion-1.5"),J(ei.src,OJ="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/vermeer_canny_edged.png")||s(ei,"src",OJ),s(ei,"alt","img"),s(ti,"href","runwayml/stable-diffusion-v1-5"),s(ni,"href","/docs/diffusers/v0.18.2/en/api/schedulers/unipc#diffusers.UniPCMultistepScheduler"),J(si.src,KJ="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/vermeer_disco_dancing.png")||s(si,"src",KJ),s(si,"alt","img"),s(ii,"href","#controlnet-with-stable-diffusion-1.5"),s(on,"id","combining-multiple-conditionings"),s(on,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(on,"href","#combining-multiple-conditionings"),s(Jt,"class","relative group"),s(sn,"id","canny-conditioning"),s(sn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(sn,"href","#canny-conditioning"),s(Et,"class","relative group"),J(di.src,eE="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/landscape.png")||s(di,"src",eE),J(fi.src,tE="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/controlnet/landscape_canny_masked.png")||s(fi,"src",tE),s(rn,"id","openpose-conditioning"),s(rn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(rn,"href","#openpose-conditioning"),s(Ct,"class","relative group"),J(pa.src,nE="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/person.png")||s(pa,"src",nE),s(pa,"width","600"),J(ma.src,oE="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/controlnet/person_pose.png")||s(ma,"src",oE),s(ma,"width","600"),s(cn,"id","running-controlnet-with-multiple-conditionings"),s(cn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(cn,"href","#running-controlnet-with-multiple-conditionings"),s(jt,"class","relative group"),J(ga.src,aE="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/controlnet/multi_controlnet_output.png")||s(ga,"src",aE),s(ga,"width","600"),s(dn,"id","guess-mode"),s(dn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(dn,"href","#guess-mode"),s(Zt,"class","relative group"),s(ba,"href","https://github.com/lllyasviel/ControlNet#guess-mode--non-prompt-mode"),s(ba,"rel","nofollow"),s(va,"href","https://arxiv.org/abs/2302.05543"),s(va,"rel","nofollow"),s(pn,"id","the-core-implementation"),s(pn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(pn,"href","#the-core-implementation"),s(Nt,"class","relative group"),s(mn,"id","usage"),s(mn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(mn,"href","#usage"),s(xt,"class","relative group"),s(Ma,"href","https://github.com/lllyasviel/ControlNet#guess-mode--non-prompt-mode"),s(Ma,"rel","nofollow"),s(un,"id","output-image-comparison"),s(un,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(un,"href","#output-image-comparison"),s(kt,"class","relative group"),s(_i,"width","128"),J(_i.src,lE="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_guess_mode/output_images/diffusers/output_bird_canny_0.png")||s(_i,"src",lE),s(gi,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_guess_mode/output_images/diffusers/output_bird_canny_0.png"),s(vi,"width","128"),J(vi.src,sE="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_guess_mode/output_images/diffusers/output_bird_canny_0_gm.png")||s(vi,"src",sE),s(bi,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_guess_mode/output_images/diffusers/output_bird_canny_0_gm.png"),s(gn,"id","available-checkpoints"),s(gn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(gn,"href","#available-checkpoints"),s($t,"class","relative group"),s(Ca,"href","https://huggingface.co/lllyasviel"),s(Ca,"rel","nofollow"),s(yi,"href","#controlnet-v1.1"),s(bn,"id","controlnet-v10"),s(bn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(bn,"href","#controlnet-v10"),s(Wt,"class","relative group"),s(Za,"href","https://huggingface.co/lllyasviel/sd-controlnet-canny"),s(Za,"rel","nofollow"),s(wn,"width","64"),W(wn,"margin","0"),W(wn,"padding","0"),J(wn.src,iE="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_bird_canny.png")||s(wn,"src",iE),s(wi,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_bird_canny.png"),s(Ti,"width","64"),J(Ti.src,rE="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_bird_canny_1.png")||s(Ti,"src",rE),s(Mi,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_bird_canny_1.png"),s(Na,"href","https://huggingface.co/lllyasviel/sd-controlnet-depth"),s(Na,"rel","nofollow"),s(Ii,"width","64"),J(Ii.src,cE="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_vermeer_depth.png")||s(Ii,"src",cE),s(Ui,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_vermeer_depth.png"),s(Ei,"width","64"),J(Ei.src,dE="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_vermeer_depth_2.png")||s(Ei,"src",dE),s(Ji,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_vermeer_depth_2.png"),s(xa,"href","https://huggingface.co/lllyasviel/sd-controlnet-hed"),s(xa,"rel","nofollow"),s(ji,"width","64"),J(ji.src,pE="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_bird_hed.png")||s(ji,"src",pE),s(Ci,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_bird_hed.png"),s(Ni,"width","64"),J(Ni.src,fE="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_bird_hed_1.png")||s(Ni,"src",fE),s(Zi,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_bird_hed_1.png"),s(ka,"href","https://huggingface.co/lllyasviel/sd-controlnet-mlsd"),s(ka,"rel","nofollow"),s(ki,"width","64"),J(ki.src,mE="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_room_mlsd.png")||s(ki,"src",mE),s(xi,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_room_mlsd.png"),s(Gi,"width","64"),J(Gi.src,uE="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_room_mlsd_0.png")||s(Gi,"src",uE),s($i,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_room_mlsd_0.png"),s($a,"href","https://huggingface.co/lllyasviel/sd-controlnet-normal"),s($a,"rel","nofollow"),s(Wa,"href","https://en.wikipedia.org/wiki/Normal_mapping"),s(Wa,"rel","nofollow"),s(Di,"width","64"),J(Di.src,hE="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_human_normal.png")||s(Di,"src",hE),s(Wi,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_human_normal.png"),s(Bi,"width","64"),J(Bi.src,gE="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_human_normal_1.png")||s(Bi,"src",gE),s(Si,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_human_normal_1.png"),s(Da,"href","https://huggingface.co/lllyasviel/sd-controlnet_openpose"),s(Da,"rel","nofollow"),s(Ba,"href","https://github.com/CMU-Perceptual-Computing-Lab/openpose"),s(Ba,"rel","nofollow"),s(Fi,"width","64"),J(Fi.src,_E="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_human_openpose.png")||s(Fi,"src",_E),s(Pi,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_human_openpose.png"),s(Vi,"width","64"),J(Vi.src,bE="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_human_openpose_0.png")||s(Vi,"src",bE),s(Ri,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_human_openpose_0.png"),s(Pa,"href","https://huggingface.co/lllyasviel/sd-controlnet_scribble"),s(Pa,"rel","nofollow"),s(Xi,"width","64"),J(Xi.src,vE="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_vermeer_scribble.png")||s(Xi,"src",vE),s(Ai,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_vermeer_scribble.png"),s(Qi,"width","64"),J(Qi.src,yE="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_vermeer_scribble_0.png")||s(Qi,"src",yE),s(Yi,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_vermeer_scribble_0.png"),s(Ra,"href","https://huggingface.co/lllyasviel/sd-controlnet_seg"),s(Ra,"rel","nofollow"),s(Aa,"href","https://groups.csail.mit.edu/vision/datasets/ADE20K/"),s(Aa,"rel","nofollow"),s(zi,"width","64"),J(zi.src,wE="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_room_seg.png")||s(zi,"src",wE),s(Li,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_room_seg.png"),s(qi,"width","64"),J(qi.src,ME="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_room_seg_1.png")||s(qi,"src",ME),s(Hi,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_room_seg_1.png"),s(Cn,"id","controlnet-v11"),s(Cn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(Cn,"href","#controlnet-v11"),s(Dt,"class","relative group"),s(Ya,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_canny"),s(Ya,"rel","nofollow"),s(Zn,"width","64"),W(Zn,"margin","0"),W(Zn,"padding","0"),J(Zn.src,TE="https://huggingface.co/lllyasviel/control_v11p_sd15_canny/resolve/main/images/control.png")||s(Zn,"src",TE),s(Ki,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_canny/resolve/main/images/control.png"),s(tr,"width","64"),J(tr.src,UE="https://huggingface.co/lllyasviel/control_v11p_sd15_canny/resolve/main/images/image_out.png")||s(tr,"src",UE),s(er,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_canny/resolve/main/images/image_out.png"),s(Qa,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p"),s(Qa,"rel","nofollow"),s(Nn,"width","64"),W(Nn,"margin","0"),W(Nn,"padding","0"),J(Nn.src,IE="https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p/resolve/main/images/control.png")||s(Nn,"src",IE),s(or,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p/resolve/main/images/control.png"),s(lr,"width","64"),J(lr.src,JE="https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p/resolve/main/images/image_out.png")||s(lr,"src",JE),s(ar,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p/resolve/main/images/image_out.png"),s(La,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint"),s(La,"rel","nofollow"),s(xn,"width","64"),W(xn,"margin","0"),W(xn,"padding","0"),J(xn.src,EE="https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint/resolve/main/images/control.png")||s(xn,"src",EE),s(ir,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint/resolve/main/images/control.png"),s(cr,"width","64"),J(cr.src,CE="https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint/resolve/main/images/output.png")||s(cr,"src",CE),s(rr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint/resolve/main/images/output.png"),s(za,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd"),s(za,"rel","nofollow"),s(kn,"width","64"),W(kn,"margin","0"),W(kn,"padding","0"),J(kn.src,jE="https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd/resolve/main/images/control.png")||s(kn,"src",jE),s(pr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd/resolve/main/images/control.png"),s(mr,"width","64"),J(mr.src,ZE="https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd/resolve/main/images/image_out.png")||s(mr,"src",ZE),s(fr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd/resolve/main/images/image_out.png"),s(Ha,"href","https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth"),s(Ha,"rel","nofollow"),s($n,"width","64"),W($n,"margin","0"),W($n,"padding","0"),J($n.src,NE="https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth/resolve/main/images/control.png")||s($n,"src",NE),s(hr,"href","https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth/resolve/main/images/control.png"),s(_r,"width","64"),J(_r.src,xE="https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth/resolve/main/images/image_out.png")||s(_r,"src",xE),s(gr,"href","https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth/resolve/main/images/image_out.png"),s(qa,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae"),s(qa,"rel","nofollow"),s(Gn,"width","64"),W(Gn,"margin","0"),W(Gn,"padding","0"),J(Gn.src,kE="https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae/resolve/main/images/control.png")||s(Gn,"src",kE),s(vr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae/resolve/main/images/control.png"),s(wr,"width","64"),J(wr.src,$E="https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae/resolve/main/images/image_out.png")||s(wr,"src",$E),s(yr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae/resolve/main/images/image_out.png"),s(Oa,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_seg"),s(Oa,"rel","nofollow"),s(Wn,"width","64"),W(Wn,"margin","0"),W(Wn,"padding","0"),J(Wn.src,GE="https://huggingface.co/lllyasviel/control_v11p_sd15_seg/resolve/main/images/control.png")||s(Wn,"src",GE),s(Tr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_seg/resolve/main/images/control.png"),s(Ir,"width","64"),J(Ir.src,WE="https://huggingface.co/lllyasviel/control_v11p_sd15_seg/resolve/main/images/image_out.png")||s(Ir,"src",WE),s(Ur,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_seg/resolve/main/images/image_out.png"),s(Ka,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_lineart"),s(Ka,"rel","nofollow"),s(Dn,"width","64"),W(Dn,"margin","0"),W(Dn,"padding","0"),J(Dn.src,DE="https://huggingface.co/lllyasviel/control_v11p_sd15_lineart/resolve/main/images/control.png")||s(Dn,"src",DE),s(Er,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_lineart/resolve/main/images/control.png"),s(jr,"width","64"),J(jr.src,SE="https://huggingface.co/lllyasviel/control_v11p_sd15_lineart/resolve/main/images/image_out.png")||s(jr,"src",SE),s(Cr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_lineart/resolve/main/images/image_out.png"),s(el,"href","https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime"),s(el,"rel","nofollow"),s(Sn,"width","64"),W(Sn,"margin","0"),W(Sn,"padding","0"),J(Sn.src,BE="https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime/resolve/main/images/control.png")||s(Sn,"src",BE),s(Nr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime/resolve/main/images/control.png"),s(kr,"width","64"),J(kr.src,PE="https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime/resolve/main/images/image_out.png")||s(kr,"src",PE),s(xr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime/resolve/main/images/image_out.png"),s(tl,"href","https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime"),s(tl,"rel","nofollow"),s(Bn,"width","64"),W(Bn,"margin","0"),W(Bn,"padding","0"),J(Bn.src,FE="https://huggingface.co/lllyasviel/control_v11p_sd15_openpose/resolve/main/images/control.png")||s(Bn,"src",FE),s(Gr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_openpose/resolve/main/images/control.png"),s(Dr,"width","64"),J(Dr.src,RE="https://huggingface.co/lllyasviel/control_v11p_sd15_openpose/resolve/main/images/image_out.png")||s(Dr,"src",RE),s(Wr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_openpose/resolve/main/images/image_out.png"),s(nl,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_scribble"),s(nl,"rel","nofollow"),s(Pn,"width","64"),W(Pn,"margin","0"),W(Pn,"padding","0"),J(Pn.src,VE="https://huggingface.co/lllyasviel/control_v11p_sd15_scribble/resolve/main/images/control.png")||s(Pn,"src",VE),s(Br,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_scribble/resolve/main/images/control.png"),s(Fr,"width","64"),J(Fr.src,AE="https://huggingface.co/lllyasviel/control_v11p_sd15_scribble/resolve/main/images/image_out.png")||s(Fr,"src",AE),s(Pr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_scribble/resolve/main/images/image_out.png"),s(ol,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_softedge"),s(ol,"rel","nofollow"),s(Fn,"width","64"),W(Fn,"margin","0"),W(Fn,"padding","0"),J(Fn.src,XE="https://huggingface.co/lllyasviel/control_v11p_sd15_softedge/resolve/main/images/control.png")||s(Fn,"src",XE),s(Vr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_softedge/resolve/main/images/control.png"),s(Xr,"width","64"),J(Xr.src,YE="https://huggingface.co/lllyasviel/control_v11p_sd15_softedge/resolve/main/images/image_out.png")||s(Xr,"src",YE),s(Ar,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_softedge/resolve/main/images/image_out.png"),s(al,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle"),s(al,"rel","nofollow"),s(Rn,"width","64"),W(Rn,"margin","0"),W(Rn,"padding","0"),J(Rn.src,QE="https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle/resolve/main/images/control.png")||s(Rn,"src",QE),s(Qr,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle/resolve/main/images/control.png"),s(zr,"width","64"),J(zr.src,LE="https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle/resolve/main/images/image_out.png")||s(zr,"src",LE),s(Lr,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle/resolve/main/images/image_out.png"),s(ll,"href","https://huggingface.co/lllyasviel/control_v11f1e_sd15_tile"),s(ll,"rel","nofollow"),s(Vn,"width","64"),W(Vn,"margin","0"),W(Vn,"padding","0"),J(Vn.src,zE="https://huggingface.co/lllyasviel/control_v11f1e_sd15_tile/resolve/main/images/original.png")||s(Vn,"src",zE),s(qr,"href","https://huggingface.co/lllyasviel/control_v11f1e_sd15_tile/resolve/main/images/original.png"),s(Kr,"width","64"),J(Kr.src,HE="https://huggingface.co/lllyasviel/control_v11f1e_sd15_tile/resolve/main/images/output.png")||s(Kr,"src",HE),s(Or,"href","https://huggingface.co/lllyasviel/control_v11f1e_sd15_tile/resolve/main/images/output.png"),s(An,"id","diffusers.StableDiffusionControlNetPipeline"),s(An,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(An,"href","#diffusers.StableDiffusionControlNetPipeline"),s(St,"class","relative group"),s(ec,"href","/docs/diffusers/v0.18.2/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),s(tc,"href","/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/depth2img#diffusers.StableDiffusionDepth2ImgPipeline.load_textual_inversion"),s(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Yn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Qn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(vl,"href","https://facebookresearch.github.io/xformers/"),s(vl,"rel","nofollow"),s(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Ml,"href","https://facebookresearch.github.io/xformers/"),s(Ml,"rel","nofollow"),s(Hn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(nc,"href","/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),s(Jl,"href","https://civitai.com/models/3036?modelVersionId=9857"),s(Jl,"rel","nofollow"),s(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Kn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(eo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(to,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(no,"id","diffusers.StableDiffusionControlNetImg2ImgPipeline"),s(no,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(no,"href","#diffusers.StableDiffusionControlNetImg2ImgPipeline"),s(Pt,"class","relative group"),s(oc,"href","/docs/diffusers/v0.18.2/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),s(ac,"href","/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/depth2img#diffusers.StableDiffusionDepth2ImgPipeline.load_textual_inversion"),s(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(ao,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(lo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Xl,"href","https://facebookresearch.github.io/xformers/"),s(Xl,"rel","nofollow"),s(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Ll,"href","https://facebookresearch.github.io/xformers/"),s(Ll,"rel","nofollow"),s(ro,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(lc,"href","/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),s(Ol,"href","https://civitai.com/models/3036?modelVersionId=9857"),s(Ol,"rel","nofollow"),s(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(fo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(mo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(uo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(ho,"id","diffusers.StableDiffusionControlNetInpaintPipeline"),s(ho,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(ho,"href","#diffusers.StableDiffusionControlNetInpaintPipeline"),s(Rt,"class","relative group"),s(sc,"href","/docs/diffusers/v0.18.2/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),s(ic,"href","/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/depth2img#diffusers.StableDiffusionDepth2ImgPipeline.load_textual_inversion"),s(Xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(bo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(vo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(_s,"href","https://facebookresearch.github.io/xformers/"),s(_s,"rel","nofollow"),s(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(ys,"href","https://facebookresearch.github.io/xformers/"),s(ys,"rel","nofollow"),s(Mo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(rc,"href","/docs/diffusers/v0.18.2/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),s(Us,"href","https://civitai.com/models/3036?modelVersionId=9857"),s(Us,"rel","nofollow"),s(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Io,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Jo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Eo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(Co,"id","diffusers.FlaxStableDiffusionControlNetPipeline"),s(Co,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(Co,"href","#diffusers.FlaxStableDiffusionControlNetPipeline"),s(At,"class","relative group"),s(ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),s(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(n,f){e(document.head,u),m(n,I,f),m(n,M,f),e(M,h),e(h,U),b(p,U,null),e(M,T),e(M,_t),e(_t,Me),m(n,Xt,f),m(n,H,f),e(H,Y),e(Y,F),b(xe,F,null),e(H,Ds),e(H,Yt),e(Yt,k_),m(n,Zu,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,Bw),e(ne,Pw),e(ne,ef),e(ef,hr),e(hr,$n),e(ne,Fw),e(ne,tf),e(tf,gr),e(gr,_r),e(G,Rw),e(G,oe),e(oe,br),e(br,qa),e(qa,Vw),e(br,Aw),e(oe,Xw),e(oe,nf),e(nf,Yw),e(oe,Qw),e(oe,of),e(of,Lw),e(oe,zw),e(oe,af),e(af,vr),e(vr,Gn),e(oe,Hw),e(oe,lf),e(lf,yr),e(yr,wr),e(G,qw),e(G,ae),e(ae,Mr),e(Mr,Oa),e(Oa,Ow),e(Mr,Kw),e(ae,e2),e(ae,sf),e(sf,t2),e(ae,n2),e(ae,rf),e(rf,o2),e(ae,a2),e(ae,cf),e(cf,Tr),e(Tr,Wn),e(ae,l2),e(ae,df),e(df,Ur),e(Ur,Ir),e(G,s2),e(G,le),e(le,Jr),e(Jr,Ka),e(Ka,i2),e(Jr,r2),e(le,c2),e(le,pf),e(pf,d2),e(le,p2),e(le,ff),e(ff,f2),e(le,m2),e(le,mf),e(mf,Er),e(Er,Dn),e(le,u2),e(le,uf),e(uf,Cr),e(Cr,jr),e(G,h2),e(G,se),e(se,Zr),e(Zr,el),e(el,g2),e(Zr,_2),e(se,b2),e(se,hf),e(hf,v2),e(se,y2),e(se,gf),e(gf,w2),e(se,M2),e(se,_f),e(_f,Nr),e(Nr,Sn),e(se,T2),e(se,bf),e(bf,xr),e(xr,kr),e(G,U2),e(G,ie),e(ie,$r),e($r,tl),e(tl,I2),e($r,J2),e(ie,E2),e(ie,vf),e(vf,C2),e(ie,j2),e(ie,yf),e(yf,Z2),e(ie,N2),e(ie,wf),e(wf,Gr),e(Gr,Bn),e(ie,x2),e(ie,Mf),e(Mf,Wr),e(Wr,Dr),e(G,k2),e(G,re),e(re,Sr),e(Sr,nl),e(nl,$2),e(Sr,G2),e(re,W2),e(re,Tf),e(Tf,D2),e(re,S2),e(re,Uf),e(Uf,B2),e(re,P2),e(re,If),e(If,Br),e(Br,Pn),e(re,F2),e(re,Jf),e(Jf,Pr),e(Pr,Fr),e(G,R2),e(G,ce),e(ce,Rr),e(Rr,ol),e(ol,V2),e(Rr,A2),e(ce,X2),e(ce,Ef),e(Ef,Y2),e(ce,Q2),e(ce,Cf),e(Cf,L2),e(ce,z2),e(ce,jf),e(jf,Vr),e(Vr,Fn),e(ce,H2),e(ce,Zf),e(Zf,Ar),e(Ar,Xr),e(G,q2),e(G,de),e(de,Yr),e(Yr,al),e(al,O2),e(Yr,K2),e(de,eM),e(de,Nf),e(Nf,tM),e(de,nM),e(de,xf),e(xf,oM),e(de,aM),e(de,kf),e(kf,Qr),e(Qr,Rn),e(de,lM),e(de,$f),e($f,Lr),e(Lr,zr),e(G,sM),e(G,pe),e(pe,Hr),e(Hr,ll),e(ll,iM),e(Hr,rM),e(pe,cM),e(pe,Gf),e(Gf,dM),e(pe,pM),e(pe,Wf),e(Wf,fM),e(pe,mM),e(pe,Df),e(Df,qr),e(qr,Vn),e(pe,uM),e(pe,Sf),e(Sf,Or),e(Or,Kr),m(n,Qh,f),m(n,St,f),e(St,An),e(An,Bf),b(sl,Bf,null),e(St,hM),e(St,Pf),e(Pf,gM),m(n,Lh,f),m(n,j,f),b(il,j,null),e(j,_M),e(j,Ff),e(Ff,bM),e(j,vM),e(j,rl),e(rl,yM),e(rl,ec),e(ec,wM),e(rl,MM),e(j,TM),e(j,Rf),e(Rf,UM),e(j,IM),e(j,Vf),e(Vf,cl),e(cl,Af),e(Af,JM),e(cl,EM),e(cl,tc),e(tc,CM),e(j,jM),e(j,De),b(dl,De,null),e(De,ZM),e(De,Xf),e(Xf,NM),e(De,xM),b(Xn,De,null),e(j,kM),e(j,Se),b(pl,Se,null),e(Se,$M),e(Se,Yf),e(Yf,GM),e(Se,WM),e(Se,Qf),e(Qf,DM),e(j,SM),e(j,Yn),b(fl,Yn,null),e(Yn,BM),e(Yn,ml),e(ml,PM),e(ml,Lf),e(Lf,FM),e(ml,RM),e(j,VM),e(j,Be),b(ul,Be,null),e(Be,AM),e(Be,zf),e(zf,XM),e(Be,YM),e(Be,Hf),e(Hf,QM),e(j,LM),e(j,Qn),b(hl,Qn,null),e(Qn,zM),e(Qn,gl),e(gl,HM),e(gl,qf),e(qf,qM),e(gl,OM),e(j,KM),e(j,Q),b(_l,Q,null),e(Q,e0),e(Q,bl),e(bl,t0),e(bl,vl),e(vl,n0),e(bl,o0),e(Q,a0),e(Q,Of),e(Of,l0),e(Q,s0),b(Ln,Q,null),e(Q,i0),b(zn,Q,null),e(j,r0),e(j,Hn),b(yl,Hn,null),e(Hn,c0),e(Hn,wl),e(wl,d0),e(wl,Ml),e(Ml,p0),e(wl,f0),e(j,m0),e(j,R),b(Tl,R,null),e(R,u0),e(R,Ul),e(Ul,h0),e(Ul,nc),e(nc,g0),e(Ul,_0),e(R,b0),e(R,Kf),e(Kf,v0),e(R,y0),b(qn,R,null),e(R,w0),e(R,Il),e(Il,M0),e(Il,Jl),e(Jl,T0),e(Il,U0),e(R,I0),b(On,R,null),e(j,J0),e(j,Kn),b(El,Kn,null),e(Kn,E0),e(Kn,Cl),e(Cl,C0),e(Cl,em),e(em,j0),e(Cl,Z0),e(j,N0),e(j,eo),b(jl,eo,null),e(eo,x0),e(eo,fe),e(fe,k0),e(fe,tm),e(tm,$0),e(fe,G0),e(fe,nm),e(nm,W0),e(fe,D0),e(fe,om),e(om,S0),e(fe,B0),e(fe,am),e(am,P0),e(fe,F0),e(j,R0),e(j,to),b(Zl,to,null),e(to,V0),e(to,Bt),e(Bt,A0),e(Bt,lm),e(lm,X0),e(Bt,Y0),e(Bt,sm),e(sm,Q0),e(Bt,L0),e(j,z0),e(j,Pe),b(Nl,Pe,null),e(Pe,H0),e(Pe,im),e(im,q0),e(Pe,O0),e(Pe,rm),e(rm,K0),m(n,zh,f),m(n,Pt,f),e(Pt,no),e(no,cm),b(xl,cm,null),e(Pt,eT),e(Pt,dm),e(dm,tT),m(n,Hh,f),m(n,Z,f),b(kl,Z,null),e(Z,nT),e(Z,pm),e(pm,oT),e(Z,aT),e(Z,$l),e($l,lT),e($l,oc),e(oc,sT),e($l,iT),e(Z,rT),e(Z,fm),e(fm,cT),e(Z,dT),e(Z,mm),e(mm,Gl),e(Gl,um),e(um,pT),e(Gl,fT),e(Gl,ac),e(ac,mT),e(Z,uT),e(Z,Fe),b(Wl,Fe,null),e(Fe,hT),e(Fe,hm),e(hm,gT),e(Fe,_T),b(oo,Fe,null),e(Z,bT),e(Z,Re),b(Dl,Re,null),e(Re,vT),e(Re,gm),e(gm,yT),e(Re,wT),e(Re,_m),e(_m,MT),e(Z,TT),e(Z,ao),b(Sl,ao,null),e(ao,UT),e(ao,Bl),e(Bl,IT),e(Bl,bm),e(bm,JT),e(Bl,ET),e(Z,CT),e(Z,Ve),b(Pl,Ve,null),e(Ve,jT),e(Ve,vm),e(vm,ZT),e(Ve,NT),e(Ve,ym),e(ym,xT),e(Z,kT),e(Z,lo),b(Fl,lo,null),e(lo,$T),e(lo,Rl),e(Rl,GT),e(Rl,wm),e(wm,WT),e(Rl,DT),e(Z,ST),e(Z,L),b(Vl,L,null),e(L,BT),e(L,Al),e(Al,PT),e(Al,Xl),e(Xl,FT),e(Al,RT),e(L,VT),e(L,Mm),e(Mm,AT),e(L,XT),b(so,L,null),e(L,YT),b(io,L,null),e(Z,QT),e(Z,ro),b(Yl,ro,null),e(ro,LT),e(ro,Ql),e(Ql,zT),e(Ql,Ll),e(Ll,HT),e(Ql,qT),e(Z,OT),e(Z,V),b(zl,V,null),e(V,KT),e(V,Hl),e(Hl,eU),e(Hl,lc),e(lc,tU),e(Hl,nU),e(V,oU),e(V,Tm),e(Tm,aU),e(V,lU),b(co,V,null),e(V,sU),e(V,ql),e(ql,iU),e(ql,Ol),e(Ol,rU),e(ql,cU),e(V,dU),b(po,V,null),e(Z,pU),e(Z,fo),b(Kl,fo,null),e(fo,fU),e(fo,es),e(es,mU),e(es,Um),e(Um,uU),e(es,hU),e(Z,gU),e(Z,mo),b(ts,mo,null),e(mo,_U),e(mo,me),e(me,bU),e(me,Im),e(Im,vU),e(me,yU),e(me,Jm),e(Jm,wU),e(me,MU),e(me,Em),e(Em,TU),e(me,UU),e(me,Cm),e(Cm,IU),e(me,JU),e(Z,EU),e(Z,uo),b(ns,uo,null),e(uo,CU),e(uo,Ft),e(Ft,jU),e(Ft,jm),e(jm,ZU),e(Ft,NU),e(Ft,Zm),e(Zm,xU),e(Ft,kU),e(Z,$U),e(Z,Ae),b(os,Ae,null),e(Ae,GU),e(Ae,Nm),e(Nm,WU),e(Ae,DU),e(Ae,xm),e(xm,SU),m(n,qh,f),m(n,Rt,f),e(Rt,ho),e(ho,km),b(as,km,null),e(Rt,BU),e(Rt,$m),e($m,PU),m(n,Oh,f),m(n,E,f),b(ls,E,null),e(E,FU),e(E,Gm),e(Gm,RU),e(E,VU),e(E,ss),e(ss,AU),e(ss,sc),e(sc,XU),e(ss,YU),e(E,QU),e(E,Wm),e(Wm,LU),e(E,zU),e(E,Dm),e(Dm,is),e(is,Sm),e(Sm,HU),e(is,qU),e(is,ic),e(ic,OU),e(E,KU),b(go,E,null),e(E,eI),e(E,Xe),b(rs,Xe,null),e(Xe,tI),e(Xe,Bm),e(Bm,nI),e(Xe,oI),b(_o,Xe,null),e(E,aI),e(E,Ye),b(cs,Ye,null),e(Ye,lI),e(Ye,Pm),e(Pm,sI),e(Ye,iI),e(Ye,Fm),e(Fm,rI),e(E,cI),e(E,bo),b(ds,bo,null),e(bo,dI),e(bo,ps),e(ps,pI),e(ps,Rm),e(Rm,fI),e(ps,mI),e(E,uI),e(E,Qe),b(fs,Qe,null),e(Qe,hI),e(Qe,Vm),e(Vm,gI),e(Qe,_I),e(Qe,Am),e(Am,bI),e(E,vI),e(E,vo),b(ms,vo,null),e(vo,yI),e(vo,us),e(us,wI),e(us,Xm),e(Xm,MI),e(us,TI),e(E,UI),e(E,z),b(hs,z,null),e(z,II),e(z,gs),e(gs,JI),e(gs,_s),e(_s,EI),e(gs,CI),e(z,jI),e(z,Ym),e(Ym,ZI),e(z,NI),b(yo,z,null),e(z,xI),b(wo,z,null),e(E,kI),e(E,Mo),b(bs,Mo,null),e(Mo,$I),e(Mo,vs),e(vs,GI),e(vs,ys),e(ys,WI),e(vs,DI),e(E,SI),e(E,A),b(ws,A,null),e(A,BI),e(A,Ms),e(Ms,PI),e(Ms,rc),e(rc,FI),e(Ms,RI),e(A,VI),e(A,Qm),e(Qm,AI),e(A,XI),b(To,A,null),e(A,YI),e(A,Ts),e(Ts,QI),e(Ts,Us),e(Us,LI),e(Ts,zI),e(A,HI),b(Uo,A,null),e(E,qI),e(E,Io),b(Is,Io,null),e(Io,OI),e(Io,Js),e(Js,KI),e(Js,Lm),e(Lm,eJ),e(Js,tJ),e(E,nJ),e(E,Jo),b(Es,Jo,null),e(Jo,oJ),e(Jo,ue),e(ue,aJ),e(ue,zm),e(zm,lJ),e(ue,sJ),e(ue,Hm),e(Hm,iJ),e(ue,rJ),e(ue,qm),e(qm,cJ),e(ue,dJ),e(ue,Om),e(Om,pJ),e(ue,fJ),e(E,mJ),e(E,Eo),b(Cs,Eo,null),e(Eo,uJ),e(Eo,Vt),e(Vt,hJ),e(Vt,Km),e(Km,gJ),e(Vt,_J),e(Vt,eu),e(eu,bJ),e(Vt,vJ),e(E,yJ),e(E,Le),b(js,Le,null),e(Le,wJ),e(Le,tu),e(tu,MJ),e(Le,TJ),e(Le,nu),e(nu,UJ),m(n,Kh,f),m(n,At,f),e(At,Co),e(Co,ou),b(Zs,ou,null),e(At,IJ),e(At,au),e(au,JJ),m(n,eg,f),m(n,he,f),b(Ns,he,null),e(he,EJ),e(he,lu),e(lu,CJ),e(he,jJ),e(he,xs),e(xs,ZJ),e(xs,su),e(su,NJ),e(xs,xJ),e(he,kJ),e(he,ze),b(ks,ze,null),e(ze,$J),e(ze,iu),e(iu,GJ),e(ze,WJ),b(jo,ze,null),tg=!0},p(n,[f]){const $s={};f&2&&($s.$$scope={dirty:f,ctx:n}),Xn.$set($s);const ru={};f&2&&(ru.$$scope={dirty:f,ctx:n}),Ln.$set(ru);const cu={};f&2&&(cu.$$scope={dirty:f,ctx:n}),zn.$set(cu);const du={};f&2&&(du.$$scope={dirty:f,ctx:n}),qn.$set(du);const Gs={};f&2&&(Gs.$$scope={dirty:f,ctx:n}),On.$set(Gs);const pu={};f&2&&(pu.$$scope={dirty:f,ctx:n}),oo.$set(pu);const fu={};f&2&&(fu.$$scope={dirty:f,ctx:n}),so.$set(fu);const mu={};f&2&&(mu.$$scope={dirty:f,ctx:n}),io.$set(mu);const cc={};f&2&&(cc.$$scope={dirty:f,ctx:n}),co.$set(cc);const uu={};f&2&&(uu.$$scope={dirty:f,ctx:n}),po.$set(uu);const hu={};f&2&&(hu.$$scope={dirty:f,ctx:n}),go.$set(hu);const gu={};f&2&&(gu.$$scope={dirty:f,ctx:n}),_o.$set(gu);const _u={};f&2&&(_u.$$scope={dirty:f,ctx:n}),yo.$set(_u);const bu={};f&2&&(bu.$$scope={dirty:f,ctx:n}),wo.$set(bu);const Ws={};f&2&&(Ws.$$scope={dirty:f,ctx:n}),To.$set(Ws);const vu={};f&2&&(vu.$$scope={dirty:f,ctx:n}),Uo.$set(vu);const yu={};f&2&&(yu.$$scope={dirty:f,ctx:n}),jo.$set(yu)},i(n){tg||(v(p.$$.fragment,n),v(xe.$$.fragment,n),v(Yo.$$.fragment,n),v(qo.$$.fragment,n),v(ea.$$.fragment,n),v(ta.$$.fragment,n),v(na.$$.fragment,n),v(oa.$$.fragment,n),v(aa.$$.fragment,n),v(la.$$.fragment,n),v(sa.$$.fragment,n),v(ia.$$.fragment,n),v(ra.$$.fragment,n),v(ca.$$.fragment,n),v(da.$$.fragment,n),v(fa.$$.fragment,n),v(ua.$$.fragment,n),v(ha.$$.fragment,n),v(_a.$$.fragment,n),v(ya.$$.fragment,n),v(wa.$$.fragment,n),v(Ta.$$.fragment,n),v(Ua.$$.fragment,n),v(Ea.$$.fragment,n),v(ja.$$.fragment,n),v(Xa.$$.fragment,n),v(sl.$$.fragment,n),v(il.$$.fragment,n),v(dl.$$.fragment,n),v(Xn.$$.fragment,n),v(pl.$$.fragment,n),v(fl.$$.fragment,n),v(ul.$$.fragment,n),v(hl.$$.fragment,n),v(_l.$$.fragment,n),v(Ln.$$.fragment,n),v(zn.$$.fragment,n),v(yl.$$.fragment,n),v(Tl.$$.fragment,n),v(qn.$$.fragment,n),v(On.$$.fragment,n),v(El.$$.fragment,n),v(jl.$$.fragment,n),v(Zl.$$.fragment,n),v(Nl.$$.fragment,n),v(xl.$$.fragment,n),v(kl.$$.fragment,n),v(Wl.$$.fragment,n),v(oo.$$.fragment,n),v(Dl.$$.fragment,n),v(Sl.$$.fragment,n),v(Pl.$$.fragment,n),v(Fl.$$.fragment,n),v(Vl.$$.fragment,n),v(so.$$.fragment,n),v(io.$$.fragment,n),v(Yl.$$.fragment,n),v(zl.$$.fragment,n),v(co.$$.fragment,n),v(po.$$.fragment,n),v(Kl.$$.fragment,n),v(ts.$$.fragment,n),v(ns.$$.fragment,n),v(os.$$.fragment,n),v(as.$$.fragment,n),v(ls.$$.fragment,n),v(go.$$.fragment,n),v(rs.$$.fragment,n),v(_o.$$.fragment,n),v(cs.$$.fragment,n),v(ds.$$.fragment,n),v(fs.$$.fragment,n),v(ms.$$.fragment,n),v(hs.$$.fragment,n),v(yo.$$.fragment,n),v(wo.$$.fragment,n),v(bs.$$.fragment,n),v(ws.$$.fragment,n),v(To.$$.fragment,n),v(Uo.$$.fragment,n),v(Is.$$.fragment,n),v(Es.$$.fragment,n),v(Cs.$$.fragment,n),v(js.$$.fragment,n),v(Zs.$$.fragment,n),v(Ns.$$.fragment,n),v(ks.$$.fragment,n),v(jo.$$.fragment,n),tg=!0)},o(n){y(p.$$.fragment,n),y(xe.$$.fragment,n),y(Yo.$$.fragment,n),y(qo.$$.fragment,n),y(ea.$$.fragment,n),y(ta.$$.fragment,n),y(na.$$.fragment,n),y(oa.$$.fragment,n),y(aa.$$.fragment,n),y(la.$$.fragment,n),y(sa.$$.fragment,n),y(ia.$$.fragment,n),y(ra.$$.fragment,n),y(ca.$$.fragment,n),y(da.$$.fragment,n),y(fa.$$.fragment,n),y(ua.$$.fragment,n),y(ha.$$.fragment,n),y(_a.$$.fragment,n),y(ya.$$.fragment,n),y(wa.$$.fragment,n),y(Ta.$$.fragment,n),y(Ua.$$.fragment,n),y(Ea.$$.fragment,n),y(ja.$$.fragment,n),y(Xa.$$.fragment,n),y(sl.$$.fragment,n),y(il.$$.fragment,n),y(dl.$$.fragment,n),y(Xn.$$.fragment,n),y(pl.$$.fragment,n),y(fl.$$.fragment,n),y(ul.$$.fragment,n),y(hl.$$.fragment,n),y(_l.$$.fragment,n),y(Ln.$$.fragment,n),y(zn.$$.fragment,n),y(yl.$$.fragment,n),y(Tl.$$.fragment,n),y(qn.$$.fragment,n),y(On.$$.fragment,n),y(El.$$.fragment,n),y(jl.$$.fragment,n),y(Zl.$$.fragment,n),y(Nl.$$.fragment,n),y(xl.$$.fragment,n),y(kl.$$.fragment,n),y(Wl.$$.fragment,n),y(oo.$$.fragment,n),y(Dl.$$.fragment,n),y(Sl.$$.fragment,n),y(Pl.$$.fragment,n),y(Fl.$$.fragment,n),y(Vl.$$.fragment,n),y(so.$$.fragment,n),y(io.$$.fragment,n),y(Yl.$$.fragment,n),y(zl.$$.fragment,n),y(co.$$.fragment,n),y(po.$$.fragment,n),y(Kl.$$.fragment,n),y(ts.$$.fragment,n),y(ns.$$.fragment,n),y(os.$$.fragment,n),y(as.$$.fragment,n),y(ls.$$.fragment,n),y(go.$$.fragment,n),y(rs.$$.fragment,n),y(_o.$$.fragment,n),y(cs.$$.fragment,n),y(ds.$$.fragment,n),y(fs.$$.fragment,n),y(ms.$$.fragment,n),y(hs.$$.fragment,n),y(yo.$$.fragment,n),y(wo.$$.fragment,n),y(bs.$$.fragment,n),y(ws.$$.fragment,n),y(To.$$.fragment,n),y(Uo.$$.fragment,n),y(Is.$$.fragment,n),y(Es.$$.fragment,n),y(Cs.$$.fragment,n),y(js.$$.fragment,n),y(Zs.$$.fragment,n),y(Ns.$$.fragment,n),y(ks.$$.fragment,n),y(jo.$$.fragment,n),tg=!1},d(n){t(u),n&&t(I),n&&t(M),w(p),n&&t(Xt),n&&t(H),w(xe),n&&t(Zu),n&&t(Fo),n&&t(Nu),n&&t(Ss),n&&t(xu),n&&t(Bs),n&&t(ku),n&&t(Ps),n&&t($u),n&&t(Qt),n&&t(Gu),n&&t(Fs),n&&t(Wu),n&&t(Lt),n&&t(Du),n&&t(bt),w(Yo),n&&t(Su),n&&t(Ht),n&&t(Bu),n&&t(Ut),w(qo),n&&t(Pu),n&&t(Ot),n&&t(Fu),n&&t(Kt),n&&t(Ru),n&&t(en),n&&t(Vu),w(ea,n),n&&t(Au),n&&t(Ys),n&&t(Xu),n&&t(ke),n&&t(Yu),n&&t(zs),n&&t(Qu),w(ta,n),n&&t(Lu),n&&t(Hs),n&&t(zu),w(na,n),n&&t(Hu),n&&t(qs),n&&t(qu),w(oa,n),n&&t(Ou),n&&t(Os),n&&t(Ku),n&&t(Ks),n&&t(eh),n&&t(tn),n&&t(th),w(aa,n),n&&t(nh),n&&t(nn),n&&t(oh),w(la,n),n&&t(ah),n&&t(oi),n&&t(lh),w(sa,n),n&&t(sh),n&&t(ai),n&&t(ih),n&&t(li),n&&t(rh),n&&t(It),n&&t(ch),n&&t(Jt),w(ia),n&&t(dh),n&&t(an),n&&t(ph),n&&t(ri),n&&t(fh),n&&t(ln),n&&t(mh),n&&t(Et),w(ra),n&&t(uh),n&&t(ci),n&&t(hh),n&&t(di),n&&t(gh),n&&t(pi),n&&t(_h),w(ca,n),n&&t(bh),n&&t(fi),n&&t(vh),n&&t(Ct),w(da),n&&t(yh),n&&t(mi),n&&t(wh),n&&t(pa),n&&t(Mh),n&&t(ui),n&&t(Th),w(fa,n),n&&t(Uh),n&&t(ma),n&&t(Ih),n&&t(jt),w(ua),n&&t(Jh),w(ha,n),n&&t(Eh),n&&t(ga),n&&t(Ch),n&&t(Zt),w(_a),n&&t(jh),n&&t($e),n&&t(Zh),n&&t(hi),n&&t(Nh),n&&t(Nt),w(ya),n&&t(xh),n&&t(Ge),n&&t(kh),n&&t(fn),n&&t($h),n&&t(xt),w(wa),n&&t(Gh),n&&t(be),n&&t(Wh),w(Ta,n),n&&t(Dh),n&&t(kt),w(Ua),n&&t(Sh),n&&t(hn),n&&t(Bh),n&&t($t),w(Ea),n&&t(Ph),n&&t(We),n&&t(Fh),n&&t(_n),n&&t(Rh),n&&t(Gt),n&&t(Vh),n&&t(Wt),w(ja),n&&t(Ah),n&&t(vn),n&&t(Xh),n&&t(Dt),w(Xa),n&&t(Yh),n&&t(jn),n&&t(Qh),n&&t(St),w(sl),n&&t(Lh),n&&t(j),w(il),w(dl),w(Xn),w(pl),w(fl),w(ul),w(hl),w(_l),w(Ln),w(zn),w(yl),w(Tl),w(qn),w(On),w(El),w(jl),w(Zl),w(Nl),n&&t(zh),n&&t(Pt),w(xl),n&&t(Hh),n&&t(Z),w(kl),w(Wl),w(oo),w(Dl),w(Sl),w(Pl),w(Fl),w(Vl),w(so),w(io),w(Yl),w(zl),w(co),w(po),w(Kl),w(ts),w(ns),w(os),n&&t(qh),n&&t(Rt),w(as),n&&t(Oh),n&&t(E),w(ls),w(go),w(rs),w(_o),w(cs),w(ds),w(fs),w(ms),w(hs),w(yo),w(wo),w(bs),w(ws),w(To),w(Uo),w(Is),w(Es),w(Cs),w(js),n&&t(Kh),n&&t(At),w(Zs),n&&t(eg),n&&t(he),w(Ns),w(ks),w(jo)}}}const M$={local:"texttoimage-generation-with-controlnet-conditioning",sections:[{local:"overview",title:"Overview"},{local:"available-pipelines",title:"Available Pipelines:"},{local:"usage-example",title:"Usage example"},{local:"combining-multiple-conditionings",sections:[{local:"canny-conditioning",title:"Canny conditioning"},{local:"openpose-conditioning",title:"Openpose conditioning"},{local:"running-controlnet-with-multiple-conditionings",title:"Running ControlNet with multiple conditionings"},{local:"guess-mode",sections:[{local:"the-core-implementation",title:"The core implementation:"},{local:"usage",title:"Usage:"},{local:"output-image-comparison",title:"Output image comparison:"}],title:"Guess Mode"}],title:"Combining multiple conditionings"},{local:"available-checkpoints",sections:[{local:"controlnet-v10",title:"ControlNet v1.0"},{local:"controlnet-v11",title:"ControlNet v1.1"}],title:"Available checkpoints"},{local:"diffusers.StableDiffusionControlNetPipeline",title:"StableDiffusionControlNetPipeline"},{local:"diffusers.StableDiffusionControlNetImg2ImgPipeline",title:"StableDiffusionControlNetImg2ImgPipeline"},{local:"diffusers.StableDiffusionControlNetInpaintPipeline",title:"StableDiffusionControlNetInpaintPipeline"},{local:"diffusers.FlaxStableDiffusionControlNetPipeline",title:"FlaxStableDiffusionControlNetPipeline"}],title:"Text-to-Image Generation with ControlNet Conditioning"};function T$(N){return o$(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Z$ extends Kk{constructor(u){super();e$(this,u,T$,w$,t$,{})}}export{Z$ as default,M$ as metadata};
