import{S as fZ,i as uZ,s as hZ,e as o,k as c,w as b,t as i,M as gZ,c as a,d as t,m as d,a as s,x as y,h as r,b as l,N as I,f as G,G as e,g as f,y as v,q as w,o as M,B as T,v as _Z,L as fe}from"../../../chunks/vendor-hf-doc-builder.js";import{T as tg}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 me}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function bZ(N){let u,J,g,h,U;return h=new S({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjBvcGVuY3YtcHl0aG9uJTIwdHJhbnNmb3JtZXJzJTIwYWNjZWxlcmF0ZSUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBTdGFibGVEaWZmdXNpb25Db250cm9sTmV0UGlwZWxpbmUlMkMlMjBDb250cm9sTmV0TW9kZWwlMkMlMjBVbmlQQ011bHRpc3RlcFNjaGVkdWxlciUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBaW1wb3J0JTIwdG9yY2glMEElMEFpbXBvcnQlMjBjdjIlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEElMjMlMjBkb3dubG9hZCUyMGFuJTIwaW1hZ2UlMEFpbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZoZi5jbyUyRmRhdGFzZXRzJTJGaHVnZ2luZ2ZhY2UlMkZkb2N1bWVudGF0aW9uLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGZGlmZnVzZXJzJTJGaW5wdXRfaW1hZ2VfdmVybWVlci5wbmclMjIlMEEpJTBBaW1hZ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lMjBVbmlQQ011bHRpc3RlcFNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlLnNjaGVkdWxlci5jb25maWcpJTBBJTIzJTIwcmVtb3ZlJTIwZm9sbG93aW5nJTIwbGluZSUyMGlmJTIweGZvcm1lcnMlMjBpcyUyMG5vdCUyMGluc3RhbGxlZCUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKCklMEElMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBJTIzJTIwZ2VuZXJhdGUlMjBpbWFnZSUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLm1hbnVhbF9zZWVkKDApJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMCUyMmZ1dHVyaXN0aWMtbG9va2luZyUyMHdvbWFuJTIyJTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTIwaW1hZ2UlM0RjYW5ueV9pbWFnZSUwQSkuaW1hZ2VzJTVCMCU1RA==",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"),J=i("Examples:"),g=c(),b(h.$$.fragment)},l(p){u=a(p,"P",{});var _=s(u);J=r(_,"Examples:"),_.forEach(t),g=d(p),y(h.$$.fragment,p)},m(p,_){f(p,u,_),e(u,J),f(p,g,_),v(h,p,_),U=!0},p:fe,i(p){U||(w(h.$$.fragment,p),U=!0)},o(p){M(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(g),T(h,p)}}}function yZ(N){let u,J;return{c(){u=o("p"),J=i(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(g){u=a(g,"P",{});var h=s(u);J=r(h,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),h.forEach(t)},m(g,h){f(g,u,h),e(u,J)},d(g){g&&t(u)}}}function vZ(N){let u,J,g,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"),J=i("Examples:"),g=c(),b(h.$$.fragment)},l(p){u=a(p,"P",{});var _=s(u);J=r(_,"Examples:"),_.forEach(t),g=d(p),y(h.$$.fragment,p)},m(p,_){f(p,u,_),e(u,J),f(p,g,_),v(h,p,_),U=!0},p:fe,i(p){U||(w(h.$$.fragment,p),U=!0)},o(p){M(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(g),T(h,p)}}}function wZ(N){let u,J,g,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"),J=i("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),g=c(),b(h.$$.fragment)},l(p){u=a(p,"P",{});var _=s(u);J=r(_,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),_.forEach(t),g=d(p),y(h.$$.fragment,p)},m(p,_){f(p,u,_),e(u,J),f(p,g,_),v(h,p,_),U=!0},p:fe,i(p){U||(w(h.$$.fragment,p),U=!0)},o(p){M(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(g),T(h,p)}}}function MZ(N){let u,J,g,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"),J=i("locally:"),g=c(),b(h.$$.fragment)},l(p){u=a(p,"P",{});var _=s(u);J=r(_,"locally:"),_.forEach(t),g=d(p),y(h.$$.fragment,p)},m(p,_){f(p,u,_),e(u,J),f(p,g,_),v(h,p,_),U=!0},p:fe,i(p){U||(w(h.$$.fragment,p),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bF9zZWVkKDApJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMCUyMmZ1dHVyaXN0aWMtbG9va2luZyUyMHdvbWFuJTIyJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0RpbWFnZSUyQyUwQSUyMCUyMCUyMCUyMGNvbnRyb2xfaW1hZ2UlM0RjYW5ueV9pbWFnZSUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",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"),J=i("Examples:"),g=c(),b(h.$$.fragment)},l(p){u=a(p,"P",{});var _=s(u);J=r(_,"Examples:"),_.forEach(t),g=d(p),y(h.$$.fragment,p)},m(p,_){f(p,u,_),e(u,J),f(p,g,_),v(h,p,_),U=!0},p:fe,i(p){U||(w(h.$$.fragment,p),U=!0)},o(p){M(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(g),T(h,p)}}}function UZ(N){let u,J;return{c(){u=o("p"),J=i(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(g){u=a(g,"P",{});var h=s(u);J=r(h,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),h.forEach(t)},m(g,h){f(g,u,h),e(u,J)},d(g){g&&t(u)}}}function JZ(N){let u,J,g,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"),J=i("Examples:"),g=c(),b(h.$$.fragment)},l(p){u=a(p,"P",{});var _=s(u);J=r(_,"Examples:"),_.forEach(t),g=d(p),y(h.$$.fragment,p)},m(p,_){f(p,u,_),e(u,J),f(p,g,_),v(h,p,_),U=!0},p:fe,i(p){U||(w(h.$$.fragment,p),U=!0)},o(p){M(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(g),T(h,p)}}}function IZ(N){let u,J,g,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"),J=i("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),g=c(),b(h.$$.fragment)},l(p){u=a(p,"P",{});var _=s(u);J=r(_,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),_.forEach(t),g=d(p),y(h.$$.fragment,p)},m(p,_){f(p,u,_),e(u,J),f(p,g,_),v(h,p,_),U=!0},p:fe,i(p){U||(w(h.$$.fragment,p),U=!0)},o(p){M(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(g),T(h,p)}}}function EZ(N){let u,J,g,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"),J=i("locally:"),g=c(),b(h.$$.fragment)},l(p){u=a(p,"P",{});var _=s(u);J=r(_,"locally:"),_.forEach(t),g=d(p),y(h.$$.fragment,p)},m(p,_){f(p,u,_),e(u,J),f(p,g,_),v(h,p,_),U=!0},p:fe,i(p){U||(w(h.$$.fragment,p),U=!0)},o(p){M(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(g),T(h,p)}}}function CZ(N){let u,J,g,h,U,p,_,at,we,Ut,Me;return{c(){u=o("p"),J=i(`This pipeline can be used both with checkpoints that have been specifically fine-tuned for inpainting, such as
`),g=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"),_=i("runwayml/stable-diffusion-v1-5"),at=i(`.
Default text-to-image stable diffusion checkpoints might be preferable for controlnets that have been fine-tuned on
those, such as `),we=o("a"),Ut=i("lllyasviel/control_v11p_sd15_inpaint"),Me=i("."),this.h()},l(Y){u=a(Y,"P",{});var A=s(u);J=r(A,`This pipeline can be used both with checkpoints that have been specifically fine-tuned for inpainting, such as
`),g=a(A,"A",{href:!0,rel:!0});var fl=s(g);h=r(fl,"runwayml/stable-diffusion-inpainting"),fl.forEach(t),U=r(A,`
as well as default text-to-image stable diffusion checkpoints, such as
`),p=a(A,"A",{href:!0,rel:!0});var Io=s(p);_=r(Io,"runwayml/stable-diffusion-v1-5"),Io.forEach(t),at=r(A,`.
Default text-to-image stable diffusion checkpoints might be preferable for controlnets that have been fine-tuned on
those, such as `),we=a(A,"A",{href:!0,rel:!0});var st=s(we);Ut=r(st,"lllyasviel/control_v11p_sd15_inpaint"),st.forEach(t),Me=r(A,"."),A.forEach(t),this.h()},h(){l(g,"href","https://huggingface.co/runwayml/stable-diffusion-inpainting"),l(g,"rel","nofollow"),l(p,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5"),l(p,"rel","nofollow"),l(we,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint"),l(we,"rel","nofollow")},m(Y,A){f(Y,u,A),e(u,J),e(u,g),e(g,h),e(u,U),e(u,p),e(p,_),e(u,at),e(u,we),e(we,Ut),e(u,Me)},d(Y){Y&&t(u)}}}function jZ(N){let u,J,g,h,U;return h=new S({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjB0cmFuc2Zvcm1lcnMlMjBhY2NlbGVyYXRlJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRJbnBhaW50UGlwZWxpbmUlMkMlMjBDb250cm9sTmV0TW9kZWwlMkMlMjBERElNU2NoZWR1bGVyJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEFpbXBvcnQlMjBudW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W5lZCglMEElMjAlMjAlMjAlMjAlMjJydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUyQyUyMGNvbnRyb2xuZXQlM0Rjb250cm9sbmV0JTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQSUwQXBpcGUuc2NoZWR1bGVyJTIwJTNEJTIwRERJTVNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlLnNjaGVkdWxlci5jb25maWcpJTBBcGlwZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQSUwQSUyMyUyMGdlbmVyYXRlJTIwaW1hZ2UlMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwJTIyYSUyMGhhbmRzb21lJTIwbWFuJTIwd2l0aCUyMHJheS1iYW4lMjBzdW5nbGFzc2VzJTIyJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTBBJTIwJTIwJTIwJTIwZXRhJTNEMS4wJTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0Rpbml0X2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwbWFza19pbWFnZSUzRG1hc2tfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBjb250cm9sX2ltYWdlJTNEY29udHJvbF9pbWFnZSUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",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"),J=i("Examples:"),g=c(),b(h.$$.fragment)},l(p){u=a(p,"P",{});var _=s(u);J=r(_,"Examples:"),_.forEach(t),g=d(p),y(h.$$.fragment,p)},m(p,_){f(p,u,_),e(u,J),f(p,g,_),v(h,p,_),U=!0},p:fe,i(p){U||(w(h.$$.fragment,p),U=!0)},o(p){M(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(g),T(h,p)}}}function ZZ(N){let u,J;return{c(){u=o("p"),J=i(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(g){u=a(g,"P",{});var h=s(u);J=r(h,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),h.forEach(t)},m(g,h){f(g,u,h),e(u,J)},d(g){g&&t(u)}}}function NZ(N){let u,J,g,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"),J=i("Examples:"),g=c(),b(h.$$.fragment)},l(p){u=a(p,"P",{});var _=s(u);J=r(_,"Examples:"),_.forEach(t),g=d(p),y(h.$$.fragment,p)},m(p,_){f(p,u,_),e(u,J),f(p,g,_),v(h,p,_),U=!0},p:fe,i(p){U||(w(h.$$.fragment,p),U=!0)},o(p){M(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(g),T(h,p)}}}function xZ(N){let u,J,g,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"),J=i("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),g=c(),b(h.$$.fragment)},l(p){u=a(p,"P",{});var _=s(u);J=r(_,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),_.forEach(t),g=d(p),y(h.$$.fragment,p)},m(p,_){f(p,u,_),e(u,J),f(p,g,_),v(h,p,_),U=!0},p:fe,i(p){U||(w(h.$$.fragment,p),U=!0)},o(p){M(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(g),T(h,p)}}}function kZ(N){let u,J,g,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"),J=i("locally:"),g=c(),b(h.$$.fragment)},l(p){u=a(p,"P",{});var _=s(u);J=r(_,"locally:"),_.forEach(t),g=d(p),y(h.$$.fragment,p)},m(p,_){f(p,u,_),e(u,J),f(p,g,_),v(h,p,_),U=!0},p:fe,i(p){U||(w(h.$$.fragment,p),U=!0)},o(p){M(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(g),T(h,p)}}}function $Z(N){let u,J,g,h,U;return h=new S({props:{code:"aW1wb3J0JTIwamF4JTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBaW1wb3J0JTIwamF4Lm51bXB5JTIwYXMlMjBqbnAlMEFmcm9tJTIwZmxheC5qYXhfdXRpbHMlMjBpbXBvcnQlMjByZXBsaWNhdGUlMEFmcm9tJTIwZmxheC50cmFpbmluZy5jb21tb25fdXRpbHMlMjBpbXBvcnQlMjBzaGFyZCUwQWZyb20lMjBkaWZm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cHRfaWRzJTNEbmVnYXRpdmVfcHJvbXB0X2lkcyUyQyUwQSUyMCUyMCUyMCUyMGppdCUzRFRydWUlMkMlMEEpLmltYWdlcyUwQSUwQW91dHB1dF9pbWFnZXMlMjAlM0QlMjBwaXBlLm51bXB5X3RvX3BpbChucC5hc2FycmF5KG91dHB1dC5yZXNoYXBlKChudW1fc2FtcGxlcyUyQyklMjAlMkIlMjBvdXRwdXQuc2hhcGUlNUItMyUzQSU1RCkpKSUwQW91dHB1dF9pbWFnZXMlMjAlM0QlMjBpbWFnZV9ncmlkKG91dHB1dF9pbWFnZXMlMkMlMjBudW1fc2FtcGxlcyUyMCUyRiUyRiUyMDQlMkMlMjA0KSUwQW91dHB1dF9pbWFnZXMuc2F2ZSglMjJnZW5lcmF0ZWRfaW1hZ2UucG5nJTIyKQ==",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"),J=i("Examples:"),g=c(),b(h.$$.fragment)},l(p){u=a(p,"P",{});var _=s(u);J=r(_,"Examples:"),_.forEach(t),g=d(p),y(h.$$.fragment,p)},m(p,_){f(p,u,_),e(u,J),f(p,g,_),v(h,p,_),U=!0},p:fe,i(p){U||(w(h.$$.fragment,p),U=!0)},o(p){M(h.$$.fragment,p),U=!1},d(p){p&&t(u),p&&t(g),T(h,p)}}}function WZ(N){let u,J,g,h,U,p,_,at,we,Ut,Me,Y,A,fl,Io,st,ng,tf,ul,og,nf,hl,Ar,ag,of,Jt,sg,Eo,lg,ig,af,It,rg,Co,cg,dg,sf,lt,Et,Yr,jo,pg,Qr,mg,lf,Ct,fg,Lr,ug,hg,rf,jt,zr,Hr,qr,gg,_g,Or,gl,Zo,bg,_l,yg,vg,cf,Zt,wg,No,Mg,Tg,df,xo,pf,bl,yl,nU,mf,xe,Ug,Kr,Jg,Ig,vl,Eg,Cg,ff,wl,jg,uf,ko,hf,Ml,Zg,gf,$o,_f,Tl,Ng,bf,Wo,yf,Ul,xg,vf,Jl,Il,oU,wf,Nt,kg,El,$g,Wg,Mf,Go,Tf,xt,Gg,Cl,Dg,Sg,Uf,Do,Jf,jl,Bg,If,So,Ef,Zl,Pg,Cf,Nl,xl,aU,jf,it,ec,Fg,Rg,kl,Vg,Xg,Zf,rt,kt,tc,Bo,Ag,nc,Yg,Nf,$t,Qg,oc,Lg,zg,xf,$l,Hg,kf,Wt,qg,ac,Og,Kg,$f,ct,Gt,sc,Po,e_,lc,t_,Wf,Wl,n_,Gf,Gl,sU,Df,Dl,o_,Sf,Fo,Bf,Sl,lU,Pf,dt,Dt,ic,Ro,a_,rc,s_,Ff,Bl,l_,Rf,Vo,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yRmRvY3VtZW50YXRpb24taW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZkaWZmdXNlcnMlMkZpbnB1dF9pbWFnZV92ZXJtZWVyLnBuZyUyMiUwQSk=",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>
)`}}),ko=new S({props:{code:"cGlwJTIwaW5zdGFsbCUyMG9wZW5jdi1jb250cmliLXB5dGhvbg==",highlighted:'pip <span class="hljs-keyword">install</span> opencv-contrib-python'}}),$o=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'}}),Wo=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)`}}),Go=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
)`}}),Do=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()`}}),So=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>]`}}),Bo=new P({}),Po=new P({}),Fo=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjBjdjIlMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQSUwQWNhbm55X2ltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZodWdnaW5nZmFjZSUyRmRvY3VtZW50YXRpb24taW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZkaWZmdXNlcnMlMkZsYW5kc2NhcGUucG5nJTIyJTBBKSUwQWNhbm55X2ltYWdlJTIwJTNEJTIwbnAuYXJyYXkoY2FubnlfaW1hZ2UpJTBBJTBBbG93X3RocmVzaG9sZCUyMCUzRCUyMDEwMCUwQWhpZ2hfdGhyZXNob2xkJTIwJTNEJTIwMjAwJTBBJTBBY2FubnlfaW1hZ2UlMjAlM0QlMjBjdjIuQ2FubnkoY2FubnlfaW1hZ2UlMkMlMjBsb3dfdGhyZXNob2xkJTJDJTIwaGlnaF90aHJlc2hvbGQpJTBBJTBBJTIzJTIwemVybyUyMG91dCUyMG1pZGRsZSUyMGNvbHVtbnMlMjBvZiUyMGltYWdlJTIwd2hlcmUlMjBwb3NlJTIwd2lsbCUyMGJlJTIwb3ZlcmxheWVkJTBBemVyb19zdGFydCUyMCUzRCUyMGNhbm55X2ltYWdlLnNoYXBlJTVCMSU1RCUyMCUyRiUyRiUyMDQlMEF6ZXJvX2VuZCUyMCUzRCUyMHplcm9fc3RhcnQlMjAlMkIlMjBjYW5ueV9pbWFnZS5zaGFwZSU1QjElNUQlMjAlMkYlMkYlMjAyJTBBY2FubnlfaW1hZ2UlNUIlM0ElMkMlMjB6ZXJvX3N0YXJ0JTNBemVyb19lbmQlNUQlMjAlM0QlMjAwJTBBJTBBY2FubnlfaW1hZ2UlMjAlM0QlMjBjYW5ueV9pbWFnZSU1QiUzQSUyQyUyMCUzQSUyQyUyME5vbmUlNUQlMEFjYW5ueV9pbWFnZSUyMCUzRCUyMG5wLmNvbmNhdGVuYXRlKCU1QmNhbm55X2ltYWdlJTJDJTIwY2FubnlfaW1hZ2UlMkMlMjBjYW5ueV9pbWFnZSU1RCUyQyUyMGF4aXMlM0QyKSUwQWNhbm55X2ltYWdlJTIwJTNEJTIwSW1hZ2UuZnJvbWFycmF5KGNhbm55X2ltYWdlKQ==",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)`}}),Ro=new P({}),Xo=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)`}}),Yo=new P({}),Qo=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZSUyQy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0eSUyMiUwQW5lZ2F0aXZlX3Byb21wdCUyMCUzRCUyMCUyMm1vbm9jaHJvbWUlMkMlMjBsb3dyZXMlMkMlMjBiYWQlMjBhbmF0b215JTJDJTIwd29yc3QlMjBxdWFsaXR5JTJDJTIwbG93JTIwcXVhbGl0eSUyMiUwQSUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLkdlbmVyYXRvcihkZXZpY2UlM0QlMjJjcHUlMjIpLm1hbnVhbF9zZWVkKDEpJTBBJTBBaW1hZ2VzJTIwJTNEJTIwJTVCb3BlbnBvc2VfaW1hZ2UlMkMlMjBjYW5ueV9pbWFnZSU1RCUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBpbWFnZXMlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMjAlMkMlMEElMjAlMjAlMjAlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3IlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9wcm9tcHQlM0RuZWdhdGl2ZV9wcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBjb250cm9sbmV0X2NvbmRpdGlvbmluZ19zY2FsZSUzRCU1QjEuMCUyQyUyMDAuOCU1RCUyQyUwQSkuaW1hZ2VzJTVCMCU1RCUwQSUwQWltYWdlLnNhdmUoJTIyLiUyRm11bHRpX2NvbnRyb2xuZXRfb3V0cHV0LnBuZyUyMik=",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>)`}}),zo=new P({}),Oo=new P({}),Ko=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>)`}}),na=new P({}),sa=new P({}),ia=new P({}),Ta=new P({}),Sa=new P({}),Ba=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/main/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/main/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/main/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/main/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/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/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/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L93"}}),Ra=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/main/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/main/en/api/pipelines/stable_diffusion/inpaint#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/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</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/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L663",returnDescription:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/inpaint#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/main/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),wn=new me({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.example",$$slots:{default:[bZ]},$$scope:{ctx:N}}}),Va=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/main/src/diffusers/pipelines/pipeline_utils.py#L1669"}}),Xa=new C({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1684"}}),Ya=new C({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L182"}}),Qa=new C({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L190"}}),za=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/main/src/diffusers/pipelines/pipeline_utils.py#L1608"}}),In=new tg({props:{warning:!0,$$slots:{default:[yZ]},$$scope:{ctx:N}}}),En=new me({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[vZ]},$$scope:{ctx:N}}}),Oa=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/main/src/diffusers/pipelines/pipeline_utils.py#L1643"}}),ts=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/main/src/diffusers/loaders.py#L641"}}),jn=new me({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.example",$$slots:{default:[wZ]},$$scope:{ctx:N}}}),Zn=new me({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.example-2",$$slots:{default:[MZ]},$$scope:{ctx:N}}}),ss=new C({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L207"}}),is=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/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L214"}}),rs=new C({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L198"}}),cs=new P({}),ds=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/main/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/main/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/main/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/main/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/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/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/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L119"}}),fs=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/main/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/main/en/api/pipelines/stable_diffusion/inpaint#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/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</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/main/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/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L741",returnDescription:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/inpaint#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/main/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Wn=new me({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.example",$$slots:{default:[TZ]},$$scope:{ctx:N}}}),us=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/main/src/diffusers/pipelines/pipeline_utils.py#L1669"}}),hs=new C({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1684"}}),_s=new C({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L208"}}),bs=new C({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L216"}}),vs=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/main/src/diffusers/pipelines/pipeline_utils.py#L1608"}}),Pn=new tg({props:{warning:!0,$$slots:{default:[UZ]},$$scope:{ctx:N}}}),Fn=new me({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[JZ]},$$scope:{ctx:N}}}),Ts=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/main/src/diffusers/pipelines/pipeline_utils.py#L1643"}}),Is=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/main/src/diffusers/loaders.py#L641"}}),Vn=new me({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.example",$$slots:{default:[IZ]},$$scope:{ctx:N}}}),Xn=new me({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.example-2",$$slots:{default:[EZ]},$$scope:{ctx:N}}}),Zs=new C({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L233"}}),xs=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/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L240"}}),ks=new C({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L224"}}),$s=new P({}),Ws=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/main/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/main/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/main/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/main/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/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/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/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L225"}}),zn=new tg({props:{$$slots:{default:[CZ]},$$scope:{ctx:N}}}),Ss=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/main/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/main/en/api/pipelines/stable_diffusion/inpaint#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/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</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/main/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/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L941",returnDescription:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/inpaint#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/main/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Hn=new me({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.example",$$slots:{default:[jZ]},$$scope:{ctx:N}}}),Bs=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/main/src/diffusers/pipelines/pipeline_utils.py#L1669"}}),Ps=new C({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1684"}}),Rs=new C({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L325"}}),Vs=new C({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L333"}}),As=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/main/src/diffusers/pipelines/pipeline_utils.py#L1608"}}),to=new tg({props:{warning:!0,$$slots:{default:[ZZ]},$$scope:{ctx:N}}}),no=new me({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[NZ]},$$scope:{ctx:N}}}),Ls=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/main/src/diffusers/pipelines/pipeline_utils.py#L1643"}}),qs=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/main/src/diffusers/loaders.py#L641"}}),ao=new me({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.example",$$slots:{default:[xZ]},$$scope:{ctx:N}}}),so=new me({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.example-2",$$slots:{default:[kZ]},$$scope:{ctx:N}}}),tl=new C({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L350"}}),ol=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/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L357"}}),al=new C({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L341"}}),sl=new P({}),ll=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/main/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/main/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/main/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/main/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/main/src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py#L119"}}),rl=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 <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput">FlaxStableDiffusionPipelineOutput</a> 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/main/src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py#L357",returnDescription:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"
>FlaxStableDiffusionPipelineOutput</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/main/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"
>FlaxStableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),po=new me({props:{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.example",$$slots:{default:[$Z]},$$scope:{ctx:N}}}),{c(){u=o("meta"),J=c(),g=o("h1"),h=o("a"),U=o("span"),b(p.$$.fragment),_=c(),at=o("span"),we=i("ControlNet"),Ut=c(),Me=o("p"),Y=o("a"),A=i("Adding Conditional Control to Text-to-Image Diffusion Models"),fl=i(" by Lvmin Zhang and Maneesh Agrawala."),Io=c(),st=o("p"),ng=i("Using a pretrained model, 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."),tf=c(),ul=o("p"),og=i("The abstract from the paper is:"),nf=c(),hl=o("p"),Ar=o("em"),ag=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."),of=c(),Jt=o("p"),sg=i("This model was contributed by "),Eo=o("a"),lg=i("takuma104"),ig=i(". \u2764\uFE0F"),af=c(),It=o("p"),rg=i("The original codebase can be found at "),Co=o("a"),cg=i("lllyasviel/ControlNet"),dg=i("."),sf=c(),lt=o("h2"),Et=o("a"),Yr=o("span"),b(jo.$$.fragment),pg=c(),Qr=o("span"),mg=i("Usage example"),lf=c(),Ct=o("p"),fg=i("In the following we give a simple example of how to use a "),Lr=o("em"),ug=i("ControlNet"),hg=i(` checkpoint with Diffusers for inference.
The inference pipeline is the same for all pipelines:`),rf=c(),jt=o("ul"),zr=o("li"),Hr=o("ol"),qr=o("li"),gg=i("Take an image and run it through a pre-conditioning processor."),_g=c(),Or=o("li"),gl=o("ol"),Zo=o("li"),bg=i("Run the pre-processed image through the "),_l=o("a"),yg=i("StableDiffusionControlNetPipeline"),vg=i("."),cf=c(),Zt=o("p"),wg=i("Let\u2019s have a look at a simple example using the "),No=o("a"),Mg=i("Canny Edge ControlNet"),Tg=i("."),df=c(),b(xo.$$.fragment),pf=c(),bl=o("p"),yl=o("img"),mf=c(),xe=o("p"),Ug=i("Next, we process the image to get the canny image. This is step "),Kr=o("em"),Jg=i("1."),Ig=i(" - running the pre-conditioning processor. The pre-conditioning processor is different for every ControlNet. Please see the model cards of the "),vl=o("a"),Eg=i("official checkpoints"),Cg=i(" for more information about other models."),ff=c(),wl=o("p"),jg=i("First, we need to install opencv:"),uf=c(),b(ko.$$.fragment),hf=c(),Ml=o("p"),Zg=i("Next, let\u2019s also install all required Hugging Face libraries:"),gf=c(),b($o.$$.fragment),_f=c(),Tl=o("p"),Ng=i("Then we can retrieve the canny edges of the image."),bf=c(),b(Wo.$$.fragment),yf=c(),Ul=o("p"),xg=i("Let\u2019s take a look at the processed image."),vf=c(),Jl=o("p"),Il=o("img"),wf=c(),Nt=o("p"),kg=i("Now, we load the official "),El=o("a"),$g=i("Stable Diffusion 1.5 Model"),Wg=i(" as well as the ControlNet for canny edges."),Mf=c(),b(Go.$$.fragment),Tf=c(),xt=o("p"),Gg=i("To speed-up things and reduce memory, let\u2019s enable model offloading and use the fast "),Cl=o("a"),Dg=i("UniPCMultistepScheduler"),Sg=i("."),Uf=c(),b(Do.$$.fragment),Jf=c(),jl=o("p"),Bg=i("Finally, we can run the pipeline:"),If=c(),b(So.$$.fragment),Ef=c(),Zl=o("p"),Pg=i("This should take only around 3-4 seconds on GPU (depending on hardware). The output image then looks as follows:"),Cf=c(),Nl=o("p"),xl=o("img"),jf=c(),it=o("p"),ec=o("strong"),Fg=i("Note"),Rg=i(": To see how to run all other ControlNet checkpoints, please have a look at "),kl=o("a"),Vg=i("ControlNet with Stable Diffusion 1.5"),Xg=i("."),Zf=c(),rt=o("h2"),kt=o("a"),tc=o("span"),b(Bo.$$.fragment),Ag=c(),nc=o("span"),Yg=i("Combining multiple conditionings"),Nf=c(),$t=o("p"),Qg=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 "),oc=o("code"),Lg=i("__call__"),zg=i("."),xf=c(),$l=o("p"),Hg=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."),kf=c(),Wt=o("p"),qg=i("It can also be helpful to vary the "),ac=o("code"),Og=i("controlnet_conditioning_scales"),Kg=i(" to emphasize one conditioning over the other."),$f=c(),ct=o("h3"),Gt=o("a"),sc=o("span"),b(Po.$$.fragment),e_=c(),lc=o("span"),t_=i("Canny conditioning"),Wf=c(),Wl=o("p"),n_=i("The original image:"),Gf=c(),Gl=o("img"),Df=c(),Dl=o("p"),o_=i("Prepare the conditioning:"),Sf=c(),b(Fo.$$.fragment),Bf=c(),Sl=o("img"),Pf=c(),dt=o("h3"),Dt=o("a"),ic=o("span"),b(Ro.$$.fragment),a_=c(),rc=o("span"),s_=i("Openpose conditioning"),Ff=c(),Bl=o("p"),l_=i("The original image:"),Rf=c(),Vo=o("img"),Vf=c(),Pl=o("p"),i_=i("Prepare the conditioning:"),Xf=c(),b(Xo.$$.fragment),Af=c(),Ao=o("img"),Yf=c(),pt=o("h3"),St=o("a"),cc=o("span"),b(Yo.$$.fragment),r_=c(),dc=o("span"),c_=i("Running ControlNet with multiple conditionings"),Qf=c(),b(Qo.$$.fragment),Lf=c(),Lo=o("img"),zf=c(),mt=o("h3"),Bt=o("a"),pc=o("span"),b(zo.$$.fragment),d_=c(),mc=o("span"),p_=i("Guess Mode"),Hf=c(),ke=o("p"),m_=i("Guess Mode is "),Ho=o("a"),f_=i("a ControlNet feature that was implemented"),u_=i(" after the publication of "),qo=o("a"),h_=i("the paper"),g_=i(". The description states:"),qf=c(),Fl=o("blockquote"),fc=o("p"),__=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."),Of=c(),ft=o("h4"),Pt=o("a"),uc=o("span"),b(Oo.$$.fragment),b_=c(),hc=o("span"),y_=i("The core implementation:"),Kf=c(),$e=o("p"),v_=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 "),gc=o("code"),w_=i("0.1"),M_=i(". As the blocks get deeper, the scale increases exponentially, and the scale for the output of the MidBlock becomes "),_c=o("code"),T_=i("1.0"),U_=i("."),eu=c(),Ft=o("p"),J_=i("Since the core implementation is just this, "),bc=o("strong"),I_=i("it does not have any impact on prompt conditioning"),E_=i(". While it is common to use it without specifying any prompts, it is also possible to provide prompts if desired."),tu=c(),ut=o("h4"),Rt=o("a"),yc=o("span"),b(Ko.$$.fragment),C_=c(),vc=o("span"),j_=i("Usage:"),nu=c(),ue=o("p"),Z_=i("Just specify "),wc=o("code"),N_=i("guess_mode=True"),x_=i(" in the pipe() function. A "),Mc=o("code"),k_=i("guidance_scale"),$_=i(" between 3.0 and 5.0 is "),ea=o("a"),W_=i("recommended"),G_=i("."),ou=c(),b(ta.$$.fragment),au=c(),ht=o("h4"),Vt=o("a"),Tc=o("span"),b(na.$$.fragment),D_=c(),Uc=o("span"),S_=i("Output image comparison:"),su=i(`

Canny Control Example
`),Xt=o("table"),Jc=o("thead"),oa=o("tr"),Ic=o("th"),B_=i("no guess_mode with prompt"),P_=c(),Ec=o("th"),F_=i("guess_mode without prompt"),R_=c(),Cc=o("tbody"),aa=o("tr"),jc=o("td"),Rl=o("a"),Vl=o("img"),V_=c(),Zc=o("td"),Xl=o("a"),Al=o("img"),lu=c(),gt=o("h2"),At=o("a"),Nc=o("span"),b(sa.$$.fragment),X_=c(),xc=o("span"),A_=i("Available checkpoints"),iu=c(),We=o("p"),Y_=i("ControlNet requires a "),kc=o("em"),Q_=i("control image"),L_=i(" in addition to the text-to-image "),$c=o("em"),z_=i("prompt"),H_=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.`),ru=c(),Yt=o("p"),q_=i("All checkpoints can be found under the authors\u2019 namespace "),la=o("a"),O_=i("lllyasviel"),K_=i("."),cu=c(),_t=o("p"),Wc=o("strong"),eb=i("13.04.2024 Update"),tb=i(": The author has released improved controlnet checkpoints v1.1 - see "),Yl=o("a"),nb=i("here"),ob=i("."),du=c(),bt=o("h3"),Qt=o("a"),Gc=o("span"),b(ia.$$.fragment),ab=c(),Dc=o("span"),sb=i("ControlNet v1.0"),pu=c(),Lt=o("table"),Sc=o("thead"),Te=o("tr"),Bc=o("th"),lb=i("Model Name"),ib=c(),Pc=o("th"),rb=i("Control Image Overview"),cb=c(),Fc=o("th"),db=i("Control Image Example"),pb=c(),Rc=o("th"),mb=i("Generated Image Example"),fb=c(),B=o("tbody"),Ue=o("tr"),zt=o("td"),ra=o("a"),ub=i("lllyasviel/sd-controlnet-canny"),hb=o("br"),gb=c(),Vc=o("em"),_b=i("Trained with canny edge detection"),bb=c(),Xc=o("td"),yb=i("A monochrome image with white edges on a black background."),vb=c(),Ac=o("td"),Ql=o("a"),Ht=o("img"),wb=c(),Yc=o("td"),Ll=o("a"),zl=o("img"),Mb=c(),Je=o("tr"),qt=o("td"),ca=o("a"),Tb=i("lllyasviel/sd-controlnet-depth"),Ub=o("br"),Jb=c(),Qc=o("em"),Ib=i("Trained with Midas depth estimation"),Eb=c(),Lc=o("td"),Cb=i("A grayscale image with black representing deep areas and white representing shallow areas."),jb=c(),zc=o("td"),Hl=o("a"),ql=o("img"),Zb=c(),Hc=o("td"),Ol=o("a"),Kl=o("img"),Nb=c(),Ie=o("tr"),Ot=o("td"),da=o("a"),xb=i("lllyasviel/sd-controlnet-hed"),kb=o("br"),$b=c(),qc=o("em"),Wb=i("Trained with HED edge detection (soft edge)"),Gb=c(),Oc=o("td"),Db=i("A monochrome image with white soft edges on a black background."),Sb=c(),Kc=o("td"),ei=o("a"),ti=o("img"),Bb=c(),ed=o("td"),ni=o("a"),oi=o("img"),Pb=c(),Ee=o("tr"),Kt=o("td"),pa=o("a"),Fb=i("lllyasviel/sd-controlnet-mlsd"),Rb=o("br"),Vb=c(),td=o("em"),Xb=i("Trained with M-LSD line detection"),Ab=c(),nd=o("td"),Yb=i("A monochrome image composed only of white straight lines on a black background."),Qb=c(),od=o("td"),ai=o("a"),si=o("img"),Lb=c(),ad=o("td"),li=o("a"),ii=o("img"),zb=c(),Ce=o("tr"),en=o("td"),ma=o("a"),Hb=i("lllyasviel/sd-controlnet-normal"),qb=o("br"),Ob=c(),sd=o("em"),Kb=i("Trained with normal map"),ey=c(),fa=o("td"),ty=i("A "),ua=o("a"),ny=i("normal mapped"),oy=i(" image."),ay=c(),ld=o("td"),ri=o("a"),ci=o("img"),sy=c(),id=o("td"),di=o("a"),pi=o("img"),ly=c(),je=o("tr"),tn=o("td"),ha=o("a"),iy=i("lllyasviel/sd-controlnet-openpose"),ry=o("br"),cy=c(),rd=o("em"),dy=i("Trained with OpenPose bone image"),py=c(),ga=o("td"),my=i("A "),_a=o("a"),fy=i("OpenPose bone"),uy=i(" image."),hy=c(),cd=o("td"),mi=o("a"),fi=o("img"),gy=c(),dd=o("td"),ui=o("a"),hi=o("img"),_y=c(),Ze=o("tr"),nn=o("td"),ba=o("a"),by=i("lllyasviel/sd-controlnet-scribble"),yy=o("br"),vy=c(),pd=o("em"),wy=i("Trained with human scribbles"),My=c(),md=o("td"),Ty=i("A hand-drawn monochrome image with white outlines on a black background."),Uy=c(),fd=o("td"),gi=o("a"),_i=o("img"),Jy=c(),ud=o("td"),bi=o("a"),yi=o("img"),Iy=c(),Ne=o("tr"),ya=o("td"),va=o("a"),Ey=i("lllyasviel/sd-controlnet-seg"),Cy=o("br"),hd=o("em"),jy=i("Trained with semantic segmentation"),Zy=c(),wa=o("td"),Ny=i("An "),Ma=o("a"),xy=i("ADE20K"),ky=i("\u2019s segmentation protocol image."),$y=c(),gd=o("td"),vi=o("a"),wi=o("img"),Wy=c(),_d=o("td"),Mi=o("a"),Ti=o("img"),mu=c(),yt=o("h3"),on=o("a"),bd=o("span"),b(Ta.$$.fragment),Gy=c(),yd=o("span"),Dy=i("ControlNet v1.1"),fu=c(),an=o("table"),vd=o("thead"),Q=o("tr"),wd=o("th"),Sy=i("Model Name"),By=c(),Md=o("th"),Py=i("Control Image Overview"),Fy=c(),Td=o("th"),Ry=i("Condition Image"),Vy=c(),Ud=o("th"),Xy=i("Control Image Example"),Ay=c(),Jd=o("th"),Yy=i("Generated Image Example"),Qy=c(),W=o("tbody"),L=o("tr"),Ui=o("td"),Ua=o("a"),Ly=i("lllyasviel/control_v11p_sd15_canny"),zy=o("br"),Hy=c(),Id=o("td"),Ed=o("em"),qy=i("Trained with canny edge detection"),Oy=c(),Cd=o("td"),Ky=i("A monochrome image with white edges on a black background."),ev=c(),jd=o("td"),Ji=o("a"),sn=o("img"),tv=c(),Zd=o("td"),Ii=o("a"),Ei=o("img"),nv=c(),z=o("tr"),Ci=o("td"),Ja=o("a"),ov=i("lllyasviel/control_v11e_sd15_ip2p"),av=o("br"),sv=c(),Nd=o("td"),xd=o("em"),lv=i("Trained with pixel to pixel instruction"),iv=c(),kd=o("td"),rv=i("No condition ."),cv=c(),$d=o("td"),ji=o("a"),ln=o("img"),dv=c(),Wd=o("td"),Zi=o("a"),Ni=o("img"),pv=c(),H=o("tr"),xi=o("td"),Ia=o("a"),mv=i("lllyasviel/control_v11p_sd15_inpaint"),fv=o("br"),uv=c(),Gd=o("td"),hv=i("Trained with image inpainting"),gv=c(),Dd=o("td"),_v=i("No condition."),bv=c(),Sd=o("td"),ki=o("a"),rn=o("img"),yv=c(),Bd=o("td"),$i=o("a"),Wi=o("img"),vv=c(),q=o("tr"),Gi=o("td"),Ea=o("a"),wv=i("lllyasviel/control_v11p_sd15_mlsd"),Mv=o("br"),Tv=c(),Pd=o("td"),Uv=i("Trained with multi-level line segment detection"),Jv=c(),Fd=o("td"),Iv=i("An image with annotated line segments."),Ev=c(),Rd=o("td"),Di=o("a"),cn=o("img"),Cv=c(),Vd=o("td"),Si=o("a"),Bi=o("img"),jv=c(),O=o("tr"),Pi=o("td"),Ca=o("a"),Zv=i("lllyasviel/control_v11f1p_sd15_depth"),Nv=o("br"),xv=c(),Xd=o("td"),kv=i("Trained with depth estimation"),$v=c(),Ad=o("td"),Wv=i("An image with depth information, usually represented as a grayscale image."),Gv=c(),Yd=o("td"),Fi=o("a"),dn=o("img"),Dv=c(),Qd=o("td"),Ri=o("a"),Vi=o("img"),Sv=c(),K=o("tr"),Xi=o("td"),ja=o("a"),Bv=i("lllyasviel/control_v11p_sd15_normalbae"),Pv=o("br"),Fv=c(),Ld=o("td"),Rv=i("Trained with surface normal estimation"),Vv=c(),zd=o("td"),Xv=i("An image with surface normal information, usually represented as a color-coded image."),Av=c(),Hd=o("td"),Ai=o("a"),pn=o("img"),Yv=c(),qd=o("td"),Yi=o("a"),Qi=o("img"),Qv=c(),ee=o("tr"),Li=o("td"),Za=o("a"),Lv=i("lllyasviel/control_v11p_sd15_seg"),zv=o("br"),Hv=c(),Od=o("td"),qv=i("Trained with image segmentation"),Ov=c(),Kd=o("td"),Kv=i("An image with segmented regions, usually represented as a color-coded image."),e1=c(),ep=o("td"),zi=o("a"),mn=o("img"),t1=c(),tp=o("td"),Hi=o("a"),qi=o("img"),n1=c(),te=o("tr"),Oi=o("td"),Na=o("a"),o1=i("lllyasviel/control_v11p_sd15_lineart"),a1=o("br"),s1=c(),np=o("td"),l1=i("Trained with line art generation"),i1=c(),op=o("td"),r1=i("An image with line art, usually black lines on a white background."),c1=c(),ap=o("td"),Ki=o("a"),fn=o("img"),d1=c(),sp=o("td"),er=o("a"),tr=o("img"),p1=c(),ne=o("tr"),nr=o("td"),xa=o("a"),m1=i("lllyasviel/control_v11p_sd15s2_lineart_anime"),f1=o("br"),u1=c(),lp=o("td"),h1=i("Trained with anime line art generation"),g1=c(),ip=o("td"),_1=i("An image with anime-style line art."),b1=c(),rp=o("td"),or=o("a"),un=o("img"),y1=c(),cp=o("td"),ar=o("a"),sr=o("img"),v1=c(),oe=o("tr"),lr=o("td"),ka=o("a"),w1=i("lllyasviel/control_v11p_sd15_openpose"),M1=o("br"),T1=c(),dp=o("td"),U1=i("Trained with human pose estimation"),J1=c(),pp=o("td"),I1=i("An image with human poses, usually represented as a set of keypoints or skeletons."),E1=c(),mp=o("td"),ir=o("a"),hn=o("img"),C1=c(),fp=o("td"),rr=o("a"),cr=o("img"),j1=c(),ae=o("tr"),dr=o("td"),$a=o("a"),Z1=i("lllyasviel/control_v11p_sd15_scribble"),N1=o("br"),x1=c(),up=o("td"),k1=i("Trained with scribble-based image generation"),$1=c(),hp=o("td"),W1=i("An image with scribbles, usually random or user-drawn strokes."),G1=c(),gp=o("td"),pr=o("a"),gn=o("img"),D1=c(),_p=o("td"),mr=o("a"),fr=o("img"),S1=c(),se=o("tr"),ur=o("td"),Wa=o("a"),B1=i("lllyasviel/control_v11p_sd15_softedge"),P1=o("br"),F1=c(),bp=o("td"),R1=i("Trained with soft edge image generation"),V1=c(),yp=o("td"),X1=i("An image with soft edges, usually to create a more painterly or artistic effect."),A1=c(),vp=o("td"),hr=o("a"),_n=o("img"),Y1=c(),wp=o("td"),gr=o("a"),_r=o("img"),Q1=c(),le=o("tr"),br=o("td"),Ga=o("a"),L1=i("lllyasviel/control_v11e_sd15_shuffle"),z1=o("br"),H1=c(),Mp=o("td"),q1=i("Trained with image shuffling"),O1=c(),Tp=o("td"),K1=i("An image with shuffled patches or regions."),ew=c(),Up=o("td"),yr=o("a"),bn=o("img"),tw=c(),Jp=o("td"),vr=o("a"),wr=o("img"),nw=c(),ie=o("tr"),Mr=o("td"),Da=o("a"),ow=i("lllyasviel/control_v11f1e_sd15_tile"),aw=o("br"),sw=c(),Ip=o("td"),lw=i("Trained with image tiling"),iw=c(),Ep=o("td"),rw=i("A blurry image or part of an image ."),cw=c(),Cp=o("td"),Tr=o("a"),yn=o("img"),dw=c(),jp=o("td"),Ur=o("a"),Jr=o("img"),uu=c(),vt=o("h2"),vn=o("a"),Zp=o("span"),b(Sa.$$.fragment),pw=c(),Np=o("span"),mw=i("StableDiffusionControlNetPipeline"),hu=c(),j=o("div"),b(Ba.$$.fragment),fw=c(),xp=o("p"),uw=i("Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),hw=c(),Pa=o("p"),gw=i("This model inherits from "),Ir=o("a"),_w=i("DiffusionPipeline"),bw=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.)`),yw=c(),kp=o("p"),vw=i("In addition the pipeline inherits the following loading methods:"),ww=c(),$p=o("ul"),Fa=o("li"),Wp=o("em"),Mw=i("Textual-Inversion"),Tw=i(": "),Er=o("a"),Uw=i("loaders.TextualInversionLoaderMixin.load_textual_inversion()"),Jw=c(),Ge=o("div"),b(Ra.$$.fragment),Iw=c(),Gp=o("p"),Ew=i("Function invoked when calling the pipeline for generation."),Cw=c(),b(wn.$$.fragment),jw=c(),Mn=o("div"),b(Va.$$.fragment),Zw=c(),Dp=o("p"),Nw=i(`Enable sliced attention computation. 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.`),xw=c(),Tn=o("div"),b(Xa.$$.fragment),kw=c(),Aa=o("p"),$w=i("Disable sliced attention computation. If "),Sp=o("code"),Ww=i("enable_attention_slicing"),Gw=i(` was previously called, attention is
computed in one step.`),Dw=c(),Un=o("div"),b(Ya.$$.fragment),Sw=c(),Bp=o("p"),Bw=i(`Enable sliced VAE decoding. 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.`),Pw=c(),Jn=o("div"),b(Qa.$$.fragment),Fw=c(),La=o("p"),Rw=i("Disable sliced VAE decoding. If "),Pp=o("code"),Vw=i("enable_vae_slicing"),Xw=i(` was previously enabled, this method will go back to
computing decoding in one step.`),Aw=c(),he=o("div"),b(za.$$.fragment),Yw=c(),Ha=o("p"),Qw=i("Enable memory efficient attention from "),qa=o("a"),Lw=i("xFormers"),zw=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.`),Hw=c(),b(In.$$.fragment),qw=c(),b(En.$$.fragment),Ow=c(),Cn=o("div"),b(Oa.$$.fragment),Kw=c(),Ka=o("p"),e2=i("Disable memory efficient attention from "),es=o("a"),t2=i("xFormers"),n2=i("."),o2=c(),F=o("div"),b(ts.$$.fragment),a2=c(),ns=o("p"),s2=i("Load textual inversion embeddings into the text encoder of "),Cr=o("a"),l2=i("StableDiffusionPipeline"),i2=i(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),r2=c(),Fp=o("p"),c2=i("Example:"),d2=c(),b(jn.$$.fragment),p2=c(),os=o("p"),m2=i(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),as=o("a"),f2=i("civitAI"),u2=i(") and then load the vector"),h2=c(),b(Zn.$$.fragment),g2=c(),Nn=o("div"),b(ss.$$.fragment),_2=c(),ls=o("p"),b2=i("Disable tiled VAE decoding. If "),Rp=o("code"),y2=i("enable_vae_tiling"),v2=i(` was previously enabled, this method will go back to
computing decoding in one step.`),w2=c(),xn=o("div"),b(is.$$.fragment),M2=c(),re=o("p"),T2=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Vp=o("code"),U2=i("enable_sequential_cpu_offload"),J2=i(", this method moves one whole model at a time to the GPU when its "),Xp=o("code"),I2=i("forward"),E2=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Ap=o("code"),C2=i("enable_sequential_cpu_offload"),j2=i(", but performance is much better due to the iterative execution of the "),Yp=o("code"),Z2=i("unet"),N2=i("."),x2=c(),kn=o("div"),b(rs.$$.fragment),k2=c(),Qp=o("p"),$2=i(`Enable tiled VAE decoding. 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 for saving a large amount of memory and to allow
processing larger images.`),gu=c(),wt=o("h2"),$n=o("a"),Lp=o("span"),b(cs.$$.fragment),W2=c(),zp=o("span"),G2=i("StableDiffusionControlNetImg2ImgPipeline"),_u=c(),Z=o("div"),b(ds.$$.fragment),D2=c(),Hp=o("p"),S2=i("Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),B2=c(),ps=o("p"),P2=i("This model inherits from "),jr=o("a"),F2=i("DiffusionPipeline"),R2=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.)`),V2=c(),qp=o("p"),X2=i("In addition the pipeline inherits the following loading methods:"),A2=c(),Op=o("ul"),ms=o("li"),Kp=o("em"),Y2=i("Textual-Inversion"),Q2=i(": "),Zr=o("a"),L2=i("loaders.TextualInversionLoaderMixin.load_textual_inversion()"),z2=c(),De=o("div"),b(fs.$$.fragment),H2=c(),em=o("p"),q2=i("Function invoked when calling the pipeline for generation."),O2=c(),b(Wn.$$.fragment),K2=c(),Gn=o("div"),b(us.$$.fragment),eM=c(),tm=o("p"),tM=i(`Enable sliced attention computation. 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.`),nM=c(),Dn=o("div"),b(hs.$$.fragment),oM=c(),gs=o("p"),aM=i("Disable sliced attention computation. If "),nm=o("code"),sM=i("enable_attention_slicing"),lM=i(` was previously called, attention is
computed in one step.`),iM=c(),Sn=o("div"),b(_s.$$.fragment),rM=c(),om=o("p"),cM=i(`Enable sliced VAE decoding. 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.`),dM=c(),Bn=o("div"),b(bs.$$.fragment),pM=c(),ys=o("p"),mM=i("Disable sliced VAE decoding. If "),am=o("code"),fM=i("enable_vae_slicing"),uM=i(` was previously enabled, this method will go back to
computing decoding in one step.`),hM=c(),ge=o("div"),b(vs.$$.fragment),gM=c(),ws=o("p"),_M=i("Enable memory efficient attention from "),Ms=o("a"),bM=i("xFormers"),yM=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.`),vM=c(),b(Pn.$$.fragment),wM=c(),b(Fn.$$.fragment),MM=c(),Rn=o("div"),b(Ts.$$.fragment),TM=c(),Us=o("p"),UM=i("Disable memory efficient attention from "),Js=o("a"),JM=i("xFormers"),IM=i("."),EM=c(),R=o("div"),b(Is.$$.fragment),CM=c(),Es=o("p"),jM=i("Load textual inversion embeddings into the text encoder of "),Nr=o("a"),ZM=i("StableDiffusionPipeline"),NM=i(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),xM=c(),sm=o("p"),kM=i("Example:"),$M=c(),b(Vn.$$.fragment),WM=c(),Cs=o("p"),GM=i(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),js=o("a"),DM=i("civitAI"),SM=i(") and then load the vector"),BM=c(),b(Xn.$$.fragment),PM=c(),An=o("div"),b(Zs.$$.fragment),FM=c(),Ns=o("p"),RM=i("Disable tiled VAE decoding. If "),lm=o("code"),VM=i("enable_vae_tiling"),XM=i(` was previously enabled, this method will go back to
computing decoding in one step.`),AM=c(),Yn=o("div"),b(xs.$$.fragment),YM=c(),ce=o("p"),QM=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),im=o("code"),LM=i("enable_sequential_cpu_offload"),zM=i(", this method moves one whole model at a time to the GPU when its "),rm=o("code"),HM=i("forward"),qM=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),cm=o("code"),OM=i("enable_sequential_cpu_offload"),KM=i(", but performance is much better due to the iterative execution of the "),dm=o("code"),eT=i("unet"),tT=i("."),nT=c(),Qn=o("div"),b(ks.$$.fragment),oT=c(),pm=o("p"),aT=i(`Enable tiled VAE decoding. 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 for saving a large amount of memory and to allow
processing larger images.`),bu=c(),Mt=o("h2"),Ln=o("a"),mm=o("span"),b($s.$$.fragment),sT=c(),fm=o("span"),lT=i("StableDiffusionControlNetInpaintPipeline"),yu=c(),E=o("div"),b(Ws.$$.fragment),iT=c(),um=o("p"),rT=i("Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),cT=c(),Gs=o("p"),dT=i("This model inherits from "),xr=o("a"),pT=i("DiffusionPipeline"),mT=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.)`),fT=c(),hm=o("p"),uT=i("In addition the pipeline inherits the following loading methods:"),hT=c(),gm=o("ul"),Ds=o("li"),_m=o("em"),gT=i("Textual-Inversion"),_T=i(": "),kr=o("a"),bT=i("loaders.TextualInversionLoaderMixin.load_textual_inversion()"),yT=c(),b(zn.$$.fragment),vT=c(),Se=o("div"),b(Ss.$$.fragment),wT=c(),bm=o("p"),MT=i("Function invoked when calling the pipeline for generation."),TT=c(),b(Hn.$$.fragment),UT=c(),qn=o("div"),b(Bs.$$.fragment),JT=c(),ym=o("p"),IT=i(`Enable sliced attention computation. 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.`),ET=c(),On=o("div"),b(Ps.$$.fragment),CT=c(),Fs=o("p"),jT=i("Disable sliced attention computation. If "),vm=o("code"),ZT=i("enable_attention_slicing"),NT=i(` was previously called, attention is
computed in one step.`),xT=c(),Kn=o("div"),b(Rs.$$.fragment),kT=c(),wm=o("p"),$T=i(`Enable sliced VAE decoding. 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.`),WT=c(),eo=o("div"),b(Vs.$$.fragment),GT=c(),Xs=o("p"),DT=i("Disable sliced VAE decoding. If "),Mm=o("code"),ST=i("enable_vae_slicing"),BT=i(` was previously enabled, this method will go back to
computing decoding in one step.`),PT=c(),_e=o("div"),b(As.$$.fragment),FT=c(),Ys=o("p"),RT=i("Enable memory efficient attention from "),Qs=o("a"),VT=i("xFormers"),XT=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.`),AT=c(),b(to.$$.fragment),YT=c(),b(no.$$.fragment),QT=c(),oo=o("div"),b(Ls.$$.fragment),LT=c(),zs=o("p"),zT=i("Disable memory efficient attention from "),Hs=o("a"),HT=i("xFormers"),qT=i("."),OT=c(),V=o("div"),b(qs.$$.fragment),KT=c(),Os=o("p"),e0=i("Load textual inversion embeddings into the text encoder of "),$r=o("a"),t0=i("StableDiffusionPipeline"),n0=i(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),o0=c(),Tm=o("p"),a0=i("Example:"),s0=c(),b(ao.$$.fragment),l0=c(),Ks=o("p"),i0=i(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),el=o("a"),r0=i("civitAI"),c0=i(") and then load the vector"),d0=c(),b(so.$$.fragment),p0=c(),lo=o("div"),b(tl.$$.fragment),m0=c(),nl=o("p"),f0=i("Disable tiled VAE decoding. If "),Um=o("code"),u0=i("enable_vae_tiling"),h0=i(` was previously enabled, this method will go back to
computing decoding in one step.`),g0=c(),io=o("div"),b(ol.$$.fragment),_0=c(),de=o("p"),b0=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Jm=o("code"),y0=i("enable_sequential_cpu_offload"),v0=i(", this method moves one whole model at a time to the GPU when its "),Im=o("code"),w0=i("forward"),M0=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Em=o("code"),T0=i("enable_sequential_cpu_offload"),U0=i(", but performance is much better due to the iterative execution of the "),Cm=o("code"),J0=i("unet"),I0=i("."),E0=c(),ro=o("div"),b(al.$$.fragment),C0=c(),jm=o("p"),j0=i(`Enable tiled VAE decoding. 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 for saving a large amount of memory and to allow
processing larger images.`),vu=c(),Tt=o("h2"),co=o("a"),Zm=o("span"),b(sl.$$.fragment),Z0=c(),Nm=o("span"),N0=i("FlaxStableDiffusionControlNetPipeline"),wu=c(),pe=o("div"),b(ll.$$.fragment),x0=c(),xm=o("p"),k0=i("Pipeline for text-to-image generation using Stable Diffusion with ControlNet Guidance."),$0=c(),il=o("p"),W0=i("This model inherits from "),Wr=o("a"),G0=i("FlaxDiffusionPipeline"),D0=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.)`),S0=c(),Be=o("div"),b(rl.$$.fragment),B0=c(),km=o("p"),P0=i("Function invoked when calling the pipeline for generation."),F0=c(),b(po.$$.fragment),this.h()},l(n){const m=gZ('[data-svelte="svelte-1phssyn"]',document.head);u=a(m,"META",{name:!0,content:!0}),m.forEach(t),J=d(n),g=a(n,"H1",{class:!0});var cl=s(g);h=a(cl,"A",{id:!0,class:!0,href:!0});var $m=s(h);U=a($m,"SPAN",{});var Wm=s(U);y(p.$$.fragment,Wm),Wm.forEach(t),$m.forEach(t),_=d(cl),at=a(cl,"SPAN",{});var Gm=s(at);we=r(Gm,"ControlNet"),Gm.forEach(t),cl.forEach(t),Ut=d(n),Me=a(n,"P",{});var Gr=s(Me);Y=a(Gr,"A",{href:!0,rel:!0});var Dm=s(Y);A=r(Dm,"Adding Conditional Control to Text-to-Image Diffusion Models"),Dm.forEach(t),fl=r(Gr," by Lvmin Zhang and Maneesh Agrawala."),Gr.forEach(t),Io=d(n),st=a(n,"P",{});var Sm=s(st);ng=r(Sm,"Using a pretrained model, 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."),Sm.forEach(t),tf=d(n),ul=a(n,"P",{});var Bm=s(ul);og=r(Bm,"The abstract from the paper is:"),Bm.forEach(t),nf=d(n),hl=a(n,"P",{});var Pm=s(hl);Ar=a(Pm,"EM",{});var Fm=s(Ar);ag=r(Fm,"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."),Fm.forEach(t),Pm.forEach(t),of=d(n),Jt=a(n,"P",{});var dl=s(Jt);sg=r(dl,"This model was contributed by "),Eo=a(dl,"A",{href:!0,rel:!0});var Rm=s(Eo);lg=r(Rm,"takuma104"),Rm.forEach(t),ig=r(dl,". \u2764\uFE0F"),dl.forEach(t),af=d(n),It=a(n,"P",{});var pl=s(It);rg=r(pl,"The original codebase can be found at "),Co=a(pl,"A",{href:!0,rel:!0});var Vm=s(Co);cg=r(Vm,"lllyasviel/ControlNet"),Vm.forEach(t),dg=r(pl,"."),pl.forEach(t),sf=d(n),lt=a(n,"H2",{class:!0});var ml=s(lt);Et=a(ml,"A",{id:!0,class:!0,href:!0});var Xm=s(Et);Yr=a(Xm,"SPAN",{});var Am=s(Yr);y(jo.$$.fragment,Am),Am.forEach(t),Xm.forEach(t),pg=d(ml),Qr=a(ml,"SPAN",{});var nJ=s(Qr);mg=r(nJ,"Usage example"),nJ.forEach(t),ml.forEach(t),lf=d(n),Ct=a(n,"P",{});var Tu=s(Ct);fg=r(Tu,"In the following we give a simple example of how to use a "),Lr=a(Tu,"EM",{});var oJ=s(Lr);ug=r(oJ,"ControlNet"),oJ.forEach(t),hg=r(Tu,` checkpoint with Diffusers for inference.
The inference pipeline is the same for all pipelines:`),Tu.forEach(t),rf=d(n),jt=a(n,"UL",{});var Uu=s(jt);zr=a(Uu,"LI",{});var aJ=s(zr);Hr=a(aJ,"OL",{});var sJ=s(Hr);qr=a(sJ,"LI",{});var lJ=s(qr);gg=r(lJ,"Take an image and run it through a pre-conditioning processor."),lJ.forEach(t),sJ.forEach(t),aJ.forEach(t),_g=d(Uu),Or=a(Uu,"LI",{});var iJ=s(Or);gl=a(iJ,"OL",{start:!0});var rJ=s(gl);Zo=a(rJ,"LI",{});var Ju=s(Zo);bg=r(Ju,"Run the pre-processed image through the "),_l=a(Ju,"A",{href:!0});var cJ=s(_l);yg=r(cJ,"StableDiffusionControlNetPipeline"),cJ.forEach(t),vg=r(Ju,"."),Ju.forEach(t),rJ.forEach(t),iJ.forEach(t),Uu.forEach(t),cf=d(n),Zt=a(n,"P",{});var Iu=s(Zt);wg=r(Iu,"Let\u2019s have a look at a simple example using the "),No=a(Iu,"A",{href:!0,rel:!0});var dJ=s(No);Mg=r(dJ,"Canny Edge ControlNet"),dJ.forEach(t),Tg=r(Iu,"."),Iu.forEach(t),df=d(n),y(xo.$$.fragment,n),pf=d(n),bl=a(n,"P",{});var pJ=s(bl);yl=a(pJ,"IMG",{src:!0,alt:!0}),pJ.forEach(t),mf=d(n),xe=a(n,"P",{});var Dr=s(xe);Ug=r(Dr,"Next, we process the image to get the canny image. This is step "),Kr=a(Dr,"EM",{});var mJ=s(Kr);Jg=r(mJ,"1."),mJ.forEach(t),Ig=r(Dr," - running the pre-conditioning processor. The pre-conditioning processor is different for every ControlNet. Please see the model cards of the "),vl=a(Dr,"A",{href:!0});var fJ=s(vl);Eg=r(fJ,"official checkpoints"),fJ.forEach(t),Cg=r(Dr," for more information about other models."),Dr.forEach(t),ff=d(n),wl=a(n,"P",{});var uJ=s(wl);jg=r(uJ,"First, we need to install opencv:"),uJ.forEach(t),uf=d(n),y(ko.$$.fragment,n),hf=d(n),Ml=a(n,"P",{});var hJ=s(Ml);Zg=r(hJ,"Next, let\u2019s also install all required Hugging Face libraries:"),hJ.forEach(t),gf=d(n),y($o.$$.fragment,n),_f=d(n),Tl=a(n,"P",{});var gJ=s(Tl);Ng=r(gJ,"Then we can retrieve the canny edges of the image."),gJ.forEach(t),bf=d(n),y(Wo.$$.fragment,n),yf=d(n),Ul=a(n,"P",{});var _J=s(Ul);xg=r(_J,"Let\u2019s take a look at the processed image."),_J.forEach(t),vf=d(n),Jl=a(n,"P",{});var bJ=s(Jl);Il=a(bJ,"IMG",{src:!0,alt:!0}),bJ.forEach(t),wf=d(n),Nt=a(n,"P",{});var Eu=s(Nt);kg=r(Eu,"Now, we load the official "),El=a(Eu,"A",{href:!0});var yJ=s(El);$g=r(yJ,"Stable Diffusion 1.5 Model"),yJ.forEach(t),Wg=r(Eu," as well as the ControlNet for canny edges."),Eu.forEach(t),Mf=d(n),y(Go.$$.fragment,n),Tf=d(n),xt=a(n,"P",{});var Cu=s(xt);Gg=r(Cu,"To speed-up things and reduce memory, let\u2019s enable model offloading and use the fast "),Cl=a(Cu,"A",{href:!0});var vJ=s(Cl);Dg=r(vJ,"UniPCMultistepScheduler"),vJ.forEach(t),Sg=r(Cu,"."),Cu.forEach(t),Uf=d(n),y(Do.$$.fragment,n),Jf=d(n),jl=a(n,"P",{});var wJ=s(jl);Bg=r(wJ,"Finally, we can run the pipeline:"),wJ.forEach(t),If=d(n),y(So.$$.fragment,n),Ef=d(n),Zl=a(n,"P",{});var MJ=s(Zl);Pg=r(MJ,"This should take only around 3-4 seconds on GPU (depending on hardware). The output image then looks as follows:"),MJ.forEach(t),Cf=d(n),Nl=a(n,"P",{});var TJ=s(Nl);xl=a(TJ,"IMG",{src:!0,alt:!0}),TJ.forEach(t),jf=d(n),it=a(n,"P",{});var Ym=s(it);ec=a(Ym,"STRONG",{});var UJ=s(ec);Fg=r(UJ,"Note"),UJ.forEach(t),Rg=r(Ym,": To see how to run all other ControlNet checkpoints, please have a look at "),kl=a(Ym,"A",{href:!0});var JJ=s(kl);Vg=r(JJ,"ControlNet with Stable Diffusion 1.5"),JJ.forEach(t),Xg=r(Ym,"."),Ym.forEach(t),Zf=d(n),rt=a(n,"H2",{class:!0});var ju=s(rt);kt=a(ju,"A",{id:!0,class:!0,href:!0});var IJ=s(kt);tc=a(IJ,"SPAN",{});var EJ=s(tc);y(Bo.$$.fragment,EJ),EJ.forEach(t),IJ.forEach(t),Ag=d(ju),nc=a(ju,"SPAN",{});var CJ=s(nc);Yg=r(CJ,"Combining multiple conditionings"),CJ.forEach(t),ju.forEach(t),Nf=d(n),$t=a(n,"P",{});var Zu=s($t);Qg=r(Zu,"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 "),oc=a(Zu,"CODE",{});var jJ=s(oc);Lg=r(jJ,"__call__"),jJ.forEach(t),zg=r(Zu,"."),Zu.forEach(t),xf=d(n),$l=a(n,"P",{});var ZJ=s($l);Hg=r(ZJ,"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."),ZJ.forEach(t),kf=d(n),Wt=a(n,"P",{});var Nu=s(Wt);qg=r(Nu,"It can also be helpful to vary the "),ac=a(Nu,"CODE",{});var NJ=s(ac);Og=r(NJ,"controlnet_conditioning_scales"),NJ.forEach(t),Kg=r(Nu," to emphasize one conditioning over the other."),Nu.forEach(t),$f=d(n),ct=a(n,"H3",{class:!0});var xu=s(ct);Gt=a(xu,"A",{id:!0,class:!0,href:!0});var xJ=s(Gt);sc=a(xJ,"SPAN",{});var kJ=s(sc);y(Po.$$.fragment,kJ),kJ.forEach(t),xJ.forEach(t),e_=d(xu),lc=a(xu,"SPAN",{});var $J=s(lc);t_=r($J,"Canny conditioning"),$J.forEach(t),xu.forEach(t),Wf=d(n),Wl=a(n,"P",{});var WJ=s(Wl);n_=r(WJ,"The original image:"),WJ.forEach(t),Gf=d(n),Gl=a(n,"IMG",{src:!0}),Df=d(n),Dl=a(n,"P",{});var GJ=s(Dl);o_=r(GJ,"Prepare the conditioning:"),GJ.forEach(t),Sf=d(n),y(Fo.$$.fragment,n),Bf=d(n),Sl=a(n,"IMG",{src:!0}),Pf=d(n),dt=a(n,"H3",{class:!0});var ku=s(dt);Dt=a(ku,"A",{id:!0,class:!0,href:!0});var DJ=s(Dt);ic=a(DJ,"SPAN",{});var SJ=s(ic);y(Ro.$$.fragment,SJ),SJ.forEach(t),DJ.forEach(t),a_=d(ku),rc=a(ku,"SPAN",{});var BJ=s(rc);s_=r(BJ,"Openpose conditioning"),BJ.forEach(t),ku.forEach(t),Ff=d(n),Bl=a(n,"P",{});var PJ=s(Bl);l_=r(PJ,"The original image:"),PJ.forEach(t),Rf=d(n),Vo=a(n,"IMG",{src:!0,width:!0}),Vf=d(n),Pl=a(n,"P",{});var FJ=s(Pl);i_=r(FJ,"Prepare the conditioning:"),FJ.forEach(t),Xf=d(n),y(Xo.$$.fragment,n),Af=d(n),Ao=a(n,"IMG",{src:!0,width:!0}),Yf=d(n),pt=a(n,"H3",{class:!0});var $u=s(pt);St=a($u,"A",{id:!0,class:!0,href:!0});var RJ=s(St);cc=a(RJ,"SPAN",{});var VJ=s(cc);y(Yo.$$.fragment,VJ),VJ.forEach(t),RJ.forEach(t),r_=d($u),dc=a($u,"SPAN",{});var XJ=s(dc);c_=r(XJ,"Running ControlNet with multiple conditionings"),XJ.forEach(t),$u.forEach(t),Qf=d(n),y(Qo.$$.fragment,n),Lf=d(n),Lo=a(n,"IMG",{src:!0,width:!0}),zf=d(n),mt=a(n,"H3",{class:!0});var Wu=s(mt);Bt=a(Wu,"A",{id:!0,class:!0,href:!0});var AJ=s(Bt);pc=a(AJ,"SPAN",{});var YJ=s(pc);y(zo.$$.fragment,YJ),YJ.forEach(t),AJ.forEach(t),d_=d(Wu),mc=a(Wu,"SPAN",{});var QJ=s(mc);p_=r(QJ,"Guess Mode"),QJ.forEach(t),Wu.forEach(t),Hf=d(n),ke=a(n,"P",{});var Sr=s(ke);m_=r(Sr,"Guess Mode is "),Ho=a(Sr,"A",{href:!0,rel:!0});var LJ=s(Ho);f_=r(LJ,"a ControlNet feature that was implemented"),LJ.forEach(t),u_=r(Sr," after the publication of "),qo=a(Sr,"A",{href:!0,rel:!0});var zJ=s(qo);h_=r(zJ,"the paper"),zJ.forEach(t),g_=r(Sr,". The description states:"),Sr.forEach(t),qf=d(n),Fl=a(n,"BLOCKQUOTE",{});var HJ=s(Fl);fc=a(HJ,"P",{});var qJ=s(fc);__=r(qJ,"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."),qJ.forEach(t),HJ.forEach(t),Of=d(n),ft=a(n,"H4",{class:!0});var Gu=s(ft);Pt=a(Gu,"A",{id:!0,class:!0,href:!0});var OJ=s(Pt);uc=a(OJ,"SPAN",{});var KJ=s(uc);y(Oo.$$.fragment,KJ),KJ.forEach(t),OJ.forEach(t),b_=d(Gu),hc=a(Gu,"SPAN",{});var eI=s(hc);y_=r(eI,"The core implementation:"),eI.forEach(t),Gu.forEach(t),Kf=d(n),$e=a(n,"P",{});var Br=s($e);v_=r(Br,"It adjusts the scale of the output residuals from ControlNet by a fixed ratio depending on the block depth. The shallowest DownBlock corresponds to "),gc=a(Br,"CODE",{});var tI=s(gc);w_=r(tI,"0.1"),tI.forEach(t),M_=r(Br,". As the blocks get deeper, the scale increases exponentially, and the scale for the output of the MidBlock becomes "),_c=a(Br,"CODE",{});var nI=s(_c);T_=r(nI,"1.0"),nI.forEach(t),U_=r(Br,"."),Br.forEach(t),eu=d(n),Ft=a(n,"P",{});var Du=s(Ft);J_=r(Du,"Since the core implementation is just this, "),bc=a(Du,"STRONG",{});var oI=s(bc);I_=r(oI,"it does not have any impact on prompt conditioning"),oI.forEach(t),E_=r(Du,". While it is common to use it without specifying any prompts, it is also possible to provide prompts if desired."),Du.forEach(t),tu=d(n),ut=a(n,"H4",{class:!0});var Su=s(ut);Rt=a(Su,"A",{id:!0,class:!0,href:!0});var aI=s(Rt);yc=a(aI,"SPAN",{});var sI=s(yc);y(Ko.$$.fragment,sI),sI.forEach(t),aI.forEach(t),C_=d(Su),vc=a(Su,"SPAN",{});var lI=s(vc);j_=r(lI,"Usage:"),lI.forEach(t),Su.forEach(t),nu=d(n),ue=a(n,"P",{});var mo=s(ue);Z_=r(mo,"Just specify "),wc=a(mo,"CODE",{});var iI=s(wc);N_=r(iI,"guess_mode=True"),iI.forEach(t),x_=r(mo," in the pipe() function. A "),Mc=a(mo,"CODE",{});var rI=s(Mc);k_=r(rI,"guidance_scale"),rI.forEach(t),$_=r(mo," between 3.0 and 5.0 is "),ea=a(mo,"A",{href:!0,rel:!0});var cI=s(ea);W_=r(cI,"recommended"),cI.forEach(t),G_=r(mo,"."),mo.forEach(t),ou=d(n),y(ta.$$.fragment,n),au=d(n),ht=a(n,"H4",{class:!0});var Bu=s(ht);Vt=a(Bu,"A",{id:!0,class:!0,href:!0});var dI=s(Vt);Tc=a(dI,"SPAN",{});var pI=s(Tc);y(na.$$.fragment,pI),pI.forEach(t),dI.forEach(t),D_=d(Bu),Uc=a(Bu,"SPAN",{});var mI=s(Uc);S_=r(mI,"Output image comparison:"),mI.forEach(t),Bu.forEach(t),su=r(n,`

Canny Control Example
`),Xt=a(n,"TABLE",{});var Pu=s(Xt);Jc=a(Pu,"THEAD",{});var fI=s(Jc);oa=a(fI,"TR",{});var Fu=s(oa);Ic=a(Fu,"TH",{});var uI=s(Ic);B_=r(uI,"no guess_mode with prompt"),uI.forEach(t),P_=d(Fu),Ec=a(Fu,"TH",{});var hI=s(Ec);F_=r(hI,"guess_mode without prompt"),hI.forEach(t),Fu.forEach(t),fI.forEach(t),R_=d(Pu),Cc=a(Pu,"TBODY",{});var gI=s(Cc);aa=a(gI,"TR",{});var Ru=s(aa);jc=a(Ru,"TD",{});var _I=s(jc);Rl=a(_I,"A",{href:!0});var bI=s(Rl);Vl=a(bI,"IMG",{width:!0,src:!0}),bI.forEach(t),_I.forEach(t),V_=d(Ru),Zc=a(Ru,"TD",{});var yI=s(Zc);Xl=a(yI,"A",{href:!0});var vI=s(Xl);Al=a(vI,"IMG",{width:!0,src:!0}),vI.forEach(t),yI.forEach(t),Ru.forEach(t),gI.forEach(t),Pu.forEach(t),lu=d(n),gt=a(n,"H2",{class:!0});var Vu=s(gt);At=a(Vu,"A",{id:!0,class:!0,href:!0});var wI=s(At);Nc=a(wI,"SPAN",{});var MI=s(Nc);y(sa.$$.fragment,MI),MI.forEach(t),wI.forEach(t),X_=d(Vu),xc=a(Vu,"SPAN",{});var TI=s(xc);A_=r(TI,"Available checkpoints"),TI.forEach(t),Vu.forEach(t),iu=d(n),We=a(n,"P",{});var Pr=s(We);Y_=r(Pr,"ControlNet requires a "),kc=a(Pr,"EM",{});var UI=s(kc);Q_=r(UI,"control image"),UI.forEach(t),L_=r(Pr," in addition to the text-to-image "),$c=a(Pr,"EM",{});var JI=s($c);z_=r(JI,"prompt"),JI.forEach(t),H_=r(Pr,`.
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.`),Pr.forEach(t),ru=d(n),Yt=a(n,"P",{});var Xu=s(Yt);q_=r(Xu,"All checkpoints can be found under the authors\u2019 namespace "),la=a(Xu,"A",{href:!0,rel:!0});var II=s(la);O_=r(II,"lllyasviel"),II.forEach(t),K_=r(Xu,"."),Xu.forEach(t),cu=d(n),_t=a(n,"P",{});var Qm=s(_t);Wc=a(Qm,"STRONG",{});var EI=s(Wc);eb=r(EI,"13.04.2024 Update"),EI.forEach(t),tb=r(Qm,": The author has released improved controlnet checkpoints v1.1 - see "),Yl=a(Qm,"A",{href:!0});var CI=s(Yl);nb=r(CI,"here"),CI.forEach(t),ob=r(Qm,"."),Qm.forEach(t),du=d(n),bt=a(n,"H3",{class:!0});var Au=s(bt);Qt=a(Au,"A",{id:!0,class:!0,href:!0});var jI=s(Qt);Gc=a(jI,"SPAN",{});var ZI=s(Gc);y(ia.$$.fragment,ZI),ZI.forEach(t),jI.forEach(t),ab=d(Au),Dc=a(Au,"SPAN",{});var NI=s(Dc);sb=r(NI,"ControlNet v1.0"),NI.forEach(t),Au.forEach(t),pu=d(n),Lt=a(n,"TABLE",{});var Yu=s(Lt);Sc=a(Yu,"THEAD",{});var xI=s(Sc);Te=a(xI,"TR",{});var fo=s(Te);Bc=a(fo,"TH",{});var kI=s(Bc);lb=r(kI,"Model Name"),kI.forEach(t),ib=d(fo),Pc=a(fo,"TH",{});var $I=s(Pc);rb=r($I,"Control Image Overview"),$I.forEach(t),cb=d(fo),Fc=a(fo,"TH",{});var WI=s(Fc);db=r(WI,"Control Image Example"),WI.forEach(t),pb=d(fo),Rc=a(fo,"TH",{});var GI=s(Rc);mb=r(GI,"Generated Image Example"),GI.forEach(t),fo.forEach(t),xI.forEach(t),fb=d(Yu),B=a(Yu,"TBODY",{});var X=s(B);Ue=a(X,"TR",{});var uo=s(Ue);zt=a(uo,"TD",{});var Lm=s(zt);ra=a(Lm,"A",{href:!0,rel:!0});var DI=s(ra);ub=r(DI,"lllyasviel/sd-controlnet-canny"),DI.forEach(t),hb=a(Lm,"BR",{}),gb=d(Lm),Vc=a(Lm,"EM",{});var SI=s(Vc);_b=r(SI,"Trained with canny edge detection"),SI.forEach(t),Lm.forEach(t),bb=d(uo),Xc=a(uo,"TD",{});var BI=s(Xc);yb=r(BI,"A monochrome image with white edges on a black background."),BI.forEach(t),vb=d(uo),Ac=a(uo,"TD",{});var PI=s(Ac);Ql=a(PI,"A",{href:!0});var FI=s(Ql);Ht=a(FI,"IMG",{width:!0,style:!0,src:!0}),FI.forEach(t),PI.forEach(t),wb=d(uo),Yc=a(uo,"TD",{});var RI=s(Yc);Ll=a(RI,"A",{href:!0});var VI=s(Ll);zl=a(VI,"IMG",{width:!0,src:!0}),VI.forEach(t),RI.forEach(t),uo.forEach(t),Mb=d(X),Je=a(X,"TR",{});var ho=s(Je);qt=a(ho,"TD",{});var zm=s(qt);ca=a(zm,"A",{href:!0,rel:!0});var XI=s(ca);Tb=r(XI,"lllyasviel/sd-controlnet-depth"),XI.forEach(t),Ub=a(zm,"BR",{}),Jb=d(zm),Qc=a(zm,"EM",{});var AI=s(Qc);Ib=r(AI,"Trained with Midas depth estimation"),AI.forEach(t),zm.forEach(t),Eb=d(ho),Lc=a(ho,"TD",{});var YI=s(Lc);Cb=r(YI,"A grayscale image with black representing deep areas and white representing shallow areas."),YI.forEach(t),jb=d(ho),zc=a(ho,"TD",{});var QI=s(zc);Hl=a(QI,"A",{href:!0});var LI=s(Hl);ql=a(LI,"IMG",{width:!0,src:!0}),LI.forEach(t),QI.forEach(t),Zb=d(ho),Hc=a(ho,"TD",{});var zI=s(Hc);Ol=a(zI,"A",{href:!0});var HI=s(Ol);Kl=a(HI,"IMG",{width:!0,src:!0}),HI.forEach(t),zI.forEach(t),ho.forEach(t),Nb=d(X),Ie=a(X,"TR",{});var go=s(Ie);Ot=a(go,"TD",{});var Hm=s(Ot);da=a(Hm,"A",{href:!0,rel:!0});var qI=s(da);xb=r(qI,"lllyasviel/sd-controlnet-hed"),qI.forEach(t),kb=a(Hm,"BR",{}),$b=d(Hm),qc=a(Hm,"EM",{});var OI=s(qc);Wb=r(OI,"Trained with HED edge detection (soft edge)"),OI.forEach(t),Hm.forEach(t),Gb=d(go),Oc=a(go,"TD",{});var KI=s(Oc);Db=r(KI,"A monochrome image with white soft edges on a black background."),KI.forEach(t),Sb=d(go),Kc=a(go,"TD",{});var eE=s(Kc);ei=a(eE,"A",{href:!0});var tE=s(ei);ti=a(tE,"IMG",{width:!0,src:!0}),tE.forEach(t),eE.forEach(t),Bb=d(go),ed=a(go,"TD",{});var nE=s(ed);ni=a(nE,"A",{href:!0});var oE=s(ni);oi=a(oE,"IMG",{width:!0,src:!0}),oE.forEach(t),nE.forEach(t),go.forEach(t),Pb=d(X),Ee=a(X,"TR",{});var _o=s(Ee);Kt=a(_o,"TD",{});var qm=s(Kt);pa=a(qm,"A",{href:!0,rel:!0});var aE=s(pa);Fb=r(aE,"lllyasviel/sd-controlnet-mlsd"),aE.forEach(t),Rb=a(qm,"BR",{}),Vb=d(qm),td=a(qm,"EM",{});var sE=s(td);Xb=r(sE,"Trained with M-LSD line detection"),sE.forEach(t),qm.forEach(t),Ab=d(_o),nd=a(_o,"TD",{});var lE=s(nd);Yb=r(lE,"A monochrome image composed only of white straight lines on a black background."),lE.forEach(t),Qb=d(_o),od=a(_o,"TD",{});var iE=s(od);ai=a(iE,"A",{href:!0});var rE=s(ai);si=a(rE,"IMG",{width:!0,src:!0}),rE.forEach(t),iE.forEach(t),Lb=d(_o),ad=a(_o,"TD",{});var cE=s(ad);li=a(cE,"A",{href:!0});var dE=s(li);ii=a(dE,"IMG",{width:!0,src:!0}),dE.forEach(t),cE.forEach(t),_o.forEach(t),zb=d(X),Ce=a(X,"TR",{});var bo=s(Ce);en=a(bo,"TD",{});var Om=s(en);ma=a(Om,"A",{href:!0,rel:!0});var pE=s(ma);Hb=r(pE,"lllyasviel/sd-controlnet-normal"),pE.forEach(t),qb=a(Om,"BR",{}),Ob=d(Om),sd=a(Om,"EM",{});var mE=s(sd);Kb=r(mE,"Trained with normal map"),mE.forEach(t),Om.forEach(t),ey=d(bo),fa=a(bo,"TD",{});var Qu=s(fa);ty=r(Qu,"A "),ua=a(Qu,"A",{href:!0,rel:!0});var fE=s(ua);ny=r(fE,"normal mapped"),fE.forEach(t),oy=r(Qu," image."),Qu.forEach(t),ay=d(bo),ld=a(bo,"TD",{});var uE=s(ld);ri=a(uE,"A",{href:!0});var hE=s(ri);ci=a(hE,"IMG",{width:!0,src:!0}),hE.forEach(t),uE.forEach(t),sy=d(bo),id=a(bo,"TD",{});var gE=s(id);di=a(gE,"A",{href:!0});var _E=s(di);pi=a(_E,"IMG",{width:!0,src:!0}),_E.forEach(t),gE.forEach(t),bo.forEach(t),ly=d(X),je=a(X,"TR",{});var yo=s(je);tn=a(yo,"TD",{});var Km=s(tn);ha=a(Km,"A",{href:!0,rel:!0});var bE=s(ha);iy=r(bE,"lllyasviel/sd-controlnet-openpose"),bE.forEach(t),ry=a(Km,"BR",{}),cy=d(Km),rd=a(Km,"EM",{});var yE=s(rd);dy=r(yE,"Trained with OpenPose bone image"),yE.forEach(t),Km.forEach(t),py=d(yo),ga=a(yo,"TD",{});var Lu=s(ga);my=r(Lu,"A "),_a=a(Lu,"A",{href:!0,rel:!0});var vE=s(_a);fy=r(vE,"OpenPose bone"),vE.forEach(t),uy=r(Lu," image."),Lu.forEach(t),hy=d(yo),cd=a(yo,"TD",{});var wE=s(cd);mi=a(wE,"A",{href:!0});var ME=s(mi);fi=a(ME,"IMG",{width:!0,src:!0}),ME.forEach(t),wE.forEach(t),gy=d(yo),dd=a(yo,"TD",{});var TE=s(dd);ui=a(TE,"A",{href:!0});var UE=s(ui);hi=a(UE,"IMG",{width:!0,src:!0}),UE.forEach(t),TE.forEach(t),yo.forEach(t),_y=d(X),Ze=a(X,"TR",{});var vo=s(Ze);nn=a(vo,"TD",{});var ef=s(nn);ba=a(ef,"A",{href:!0,rel:!0});var JE=s(ba);by=r(JE,"lllyasviel/sd-controlnet-scribble"),JE.forEach(t),yy=a(ef,"BR",{}),vy=d(ef),pd=a(ef,"EM",{});var IE=s(pd);wy=r(IE,"Trained with human scribbles"),IE.forEach(t),ef.forEach(t),My=d(vo),md=a(vo,"TD",{});var EE=s(md);Ty=r(EE,"A hand-drawn monochrome image with white outlines on a black background."),EE.forEach(t),Uy=d(vo),fd=a(vo,"TD",{});var CE=s(fd);gi=a(CE,"A",{href:!0});var jE=s(gi);_i=a(jE,"IMG",{width:!0,src:!0}),jE.forEach(t),CE.forEach(t),Jy=d(vo),ud=a(vo,"TD",{});var ZE=s(ud);bi=a(ZE,"A",{href:!0});var NE=s(bi);yi=a(NE,"IMG",{width:!0,src:!0}),NE.forEach(t),ZE.forEach(t),vo.forEach(t),Iy=d(X),Ne=a(X,"TR",{});var wo=s(Ne);ya=a(wo,"TD",{});var zu=s(ya);va=a(zu,"A",{href:!0,rel:!0});var xE=s(va);Ey=r(xE,"lllyasviel/sd-controlnet-seg"),xE.forEach(t),Cy=a(zu,"BR",{}),hd=a(zu,"EM",{});var kE=s(hd);jy=r(kE,"Trained with semantic segmentation"),kE.forEach(t),zu.forEach(t),Zy=d(wo),wa=a(wo,"TD",{});var Hu=s(wa);Ny=r(Hu,"An "),Ma=a(Hu,"A",{href:!0,rel:!0});var $E=s(Ma);xy=r($E,"ADE20K"),$E.forEach(t),ky=r(Hu,"\u2019s segmentation protocol image."),Hu.forEach(t),$y=d(wo),gd=a(wo,"TD",{});var WE=s(gd);vi=a(WE,"A",{href:!0});var GE=s(vi);wi=a(GE,"IMG",{width:!0,src:!0}),GE.forEach(t),WE.forEach(t),Wy=d(wo),_d=a(wo,"TD",{});var DE=s(_d);Mi=a(DE,"A",{href:!0});var SE=s(Mi);Ti=a(SE,"IMG",{width:!0,src:!0}),SE.forEach(t),DE.forEach(t),wo.forEach(t),X.forEach(t),Yu.forEach(t),mu=d(n),yt=a(n,"H3",{class:!0});var qu=s(yt);on=a(qu,"A",{id:!0,class:!0,href:!0});var BE=s(on);bd=a(BE,"SPAN",{});var PE=s(bd);y(Ta.$$.fragment,PE),PE.forEach(t),BE.forEach(t),Gy=d(qu),yd=a(qu,"SPAN",{});var FE=s(yd);Dy=r(FE,"ControlNet v1.1"),FE.forEach(t),qu.forEach(t),fu=d(n),an=a(n,"TABLE",{});var Ou=s(an);vd=a(Ou,"THEAD",{});var RE=s(vd);Q=a(RE,"TR",{});var Pe=s(Q);wd=a(Pe,"TH",{});var VE=s(wd);Sy=r(VE,"Model Name"),VE.forEach(t),By=d(Pe),Md=a(Pe,"TH",{});var XE=s(Md);Py=r(XE,"Control Image Overview"),XE.forEach(t),Fy=d(Pe),Td=a(Pe,"TH",{});var AE=s(Td);Ry=r(AE,"Condition Image"),AE.forEach(t),Vy=d(Pe),Ud=a(Pe,"TH",{});var YE=s(Ud);Xy=r(YE,"Control Image Example"),YE.forEach(t),Ay=d(Pe),Jd=a(Pe,"TH",{});var QE=s(Jd);Yy=r(QE,"Generated Image Example"),QE.forEach(t),Pe.forEach(t),RE.forEach(t),Qy=d(Ou),W=a(Ou,"TBODY",{});var D=s(W);L=a(D,"TR",{});var Fe=s(L);Ui=a(Fe,"TD",{});var R0=s(Ui);Ua=a(R0,"A",{href:!0,rel:!0});var LE=s(Ua);Ly=r(LE,"lllyasviel/control_v11p_sd15_canny"),LE.forEach(t),zy=a(R0,"BR",{}),R0.forEach(t),Hy=d(Fe),Id=a(Fe,"TD",{});var zE=s(Id);Ed=a(zE,"EM",{});var HE=s(Ed);qy=r(HE,"Trained with canny edge detection"),HE.forEach(t),zE.forEach(t),Oy=d(Fe),Cd=a(Fe,"TD",{});var qE=s(Cd);Ky=r(qE,"A monochrome image with white edges on a black background."),qE.forEach(t),ev=d(Fe),jd=a(Fe,"TD",{});var OE=s(jd);Ji=a(OE,"A",{href:!0});var KE=s(Ji);sn=a(KE,"IMG",{width:!0,style:!0,src:!0}),KE.forEach(t),OE.forEach(t),tv=d(Fe),Zd=a(Fe,"TD",{});var eC=s(Zd);Ii=a(eC,"A",{href:!0});var tC=s(Ii);Ei=a(tC,"IMG",{width:!0,src:!0}),tC.forEach(t),eC.forEach(t),Fe.forEach(t),nv=d(D),z=a(D,"TR",{});var Re=s(z);Ci=a(Re,"TD",{});var V0=s(Ci);Ja=a(V0,"A",{href:!0,rel:!0});var nC=s(Ja);ov=r(nC,"lllyasviel/control_v11e_sd15_ip2p"),nC.forEach(t),av=a(V0,"BR",{}),V0.forEach(t),sv=d(Re),Nd=a(Re,"TD",{});var oC=s(Nd);xd=a(oC,"EM",{});var aC=s(xd);lv=r(aC,"Trained with pixel to pixel instruction"),aC.forEach(t),oC.forEach(t),iv=d(Re),kd=a(Re,"TD",{});var sC=s(kd);rv=r(sC,"No condition ."),sC.forEach(t),cv=d(Re),$d=a(Re,"TD",{});var lC=s($d);ji=a(lC,"A",{href:!0});var iC=s(ji);ln=a(iC,"IMG",{width:!0,style:!0,src:!0}),iC.forEach(t),lC.forEach(t),dv=d(Re),Wd=a(Re,"TD",{});var rC=s(Wd);Zi=a(rC,"A",{href:!0});var cC=s(Zi);Ni=a(cC,"IMG",{width:!0,src:!0}),cC.forEach(t),rC.forEach(t),Re.forEach(t),pv=d(D),H=a(D,"TR",{});var Ve=s(H);xi=a(Ve,"TD",{});var X0=s(xi);Ia=a(X0,"A",{href:!0,rel:!0});var dC=s(Ia);mv=r(dC,"lllyasviel/control_v11p_sd15_inpaint"),dC.forEach(t),fv=a(X0,"BR",{}),X0.forEach(t),uv=d(Ve),Gd=a(Ve,"TD",{});var pC=s(Gd);hv=r(pC,"Trained with image inpainting"),pC.forEach(t),gv=d(Ve),Dd=a(Ve,"TD",{});var mC=s(Dd);_v=r(mC,"No condition."),mC.forEach(t),bv=d(Ve),Sd=a(Ve,"TD",{});var fC=s(Sd);ki=a(fC,"A",{href:!0});var uC=s(ki);rn=a(uC,"IMG",{width:!0,style:!0,src:!0}),uC.forEach(t),fC.forEach(t),yv=d(Ve),Bd=a(Ve,"TD",{});var hC=s(Bd);$i=a(hC,"A",{href:!0});var gC=s($i);Wi=a(gC,"IMG",{width:!0,src:!0}),gC.forEach(t),hC.forEach(t),Ve.forEach(t),vv=d(D),q=a(D,"TR",{});var Xe=s(q);Gi=a(Xe,"TD",{});var A0=s(Gi);Ea=a(A0,"A",{href:!0,rel:!0});var _C=s(Ea);wv=r(_C,"lllyasviel/control_v11p_sd15_mlsd"),_C.forEach(t),Mv=a(A0,"BR",{}),A0.forEach(t),Tv=d(Xe),Pd=a(Xe,"TD",{});var bC=s(Pd);Uv=r(bC,"Trained with multi-level line segment detection"),bC.forEach(t),Jv=d(Xe),Fd=a(Xe,"TD",{});var yC=s(Fd);Iv=r(yC,"An image with annotated line segments."),yC.forEach(t),Ev=d(Xe),Rd=a(Xe,"TD",{});var vC=s(Rd);Di=a(vC,"A",{href:!0});var wC=s(Di);cn=a(wC,"IMG",{width:!0,style:!0,src:!0}),wC.forEach(t),vC.forEach(t),Cv=d(Xe),Vd=a(Xe,"TD",{});var MC=s(Vd);Si=a(MC,"A",{href:!0});var TC=s(Si);Bi=a(TC,"IMG",{width:!0,src:!0}),TC.forEach(t),MC.forEach(t),Xe.forEach(t),jv=d(D),O=a(D,"TR",{});var Ae=s(O);Pi=a(Ae,"TD",{});var Y0=s(Pi);Ca=a(Y0,"A",{href:!0,rel:!0});var UC=s(Ca);Zv=r(UC,"lllyasviel/control_v11f1p_sd15_depth"),UC.forEach(t),Nv=a(Y0,"BR",{}),Y0.forEach(t),xv=d(Ae),Xd=a(Ae,"TD",{});var JC=s(Xd);kv=r(JC,"Trained with depth estimation"),JC.forEach(t),$v=d(Ae),Ad=a(Ae,"TD",{});var IC=s(Ad);Wv=r(IC,"An image with depth information, usually represented as a grayscale image."),IC.forEach(t),Gv=d(Ae),Yd=a(Ae,"TD",{});var EC=s(Yd);Fi=a(EC,"A",{href:!0});var CC=s(Fi);dn=a(CC,"IMG",{width:!0,style:!0,src:!0}),CC.forEach(t),EC.forEach(t),Dv=d(Ae),Qd=a(Ae,"TD",{});var jC=s(Qd);Ri=a(jC,"A",{href:!0});var ZC=s(Ri);Vi=a(ZC,"IMG",{width:!0,src:!0}),ZC.forEach(t),jC.forEach(t),Ae.forEach(t),Sv=d(D),K=a(D,"TR",{});var Ye=s(K);Xi=a(Ye,"TD",{});var Q0=s(Xi);ja=a(Q0,"A",{href:!0,rel:!0});var NC=s(ja);Bv=r(NC,"lllyasviel/control_v11p_sd15_normalbae"),NC.forEach(t),Pv=a(Q0,"BR",{}),Q0.forEach(t),Fv=d(Ye),Ld=a(Ye,"TD",{});var xC=s(Ld);Rv=r(xC,"Trained with surface normal estimation"),xC.forEach(t),Vv=d(Ye),zd=a(Ye,"TD",{});var kC=s(zd);Xv=r(kC,"An image with surface normal information, usually represented as a color-coded image."),kC.forEach(t),Av=d(Ye),Hd=a(Ye,"TD",{});var $C=s(Hd);Ai=a($C,"A",{href:!0});var WC=s(Ai);pn=a(WC,"IMG",{width:!0,style:!0,src:!0}),WC.forEach(t),$C.forEach(t),Yv=d(Ye),qd=a(Ye,"TD",{});var GC=s(qd);Yi=a(GC,"A",{href:!0});var DC=s(Yi);Qi=a(DC,"IMG",{width:!0,src:!0}),DC.forEach(t),GC.forEach(t),Ye.forEach(t),Qv=d(D),ee=a(D,"TR",{});var Qe=s(ee);Li=a(Qe,"TD",{});var L0=s(Li);Za=a(L0,"A",{href:!0,rel:!0});var SC=s(Za);Lv=r(SC,"lllyasviel/control_v11p_sd15_seg"),SC.forEach(t),zv=a(L0,"BR",{}),L0.forEach(t),Hv=d(Qe),Od=a(Qe,"TD",{});var BC=s(Od);qv=r(BC,"Trained with image segmentation"),BC.forEach(t),Ov=d(Qe),Kd=a(Qe,"TD",{});var PC=s(Kd);Kv=r(PC,"An image with segmented regions, usually represented as a color-coded image."),PC.forEach(t),e1=d(Qe),ep=a(Qe,"TD",{});var FC=s(ep);zi=a(FC,"A",{href:!0});var RC=s(zi);mn=a(RC,"IMG",{width:!0,style:!0,src:!0}),RC.forEach(t),FC.forEach(t),t1=d(Qe),tp=a(Qe,"TD",{});var VC=s(tp);Hi=a(VC,"A",{href:!0});var XC=s(Hi);qi=a(XC,"IMG",{width:!0,src:!0}),XC.forEach(t),VC.forEach(t),Qe.forEach(t),n1=d(D),te=a(D,"TR",{});var Le=s(te);Oi=a(Le,"TD",{});var z0=s(Oi);Na=a(z0,"A",{href:!0,rel:!0});var AC=s(Na);o1=r(AC,"lllyasviel/control_v11p_sd15_lineart"),AC.forEach(t),a1=a(z0,"BR",{}),z0.forEach(t),s1=d(Le),np=a(Le,"TD",{});var YC=s(np);l1=r(YC,"Trained with line art generation"),YC.forEach(t),i1=d(Le),op=a(Le,"TD",{});var QC=s(op);r1=r(QC,"An image with line art, usually black lines on a white background."),QC.forEach(t),c1=d(Le),ap=a(Le,"TD",{});var LC=s(ap);Ki=a(LC,"A",{href:!0});var zC=s(Ki);fn=a(zC,"IMG",{width:!0,style:!0,src:!0}),zC.forEach(t),LC.forEach(t),d1=d(Le),sp=a(Le,"TD",{});var HC=s(sp);er=a(HC,"A",{href:!0});var qC=s(er);tr=a(qC,"IMG",{width:!0,src:!0}),qC.forEach(t),HC.forEach(t),Le.forEach(t),p1=d(D),ne=a(D,"TR",{});var ze=s(ne);nr=a(ze,"TD",{});var H0=s(nr);xa=a(H0,"A",{href:!0,rel:!0});var OC=s(xa);m1=r(OC,"lllyasviel/control_v11p_sd15s2_lineart_anime"),OC.forEach(t),f1=a(H0,"BR",{}),H0.forEach(t),u1=d(ze),lp=a(ze,"TD",{});var KC=s(lp);h1=r(KC,"Trained with anime line art generation"),KC.forEach(t),g1=d(ze),ip=a(ze,"TD",{});var e5=s(ip);_1=r(e5,"An image with anime-style line art."),e5.forEach(t),b1=d(ze),rp=a(ze,"TD",{});var t5=s(rp);or=a(t5,"A",{href:!0});var n5=s(or);un=a(n5,"IMG",{width:!0,style:!0,src:!0}),n5.forEach(t),t5.forEach(t),y1=d(ze),cp=a(ze,"TD",{});var o5=s(cp);ar=a(o5,"A",{href:!0});var a5=s(ar);sr=a(a5,"IMG",{width:!0,src:!0}),a5.forEach(t),o5.forEach(t),ze.forEach(t),v1=d(D),oe=a(D,"TR",{});var He=s(oe);lr=a(He,"TD",{});var q0=s(lr);ka=a(q0,"A",{href:!0,rel:!0});var s5=s(ka);w1=r(s5,"lllyasviel/control_v11p_sd15_openpose"),s5.forEach(t),M1=a(q0,"BR",{}),q0.forEach(t),T1=d(He),dp=a(He,"TD",{});var l5=s(dp);U1=r(l5,"Trained with human pose estimation"),l5.forEach(t),J1=d(He),pp=a(He,"TD",{});var i5=s(pp);I1=r(i5,"An image with human poses, usually represented as a set of keypoints or skeletons."),i5.forEach(t),E1=d(He),mp=a(He,"TD",{});var r5=s(mp);ir=a(r5,"A",{href:!0});var c5=s(ir);hn=a(c5,"IMG",{width:!0,style:!0,src:!0}),c5.forEach(t),r5.forEach(t),C1=d(He),fp=a(He,"TD",{});var d5=s(fp);rr=a(d5,"A",{href:!0});var p5=s(rr);cr=a(p5,"IMG",{width:!0,src:!0}),p5.forEach(t),d5.forEach(t),He.forEach(t),j1=d(D),ae=a(D,"TR",{});var qe=s(ae);dr=a(qe,"TD",{});var O0=s(dr);$a=a(O0,"A",{href:!0,rel:!0});var m5=s($a);Z1=r(m5,"lllyasviel/control_v11p_sd15_scribble"),m5.forEach(t),N1=a(O0,"BR",{}),O0.forEach(t),x1=d(qe),up=a(qe,"TD",{});var f5=s(up);k1=r(f5,"Trained with scribble-based image generation"),f5.forEach(t),$1=d(qe),hp=a(qe,"TD",{});var u5=s(hp);W1=r(u5,"An image with scribbles, usually random or user-drawn strokes."),u5.forEach(t),G1=d(qe),gp=a(qe,"TD",{});var h5=s(gp);pr=a(h5,"A",{href:!0});var g5=s(pr);gn=a(g5,"IMG",{width:!0,style:!0,src:!0}),g5.forEach(t),h5.forEach(t),D1=d(qe),_p=a(qe,"TD",{});var _5=s(_p);mr=a(_5,"A",{href:!0});var b5=s(mr);fr=a(b5,"IMG",{width:!0,src:!0}),b5.forEach(t),_5.forEach(t),qe.forEach(t),S1=d(D),se=a(D,"TR",{});var Oe=s(se);ur=a(Oe,"TD",{});var K0=s(ur);Wa=a(K0,"A",{href:!0,rel:!0});var y5=s(Wa);B1=r(y5,"lllyasviel/control_v11p_sd15_softedge"),y5.forEach(t),P1=a(K0,"BR",{}),K0.forEach(t),F1=d(Oe),bp=a(Oe,"TD",{});var v5=s(bp);R1=r(v5,"Trained with soft edge image generation"),v5.forEach(t),V1=d(Oe),yp=a(Oe,"TD",{});var w5=s(yp);X1=r(w5,"An image with soft edges, usually to create a more painterly or artistic effect."),w5.forEach(t),A1=d(Oe),vp=a(Oe,"TD",{});var M5=s(vp);hr=a(M5,"A",{href:!0});var T5=s(hr);_n=a(T5,"IMG",{width:!0,style:!0,src:!0}),T5.forEach(t),M5.forEach(t),Y1=d(Oe),wp=a(Oe,"TD",{});var U5=s(wp);gr=a(U5,"A",{href:!0});var J5=s(gr);_r=a(J5,"IMG",{width:!0,src:!0}),J5.forEach(t),U5.forEach(t),Oe.forEach(t),Q1=d(D),le=a(D,"TR",{});var Ke=s(le);br=a(Ke,"TD",{});var eU=s(br);Ga=a(eU,"A",{href:!0,rel:!0});var I5=s(Ga);L1=r(I5,"lllyasviel/control_v11e_sd15_shuffle"),I5.forEach(t),z1=a(eU,"BR",{}),eU.forEach(t),H1=d(Ke),Mp=a(Ke,"TD",{});var E5=s(Mp);q1=r(E5,"Trained with image shuffling"),E5.forEach(t),O1=d(Ke),Tp=a(Ke,"TD",{});var C5=s(Tp);K1=r(C5,"An image with shuffled patches or regions."),C5.forEach(t),ew=d(Ke),Up=a(Ke,"TD",{});var j5=s(Up);yr=a(j5,"A",{href:!0});var Z5=s(yr);bn=a(Z5,"IMG",{width:!0,style:!0,src:!0}),Z5.forEach(t),j5.forEach(t),tw=d(Ke),Jp=a(Ke,"TD",{});var N5=s(Jp);vr=a(N5,"A",{href:!0});var x5=s(vr);wr=a(x5,"IMG",{width:!0,src:!0}),x5.forEach(t),N5.forEach(t),Ke.forEach(t),nw=d(D),ie=a(D,"TR",{});var et=s(ie);Mr=a(et,"TD",{});var tU=s(Mr);Da=a(tU,"A",{href:!0,rel:!0});var k5=s(Da);ow=r(k5,"lllyasviel/control_v11f1e_sd15_tile"),k5.forEach(t),aw=a(tU,"BR",{}),tU.forEach(t),sw=d(et),Ip=a(et,"TD",{});var $5=s(Ip);lw=r($5,"Trained with image tiling"),$5.forEach(t),iw=d(et),Ep=a(et,"TD",{});var W5=s(Ep);rw=r(W5,"A blurry image or part of an image ."),W5.forEach(t),cw=d(et),Cp=a(et,"TD",{});var G5=s(Cp);Tr=a(G5,"A",{href:!0});var D5=s(Tr);yn=a(D5,"IMG",{width:!0,style:!0,src:!0}),D5.forEach(t),G5.forEach(t),dw=d(et),jp=a(et,"TD",{});var S5=s(jp);Ur=a(S5,"A",{href:!0});var B5=s(Ur);Jr=a(B5,"IMG",{width:!0,src:!0}),B5.forEach(t),S5.forEach(t),et.forEach(t),D.forEach(t),Ou.forEach(t),uu=d(n),vt=a(n,"H2",{class:!0});var Ku=s(vt);vn=a(Ku,"A",{id:!0,class:!0,href:!0});var P5=s(vn);Zp=a(P5,"SPAN",{});var F5=s(Zp);y(Sa.$$.fragment,F5),F5.forEach(t),P5.forEach(t),pw=d(Ku),Np=a(Ku,"SPAN",{});var R5=s(Np);mw=r(R5,"StableDiffusionControlNetPipeline"),R5.forEach(t),Ku.forEach(t),hu=d(n),j=a(n,"DIV",{class:!0});var k=s(j);y(Ba.$$.fragment,k),fw=d(k),xp=a(k,"P",{});var V5=s(xp);uw=r(V5,"Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),V5.forEach(t),hw=d(k),Pa=a(k,"P",{});var eh=s(Pa);gw=r(eh,"This model inherits from "),Ir=a(eh,"A",{href:!0});var X5=s(Ir);_w=r(X5,"DiffusionPipeline"),X5.forEach(t),bw=r(eh,`. 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.)`),eh.forEach(t),yw=d(k),kp=a(k,"P",{});var A5=s(kp);vw=r(A5,"In addition the pipeline inherits the following loading methods:"),A5.forEach(t),ww=d(k),$p=a(k,"UL",{});var Y5=s($p);Fa=a(Y5,"LI",{});var th=s(Fa);Wp=a(th,"EM",{});var Q5=s(Wp);Mw=r(Q5,"Textual-Inversion"),Q5.forEach(t),Tw=r(th,": "),Er=a(th,"A",{href:!0});var L5=s(Er);Uw=r(L5,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),L5.forEach(t),th.forEach(t),Y5.forEach(t),Jw=d(k),Ge=a(k,"DIV",{class:!0});var Fr=s(Ge);y(Ra.$$.fragment,Fr),Iw=d(Fr),Gp=a(Fr,"P",{});var z5=s(Gp);Ew=r(z5,"Function invoked when calling the pipeline for generation."),z5.forEach(t),Cw=d(Fr),y(wn.$$.fragment,Fr),Fr.forEach(t),jw=d(k),Mn=a(k,"DIV",{class:!0});var nh=s(Mn);y(Va.$$.fragment,nh),Zw=d(nh),Dp=a(nh,"P",{});var H5=s(Dp);Nw=r(H5,`Enable sliced attention computation. 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.`),H5.forEach(t),nh.forEach(t),xw=d(k),Tn=a(k,"DIV",{class:!0});var oh=s(Tn);y(Xa.$$.fragment,oh),kw=d(oh),Aa=a(oh,"P",{});var ah=s(Aa);$w=r(ah,"Disable sliced attention computation. If "),Sp=a(ah,"CODE",{});var q5=s(Sp);Ww=r(q5,"enable_attention_slicing"),q5.forEach(t),Gw=r(ah,` was previously called, attention is
computed in one step.`),ah.forEach(t),oh.forEach(t),Dw=d(k),Un=a(k,"DIV",{class:!0});var sh=s(Un);y(Ya.$$.fragment,sh),Sw=d(sh),Bp=a(sh,"P",{});var O5=s(Bp);Bw=r(O5,`Enable sliced VAE decoding. 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.`),O5.forEach(t),sh.forEach(t),Pw=d(k),Jn=a(k,"DIV",{class:!0});var lh=s(Jn);y(Qa.$$.fragment,lh),Fw=d(lh),La=a(lh,"P",{});var ih=s(La);Rw=r(ih,"Disable sliced VAE decoding. If "),Pp=a(ih,"CODE",{});var K5=s(Pp);Vw=r(K5,"enable_vae_slicing"),K5.forEach(t),Xw=r(ih,` was previously enabled, this method will go back to
computing decoding in one step.`),ih.forEach(t),lh.forEach(t),Aw=d(k),he=a(k,"DIV",{class:!0});var Mo=s(he);y(za.$$.fragment,Mo),Yw=d(Mo),Ha=a(Mo,"P",{});var rh=s(Ha);Qw=r(rh,"Enable memory efficient attention from "),qa=a(rh,"A",{href:!0,rel:!0});var ej=s(qa);Lw=r(ej,"xFormers"),ej.forEach(t),zw=r(rh,`. 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.`),rh.forEach(t),Hw=d(Mo),y(In.$$.fragment,Mo),qw=d(Mo),y(En.$$.fragment,Mo),Mo.forEach(t),Ow=d(k),Cn=a(k,"DIV",{class:!0});var ch=s(Cn);y(Oa.$$.fragment,ch),Kw=d(ch),Ka=a(ch,"P",{});var dh=s(Ka);e2=r(dh,"Disable memory efficient attention from "),es=a(dh,"A",{href:!0,rel:!0});var tj=s(es);t2=r(tj,"xFormers"),tj.forEach(t),n2=r(dh,"."),dh.forEach(t),ch.forEach(t),o2=d(k),F=a(k,"DIV",{class:!0});var be=s(F);y(ts.$$.fragment,be),a2=d(be),ns=a(be,"P",{});var ph=s(ns);s2=r(ph,"Load textual inversion embeddings into the text encoder of "),Cr=a(ph,"A",{href:!0});var nj=s(Cr);l2=r(nj,"StableDiffusionPipeline"),nj.forEach(t),i2=r(ph,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),ph.forEach(t),r2=d(be),Fp=a(be,"P",{});var oj=s(Fp);c2=r(oj,"Example:"),oj.forEach(t),d2=d(be),y(jn.$$.fragment,be),p2=d(be),os=a(be,"P",{});var mh=s(os);m2=r(mh,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),as=a(mh,"A",{href:!0,rel:!0});var aj=s(as);f2=r(aj,"civitAI"),aj.forEach(t),u2=r(mh,") and then load the vector"),mh.forEach(t),h2=d(be),y(Zn.$$.fragment,be),be.forEach(t),g2=d(k),Nn=a(k,"DIV",{class:!0});var fh=s(Nn);y(ss.$$.fragment,fh),_2=d(fh),ls=a(fh,"P",{});var uh=s(ls);b2=r(uh,"Disable tiled VAE decoding. If "),Rp=a(uh,"CODE",{});var sj=s(Rp);y2=r(sj,"enable_vae_tiling"),sj.forEach(t),v2=r(uh,` was previously enabled, this method will go back to
computing decoding in one step.`),uh.forEach(t),fh.forEach(t),w2=d(k),xn=a(k,"DIV",{class:!0});var hh=s(xn);y(is.$$.fragment,hh),M2=d(hh),re=a(hh,"P",{});var tt=s(re);T2=r(tt,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Vp=a(tt,"CODE",{});var lj=s(Vp);U2=r(lj,"enable_sequential_cpu_offload"),lj.forEach(t),J2=r(tt,", this method moves one whole model at a time to the GPU when its "),Xp=a(tt,"CODE",{});var ij=s(Xp);I2=r(ij,"forward"),ij.forEach(t),E2=r(tt,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Ap=a(tt,"CODE",{});var rj=s(Ap);C2=r(rj,"enable_sequential_cpu_offload"),rj.forEach(t),j2=r(tt,", but performance is much better due to the iterative execution of the "),Yp=a(tt,"CODE",{});var cj=s(Yp);Z2=r(cj,"unet"),cj.forEach(t),N2=r(tt,"."),tt.forEach(t),hh.forEach(t),x2=d(k),kn=a(k,"DIV",{class:!0});var gh=s(kn);y(rs.$$.fragment,gh),k2=d(gh),Qp=a(gh,"P",{});var dj=s(Qp);$2=r(dj,`Enable tiled VAE decoding. 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 for saving a large amount of memory and to allow
processing larger images.`),dj.forEach(t),gh.forEach(t),k.forEach(t),gu=d(n),wt=a(n,"H2",{class:!0});var _h=s(wt);$n=a(_h,"A",{id:!0,class:!0,href:!0});var pj=s($n);Lp=a(pj,"SPAN",{});var mj=s(Lp);y(cs.$$.fragment,mj),mj.forEach(t),pj.forEach(t),W2=d(_h),zp=a(_h,"SPAN",{});var fj=s(zp);G2=r(fj,"StableDiffusionControlNetImg2ImgPipeline"),fj.forEach(t),_h.forEach(t),_u=d(n),Z=a(n,"DIV",{class:!0});var $=s(Z);y(ds.$$.fragment,$),D2=d($),Hp=a($,"P",{});var uj=s(Hp);S2=r(uj,"Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),uj.forEach(t),B2=d($),ps=a($,"P",{});var bh=s(ps);P2=r(bh,"This model inherits from "),jr=a(bh,"A",{href:!0});var hj=s(jr);F2=r(hj,"DiffusionPipeline"),hj.forEach(t),R2=r(bh,`. 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.)`),bh.forEach(t),V2=d($),qp=a($,"P",{});var gj=s(qp);X2=r(gj,"In addition the pipeline inherits the following loading methods:"),gj.forEach(t),A2=d($),Op=a($,"UL",{});var _j=s(Op);ms=a(_j,"LI",{});var yh=s(ms);Kp=a(yh,"EM",{});var bj=s(Kp);Y2=r(bj,"Textual-Inversion"),bj.forEach(t),Q2=r(yh,": "),Zr=a(yh,"A",{href:!0});var yj=s(Zr);L2=r(yj,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),yj.forEach(t),yh.forEach(t),_j.forEach(t),z2=d($),De=a($,"DIV",{class:!0});var Rr=s(De);y(fs.$$.fragment,Rr),H2=d(Rr),em=a(Rr,"P",{});var vj=s(em);q2=r(vj,"Function invoked when calling the pipeline for generation."),vj.forEach(t),O2=d(Rr),y(Wn.$$.fragment,Rr),Rr.forEach(t),K2=d($),Gn=a($,"DIV",{class:!0});var vh=s(Gn);y(us.$$.fragment,vh),eM=d(vh),tm=a(vh,"P",{});var wj=s(tm);tM=r(wj,`Enable sliced attention computation. 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.`),wj.forEach(t),vh.forEach(t),nM=d($),Dn=a($,"DIV",{class:!0});var wh=s(Dn);y(hs.$$.fragment,wh),oM=d(wh),gs=a(wh,"P",{});var Mh=s(gs);aM=r(Mh,"Disable sliced attention computation. If "),nm=a(Mh,"CODE",{});var Mj=s(nm);sM=r(Mj,"enable_attention_slicing"),Mj.forEach(t),lM=r(Mh,` was previously called, attention is
computed in one step.`),Mh.forEach(t),wh.forEach(t),iM=d($),Sn=a($,"DIV",{class:!0});var Th=s(Sn);y(_s.$$.fragment,Th),rM=d(Th),om=a(Th,"P",{});var Tj=s(om);cM=r(Tj,`Enable sliced VAE decoding. 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.`),Tj.forEach(t),Th.forEach(t),dM=d($),Bn=a($,"DIV",{class:!0});var Uh=s(Bn);y(bs.$$.fragment,Uh),pM=d(Uh),ys=a(Uh,"P",{});var Jh=s(ys);mM=r(Jh,"Disable sliced VAE decoding. If "),am=a(Jh,"CODE",{});var Uj=s(am);fM=r(Uj,"enable_vae_slicing"),Uj.forEach(t),uM=r(Jh,` was previously enabled, this method will go back to
computing decoding in one step.`),Jh.forEach(t),Uh.forEach(t),hM=d($),ge=a($,"DIV",{class:!0});var To=s(ge);y(vs.$$.fragment,To),gM=d(To),ws=a(To,"P",{});var Ih=s(ws);_M=r(Ih,"Enable memory efficient attention from "),Ms=a(Ih,"A",{href:!0,rel:!0});var Jj=s(Ms);bM=r(Jj,"xFormers"),Jj.forEach(t),yM=r(Ih,`. 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.`),Ih.forEach(t),vM=d(To),y(Pn.$$.fragment,To),wM=d(To),y(Fn.$$.fragment,To),To.forEach(t),MM=d($),Rn=a($,"DIV",{class:!0});var Eh=s(Rn);y(Ts.$$.fragment,Eh),TM=d(Eh),Us=a(Eh,"P",{});var Ch=s(Us);UM=r(Ch,"Disable memory efficient attention from "),Js=a(Ch,"A",{href:!0,rel:!0});var Ij=s(Js);JM=r(Ij,"xFormers"),Ij.forEach(t),IM=r(Ch,"."),Ch.forEach(t),Eh.forEach(t),EM=d($),R=a($,"DIV",{class:!0});var ye=s(R);y(Is.$$.fragment,ye),CM=d(ye),Es=a(ye,"P",{});var jh=s(Es);jM=r(jh,"Load textual inversion embeddings into the text encoder of "),Nr=a(jh,"A",{href:!0});var Ej=s(Nr);ZM=r(Ej,"StableDiffusionPipeline"),Ej.forEach(t),NM=r(jh,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),jh.forEach(t),xM=d(ye),sm=a(ye,"P",{});var Cj=s(sm);kM=r(Cj,"Example:"),Cj.forEach(t),$M=d(ye),y(Vn.$$.fragment,ye),WM=d(ye),Cs=a(ye,"P",{});var Zh=s(Cs);GM=r(Zh,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),js=a(Zh,"A",{href:!0,rel:!0});var jj=s(js);DM=r(jj,"civitAI"),jj.forEach(t),SM=r(Zh,") and then load the vector"),Zh.forEach(t),BM=d(ye),y(Xn.$$.fragment,ye),ye.forEach(t),PM=d($),An=a($,"DIV",{class:!0});var Nh=s(An);y(Zs.$$.fragment,Nh),FM=d(Nh),Ns=a(Nh,"P",{});var xh=s(Ns);RM=r(xh,"Disable tiled VAE decoding. If "),lm=a(xh,"CODE",{});var Zj=s(lm);VM=r(Zj,"enable_vae_tiling"),Zj.forEach(t),XM=r(xh,` was previously enabled, this method will go back to
computing decoding in one step.`),xh.forEach(t),Nh.forEach(t),AM=d($),Yn=a($,"DIV",{class:!0});var kh=s(Yn);y(xs.$$.fragment,kh),YM=d(kh),ce=a(kh,"P",{});var nt=s(ce);QM=r(nt,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),im=a(nt,"CODE",{});var Nj=s(im);LM=r(Nj,"enable_sequential_cpu_offload"),Nj.forEach(t),zM=r(nt,", this method moves one whole model at a time to the GPU when its "),rm=a(nt,"CODE",{});var xj=s(rm);HM=r(xj,"forward"),xj.forEach(t),qM=r(nt,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),cm=a(nt,"CODE",{});var kj=s(cm);OM=r(kj,"enable_sequential_cpu_offload"),kj.forEach(t),KM=r(nt,", but performance is much better due to the iterative execution of the "),dm=a(nt,"CODE",{});var $j=s(dm);eT=r($j,"unet"),$j.forEach(t),tT=r(nt,"."),nt.forEach(t),kh.forEach(t),nT=d($),Qn=a($,"DIV",{class:!0});var $h=s(Qn);y(ks.$$.fragment,$h),oT=d($h),pm=a($h,"P",{});var Wj=s(pm);aT=r(Wj,`Enable tiled VAE decoding. 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 for saving a large amount of memory and to allow
processing larger images.`),Wj.forEach(t),$h.forEach(t),$.forEach(t),bu=d(n),Mt=a(n,"H2",{class:!0});var Wh=s(Mt);Ln=a(Wh,"A",{id:!0,class:!0,href:!0});var Gj=s(Ln);mm=a(Gj,"SPAN",{});var Dj=s(mm);y($s.$$.fragment,Dj),Dj.forEach(t),Gj.forEach(t),sT=d(Wh),fm=a(Wh,"SPAN",{});var Sj=s(fm);lT=r(Sj,"StableDiffusionControlNetInpaintPipeline"),Sj.forEach(t),Wh.forEach(t),yu=d(n),E=a(n,"DIV",{class:!0});var x=s(E);y(Ws.$$.fragment,x),iT=d(x),um=a(x,"P",{});var Bj=s(um);rT=r(Bj,"Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),Bj.forEach(t),cT=d(x),Gs=a(x,"P",{});var Gh=s(Gs);dT=r(Gh,"This model inherits from "),xr=a(Gh,"A",{href:!0});var Pj=s(xr);pT=r(Pj,"DiffusionPipeline"),Pj.forEach(t),mT=r(Gh,`. 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.)`),Gh.forEach(t),fT=d(x),hm=a(x,"P",{});var Fj=s(hm);uT=r(Fj,"In addition the pipeline inherits the following loading methods:"),Fj.forEach(t),hT=d(x),gm=a(x,"UL",{});var Rj=s(gm);Ds=a(Rj,"LI",{});var Dh=s(Ds);_m=a(Dh,"EM",{});var Vj=s(_m);gT=r(Vj,"Textual-Inversion"),Vj.forEach(t),_T=r(Dh,": "),kr=a(Dh,"A",{href:!0});var Xj=s(kr);bT=r(Xj,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),Xj.forEach(t),Dh.forEach(t),Rj.forEach(t),yT=d(x),y(zn.$$.fragment,x),vT=d(x),Se=a(x,"DIV",{class:!0});var Vr=s(Se);y(Ss.$$.fragment,Vr),wT=d(Vr),bm=a(Vr,"P",{});var Aj=s(bm);MT=r(Aj,"Function invoked when calling the pipeline for generation."),Aj.forEach(t),TT=d(Vr),y(Hn.$$.fragment,Vr),Vr.forEach(t),UT=d(x),qn=a(x,"DIV",{class:!0});var Sh=s(qn);y(Bs.$$.fragment,Sh),JT=d(Sh),ym=a(Sh,"P",{});var Yj=s(ym);IT=r(Yj,`Enable sliced attention computation. 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.`),Yj.forEach(t),Sh.forEach(t),ET=d(x),On=a(x,"DIV",{class:!0});var Bh=s(On);y(Ps.$$.fragment,Bh),CT=d(Bh),Fs=a(Bh,"P",{});var Ph=s(Fs);jT=r(Ph,"Disable sliced attention computation. If "),vm=a(Ph,"CODE",{});var Qj=s(vm);ZT=r(Qj,"enable_attention_slicing"),Qj.forEach(t),NT=r(Ph,` was previously called, attention is
computed in one step.`),Ph.forEach(t),Bh.forEach(t),xT=d(x),Kn=a(x,"DIV",{class:!0});var Fh=s(Kn);y(Rs.$$.fragment,Fh),kT=d(Fh),wm=a(Fh,"P",{});var Lj=s(wm);$T=r(Lj,`Enable sliced VAE decoding. 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.`),Lj.forEach(t),Fh.forEach(t),WT=d(x),eo=a(x,"DIV",{class:!0});var Rh=s(eo);y(Vs.$$.fragment,Rh),GT=d(Rh),Xs=a(Rh,"P",{});var Vh=s(Xs);DT=r(Vh,"Disable sliced VAE decoding. If "),Mm=a(Vh,"CODE",{});var zj=s(Mm);ST=r(zj,"enable_vae_slicing"),zj.forEach(t),BT=r(Vh,` was previously enabled, this method will go back to
computing decoding in one step.`),Vh.forEach(t),Rh.forEach(t),PT=d(x),_e=a(x,"DIV",{class:!0});var Uo=s(_e);y(As.$$.fragment,Uo),FT=d(Uo),Ys=a(Uo,"P",{});var Xh=s(Ys);RT=r(Xh,"Enable memory efficient attention from "),Qs=a(Xh,"A",{href:!0,rel:!0});var Hj=s(Qs);VT=r(Hj,"xFormers"),Hj.forEach(t),XT=r(Xh,`. 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.`),Xh.forEach(t),AT=d(Uo),y(to.$$.fragment,Uo),YT=d(Uo),y(no.$$.fragment,Uo),Uo.forEach(t),QT=d(x),oo=a(x,"DIV",{class:!0});var Ah=s(oo);y(Ls.$$.fragment,Ah),LT=d(Ah),zs=a(Ah,"P",{});var Yh=s(zs);zT=r(Yh,"Disable memory efficient attention from "),Hs=a(Yh,"A",{href:!0,rel:!0});var qj=s(Hs);HT=r(qj,"xFormers"),qj.forEach(t),qT=r(Yh,"."),Yh.forEach(t),Ah.forEach(t),OT=d(x),V=a(x,"DIV",{class:!0});var ve=s(V);y(qs.$$.fragment,ve),KT=d(ve),Os=a(ve,"P",{});var Qh=s(Os);e0=r(Qh,"Load textual inversion embeddings into the text encoder of "),$r=a(Qh,"A",{href:!0});var Oj=s($r);t0=r(Oj,"StableDiffusionPipeline"),Oj.forEach(t),n0=r(Qh,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),Qh.forEach(t),o0=d(ve),Tm=a(ve,"P",{});var Kj=s(Tm);a0=r(Kj,"Example:"),Kj.forEach(t),s0=d(ve),y(ao.$$.fragment,ve),l0=d(ve),Ks=a(ve,"P",{});var Lh=s(Ks);i0=r(Lh,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),el=a(Lh,"A",{href:!0,rel:!0});var eZ=s(el);r0=r(eZ,"civitAI"),eZ.forEach(t),c0=r(Lh,") and then load the vector"),Lh.forEach(t),d0=d(ve),y(so.$$.fragment,ve),ve.forEach(t),p0=d(x),lo=a(x,"DIV",{class:!0});var zh=s(lo);y(tl.$$.fragment,zh),m0=d(zh),nl=a(zh,"P",{});var Hh=s(nl);f0=r(Hh,"Disable tiled VAE decoding. If "),Um=a(Hh,"CODE",{});var tZ=s(Um);u0=r(tZ,"enable_vae_tiling"),tZ.forEach(t),h0=r(Hh,` was previously enabled, this method will go back to
computing decoding in one step.`),Hh.forEach(t),zh.forEach(t),g0=d(x),io=a(x,"DIV",{class:!0});var qh=s(io);y(ol.$$.fragment,qh),_0=d(qh),de=a(qh,"P",{});var ot=s(de);b0=r(ot,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Jm=a(ot,"CODE",{});var nZ=s(Jm);y0=r(nZ,"enable_sequential_cpu_offload"),nZ.forEach(t),v0=r(ot,", this method moves one whole model at a time to the GPU when its "),Im=a(ot,"CODE",{});var oZ=s(Im);w0=r(oZ,"forward"),oZ.forEach(t),M0=r(ot,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Em=a(ot,"CODE",{});var aZ=s(Em);T0=r(aZ,"enable_sequential_cpu_offload"),aZ.forEach(t),U0=r(ot,", but performance is much better due to the iterative execution of the "),Cm=a(ot,"CODE",{});var sZ=s(Cm);J0=r(sZ,"unet"),sZ.forEach(t),I0=r(ot,"."),ot.forEach(t),qh.forEach(t),E0=d(x),ro=a(x,"DIV",{class:!0});var Oh=s(ro);y(al.$$.fragment,Oh),C0=d(Oh),jm=a(Oh,"P",{});var lZ=s(jm);j0=r(lZ,`Enable tiled VAE decoding. 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 for saving a large amount of memory and to allow
processing larger images.`),lZ.forEach(t),Oh.forEach(t),x.forEach(t),vu=d(n),Tt=a(n,"H2",{class:!0});var Kh=s(Tt);co=a(Kh,"A",{id:!0,class:!0,href:!0});var iZ=s(co);Zm=a(iZ,"SPAN",{});var rZ=s(Zm);y(sl.$$.fragment,rZ),rZ.forEach(t),iZ.forEach(t),Z0=d(Kh),Nm=a(Kh,"SPAN",{});var cZ=s(Nm);N0=r(cZ,"FlaxStableDiffusionControlNetPipeline"),cZ.forEach(t),Kh.forEach(t),wu=d(n),pe=a(n,"DIV",{class:!0});var Jo=s(pe);y(ll.$$.fragment,Jo),x0=d(Jo),xm=a(Jo,"P",{});var dZ=s(xm);k0=r(dZ,"Pipeline for text-to-image generation using Stable Diffusion with ControlNet Guidance."),dZ.forEach(t),$0=d(Jo),il=a(Jo,"P",{});var eg=s(il);W0=r(eg,"This model inherits from "),Wr=a(eg,"A",{href:!0});var pZ=s(Wr);G0=r(pZ,"FlaxDiffusionPipeline"),pZ.forEach(t),D0=r(eg,`. 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.)`),eg.forEach(t),S0=d(Jo),Be=a(Jo,"DIV",{class:!0});var Xr=s(Be);y(rl.$$.fragment,Xr),B0=d(Xr),km=a(Xr,"P",{});var mZ=s(km);P0=r(mZ,"Function invoked when calling the pipeline for generation."),mZ.forEach(t),F0=d(Xr),y(po.$$.fragment,Xr),Xr.forEach(t),Jo.forEach(t),this.h()},h(){l(u,"name","hf:doc:metadata"),l(u,"content",JSON.stringify(GZ)),l(h,"id","controlnet"),l(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"),l(h,"href","#controlnet"),l(g,"class","relative group"),l(Y,"href","https://huggingface.co/papers/2302.05543"),l(Y,"rel","nofollow"),l(Eo,"href","https://huggingface.co/takuma104"),l(Eo,"rel","nofollow"),l(Co,"href","https://github.com/lllyasviel/ControlNet"),l(Co,"rel","nofollow"),l(Et,"id","usage-example"),l(Et,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Et,"href","#usage-example"),l(lt,"class","relative group"),l(_l,"href","/docs/diffusers/main/en/api/pipelines/controlnet#diffusers.StableDiffusionControlNetPipeline"),l(gl,"start","2"),l(No,"href","https://huggingface.co/lllyasviel/sd-controlnet-canny"),l(No,"rel","nofollow"),I(yl.src,nU="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/input_image_vermeer.png")||l(yl,"src",nU),l(yl,"alt","img"),l(vl,"href","#controlnet-with-stable-diffusion-1.5"),I(Il.src,oU="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/vermeer_canny_edged.png")||l(Il,"src",oU),l(Il,"alt","img"),l(El,"href","runwayml/stable-diffusion-v1-5"),l(Cl,"href","/docs/diffusers/main/en/api/schedulers/unipc#diffusers.UniPCMultistepScheduler"),I(xl.src,aU="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/vermeer_disco_dancing.png")||l(xl,"src",aU),l(xl,"alt","img"),l(kl,"href","#controlnet-with-stable-diffusion-1.5"),l(kt,"id","combining-multiple-conditionings"),l(kt,"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"),l(kt,"href","#combining-multiple-conditionings"),l(rt,"class","relative group"),l(Gt,"id","canny-conditioning"),l(Gt,"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"),l(Gt,"href","#canny-conditioning"),l(ct,"class","relative group"),I(Gl.src,sU="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/landscape.png")||l(Gl,"src",sU),I(Sl.src,lU="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/controlnet/landscape_canny_masked.png")||l(Sl,"src",lU),l(Dt,"id","openpose-conditioning"),l(Dt,"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"),l(Dt,"href","#openpose-conditioning"),l(dt,"class","relative group"),I(Vo.src,iU="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/person.png")||l(Vo,"src",iU),l(Vo,"width","600"),I(Ao.src,rU="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/controlnet/person_pose.png")||l(Ao,"src",rU),l(Ao,"width","600"),l(St,"id","running-controlnet-with-multiple-conditionings"),l(St,"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"),l(St,"href","#running-controlnet-with-multiple-conditionings"),l(pt,"class","relative group"),I(Lo.src,cU="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/controlnet/multi_controlnet_output.png")||l(Lo,"src",cU),l(Lo,"width","600"),l(Bt,"id","guess-mode"),l(Bt,"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"),l(Bt,"href","#guess-mode"),l(mt,"class","relative group"),l(Ho,"href","https://github.com/lllyasviel/ControlNet#guess-mode--non-prompt-mode"),l(Ho,"rel","nofollow"),l(qo,"href","https://arxiv.org/abs/2302.05543"),l(qo,"rel","nofollow"),l(Pt,"id","the-core-implementation"),l(Pt,"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"),l(Pt,"href","#the-core-implementation"),l(ft,"class","relative group"),l(Rt,"id","usage"),l(Rt,"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"),l(Rt,"href","#usage"),l(ut,"class","relative group"),l(ea,"href","https://github.com/lllyasviel/ControlNet#guess-mode--non-prompt-mode"),l(ea,"rel","nofollow"),l(Vt,"id","output-image-comparison"),l(Vt,"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"),l(Vt,"href","#output-image-comparison"),l(ht,"class","relative group"),l(Vl,"width","128"),I(Vl.src,dU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_guess_mode/output_images/diffusers/output_bird_canny_0.png")||l(Vl,"src",dU),l(Rl,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_guess_mode/output_images/diffusers/output_bird_canny_0.png"),l(Al,"width","128"),I(Al.src,pU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_guess_mode/output_images/diffusers/output_bird_canny_0_gm.png")||l(Al,"src",pU),l(Xl,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_guess_mode/output_images/diffusers/output_bird_canny_0_gm.png"),l(At,"id","available-checkpoints"),l(At,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(At,"href","#available-checkpoints"),l(gt,"class","relative group"),l(la,"href","https://huggingface.co/lllyasviel"),l(la,"rel","nofollow"),l(Yl,"href","#controlnet-v1.1"),l(Qt,"id","controlnet-v10"),l(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"),l(Qt,"href","#controlnet-v10"),l(bt,"class","relative group"),l(ra,"href","https://huggingface.co/lllyasviel/sd-controlnet-canny"),l(ra,"rel","nofollow"),l(Ht,"width","64"),G(Ht,"margin","0"),G(Ht,"padding","0"),I(Ht.src,mU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_bird_canny.png")||l(Ht,"src",mU),l(Ql,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_bird_canny.png"),l(zl,"width","64"),I(zl.src,fU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_bird_canny_1.png")||l(zl,"src",fU),l(Ll,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_bird_canny_1.png"),l(ca,"href","https://huggingface.co/lllyasviel/sd-controlnet-depth"),l(ca,"rel","nofollow"),l(ql,"width","64"),I(ql.src,uU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_vermeer_depth.png")||l(ql,"src",uU),l(Hl,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_vermeer_depth.png"),l(Kl,"width","64"),I(Kl.src,hU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_vermeer_depth_2.png")||l(Kl,"src",hU),l(Ol,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_vermeer_depth_2.png"),l(da,"href","https://huggingface.co/lllyasviel/sd-controlnet-hed"),l(da,"rel","nofollow"),l(ti,"width","64"),I(ti.src,gU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_bird_hed.png")||l(ti,"src",gU),l(ei,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_bird_hed.png"),l(oi,"width","64"),I(oi.src,_U="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_bird_hed_1.png")||l(oi,"src",_U),l(ni,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_bird_hed_1.png"),l(pa,"href","https://huggingface.co/lllyasviel/sd-controlnet-mlsd"),l(pa,"rel","nofollow"),l(si,"width","64"),I(si.src,bU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_room_mlsd.png")||l(si,"src",bU),l(ai,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_room_mlsd.png"),l(ii,"width","64"),I(ii.src,yU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_room_mlsd_0.png")||l(ii,"src",yU),l(li,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_room_mlsd_0.png"),l(ma,"href","https://huggingface.co/lllyasviel/sd-controlnet-normal"),l(ma,"rel","nofollow"),l(ua,"href","https://en.wikipedia.org/wiki/Normal_mapping"),l(ua,"rel","nofollow"),l(ci,"width","64"),I(ci.src,vU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_human_normal.png")||l(ci,"src",vU),l(ri,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_human_normal.png"),l(pi,"width","64"),I(pi.src,wU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_human_normal_1.png")||l(pi,"src",wU),l(di,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_human_normal_1.png"),l(ha,"href","https://huggingface.co/lllyasviel/sd-controlnet_openpose"),l(ha,"rel","nofollow"),l(_a,"href","https://github.com/CMU-Perceptual-Computing-Lab/openpose"),l(_a,"rel","nofollow"),l(fi,"width","64"),I(fi.src,MU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_human_openpose.png")||l(fi,"src",MU),l(mi,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_human_openpose.png"),l(hi,"width","64"),I(hi.src,TU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_human_openpose_0.png")||l(hi,"src",TU),l(ui,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_human_openpose_0.png"),l(ba,"href","https://huggingface.co/lllyasviel/sd-controlnet_scribble"),l(ba,"rel","nofollow"),l(_i,"width","64"),I(_i.src,UU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_vermeer_scribble.png")||l(_i,"src",UU),l(gi,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_vermeer_scribble.png"),l(yi,"width","64"),I(yi.src,JU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_vermeer_scribble_0.png")||l(yi,"src",JU),l(bi,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_vermeer_scribble_0.png"),l(va,"href","https://huggingface.co/lllyasviel/sd-controlnet_seg"),l(va,"rel","nofollow"),l(Ma,"href","https://groups.csail.mit.edu/vision/datasets/ADE20K/"),l(Ma,"rel","nofollow"),l(wi,"width","64"),I(wi.src,IU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_room_seg.png")||l(wi,"src",IU),l(vi,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_room_seg.png"),l(Ti,"width","64"),I(Ti.src,EU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_room_seg_1.png")||l(Ti,"src",EU),l(Mi,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_room_seg_1.png"),l(on,"id","controlnet-v11"),l(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"),l(on,"href","#controlnet-v11"),l(yt,"class","relative group"),l(Ua,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_canny"),l(Ua,"rel","nofollow"),l(sn,"width","64"),G(sn,"margin","0"),G(sn,"padding","0"),I(sn.src,CU="https://huggingface.co/lllyasviel/control_v11p_sd15_canny/resolve/main/images/control.png")||l(sn,"src",CU),l(Ji,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_canny/resolve/main/images/control.png"),l(Ei,"width","64"),I(Ei.src,jU="https://huggingface.co/lllyasviel/control_v11p_sd15_canny/resolve/main/images/image_out.png")||l(Ei,"src",jU),l(Ii,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_canny/resolve/main/images/image_out.png"),l(Ja,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p"),l(Ja,"rel","nofollow"),l(ln,"width","64"),G(ln,"margin","0"),G(ln,"padding","0"),I(ln.src,ZU="https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p/resolve/main/images/control.png")||l(ln,"src",ZU),l(ji,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p/resolve/main/images/control.png"),l(Ni,"width","64"),I(Ni.src,NU="https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p/resolve/main/images/image_out.png")||l(Ni,"src",NU),l(Zi,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p/resolve/main/images/image_out.png"),l(Ia,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint"),l(Ia,"rel","nofollow"),l(rn,"width","64"),G(rn,"margin","0"),G(rn,"padding","0"),I(rn.src,xU="https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint/resolve/main/images/control.png")||l(rn,"src",xU),l(ki,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint/resolve/main/images/control.png"),l(Wi,"width","64"),I(Wi.src,kU="https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint/resolve/main/images/output.png")||l(Wi,"src",kU),l($i,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint/resolve/main/images/output.png"),l(Ea,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd"),l(Ea,"rel","nofollow"),l(cn,"width","64"),G(cn,"margin","0"),G(cn,"padding","0"),I(cn.src,$U="https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd/resolve/main/images/control.png")||l(cn,"src",$U),l(Di,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd/resolve/main/images/control.png"),l(Bi,"width","64"),I(Bi.src,WU="https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd/resolve/main/images/image_out.png")||l(Bi,"src",WU),l(Si,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd/resolve/main/images/image_out.png"),l(Ca,"href","https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth"),l(Ca,"rel","nofollow"),l(dn,"width","64"),G(dn,"margin","0"),G(dn,"padding","0"),I(dn.src,GU="https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth/resolve/main/images/control.png")||l(dn,"src",GU),l(Fi,"href","https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth/resolve/main/images/control.png"),l(Vi,"width","64"),I(Vi.src,DU="https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth/resolve/main/images/image_out.png")||l(Vi,"src",DU),l(Ri,"href","https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth/resolve/main/images/image_out.png"),l(ja,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae"),l(ja,"rel","nofollow"),l(pn,"width","64"),G(pn,"margin","0"),G(pn,"padding","0"),I(pn.src,SU="https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae/resolve/main/images/control.png")||l(pn,"src",SU),l(Ai,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae/resolve/main/images/control.png"),l(Qi,"width","64"),I(Qi.src,BU="https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae/resolve/main/images/image_out.png")||l(Qi,"src",BU),l(Yi,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae/resolve/main/images/image_out.png"),l(Za,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_seg"),l(Za,"rel","nofollow"),l(mn,"width","64"),G(mn,"margin","0"),G(mn,"padding","0"),I(mn.src,PU="https://huggingface.co/lllyasviel/control_v11p_sd15_seg/resolve/main/images/control.png")||l(mn,"src",PU),l(zi,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_seg/resolve/main/images/control.png"),l(qi,"width","64"),I(qi.src,FU="https://huggingface.co/lllyasviel/control_v11p_sd15_seg/resolve/main/images/image_out.png")||l(qi,"src",FU),l(Hi,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_seg/resolve/main/images/image_out.png"),l(Na,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_lineart"),l(Na,"rel","nofollow"),l(fn,"width","64"),G(fn,"margin","0"),G(fn,"padding","0"),I(fn.src,RU="https://huggingface.co/lllyasviel/control_v11p_sd15_lineart/resolve/main/images/control.png")||l(fn,"src",RU),l(Ki,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_lineart/resolve/main/images/control.png"),l(tr,"width","64"),I(tr.src,VU="https://huggingface.co/lllyasviel/control_v11p_sd15_lineart/resolve/main/images/image_out.png")||l(tr,"src",VU),l(er,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_lineart/resolve/main/images/image_out.png"),l(xa,"href","https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime"),l(xa,"rel","nofollow"),l(un,"width","64"),G(un,"margin","0"),G(un,"padding","0"),I(un.src,XU="https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime/resolve/main/images/control.png")||l(un,"src",XU),l(or,"href","https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime/resolve/main/images/control.png"),l(sr,"width","64"),I(sr.src,AU="https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime/resolve/main/images/image_out.png")||l(sr,"src",AU),l(ar,"href","https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime/resolve/main/images/image_out.png"),l(ka,"href","https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime"),l(ka,"rel","nofollow"),l(hn,"width","64"),G(hn,"margin","0"),G(hn,"padding","0"),I(hn.src,YU="https://huggingface.co/lllyasviel/control_v11p_sd15_openpose/resolve/main/images/control.png")||l(hn,"src",YU),l(ir,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_openpose/resolve/main/images/control.png"),l(cr,"width","64"),I(cr.src,QU="https://huggingface.co/lllyasviel/control_v11p_sd15_openpose/resolve/main/images/image_out.png")||l(cr,"src",QU),l(rr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_openpose/resolve/main/images/image_out.png"),l($a,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_scribble"),l($a,"rel","nofollow"),l(gn,"width","64"),G(gn,"margin","0"),G(gn,"padding","0"),I(gn.src,LU="https://huggingface.co/lllyasviel/control_v11p_sd15_scribble/resolve/main/images/control.png")||l(gn,"src",LU),l(pr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_scribble/resolve/main/images/control.png"),l(fr,"width","64"),I(fr.src,zU="https://huggingface.co/lllyasviel/control_v11p_sd15_scribble/resolve/main/images/image_out.png")||l(fr,"src",zU),l(mr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_scribble/resolve/main/images/image_out.png"),l(Wa,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_softedge"),l(Wa,"rel","nofollow"),l(_n,"width","64"),G(_n,"margin","0"),G(_n,"padding","0"),I(_n.src,HU="https://huggingface.co/lllyasviel/control_v11p_sd15_softedge/resolve/main/images/control.png")||l(_n,"src",HU),l(hr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_softedge/resolve/main/images/control.png"),l(_r,"width","64"),I(_r.src,qU="https://huggingface.co/lllyasviel/control_v11p_sd15_softedge/resolve/main/images/image_out.png")||l(_r,"src",qU),l(gr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_softedge/resolve/main/images/image_out.png"),l(Ga,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle"),l(Ga,"rel","nofollow"),l(bn,"width","64"),G(bn,"margin","0"),G(bn,"padding","0"),I(bn.src,OU="https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle/resolve/main/images/control.png")||l(bn,"src",OU),l(yr,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle/resolve/main/images/control.png"),l(wr,"width","64"),I(wr.src,KU="https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle/resolve/main/images/image_out.png")||l(wr,"src",KU),l(vr,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle/resolve/main/images/image_out.png"),l(Da,"href","https://huggingface.co/lllyasviel/control_v11f1e_sd15_tile"),l(Da,"rel","nofollow"),l(yn,"width","64"),G(yn,"margin","0"),G(yn,"padding","0"),I(yn.src,eJ="https://huggingface.co/lllyasviel/control_v11f1e_sd15_tile/resolve/main/images/original.png")||l(yn,"src",eJ),l(Tr,"href","https://huggingface.co/lllyasviel/control_v11f1e_sd15_tile/resolve/main/images/original.png"),l(Jr,"width","64"),I(Jr.src,tJ="https://huggingface.co/lllyasviel/control_v11f1e_sd15_tile/resolve/main/images/output.png")||l(Jr,"src",tJ),l(Ur,"href","https://huggingface.co/lllyasviel/control_v11f1e_sd15_tile/resolve/main/images/output.png"),l(vn,"id","diffusers.StableDiffusionControlNetPipeline"),l(vn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(vn,"href","#diffusers.StableDiffusionControlNetPipeline"),l(vt,"class","relative group"),l(Ir,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),l(Er,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.load_textual_inversion"),l(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Mn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Tn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Un,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Jn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(qa,"href","https://facebookresearch.github.io/xformers/"),l(qa,"rel","nofollow"),l(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(es,"href","https://facebookresearch.github.io/xformers/"),l(es,"rel","nofollow"),l(Cn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Cr,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),l(as,"href","https://civitai.com/models/3036?modelVersionId=9857"),l(as,"rel","nofollow"),l(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Nn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(xn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(kn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l($n,"id","diffusers.StableDiffusionControlNetImg2ImgPipeline"),l($n,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l($n,"href","#diffusers.StableDiffusionControlNetImg2ImgPipeline"),l(wt,"class","relative group"),l(jr,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),l(Zr,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.load_textual_inversion"),l(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Gn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Dn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Sn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Bn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ms,"href","https://facebookresearch.github.io/xformers/"),l(Ms,"rel","nofollow"),l(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Js,"href","https://facebookresearch.github.io/xformers/"),l(Js,"rel","nofollow"),l(Rn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Nr,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),l(js,"href","https://civitai.com/models/3036?modelVersionId=9857"),l(js,"rel","nofollow"),l(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(An,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Yn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Qn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ln,"id","diffusers.StableDiffusionControlNetInpaintPipeline"),l(Ln,"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"),l(Ln,"href","#diffusers.StableDiffusionControlNetInpaintPipeline"),l(Mt,"class","relative group"),l(xr,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline"),l(kr,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.load_textual_inversion"),l(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(qn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(On,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Kn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(eo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Qs,"href","https://facebookresearch.github.io/xformers/"),l(Qs,"rel","nofollow"),l(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Hs,"href","https://facebookresearch.github.io/xformers/"),l(Hs,"rel","nofollow"),l(oo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l($r,"href","/docs/diffusers/main/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),l(el,"href","https://civitai.com/models/3036?modelVersionId=9857"),l(el,"rel","nofollow"),l(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(lo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(io,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ro,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(co,"id","diffusers.FlaxStableDiffusionControlNetPipeline"),l(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"),l(co,"href","#diffusers.FlaxStableDiffusionControlNetPipeline"),l(Tt,"class","relative group"),l(Wr,"href","/docs/diffusers/main/en/api/pipelines/overview#diffusers.FlaxDiffusionPipeline"),l(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(pe,"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,m){e(document.head,u),f(n,J,m),f(n,g,m),e(g,h),e(h,U),v(p,U,null),e(g,_),e(g,at),e(at,we),f(n,Ut,m),f(n,Me,m),e(Me,Y),e(Y,A),e(Me,fl),f(n,Io,m),f(n,st,m),e(st,ng),f(n,tf,m),f(n,ul,m),e(ul,og),f(n,nf,m),f(n,hl,m),e(hl,Ar),e(Ar,ag),f(n,of,m),f(n,Jt,m),e(Jt,sg),e(Jt,Eo),e(Eo,lg),e(Jt,ig),f(n,af,m),f(n,It,m),e(It,rg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(pp,I1),e(oe,E1),e(oe,mp),e(mp,ir),e(ir,hn),e(oe,C1),e(oe,fp),e(fp,rr),e(rr,cr),e(W,j1),e(W,ae),e(ae,dr),e(dr,$a),e($a,Z1),e(dr,N1),e(ae,x1),e(ae,up),e(up,k1),e(ae,$1),e(ae,hp),e(hp,W1),e(ae,G1),e(ae,gp),e(gp,pr),e(pr,gn),e(ae,D1),e(ae,_p),e(_p,mr),e(mr,fr),e(W,S1),e(W,se),e(se,ur),e(ur,Wa),e(Wa,B1),e(ur,P1),e(se,F1),e(se,bp),e(bp,R1),e(se,V1),e(se,yp),e(yp,X1),e(se,A1),e(se,vp),e(vp,hr),e(hr,_n),e(se,Y1),e(se,wp),e(wp,gr),e(gr,_r),e(W,Q1),e(W,le),e(le,br),e(br,Ga),e(Ga,L1),e(br,z1),e(le,H1),e(le,Mp),e(Mp,q1),e(le,O1),e(le,Tp),e(Tp,K1),e(le,ew),e(le,Up),e(Up,yr),e(yr,bn),e(le,tw),e(le,Jp),e(Jp,vr),e(vr,wr),e(W,nw),e(W,ie),e(ie,Mr),e(Mr,Da),e(Da,ow),e(Mr,aw),e(ie,sw),e(ie,Ip),e(Ip,lw),e(ie,iw),e(ie,Ep),e(Ep,rw),e(ie,cw),e(ie,Cp),e(Cp,Tr),e(Tr,yn),e(ie,dw),e(ie,jp),e(jp,Ur),e(Ur,Jr),f(n,uu,m),f(n,vt,m),e(vt,vn),e(vn,Zp),v(Sa,Zp,null),e(vt,pw),e(vt,Np),e(Np,mw),f(n,hu,m),f(n,j,m),v(Ba,j,null),e(j,fw),e(j,xp),e(xp,uw),e(j,hw),e(j,Pa),e(Pa,gw),e(Pa,Ir),e(Ir,_w),e(Pa,bw),e(j,yw),e(j,kp),e(kp,vw),e(j,ww),e(j,$p),e($p,Fa),e(Fa,Wp),e(Wp,Mw),e(Fa,Tw),e(Fa,Er),e(Er,Uw),e(j,Jw),e(j,Ge),v(Ra,Ge,null),e(Ge,Iw),e(Ge,Gp),e(Gp,Ew),e(Ge,Cw),v(wn,Ge,null),e(j,jw),e(j,Mn),v(Va,Mn,null),e(Mn,Zw),e(Mn,Dp),e(Dp,Nw),e(j,xw),e(j,Tn),v(Xa,Tn,null),e(Tn,kw),e(Tn,Aa),e(Aa,$w),e(Aa,Sp),e(Sp,Ww),e(Aa,Gw),e(j,Dw),e(j,Un),v(Ya,Un,null),e(Un,Sw),e(Un,Bp),e(Bp,Bw),e(j,Pw),e(j,Jn),v(Qa,Jn,null),e(Jn,Fw),e(Jn,La),e(La,Rw),e(La,Pp),e(Pp,Vw),e(La,Xw),e(j,Aw),e(j,he),v(za,he,null),e(he,Yw),e(he,Ha),e(Ha,Qw),e(Ha,qa),e(qa,Lw),e(Ha,zw),e(he,Hw),v(In,he,null),e(he,qw),v(En,he,null),e(j,Ow),e(j,Cn),v(Oa,Cn,null),e(Cn,Kw),e(Cn,Ka),e(Ka,e2),e(Ka,es),e(es,t2),e(Ka,n2),e(j,o2),e(j,F),v(ts,F,null),e(F,a2),e(F,ns),e(ns,s2),e(ns,Cr),e(Cr,l2),e(ns,i2),e(F,r2),e(F,Fp),e(Fp,c2),e(F,d2),v(jn,F,null),e(F,p2),e(F,os),e(os,m2),e(os,as),e(as,f2),e(os,u2),e(F,h2),v(Zn,F,null),e(j,g2),e(j,Nn),v(ss,Nn,null),e(Nn,_2),e(Nn,ls),e(ls,b2),e(ls,Rp),e(Rp,y2),e(ls,v2),e(j,w2),e(j,xn),v(is,xn,null),e(xn,M2),e(xn,re),e(re,T2),e(re,Vp),e(Vp,U2),e(re,J2),e(re,Xp),e(Xp,I2),e(re,E2),e(re,Ap),e(Ap,C2),e(re,j2),e(re,Yp),e(Yp,Z2),e(re,N2),e(j,x2),e(j,kn),v(rs,kn,null),e(kn,k2),e(kn,Qp),e(Qp,$2),f(n,gu,m),f(n,wt,m),e(wt,$n),e($n,Lp),v(cs,Lp,null),e(wt,W2),e(wt,zp),e(zp,G2),f(n,_u,m),f(n,Z,m),v(ds,Z,null),e(Z,D2),e(Z,Hp),e(Hp,S2),e(Z,B2),e(Z,ps),e(ps,P2),e(ps,jr),e(jr,F2),e(ps,R2),e(Z,V2),e(Z,qp),e(qp,X2),e(Z,A2),e(Z,Op),e(Op,ms),e(ms,Kp),e(Kp,Y2),e(ms,Q2),e(ms,Zr),e(Zr,L2),e(Z,z2),e(Z,De),v(fs,De,null),e(De,H2),e(De,em),e(em,q2),e(De,O2),v(Wn,De,null),e(Z,K2),e(Z,Gn),v(us,Gn,null),e(Gn,eM),e(Gn,tm),e(tm,tM),e(Z,nM),e(Z,Dn),v(hs,Dn,null),e(Dn,oM),e(Dn,gs),e(gs,aM),e(gs,nm),e(nm,sM),e(gs,lM),e(Z,iM),e(Z,Sn),v(_s,Sn,null),e(Sn,rM),e(Sn,om),e(om,cM),e(Z,dM),e(Z,Bn),v(bs,Bn,null),e(Bn,pM),e(Bn,ys),e(ys,mM),e(ys,am),e(am,fM),e(ys,uM),e(Z,hM),e(Z,ge),v(vs,ge,null),e(ge,gM),e(ge,ws),e(ws,_M),e(ws,Ms),e(Ms,bM),e(ws,yM),e(ge,vM),v(Pn,ge,null),e(ge,wM),v(Fn,ge,null),e(Z,MM),e(Z,Rn),v(Ts,Rn,null),e(Rn,TM),e(Rn,Us),e(Us,UM),e(Us,Js),e(Js,JM),e(Us,IM),e(Z,EM),e(Z,R),v(Is,R,null),e(R,CM),e(R,Es),e(Es,jM),e(Es,Nr),e(Nr,ZM),e(Es,NM),e(R,xM),e(R,sm),e(sm,kM),e(R,$M),v(Vn,R,null),e(R,WM),e(R,Cs),e(Cs,GM),e(Cs,js),e(js,DM),e(Cs,SM),e(R,BM),v(Xn,R,null),e(Z,PM),e(Z,An),v(Zs,An,null),e(An,FM),e(An,Ns),e(Ns,RM),e(Ns,lm),e(lm,VM),e(Ns,XM),e(Z,AM),e(Z,Yn),v(xs,Yn,null),e(Yn,YM),e(Yn,ce),e(ce,QM),e(ce,im),e(im,LM),e(ce,zM),e(ce,rm),e(rm,HM),e(ce,qM),e(ce,cm),e(cm,OM),e(ce,KM),e(ce,dm),e(dm,eT),e(ce,tT),e(Z,nT),e(Z,Qn),v(ks,Qn,null),e(Qn,oT),e(Qn,pm),e(pm,aT),f(n,bu,m),f(n,Mt,m),e(Mt,Ln),e(Ln,mm),v($s,mm,null),e(Mt,sT),e(Mt,fm),e(fm,lT),f(n,yu,m),f(n,E,m),v(Ws,E,null),e(E,iT),e(E,um),e(um,rT),e(E,cT),e(E,Gs),e(Gs,dT),e(Gs,xr),e(xr,pT),e(Gs,mT),e(E,fT),e(E,hm),e(hm,uT),e(E,hT),e(E,gm),e(gm,Ds),e(Ds,_m),e(_m,gT),e(Ds,_T),e(Ds,kr),e(kr,bT),e(E,yT),v(zn,E,null),e(E,vT),e(E,Se),v(Ss,Se,null),e(Se,wT),e(Se,bm),e(bm,MT),e(Se,TT),v(Hn,Se,null),e(E,UT),e(E,qn),v(Bs,qn,null),e(qn,JT),e(qn,ym),e(ym,IT),e(E,ET),e(E,On),v(Ps,On,null),e(On,CT),e(On,Fs),e(Fs,jT),e(Fs,vm),e(vm,ZT),e(Fs,NT),e(E,xT),e(E,Kn),v(Rs,Kn,null),e(Kn,kT),e(Kn,wm),e(wm,$T),e(E,WT),e(E,eo),v(Vs,eo,null),e(eo,GT),e(eo,Xs),e(Xs,DT),e(Xs,Mm),e(Mm,ST),e(Xs,BT),e(E,PT),e(E,_e),v(As,_e,null),e(_e,FT),e(_e,Ys),e(Ys,RT),e(Ys,Qs),e(Qs,VT),e(Ys,XT),e(_e,AT),v(to,_e,null),e(_e,YT),v(no,_e,null),e(E,QT),e(E,oo),v(Ls,oo,null),e(oo,LT),e(oo,zs),e(zs,zT),e(zs,Hs),e(Hs,HT),e(zs,qT),e(E,OT),e(E,V),v(qs,V,null),e(V,KT),e(V,Os),e(Os,e0),e(Os,$r),e($r,t0),e(Os,n0),e(V,o0),e(V,Tm),e(Tm,a0),e(V,s0),v(ao,V,null),e(V,l0),e(V,Ks),e(Ks,i0),e(Ks,el),e(el,r0),e(Ks,c0),e(V,d0),v(so,V,null),e(E,p0),e(E,lo),v(tl,lo,null),e(lo,m0),e(lo,nl),e(nl,f0),e(nl,Um),e(Um,u0),e(nl,h0),e(E,g0),e(E,io),v(ol,io,null),e(io,_0),e(io,de),e(de,b0),e(de,Jm),e(Jm,y0),e(de,v0),e(de,Im),e(Im,w0),e(de,M0),e(de,Em),e(Em,T0),e(de,U0),e(de,Cm),e(Cm,J0),e(de,I0),e(E,E0),e(E,ro),v(al,ro,null),e(ro,C0),e(ro,jm),e(jm,j0),f(n,vu,m),f(n,Tt,m),e(Tt,co),e(co,Zm),v(sl,Zm,null),e(Tt,Z0),e(Tt,Nm),e(Nm,N0),f(n,wu,m),f(n,pe,m),v(ll,pe,null),e(pe,x0),e(pe,xm),e(xm,k0),e(pe,$0),e(pe,il),e(il,W0),e(il,Wr),e(Wr,G0),e(il,D0),e(pe,S0),e(pe,Be),v(rl,Be,null),e(Be,B0),e(Be,km),e(km,P0),e(Be,F0),v(po,Be,null),Mu=!0},p(n,[m]){const cl={};m&2&&(cl.$$scope={dirty:m,ctx:n}),wn.$set(cl);const $m={};m&2&&($m.$$scope={dirty:m,ctx:n}),In.$set($m);const Wm={};m&2&&(Wm.$$scope={dirty:m,ctx:n}),En.$set(Wm);const Gm={};m&2&&(Gm.$$scope={dirty:m,ctx:n}),jn.$set(Gm);const Gr={};m&2&&(Gr.$$scope={dirty:m,ctx:n}),Zn.$set(Gr);const Dm={};m&2&&(Dm.$$scope={dirty:m,ctx:n}),Wn.$set(Dm);const Sm={};m&2&&(Sm.$$scope={dirty:m,ctx:n}),Pn.$set(Sm);const Bm={};m&2&&(Bm.$$scope={dirty:m,ctx:n}),Fn.$set(Bm);const Pm={};m&2&&(Pm.$$scope={dirty:m,ctx:n}),Vn.$set(Pm);const Fm={};m&2&&(Fm.$$scope={dirty:m,ctx:n}),Xn.$set(Fm);const dl={};m&2&&(dl.$$scope={dirty:m,ctx:n}),zn.$set(dl);const Rm={};m&2&&(Rm.$$scope={dirty:m,ctx:n}),Hn.$set(Rm);const pl={};m&2&&(pl.$$scope={dirty:m,ctx:n}),to.$set(pl);const Vm={};m&2&&(Vm.$$scope={dirty:m,ctx:n}),no.$set(Vm);const ml={};m&2&&(ml.$$scope={dirty:m,ctx:n}),ao.$set(ml);const Xm={};m&2&&(Xm.$$scope={dirty:m,ctx:n}),so.$set(Xm);const Am={};m&2&&(Am.$$scope={dirty:m,ctx:n}),po.$set(Am)},i(n){Mu||(w(p.$$.fragment,n),w(jo.$$.fragment,n),w(xo.$$.fragment,n),w(ko.$$.fragment,n),w($o.$$.fragment,n),w(Wo.$$.fragment,n),w(Go.$$.fragment,n),w(Do.$$.fragment,n),w(So.$$.fragment,n),w(Bo.$$.fragment,n),w(Po.$$.fragment,n),w(Fo.$$.fragment,n),w(Ro.$$.fragment,n),w(Xo.$$.fragment,n),w(Yo.$$.fragment,n),w(Qo.$$.fragment,n),w(zo.$$.fragment,n),w(Oo.$$.fragment,n),w(Ko.$$.fragment,n),w(ta.$$.fragment,n),w(na.$$.fragment,n),w(sa.$$.fragment,n),w(ia.$$.fragment,n),w(Ta.$$.fragment,n),w(Sa.$$.fragment,n),w(Ba.$$.fragment,n),w(Ra.$$.fragment,n),w(wn.$$.fragment,n),w(Va.$$.fragment,n),w(Xa.$$.fragment,n),w(Ya.$$.fragment,n),w(Qa.$$.fragment,n),w(za.$$.fragment,n),w(In.$$.fragment,n),w(En.$$.fragment,n),w(Oa.$$.fragment,n),w(ts.$$.fragment,n),w(jn.$$.fragment,n),w(Zn.$$.fragment,n),w(ss.$$.fragment,n),w(is.$$.fragment,n),w(rs.$$.fragment,n),w(cs.$$.fragment,n),w(ds.$$.fragment,n),w(fs.$$.fragment,n),w(Wn.$$.fragment,n),w(us.$$.fragment,n),w(hs.$$.fragment,n),w(_s.$$.fragment,n),w(bs.$$.fragment,n),w(vs.$$.fragment,n),w(Pn.$$.fragment,n),w(Fn.$$.fragment,n),w(Ts.$$.fragment,n),w(Is.$$.fragment,n),w(Vn.$$.fragment,n),w(Xn.$$.fragment,n),w(Zs.$$.fragment,n),w(xs.$$.fragment,n),w(ks.$$.fragment,n),w($s.$$.fragment,n),w(Ws.$$.fragment,n),w(zn.$$.fragment,n),w(Ss.$$.fragment,n),w(Hn.$$.fragment,n),w(Bs.$$.fragment,n),w(Ps.$$.fragment,n),w(Rs.$$.fragment,n),w(Vs.$$.fragment,n),w(As.$$.fragment,n),w(to.$$.fragment,n),w(no.$$.fragment,n),w(Ls.$$.fragment,n),w(qs.$$.fragment,n),w(ao.$$.fragment,n),w(so.$$.fragment,n),w(tl.$$.fragment,n),w(ol.$$.fragment,n),w(al.$$.fragment,n),w(sl.$$.fragment,n),w(ll.$$.fragment,n),w(rl.$$.fragment,n),w(po.$$.fragment,n),Mu=!0)},o(n){M(p.$$.fragment,n),M(jo.$$.fragment,n),M(xo.$$.fragment,n),M(ko.$$.fragment,n),M($o.$$.fragment,n),M(Wo.$$.fragment,n),M(Go.$$.fragment,n),M(Do.$$.fragment,n),M(So.$$.fragment,n),M(Bo.$$.fragment,n),M(Po.$$.fragment,n),M(Fo.$$.fragment,n),M(Ro.$$.fragment,n),M(Xo.$$.fragment,n),M(Yo.$$.fragment,n),M(Qo.$$.fragment,n),M(zo.$$.fragment,n),M(Oo.$$.fragment,n),M(Ko.$$.fragment,n),M(ta.$$.fragment,n),M(na.$$.fragment,n),M(sa.$$.fragment,n),M(ia.$$.fragment,n),M(Ta.$$.fragment,n),M(Sa.$$.fragment,n),M(Ba.$$.fragment,n),M(Ra.$$.fragment,n),M(wn.$$.fragment,n),M(Va.$$.fragment,n),M(Xa.$$.fragment,n),M(Ya.$$.fragment,n),M(Qa.$$.fragment,n),M(za.$$.fragment,n),M(In.$$.fragment,n),M(En.$$.fragment,n),M(Oa.$$.fragment,n),M(ts.$$.fragment,n),M(jn.$$.fragment,n),M(Zn.$$.fragment,n),M(ss.$$.fragment,n),M(is.$$.fragment,n),M(rs.$$.fragment,n),M(cs.$$.fragment,n),M(ds.$$.fragment,n),M(fs.$$.fragment,n),M(Wn.$$.fragment,n),M(us.$$.fragment,n),M(hs.$$.fragment,n),M(_s.$$.fragment,n),M(bs.$$.fragment,n),M(vs.$$.fragment,n),M(Pn.$$.fragment,n),M(Fn.$$.fragment,n),M(Ts.$$.fragment,n),M(Is.$$.fragment,n),M(Vn.$$.fragment,n),M(Xn.$$.fragment,n),M(Zs.$$.fragment,n),M(xs.$$.fragment,n),M(ks.$$.fragment,n),M($s.$$.fragment,n),M(Ws.$$.fragment,n),M(zn.$$.fragment,n),M(Ss.$$.fragment,n),M(Hn.$$.fragment,n),M(Bs.$$.fragment,n),M(Ps.$$.fragment,n),M(Rs.$$.fragment,n),M(Vs.$$.fragment,n),M(As.$$.fragment,n),M(to.$$.fragment,n),M(no.$$.fragment,n),M(Ls.$$.fragment,n),M(qs.$$.fragment,n),M(ao.$$.fragment,n),M(so.$$.fragment,n),M(tl.$$.fragment,n),M(ol.$$.fragment,n),M(al.$$.fragment,n),M(sl.$$.fragment,n),M(ll.$$.fragment,n),M(rl.$$.fragment,n),M(po.$$.fragment,n),Mu=!1},d(n){t(u),n&&t(J),n&&t(g),T(p),n&&t(Ut),n&&t(Me),n&&t(Io),n&&t(st),n&&t(tf),n&&t(ul),n&&t(nf),n&&t(hl),n&&t(of),n&&t(Jt),n&&t(af),n&&t(It),n&&t(sf),n&&t(lt),T(jo),n&&t(lf),n&&t(Ct),n&&t(rf),n&&t(jt),n&&t(cf),n&&t(Zt),n&&t(df),T(xo,n),n&&t(pf),n&&t(bl),n&&t(mf),n&&t(xe),n&&t(ff),n&&t(wl),n&&t(uf),T(ko,n),n&&t(hf),n&&t(Ml),n&&t(gf),T($o,n),n&&t(_f),n&&t(Tl),n&&t(bf),T(Wo,n),n&&t(yf),n&&t(Ul),n&&t(vf),n&&t(Jl),n&&t(wf),n&&t(Nt),n&&t(Mf),T(Go,n),n&&t(Tf),n&&t(xt),n&&t(Uf),T(Do,n),n&&t(J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n&&t(Mt),T($s),n&&t(yu),n&&t(E),T(Ws),T(zn),T(Ss),T(Hn),T(Bs),T(Ps),T(Rs),T(Vs),T(As),T(to),T(no),T(Ls),T(qs),T(ao),T(so),T(tl),T(ol),T(al),n&&t(vu),n&&t(Tt),T(sl),n&&t(wu),n&&t(pe),T(ll),T(rl),T(po)}}}const GZ={local:"controlnet",sections:[{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:"ControlNet"};function DZ(N){return _Z(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class XZ extends fZ{constructor(u){super();uZ(this,u,DZ,WZ,hZ,{})}}export{XZ as default,GZ as metadata};
