import{S as mZ,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 v,h as r,b as l,N as I,f as G,G as e,g as m,y,q as w,o as M,B as T,v as _Z,L as me}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 fe}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function bZ(N){let u,J,g,h,U;return h=new S({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjBvcGVuY3YtcHl0aG9uJTIwdHJhbnNmb3JtZXJzJTIwYWNjZWxlcmF0ZSUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBTdGFibGVEaWZmdXNpb25Db250cm9sTmV0UGlwZWxpbmUlMkMlMjBDb250cm9sTmV0TW9kZWwlMkMlMjBVbmlQQ011bHRpc3RlcFNjaGVkdWxlciUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBaW1wb3J0JTIwdG9yY2glMEElMEFpbXBvcnQlMjBjdjIlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEElMjMlMjBkb3dubG9hZCUyMGFuJTIwaW1hZ2UlMEFpbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZoZi5jbyUyRmRhdGFzZXRzJTJGaHVnZ2luZ2ZhY2UlMkZkb2N1bWVudGF0aW9uLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGZGlmZnVzZXJzJTJGaW5wdXRfaW1hZ2VfdmVybWVlci5wbmclMjIlMEEpJTBBaW1hZ2U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jBVbmlQQ011bHRpc3RlcFNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlLnNjaGVkdWxlci5jb25maWcpJTBBJTIzJTIwcmVtb3ZlJTIwZm9sbG93aW5nJTIwbGluZSUyMGlmJTIweGZvcm1lcnMlMjBpcyUyMG5vdCUyMGluc3RhbGxlZCUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKCklMEElMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBJTIzJTIwZ2VuZXJhdGUlMjBpbWFnZSUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLm1hbnVhbF9zZWVkKDApJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMCUyMmZ1dHVyaXN0aWMtbG9va2luZyUyMHdvbWFuJTIyJTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTIwaW1hZ2UlM0RjYW5ueV9pbWFnZSUwQSkuaW1hZ2VzJTVCMCU1RA==",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),v(h.$$.fragment,p)},m(p,_){m(p,u,_),e(u,J),m(p,g,_),y(h,p,_),U=!0},p:me,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 vZ(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){m(g,u,h),e(u,J)},d(g){g&&t(u)}}}function yZ(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),v(h.$$.fragment,p)},m(p,_){m(p,u,_),e(u,J),m(p,g,_),y(h,p,_),U=!0},p:me,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),v(h.$$.fragment,p)},m(p,_){m(p,u,_),e(u,J),m(p,g,_),y(h,p,_),U=!0},p:me,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),v(h.$$.fragment,p)},m(p,_){m(p,u,_),e(u,J),m(p,g,_),y(h,p,_),U=!0},p:me,i(p){U||(w(h.$$.fragment,p),U=!0)},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VkKDApJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMCUyMmZ1dHVyaXN0aWMtbG9va2luZyUyMHdvbWFuJTIyJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0RpbWFnZSUyQyUwQSUyMCUyMCUyMCUyMGNvbnRyb2xfaW1hZ2UlM0RjYW5ueV9pbWFnZSUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",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),v(h.$$.fragment,p)},m(p,_){m(p,u,_),e(u,J),m(p,g,_),y(h,p,_),U=!0},p:me,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){m(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),v(h.$$.fragment,p)},m(p,_){m(p,u,_),e(u,J),m(p,g,_),y(h,p,_),U=!0},p:me,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),v(h.$$.fragment,p)},m(p,_){m(p,u,_),e(u,J),m(p,g,_),y(h,p,_),U=!0},p:me,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),v(h.$$.fragment,p)},m(p,_){m(p,u,_),e(u,J),m(p,g,_),y(h,p,_),U=!0},p:me,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 ml=s(g);h=r(ml,"runwayml/stable-diffusion-inpainting"),ml.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){m(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:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjB0cmFuc2Zvcm1lcnMlMjBhY2NlbGVyYXRlJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRJbnBhaW50UGlwZWxpbmUlMkMlMjBDb250cm9sTmV0TW9kZWwlMkMlMjBERElNU2NoZWR1bGVyJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEFpbXBvcnQlMjBudW1weSUyMGFzJ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jAlMjAlMjAlMjAlMjJydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUyQyUyMGNvbnRyb2xuZXQlM0Rjb250cm9sbmV0JTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQSUwQXBpcGUuc2NoZWR1bGVyJTIwJTNEJTIwRERJTVNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlLnNjaGVkdWxlci5jb25maWcpJTBBcGlwZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQSUwQSUyMyUyMGdlbmVyYXRlJTIwaW1hZ2UlMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwJTIyYSUyMGhhbmRzb21lJTIwbWFuJTIwd2l0aCUyMHJheS1iYW4lMjBzdW5nbGFzc2VzJTIyJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTBBJTIwJTIwJTIwJTIwZXRhJTNEMS4wJTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0Rpbml0X2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwbWFza19pbWFnZSUzRG1hc2tfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBjb250cm9sX2ltYWdlJTNEY29udHJvbF9pbWFnZSUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",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),v(h.$$.fragment,p)},m(p,_){m(p,u,_),e(u,J),m(p,g,_),y(h,p,_),U=!0},p:me,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){m(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),v(h.$$.fragment,p)},m(p,_){m(p,u,_),e(u,J),m(p,g,_),y(h,p,_),U=!0},p:me,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),v(h.$$.fragment,p)},m(p,_){m(p,u,_),e(u,J),m(p,g,_),y(h,p,_),U=!0},p:me,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),v(h.$$.fragment,p)},m(p,_){m(p,u,_),e(u,J),m(p,g,_),y(h,p,_),U=!0},p:me,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:"aW1wb3J0JTIwamF4JTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBaW1wb3J0JTIwamF4Lm51bXB5JTIwYXMlMjBqbnAlMEFmcm9tJTIwZmxheC5qYXhfdXRpbHMlMjBpbXBvcnQlMjByZXBsaWNhdGUlMEFmcm9tJTIwZmxheC50cmFpbmluZy5jb21tb25fdXRpbHMlMjBpbXBvcnQlMjBzaGFyZCUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHM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VnYXRpdmVfcHJvbXB0X2lkcyUyQyUwQSUyMCUyMCUyMCUyMGppdCUzRFRydWUlMkMlMEEpLmltYWdlcyUwQSUwQW91dHB1dF9pbWFnZXMlMjAlM0QlMjBwaXBlLm51bXB5X3RvX3BpbChucC5hc2FycmF5KG91dHB1dC5yZXNoYXBlKChudW1fc2FtcGxlcyUyQyklMjAlMkIlMjBvdXRwdXQuc2hhcGUlNUItMyUzQSU1RCkpKSUwQW91dHB1dF9pbWFnZXMlMjAlM0QlMjBpbWFnZV9ncmlkKG91dHB1dF9pbWFnZXMlMkMlMjBudW1fc2FtcGxlcyUyMCUyRiUyRiUyMDQlMkMlMjA0KSUwQW91dHB1dF9pbWFnZXMuc2F2ZSglMjJnZW5lcmF0ZWRfaW1hZ2UucG5nJTIyKQ==",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),v(h.$$.fragment,p)},m(p,_){m(p,u,_),e(u,J),m(p,g,_),y(h,p,_),U=!0},p:me,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,ml,Io,st,ng,nm,ul,og,om,hl,Ar,ag,am,Jt,sg,Eo,lg,ig,sm,It,rg,Co,cg,dg,lm,lt,Et,Yr,jo,pg,Qr,fg,im,Ct,mg,Lr,ug,hg,rm,jt,zr,Hr,qr,gg,_g,Or,gl,Zo,bg,_l,vg,yg,cm,Zt,wg,No,Mg,Tg,dm,xo,pm,bl,vl,nU,fm,xe,Ug,Kr,Jg,Ig,yl,Eg,Cg,mm,wl,jg,um,ko,hm,Ml,Zg,gm,$o,_m,Tl,Ng,bm,Wo,vm,Ul,xg,ym,Jl,Il,oU,wm,Nt,kg,El,$g,Wg,Mm,Go,Tm,xt,Gg,Cl,Dg,Sg,Um,Do,Jm,jl,Bg,Im,So,Em,Zl,Pg,Cm,Nl,xl,aU,jm,it,ec,Fg,Rg,kl,Vg,Xg,Zm,rt,kt,tc,Bo,Ag,nc,Yg,Nm,$t,Qg,oc,Lg,zg,xm,$l,Hg,km,Wt,qg,ac,Og,Kg,$m,ct,Gt,sc,Po,e_,lc,t_,Wm,Wl,n_,Gm,Gl,sU,Dm,Dl,o_,Sm,Fo,Bm,Sl,lU,Pm,dt,Dt,ic,Ro,a_,rc,s_,Fm,Bl,l_,Rm,Vo,iU,Vm,Pl,i_,Xm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YXRpb24taW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZkaWZmdXNlcnMlMkZpbnB1dF9pbWFnZV92ZXJtZWVyLnBuZyUyMiUwQSk=",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:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZSUyQyUyMENvbnRyb2x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lZ2F0aXZlX3Byb21wdCUyMCUzRCUyMCUyMm1vbm9jaHJvbWUlMkMlMjBsb3dyZXMlMkMlMjBiYWQlMjBhbmF0b215JTJDJTIwd29yc3QlMjBxdWFsaXR5JTJDJTIwbG93JTIwcXVhbGl0eSUyMiUwQSUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLkdlbmVyYXRvcihkZXZpY2UlM0QlMjJjcHUlMjIpLm1hbnVhbF9zZWVkKDEpJTBBJTBBaW1hZ2VzJTIwJTNEJTIwJTVCb3BlbnBvc2VfaW1hZ2UlMkMlMjBjYW5ueV9pbWFnZSU1RCUwQSUwQWltYWdlJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBpbWFnZXMlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEMjAlMkMlMEElMjAlMjAlMjAlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3IlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9wcm9tcHQlM0RuZWdhdGl2ZV9wcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBjb250cm9sbmV0X2NvbmRpdGlvbmluZ19zY2FsZSUzRCU1QjEuMCUyQyUyMDAuOCU1RCUyQyUwQSkuaW1hZ2VzJTVCMCU1RCUwQSUwQWltYWdlLnNhdmUoJTIyLiUyRm11bHRpX2NvbnRyb2xuZXRfb3V0cHV0LnBuZyUyMik=",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/v0.19.0/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionControlNetPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionControlNetPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code>) &#x2014;
Provides additional conditioning to the unet during the denoising process. If you set multiple ControlNets
as a list, the outputs from each ControlNet are added together to create one combined additional
conditioning.`,name:"controlnet"},{anchor:"diffusers.StableDiffusionControlNetPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.19.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.19.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.19.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.19.0/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionControlNetPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionControlNetPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/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/v0.19.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.19.0/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/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet. If multiple ControlNets are specified in init, you can set the
corresponding scale as a list.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.guess_mode",description:`<strong>guess_mode</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
In this mode, the ControlNet encoder will try best to recognize the content of the input image even if
you remove all prompts. The <code>guidance_scale</code> between 3.0 and 5.0 is recommended.`,name:"guess_mode"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.control_guidance_start",description:`<strong>control_guidance_start</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The percentage of total steps at which the controlnet starts applying.`,name:"control_guidance_start"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.control_guidance_end",description:`<strong>control_guidance_end</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The percentage of total steps at which the controlnet stops applying.`,name:"control_guidance_end"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L663",returnDescription:`
<p><a
  href="/docs/diffusers/v0.19.0/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/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),wn=new fe({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/v0.19.0/src/diffusers/pipelines/pipeline_utils.py#L1631"}}),Xa=new C({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/pipeline_utils.py#L1646"}}),Ya=new C({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/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/v0.19.0/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/v0.19.0/src/diffusers/pipelines/pipeline_utils.py#L1570"}}),In=new tg({props:{warning:!0,$$slots:{default:[vZ]},$$scope:{ctx:N}}}),En=new fe({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[yZ]},$$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/v0.19.0/src/diffusers/pipelines/pipeline_utils.py#L1605"}}),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/v0.19.0/src/diffusers/loaders.py#L585"}}),jn=new fe({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.example",$$slots:{default:[wZ]},$$scope:{ctx:N}}}),Zn=new fe({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/v0.19.0/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/v0.19.0/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/v0.19.0/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/v0.19.0/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code>) &#x2014;
Provides additional conditioning to the unet during the denoising process. If you set multiple ControlNets
as a list, the outputs from each ControlNet are added together to create one combined additional
conditioning.`,name:"controlnet"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.19.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.19.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.19.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.19.0/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L119"}}),ms=new C({props:{name:"__call__",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, numpy.ndarray, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image], typing.List[numpy.ndarray]] = None"},{name:"control_image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, numpy.ndarray, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image], typing.List[numpy.ndarray]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"strength",val:": float = 0.8"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 0.8"},{name:"guess_mode",val:": bool = False"},{name:"control_guidance_start",val:": typing.Union[float, typing.List[float]] = 0.0"},{name:"control_guidance_end",val:": typing.Union[float, typing.List[float]] = 1.0"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, <code>List[List[np.ndarray]]</code> or <code>List[List[PIL.Image.Image]]</code>):
The initial image will be used as the starting point for the image generation process. Can also accpet
image latents as <code>image</code>, if passing latents directly, it will not be encoded again.`,name:"image"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.control_image",description:`<strong>control_image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, <code>List[List[np.ndarray]]</code> or <code>List[List[PIL.Image.Image]]</code>):
The ControlNet input condition. ControlNet uses this input condition to generate guidance to Unet. If
the type is specified as <code>Torch.FloatTensor</code>, it is passed to ControlNet as is. <code>PIL.Image.Image</code> can
also be accepted as an image. The dimensions of the output image defaults to <code>image</code>&#x2019;s dimensions. If
height and/or width are passed, <code>image</code> is resized according to them. If multiple ControlNets are
specified in init, images must be passed as a list such that each element of the list can be correctly
batched for input to a single controlnet.`,name:"control_image"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.19.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.19.0/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/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet. If multiple ControlNets are specified in init, you can set the
corresponding scale as a list. Note that by default, we use a smaller conditioning scale for inpainting
than for <a href="/docs/diffusers/v0.19.0/en/api/pipelines/controlnet#diffusers.StableDiffusionControlNetPipeline.__call__"><strong>call</strong>()</a>.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.guess_mode",description:`<strong>guess_mode</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
In this mode, the ControlNet encoder will try best to recognize the content of the input image even if
you remove all prompts. The <code>guidance_scale</code> between 3.0 and 5.0 is recommended.`,name:"guess_mode"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.control_guidance_start",description:`<strong>control_guidance_start</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The percentage of total steps at which the controlnet starts applying.`,name:"control_guidance_start"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.control_guidance_end",description:`<strong>control_guidance_end</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The percentage of total steps at which the controlnet stops applying.`,name:"control_guidance_end"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L741",returnDescription:`
<p><a
  href="/docs/diffusers/v0.19.0/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/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Wn=new fe({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/v0.19.0/src/diffusers/pipelines/pipeline_utils.py#L1631"}}),hs=new C({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/pipeline_utils.py#L1646"}}),_s=new C({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/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/v0.19.0/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L216"}}),ys=new C({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/pipeline_utils.py#L1570"}}),Pn=new tg({props:{warning:!0,$$slots:{default:[UZ]},$$scope:{ctx:N}}}),Fn=new fe({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/v0.19.0/src/diffusers/pipelines/pipeline_utils.py#L1605"}}),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/v0.19.0/src/diffusers/loaders.py#L585"}}),Vn=new fe({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.example",$$slots:{default:[IZ]},$$scope:{ctx:N}}}),Xn=new fe({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/v0.19.0/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/v0.19.0/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/v0.19.0/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/v0.19.0/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code>) &#x2014;
Provides additional conditioning to the unet during the denoising process. If you set multiple ControlNets
as a list, the outputs from each ControlNet are added together to create one combined additional
conditioning.`,name:"controlnet"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.19.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.19.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.19.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.19.0/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/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/v0.19.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.19.0/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/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.5) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet. If multiple ControlNets are specified in init, you can set the
corresponding scale as a list. Note that by default, we use a smaller conditioning scale for inpainting
than for <a href="/docs/diffusers/v0.19.0/en/api/pipelines/controlnet#diffusers.StableDiffusionControlNetPipeline.__call__"><strong>call</strong>()</a>.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.guess_mode",description:`<strong>guess_mode</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
In this mode, the ControlNet encoder will try best to recognize the content of the input image even if
you remove all prompts. The <code>guidance_scale</code> between 3.0 and 5.0 is recommended.`,name:"guess_mode"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.control_guidance_start",description:`<strong>control_guidance_start</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The percentage of total steps at which the controlnet starts applying.`,name:"control_guidance_start"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.control_guidance_end",description:`<strong>control_guidance_end</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The percentage of total steps at which the controlnet stops applying.`,name:"control_guidance_end"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L941",returnDescription:`
<p><a
  href="/docs/diffusers/v0.19.0/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/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Hn=new fe({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/v0.19.0/src/diffusers/pipelines/pipeline_utils.py#L1631"}}),Ps=new C({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/src/diffusers/pipelines/pipeline_utils.py#L1646"}}),Rs=new C({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/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/v0.19.0/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/v0.19.0/src/diffusers/pipelines/pipeline_utils.py#L1570"}}),to=new tg({props:{warning:!0,$$slots:{default:[ZZ]},$$scope:{ctx:N}}}),no=new fe({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/v0.19.0/src/diffusers/pipelines/pipeline_utils.py#L1605"}}),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/v0.19.0/src/diffusers/loaders.py#L585"}}),ao=new fe({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.example",$$slots:{default:[xZ]},$$scope:{ctx:N}}}),so=new fe({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/v0.19.0/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/v0.19.0/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/v0.19.0/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/v0.19.0/en/api/models/autoencoderkl#diffusers.FlaxAutoencoderKL">FlaxAutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>FlaxCLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.FlaxCLIPTextModel" rel="nofollow">CLIP</a>,
specifically the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/unet2d-cond#diffusers.FlaxUNet2DConditionModel">FlaxUNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/v0.19.0/en/api/models/controlnet#diffusers.FlaxControlNetModel">FlaxControlNetModel</a> &#x2014;
Provides additional conditioning to the unet during the denoising process.`,name:"controlnet"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.19.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<code>FlaxDDIMScheduler</code>, <code>FlaxLMSDiscreteScheduler</code>, <code>FlaxPNDMScheduler</code>, or
<code>FlaxDPMSolverMultistepScheduler</code>.`,name:"scheduler"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>FlaxStableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPFeatureExtractor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.19.0/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/v0.19.0/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/v0.19.0/src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py#L357",returnDescription:`
<p><a
  href="/docs/diffusers/v0.19.0/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/v0.19.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"
>FlaxStableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),po=new fe({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"),ml=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."),nm=c(),ul=o("p"),og=i("The abstract from the paper is:"),om=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."),am=c(),Jt=o("p"),sg=i("This model was contributed by "),Eo=o("a"),lg=i("takuma104"),ig=i(". \u2764\uFE0F"),sm=c(),It=o("p"),rg=i("The original codebase can be found at "),Co=o("a"),cg=i("lllyasviel/ControlNet"),dg=i("."),lm=c(),lt=o("h2"),Et=o("a"),Yr=o("span"),b(jo.$$.fragment),pg=c(),Qr=o("span"),fg=i("Usage example"),im=c(),Ct=o("p"),mg=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:`),rm=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"),vg=i("StableDiffusionControlNetPipeline"),yg=i("."),cm=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("."),dm=c(),b(xo.$$.fragment),pm=c(),bl=o("p"),vl=o("img"),fm=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 "),yl=o("a"),Eg=i("official checkpoints"),Cg=i(" for more information about other models."),mm=c(),wl=o("p"),jg=i("First, we need to install opencv:"),um=c(),b(ko.$$.fragment),hm=c(),Ml=o("p"),Zg=i("Next, let\u2019s also install all required Hugging Face libraries:"),gm=c(),b($o.$$.fragment),_m=c(),Tl=o("p"),Ng=i("Then we can retrieve the canny edges of the image."),bm=c(),b(Wo.$$.fragment),vm=c(),Ul=o("p"),xg=i("Let\u2019s take a look at the processed image."),ym=c(),Jl=o("p"),Il=o("img"),wm=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."),Mm=c(),b(Go.$$.fragment),Tm=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("."),Um=c(),b(Do.$$.fragment),Jm=c(),jl=o("p"),Bg=i("Finally, we can run the pipeline:"),Im=c(),b(So.$$.fragment),Em=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:"),Cm=c(),Nl=o("p"),xl=o("img"),jm=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("."),Zm=c(),rt=o("h2"),kt=o("a"),tc=o("span"),b(Bo.$$.fragment),Ag=c(),nc=o("span"),Yg=i("Combining multiple conditionings"),Nm=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("."),xm=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."),km=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."),$m=c(),ct=o("h3"),Gt=o("a"),sc=o("span"),b(Po.$$.fragment),e_=c(),lc=o("span"),t_=i("Canny conditioning"),Wm=c(),Wl=o("p"),n_=i("The original image:"),Gm=c(),Gl=o("img"),Dm=c(),Dl=o("p"),o_=i("Prepare the conditioning:"),Sm=c(),b(Fo.$$.fragment),Bm=c(),Sl=o("img"),Pm=c(),dt=o("h3"),Dt=o("a"),ic=o("span"),b(Ro.$$.fragment),a_=c(),rc=o("span"),s_=i("Openpose conditioning"),Fm=c(),Bl=o("p"),l_=i("The original image:"),Rm=c(),Vo=o("img"),Vm=c(),Pl=o("p"),i_=i("Prepare the conditioning:"),Xm=c(),b(Xo.$$.fragment),Am=c(),Ao=o("img"),Ym=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"),Qm=c(),b(Qo.$$.fragment),Lm=c(),Lo=o("img"),zm=c(),ft=o("h3"),Bt=o("a"),pc=o("span"),b(zo.$$.fragment),d_=c(),fc=o("span"),p_=i("Guess Mode"),Hm=c(),ke=o("p"),f_=i("Guess Mode is "),Ho=o("a"),m_=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:"),qm=c(),Fl=o("blockquote"),mc=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."),Om=c(),mt=o("h4"),Pt=o("a"),uc=o("span"),b(Oo.$$.fragment),b_=c(),hc=o("span"),v_=i("The core implementation:"),Km=c(),$e=o("p"),y_=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"),vc=o("span"),b(Ko.$$.fragment),C_=c(),yc=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"),fb=i("Generated Image Example"),mb=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"),vb=i("A monochrome image with white edges on a black background."),yb=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"),fa=o("a"),Hb=i("lllyasviel/sd-controlnet-normal"),qb=o("br"),Ob=c(),sd=o("em"),Kb=i("Trained with normal map"),ev=c(),ma=o("td"),tv=i("A "),ua=o("a"),nv=i("normal mapped"),ov=i(" image."),av=c(),ld=o("td"),ri=o("a"),ci=o("img"),sv=c(),id=o("td"),di=o("a"),pi=o("img"),lv=c(),je=o("tr"),tn=o("td"),ha=o("a"),iv=i("lllyasviel/sd-controlnet-openpose"),rv=o("br"),cv=c(),rd=o("em"),dv=i("Trained with OpenPose bone image"),pv=c(),ga=o("td"),fv=i("A "),_a=o("a"),mv=i("OpenPose bone"),uv=i(" image."),hv=c(),cd=o("td"),fi=o("a"),mi=o("img"),gv=c(),dd=o("td"),ui=o("a"),hi=o("img"),_v=c(),Ze=o("tr"),nn=o("td"),ba=o("a"),bv=i("lllyasviel/sd-controlnet-scribble"),vv=o("br"),yv=c(),pd=o("em"),wv=i("Trained with human scribbles"),Mv=c(),fd=o("td"),Tv=i("A hand-drawn monochrome image with white outlines on a black background."),Uv=c(),md=o("td"),gi=o("a"),_i=o("img"),Jv=c(),ud=o("td"),bi=o("a"),vi=o("img"),Iv=c(),Ne=o("tr"),va=o("td"),ya=o("a"),Ev=i("lllyasviel/sd-controlnet-seg"),Cv=o("br"),hd=o("em"),jv=i("Trained with semantic segmentation"),Zv=c(),wa=o("td"),Nv=i("An "),Ma=o("a"),xv=i("ADE20K"),kv=i("\u2019s segmentation protocol image."),$v=c(),gd=o("td"),yi=o("a"),wi=o("img"),Wv=c(),_d=o("td"),Mi=o("a"),Ti=o("img"),fu=c(),vt=o("h3"),on=o("a"),bd=o("span"),b(Ta.$$.fragment),Gv=c(),vd=o("span"),Dv=i("ControlNet v1.1"),mu=c(),an=o("table"),yd=o("thead"),Q=o("tr"),wd=o("th"),Sv=i("Model Name"),Bv=c(),Md=o("th"),Pv=i("Control Image Overview"),Fv=c(),Td=o("th"),Rv=i("Condition Image"),Vv=c(),Ud=o("th"),Xv=i("Control Image Example"),Av=c(),Jd=o("th"),Yv=i("Generated Image Example"),Qv=c(),W=o("tbody"),L=o("tr"),Ui=o("td"),Ua=o("a"),Lv=i("lllyasviel/control_v11p_sd15_canny"),zv=o("br"),Hv=c(),Id=o("td"),Ed=o("em"),qv=i("Trained with canny edge detection"),Ov=c(),Cd=o("td"),Kv=i("A monochrome image with white edges on a black background."),ey=c(),jd=o("td"),Ji=o("a"),sn=o("img"),ty=c(),Zd=o("td"),Ii=o("a"),Ei=o("img"),ny=c(),z=o("tr"),Ci=o("td"),Ja=o("a"),oy=i("lllyasviel/control_v11e_sd15_ip2p"),ay=o("br"),sy=c(),Nd=o("td"),xd=o("em"),ly=i("Trained with pixel to pixel instruction"),iy=c(),kd=o("td"),ry=i("No condition ."),cy=c(),$d=o("td"),ji=o("a"),ln=o("img"),dy=c(),Wd=o("td"),Zi=o("a"),Ni=o("img"),py=c(),H=o("tr"),xi=o("td"),Ia=o("a"),fy=i("lllyasviel/control_v11p_sd15_inpaint"),my=o("br"),uy=c(),Gd=o("td"),hy=i("Trained with image inpainting"),gy=c(),Dd=o("td"),_y=i("No condition."),by=c(),Sd=o("td"),ki=o("a"),rn=o("img"),vy=c(),Bd=o("td"),$i=o("a"),Wi=o("img"),yy=c(),q=o("tr"),Gi=o("td"),Ea=o("a"),wy=i("lllyasviel/control_v11p_sd15_mlsd"),My=o("br"),Ty=c(),Pd=o("td"),Uy=i("Trained with multi-level line segment detection"),Jy=c(),Fd=o("td"),Iy=i("An image with annotated line segments."),Ey=c(),Rd=o("td"),Di=o("a"),cn=o("img"),Cy=c(),Vd=o("td"),Si=o("a"),Bi=o("img"),jy=c(),O=o("tr"),Pi=o("td"),Ca=o("a"),Zy=i("lllyasviel/control_v11f1p_sd15_depth"),Ny=o("br"),xy=c(),Xd=o("td"),ky=i("Trained with depth estimation"),$y=c(),Ad=o("td"),Wy=i("An image with depth information, usually represented as a grayscale image."),Gy=c(),Yd=o("td"),Fi=o("a"),dn=o("img"),Dy=c(),Qd=o("td"),Ri=o("a"),Vi=o("img"),Sy=c(),K=o("tr"),Xi=o("td"),ja=o("a"),By=i("lllyasviel/control_v11p_sd15_normalbae"),Py=o("br"),Fy=c(),Ld=o("td"),Ry=i("Trained with surface normal estimation"),Vy=c(),zd=o("td"),Xy=i("An image with surface normal information, usually represented as a color-coded image."),Ay=c(),Hd=o("td"),Ai=o("a"),pn=o("img"),Yy=c(),qd=o("td"),Yi=o("a"),Qi=o("img"),Qy=c(),ee=o("tr"),Li=o("td"),Za=o("a"),Ly=i("lllyasviel/control_v11p_sd15_seg"),zy=o("br"),Hy=c(),Od=o("td"),qy=i("Trained with image segmentation"),Oy=c(),Kd=o("td"),Ky=i("An image with segmented regions, usually represented as a color-coded image."),e1=c(),ep=o("td"),zi=o("a"),fn=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"),mn=o("img"),d1=c(),sp=o("td"),er=o("a"),tr=o("img"),p1=c(),ne=o("tr"),nr=o("td"),xa=o("a"),f1=i("lllyasviel/control_v11p_sd15s2_lineart_anime"),m1=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"),v1=c(),cp=o("td"),ar=o("a"),sr=o("img"),y1=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(),fp=o("td"),ir=o("a"),hn=o("img"),C1=c(),mp=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"),fr=o("a"),mr=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(),vp=o("td"),X1=i("An image with soft edges, usually to create a more painterly or artistic effect."),A1=c(),yp=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"),vr=o("a"),bn=o("img"),tw=c(),Jp=o("td"),yr=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"),vn=o("img"),dw=c(),jp=o("td"),Ur=o("a"),Jr=o("img"),uu=c(),yt=o("h2"),yn=o("a"),Zp=o("span"),b(Sa.$$.fragment),pw=c(),Np=o("span"),fw=i("StableDiffusionControlNetPipeline"),hu=c(),j=o("div"),b(Ba.$$.fragment),mw=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.)`),vw=c(),kp=o("p"),yw=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"),f2=i(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),as=o("a"),m2=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"),v2=i("enable_vae_tiling"),y2=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"),fs=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(ms.$$.fragment),H2=c(),ef=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(),tf=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 "),nf=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(),of=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(),vs=o("p"),fM=i("Disable sliced VAE decoding. If "),af=o("code"),mM=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(ys.$$.fragment),gM=c(),ws=o("p"),_M=i("Enable memory efficient attention from "),Ms=o("a"),bM=i("xFormers"),vM=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.`),yM=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(),sf=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 "),lf=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 `),rf=o("code"),LM=i("enable_sequential_cpu_offload"),zM=i(", this method moves one whole model at a time to the GPU when its "),cf=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
`),df=o("code"),OM=i("enable_sequential_cpu_offload"),KM=i(", but performance is much better due to the iterative execution of the "),pf=o("code"),e0=i("unet"),t0=i("."),n0=c(),Qn=o("div"),b(ks.$$.fragment),o0=c(),ff=o("p"),a0=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"),mf=o("span"),b($s.$$.fragment),s0=c(),uf=o("span"),l0=i("StableDiffusionControlNetInpaintPipeline"),vu=c(),E=o("div"),b(Ws.$$.fragment),i0=c(),hf=o("p"),r0=i("Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),c0=c(),Gs=o("p"),d0=i("This model inherits from "),xr=o("a"),p0=i("DiffusionPipeline"),f0=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.)`),m0=c(),gf=o("p"),u0=i("In addition the pipeline inherits the following loading methods:"),h0=c(),_f=o("ul"),Ds=o("li"),bf=o("em"),g0=i("Textual-Inversion"),_0=i(": "),kr=o("a"),b0=i("loaders.TextualInversionLoaderMixin.load_textual_inversion()"),v0=c(),b(zn.$$.fragment),y0=c(),Se=o("div"),b(Ss.$$.fragment),w0=c(),vf=o("p"),M0=i("Function invoked when calling the pipeline for generation."),T0=c(),b(Hn.$$.fragment),U0=c(),qn=o("div"),b(Bs.$$.fragment),J0=c(),yf=o("p"),I0=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.`),E0=c(),On=o("div"),b(Ps.$$.fragment),C0=c(),Fs=o("p"),j0=i("Disable sliced attention computation. If "),wf=o("code"),Z0=i("enable_attention_slicing"),N0=i(` was previously called, attention is
computed in one step.`),x0=c(),Kn=o("div"),b(Rs.$$.fragment),k0=c(),Mf=o("p"),$0=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.`),W0=c(),eo=o("div"),b(Vs.$$.fragment),G0=c(),Xs=o("p"),D0=i("Disable sliced VAE decoding. If "),Tf=o("code"),S0=i("enable_vae_slicing"),B0=i(` was previously enabled, this method will go back to
computing decoding in one step.`),P0=c(),_e=o("div"),b(As.$$.fragment),F0=c(),Ys=o("p"),R0=i("Enable memory efficient attention from "),Qs=o("a"),V0=i("xFormers"),X0=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.`),A0=c(),b(to.$$.fragment),Y0=c(),b(no.$$.fragment),Q0=c(),oo=o("div"),b(Ls.$$.fragment),L0=c(),zs=o("p"),z0=i("Disable memory efficient attention from "),Hs=o("a"),H0=i("xFormers"),q0=i("."),O0=c(),V=o("div"),b(qs.$$.fragment),K0=c(),Os=o("p"),eT=i("Load textual inversion embeddings into the text encoder of "),$r=o("a"),tT=i("StableDiffusionPipeline"),nT=i(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),oT=c(),Uf=o("p"),aT=i("Example:"),sT=c(),b(ao.$$.fragment),lT=c(),Ks=o("p"),iT=i(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),el=o("a"),rT=i("civitAI"),cT=i(") and then load the vector"),dT=c(),b(so.$$.fragment),pT=c(),lo=o("div"),b(tl.$$.fragment),fT=c(),nl=o("p"),mT=i("Disable tiled VAE decoding. If "),Jf=o("code"),uT=i("enable_vae_tiling"),hT=i(` was previously enabled, this method will go back to
computing decoding in one step.`),gT=c(),io=o("div"),b(ol.$$.fragment),_T=c(),de=o("p"),bT=i(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),If=o("code"),vT=i("enable_sequential_cpu_offload"),yT=i(", this method moves one whole model at a time to the GPU when its "),Ef=o("code"),wT=i("forward"),MT=i(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Cf=o("code"),TT=i("enable_sequential_cpu_offload"),UT=i(", but performance is much better due to the iterative execution of the "),jf=o("code"),JT=i("unet"),IT=i("."),ET=c(),ro=o("div"),b(al.$$.fragment),CT=c(),Zf=o("p"),jT=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.`),yu=c(),Tt=o("h2"),co=o("a"),Nf=o("span"),b(sl.$$.fragment),ZT=c(),xf=o("span"),NT=i("FlaxStableDiffusionControlNetPipeline"),wu=c(),pe=o("div"),b(ll.$$.fragment),xT=c(),kf=o("p"),kT=i("Pipeline for text-to-image generation using Stable Diffusion with ControlNet Guidance."),$T=c(),il=o("p"),WT=i("This model inherits from "),Wr=o("a"),GT=i("FlaxDiffusionPipeline"),DT=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.)`),ST=c(),Be=o("div"),b(rl.$$.fragment),BT=c(),$f=o("p"),PT=i("Function invoked when calling the pipeline for generation."),FT=c(),b(po.$$.fragment),this.h()},l(n){const f=gZ('[data-svelte="svelte-1phssyn"]',document.head);u=a(f,"META",{name:!0,content:!0}),f.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 Wf=s(h);U=a(Wf,"SPAN",{});var Gf=s(U);v(p.$$.fragment,Gf),Gf.forEach(t),Wf.forEach(t),_=d(cl),at=a(cl,"SPAN",{});var Df=s(at);we=r(Df,"ControlNet"),Df.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 Sf=s(Y);A=r(Sf,"Adding Conditional Control to Text-to-Image Diffusion Models"),Sf.forEach(t),ml=r(Gr," by Lvmin Zhang and Maneesh Agrawala."),Gr.forEach(t),Io=d(n),st=a(n,"P",{});var Bf=s(st);ng=r(Bf,"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."),Bf.forEach(t),nm=d(n),ul=a(n,"P",{});var Pf=s(ul);og=r(Pf,"The abstract from the paper is:"),Pf.forEach(t),om=d(n),hl=a(n,"P",{});var Ff=s(hl);Ar=a(Ff,"EM",{});var Rf=s(Ar);ag=r(Rf,"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."),Rf.forEach(t),Ff.forEach(t),am=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 Vf=s(Eo);lg=r(Vf,"takuma104"),Vf.forEach(t),ig=r(dl,". \u2764\uFE0F"),dl.forEach(t),sm=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 Xf=s(Co);cg=r(Xf,"lllyasviel/ControlNet"),Xf.forEach(t),dg=r(pl,"."),pl.forEach(t),lm=d(n),lt=a(n,"H2",{class:!0});var fl=s(lt);Et=a(fl,"A",{id:!0,class:!0,href:!0});var Af=s(Et);Yr=a(Af,"SPAN",{});var Yf=s(Yr);v(jo.$$.fragment,Yf),Yf.forEach(t),Af.forEach(t),pg=d(fl),Qr=a(fl,"SPAN",{});var nJ=s(Qr);fg=r(nJ,"Usage example"),nJ.forEach(t),fl.forEach(t),im=d(n),Ct=a(n,"P",{});var Tu=s(Ct);mg=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),rm=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);vg=r(cJ,"StableDiffusionControlNetPipeline"),cJ.forEach(t),yg=r(Ju,"."),Ju.forEach(t),rJ.forEach(t),iJ.forEach(t),Uu.forEach(t),cm=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),dm=d(n),v(xo.$$.fragment,n),pm=d(n),bl=a(n,"P",{});var pJ=s(bl);vl=a(pJ,"IMG",{src:!0,alt:!0}),pJ.forEach(t),fm=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 fJ=s(Kr);Jg=r(fJ,"1."),fJ.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 "),yl=a(Dr,"A",{href:!0});var mJ=s(yl);Eg=r(mJ,"official checkpoints"),mJ.forEach(t),Cg=r(Dr," for more information about other models."),Dr.forEach(t),mm=d(n),wl=a(n,"P",{});var uJ=s(wl);jg=r(uJ,"First, we need to install opencv:"),uJ.forEach(t),um=d(n),v(ko.$$.fragment,n),hm=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),gm=d(n),v($o.$$.fragment,n),_m=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),bm=d(n),v(Wo.$$.fragment,n),vm=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),ym=d(n),Jl=a(n,"P",{});var bJ=s(Jl);Il=a(bJ,"IMG",{src:!0,alt:!0}),bJ.forEach(t),wm=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 vJ=s(El);$g=r(vJ,"Stable Diffusion 1.5 Model"),vJ.forEach(t),Wg=r(Eu," as well as the ControlNet for canny edges."),Eu.forEach(t),Mm=d(n),v(Go.$$.fragment,n),Tm=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 yJ=s(Cl);Dg=r(yJ,"UniPCMultistepScheduler"),yJ.forEach(t),Sg=r(Cu,"."),Cu.forEach(t),Um=d(n),v(Do.$$.fragment,n),Jm=d(n),jl=a(n,"P",{});var wJ=s(jl);Bg=r(wJ,"Finally, we can run the pipeline:"),wJ.forEach(t),Im=d(n),v(So.$$.fragment,n),Em=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),Cm=d(n),Nl=a(n,"P",{});var TJ=s(Nl);xl=a(TJ,"IMG",{src:!0,alt:!0}),TJ.forEach(t),jm=d(n),it=a(n,"P",{});var Qf=s(it);ec=a(Qf,"STRONG",{});var UJ=s(ec);Fg=r(UJ,"Note"),UJ.forEach(t),Rg=r(Qf,": To see how to run all other ControlNet checkpoints, please have a look at "),kl=a(Qf,"A",{href:!0});var JJ=s(kl);Vg=r(JJ,"ControlNet with Stable Diffusion 1.5"),JJ.forEach(t),Xg=r(Qf,"."),Qf.forEach(t),Zm=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);v(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),Nm=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),xm=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),km=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),$m=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);v(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),Wm=d(n),Wl=a(n,"P",{});var WJ=s(Wl);n_=r(WJ,"The original image:"),WJ.forEach(t),Gm=d(n),Gl=a(n,"IMG",{src:!0}),Dm=d(n),Dl=a(n,"P",{});var GJ=s(Dl);o_=r(GJ,"Prepare the conditioning:"),GJ.forEach(t),Sm=d(n),v(Fo.$$.fragment,n),Bm=d(n),Sl=a(n,"IMG",{src:!0}),Pm=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);v(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),Fm=d(n),Bl=a(n,"P",{});var PJ=s(Bl);l_=r(PJ,"The original image:"),PJ.forEach(t),Rm=d(n),Vo=a(n,"IMG",{src:!0,width:!0}),Vm=d(n),Pl=a(n,"P",{});var FJ=s(Pl);i_=r(FJ,"Prepare the conditioning:"),FJ.forEach(t),Xm=d(n),v(Xo.$$.fragment,n),Am=d(n),Ao=a(n,"IMG",{src:!0,width:!0}),Ym=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);v(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),Qm=d(n),v(Qo.$$.fragment,n),Lm=d(n),Lo=a(n,"IMG",{src:!0,width:!0}),zm=d(n),ft=a(n,"H3",{class:!0});var Wu=s(ft);Bt=a(Wu,"A",{id:!0,class:!0,href:!0});var AJ=s(Bt);pc=a(AJ,"SPAN",{});var YJ=s(pc);v(zo.$$.fragment,YJ),YJ.forEach(t),AJ.forEach(t),d_=d(Wu),fc=a(Wu,"SPAN",{});var QJ=s(fc);p_=r(QJ,"Guess Mode"),QJ.forEach(t),Wu.forEach(t),Hm=d(n),ke=a(n,"P",{});var Sr=s(ke);f_=r(Sr,"Guess Mode is "),Ho=a(Sr,"A",{href:!0,rel:!0});var LJ=s(Ho);m_=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),qm=d(n),Fl=a(n,"BLOCKQUOTE",{});var HJ=s(Fl);mc=a(HJ,"P",{});var qJ=s(mc);__=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),Om=d(n),mt=a(n,"H4",{class:!0});var Gu=s(mt);Pt=a(Gu,"A",{id:!0,class:!0,href:!0});var OJ=s(Pt);uc=a(OJ,"SPAN",{});var KJ=s(uc);v(Oo.$$.fragment,KJ),KJ.forEach(t),OJ.forEach(t),b_=d(Gu),hc=a(Gu,"SPAN",{});var eI=s(hc);v_=r(eI,"The core implementation:"),eI.forEach(t),Gu.forEach(t),Km=d(n),$e=a(n,"P",{});var Br=s($e);y_=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);vc=a(aI,"SPAN",{});var sI=s(vc);v(Ko.$$.fragment,sI),sI.forEach(t),aI.forEach(t),C_=d(Su),yc=a(Su,"SPAN",{});var lI=s(yc);j_=r(lI,"Usage:"),lI.forEach(t),Su.forEach(t),nu=d(n),ue=a(n,"P",{});var fo=s(ue);Z_=r(fo,"Just specify "),wc=a(fo,"CODE",{});var iI=s(wc);N_=r(iI,"guess_mode=True"),iI.forEach(t),x_=r(fo," in the pipe() function. A "),Mc=a(fo,"CODE",{});var rI=s(Mc);k_=r(rI,"guidance_scale"),rI.forEach(t),$_=r(fo," between 3.0 and 5.0 is "),ea=a(fo,"A",{href:!0,rel:!0});var cI=s(ea);W_=r(cI,"recommended"),cI.forEach(t),G_=r(fo,"."),fo.forEach(t),ou=d(n),v(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);v(na.$$.fragment,pI),pI.forEach(t),dI.forEach(t),D_=d(Bu),Uc=a(Bu,"SPAN",{});var fI=s(Uc);S_=r(fI,"Output image comparison:"),fI.forEach(t),Bu.forEach(t),su=r(n,`

Canny Control Example
`),Xt=a(n,"TABLE",{});var Pu=s(Xt);Jc=a(Pu,"THEAD",{});var mI=s(Jc);oa=a(mI,"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),mI.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 vI=s(Zc);Xl=a(vI,"A",{href:!0});var yI=s(Xl);Al=a(yI,"IMG",{width:!0,src:!0}),yI.forEach(t),vI.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);v(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 Lf=s(_t);Wc=a(Lf,"STRONG",{});var EI=s(Wc);eb=r(EI,"13.04.2024 Update"),EI.forEach(t),tb=r(Lf,": The author has released improved controlnet checkpoints v1.1 - see "),Yl=a(Lf,"A",{href:!0});var CI=s(Yl);nb=r(CI,"here"),CI.forEach(t),ob=r(Lf,"."),Lf.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);v(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 mo=s(Te);Bc=a(mo,"TH",{});var kI=s(Bc);lb=r(kI,"Model Name"),kI.forEach(t),ib=d(mo),Pc=a(mo,"TH",{});var $I=s(Pc);rb=r($I,"Control Image Overview"),$I.forEach(t),cb=d(mo),Fc=a(mo,"TH",{});var WI=s(Fc);db=r(WI,"Control Image Example"),WI.forEach(t),pb=d(mo),Rc=a(mo,"TH",{});var GI=s(Rc);fb=r(GI,"Generated Image Example"),GI.forEach(t),mo.forEach(t),xI.forEach(t),mb=d(Yu),B=a(Yu,"TBODY",{});var X=s(B);Ue=a(X,"TR",{});var uo=s(Ue);zt=a(uo,"TD",{});var zf=s(zt);ra=a(zf,"A",{href:!0,rel:!0});var DI=s(ra);ub=r(DI,"lllyasviel/sd-controlnet-canny"),DI.forEach(t),hb=a(zf,"BR",{}),gb=d(zf),Vc=a(zf,"EM",{});var SI=s(Vc);_b=r(SI,"Trained with canny edge detection"),SI.forEach(t),zf.forEach(t),bb=d(uo),Xc=a(uo,"TD",{});var BI=s(Xc);vb=r(BI,"A monochrome image with white edges on a black background."),BI.forEach(t),yb=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 Hf=s(qt);ca=a(Hf,"A",{href:!0,rel:!0});var XI=s(ca);Tb=r(XI,"lllyasviel/sd-controlnet-depth"),XI.forEach(t),Ub=a(Hf,"BR",{}),Jb=d(Hf),Qc=a(Hf,"EM",{});var AI=s(Qc);Ib=r(AI,"Trained with Midas depth estimation"),AI.forEach(t),Hf.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 qf=s(Ot);da=a(qf,"A",{href:!0,rel:!0});var qI=s(da);xb=r(qI,"lllyasviel/sd-controlnet-hed"),qI.forEach(t),kb=a(qf,"BR",{}),$b=d(qf),qc=a(qf,"EM",{});var OI=s(qc);Wb=r(OI,"Trained with HED edge detection (soft edge)"),OI.forEach(t),qf.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 e5=s(Kc);ei=a(e5,"A",{href:!0});var t5=s(ei);ti=a(t5,"IMG",{width:!0,src:!0}),t5.forEach(t),e5.forEach(t),Bb=d(go),ed=a(go,"TD",{});var n5=s(ed);ni=a(n5,"A",{href:!0});var o5=s(ni);oi=a(o5,"IMG",{width:!0,src:!0}),o5.forEach(t),n5.forEach(t),go.forEach(t),Pb=d(X),Ee=a(X,"TR",{});var _o=s(Ee);Kt=a(_o,"TD",{});var Of=s(Kt);pa=a(Of,"A",{href:!0,rel:!0});var a5=s(pa);Fb=r(a5,"lllyasviel/sd-controlnet-mlsd"),a5.forEach(t),Rb=a(Of,"BR",{}),Vb=d(Of),td=a(Of,"EM",{});var s5=s(td);Xb=r(s5,"Trained with M-LSD line detection"),s5.forEach(t),Of.forEach(t),Ab=d(_o),nd=a(_o,"TD",{});var l5=s(nd);Yb=r(l5,"A monochrome image composed only of white straight lines on a black background."),l5.forEach(t),Qb=d(_o),od=a(_o,"TD",{});var i5=s(od);ai=a(i5,"A",{href:!0});var r5=s(ai);si=a(r5,"IMG",{width:!0,src:!0}),r5.forEach(t),i5.forEach(t),Lb=d(_o),ad=a(_o,"TD",{});var c5=s(ad);li=a(c5,"A",{href:!0});var d5=s(li);ii=a(d5,"IMG",{width:!0,src:!0}),d5.forEach(t),c5.forEach(t),_o.forEach(t),zb=d(X),Ce=a(X,"TR",{});var bo=s(Ce);en=a(bo,"TD",{});var Kf=s(en);fa=a(Kf,"A",{href:!0,rel:!0});var p5=s(fa);Hb=r(p5,"lllyasviel/sd-controlnet-normal"),p5.forEach(t),qb=a(Kf,"BR",{}),Ob=d(Kf),sd=a(Kf,"EM",{});var f5=s(sd);Kb=r(f5,"Trained with normal map"),f5.forEach(t),Kf.forEach(t),ev=d(bo),ma=a(bo,"TD",{});var Qu=s(ma);tv=r(Qu,"A "),ua=a(Qu,"A",{href:!0,rel:!0});var m5=s(ua);nv=r(m5,"normal mapped"),m5.forEach(t),ov=r(Qu," image."),Qu.forEach(t),av=d(bo),ld=a(bo,"TD",{});var u5=s(ld);ri=a(u5,"A",{href:!0});var h5=s(ri);ci=a(h5,"IMG",{width:!0,src:!0}),h5.forEach(t),u5.forEach(t),sv=d(bo),id=a(bo,"TD",{});var g5=s(id);di=a(g5,"A",{href:!0});var _5=s(di);pi=a(_5,"IMG",{width:!0,src:!0}),_5.forEach(t),g5.forEach(t),bo.forEach(t),lv=d(X),je=a(X,"TR",{});var vo=s(je);tn=a(vo,"TD",{});var em=s(tn);ha=a(em,"A",{href:!0,rel:!0});var b5=s(ha);iv=r(b5,"lllyasviel/sd-controlnet-openpose"),b5.forEach(t),rv=a(em,"BR",{}),cv=d(em),rd=a(em,"EM",{});var v5=s(rd);dv=r(v5,"Trained with OpenPose bone image"),v5.forEach(t),em.forEach(t),pv=d(vo),ga=a(vo,"TD",{});var Lu=s(ga);fv=r(Lu,"A "),_a=a(Lu,"A",{href:!0,rel:!0});var y5=s(_a);mv=r(y5,"OpenPose bone"),y5.forEach(t),uv=r(Lu," image."),Lu.forEach(t),hv=d(vo),cd=a(vo,"TD",{});var w5=s(cd);fi=a(w5,"A",{href:!0});var M5=s(fi);mi=a(M5,"IMG",{width:!0,src:!0}),M5.forEach(t),w5.forEach(t),gv=d(vo),dd=a(vo,"TD",{});var T5=s(dd);ui=a(T5,"A",{href:!0});var U5=s(ui);hi=a(U5,"IMG",{width:!0,src:!0}),U5.forEach(t),T5.forEach(t),vo.forEach(t),_v=d(X),Ze=a(X,"TR",{});var yo=s(Ze);nn=a(yo,"TD",{});var tm=s(nn);ba=a(tm,"A",{href:!0,rel:!0});var J5=s(ba);bv=r(J5,"lllyasviel/sd-controlnet-scribble"),J5.forEach(t),vv=a(tm,"BR",{}),yv=d(tm),pd=a(tm,"EM",{});var I5=s(pd);wv=r(I5,"Trained with human scribbles"),I5.forEach(t),tm.forEach(t),Mv=d(yo),fd=a(yo,"TD",{});var E5=s(fd);Tv=r(E5,"A hand-drawn monochrome image with white outlines on a black background."),E5.forEach(t),Uv=d(yo),md=a(yo,"TD",{});var C5=s(md);gi=a(C5,"A",{href:!0});var j5=s(gi);_i=a(j5,"IMG",{width:!0,src:!0}),j5.forEach(t),C5.forEach(t),Jv=d(yo),ud=a(yo,"TD",{});var Z5=s(ud);bi=a(Z5,"A",{href:!0});var N5=s(bi);vi=a(N5,"IMG",{width:!0,src:!0}),N5.forEach(t),Z5.forEach(t),yo.forEach(t),Iv=d(X),Ne=a(X,"TR",{});var wo=s(Ne);va=a(wo,"TD",{});var zu=s(va);ya=a(zu,"A",{href:!0,rel:!0});var x5=s(ya);Ev=r(x5,"lllyasviel/sd-controlnet-seg"),x5.forEach(t),Cv=a(zu,"BR",{}),hd=a(zu,"EM",{});var k5=s(hd);jv=r(k5,"Trained with semantic segmentation"),k5.forEach(t),zu.forEach(t),Zv=d(wo),wa=a(wo,"TD",{});var Hu=s(wa);Nv=r(Hu,"An "),Ma=a(Hu,"A",{href:!0,rel:!0});var $5=s(Ma);xv=r($5,"ADE20K"),$5.forEach(t),kv=r(Hu,"\u2019s segmentation protocol image."),Hu.forEach(t),$v=d(wo),gd=a(wo,"TD",{});var W5=s(gd);yi=a(W5,"A",{href:!0});var G5=s(yi);wi=a(G5,"IMG",{width:!0,src:!0}),G5.forEach(t),W5.forEach(t),Wv=d(wo),_d=a(wo,"TD",{});var D5=s(_d);Mi=a(D5,"A",{href:!0});var S5=s(Mi);Ti=a(S5,"IMG",{width:!0,src:!0}),S5.forEach(t),D5.forEach(t),wo.forEach(t),X.forEach(t),Yu.forEach(t),fu=d(n),vt=a(n,"H3",{class:!0});var qu=s(vt);on=a(qu,"A",{id:!0,class:!0,href:!0});var B5=s(on);bd=a(B5,"SPAN",{});var P5=s(bd);v(Ta.$$.fragment,P5),P5.forEach(t),B5.forEach(t),Gv=d(qu),vd=a(qu,"SPAN",{});var F5=s(vd);Dv=r(F5,"ControlNet v1.1"),F5.forEach(t),qu.forEach(t),mu=d(n),an=a(n,"TABLE",{});var Ou=s(an);yd=a(Ou,"THEAD",{});var R5=s(yd);Q=a(R5,"TR",{});var Pe=s(Q);wd=a(Pe,"TH",{});var V5=s(wd);Sv=r(V5,"Model Name"),V5.forEach(t),Bv=d(Pe),Md=a(Pe,"TH",{});var X5=s(Md);Pv=r(X5,"Control Image Overview"),X5.forEach(t),Fv=d(Pe),Td=a(Pe,"TH",{});var A5=s(Td);Rv=r(A5,"Condition Image"),A5.forEach(t),Vv=d(Pe),Ud=a(Pe,"TH",{});var Y5=s(Ud);Xv=r(Y5,"Control Image Example"),Y5.forEach(t),Av=d(Pe),Jd=a(Pe,"TH",{});var Q5=s(Jd);Yv=r(Q5,"Generated Image Example"),Q5.forEach(t),Pe.forEach(t),R5.forEach(t),Qv=d(Ou),W=a(Ou,"TBODY",{});var D=s(W);L=a(D,"TR",{});var Fe=s(L);Ui=a(Fe,"TD",{});var RT=s(Ui);Ua=a(RT,"A",{href:!0,rel:!0});var L5=s(Ua);Lv=r(L5,"lllyasviel/control_v11p_sd15_canny"),L5.forEach(t),zv=a(RT,"BR",{}),RT.forEach(t),Hv=d(Fe),Id=a(Fe,"TD",{});var z5=s(Id);Ed=a(z5,"EM",{});var H5=s(Ed);qv=r(H5,"Trained with canny edge detection"),H5.forEach(t),z5.forEach(t),Ov=d(Fe),Cd=a(Fe,"TD",{});var q5=s(Cd);Kv=r(q5,"A monochrome image with white edges on a black background."),q5.forEach(t),ey=d(Fe),jd=a(Fe,"TD",{});var O5=s(jd);Ji=a(O5,"A",{href:!0});var K5=s(Ji);sn=a(K5,"IMG",{width:!0,style:!0,src:!0}),K5.forEach(t),O5.forEach(t),ty=d(Fe),Zd=a(Fe,"TD",{});var eE=s(Zd);Ii=a(eE,"A",{href:!0});var tE=s(Ii);Ei=a(tE,"IMG",{width:!0,src:!0}),tE.forEach(t),eE.forEach(t),Fe.forEach(t),ny=d(D),z=a(D,"TR",{});var Re=s(z);Ci=a(Re,"TD",{});var VT=s(Ci);Ja=a(VT,"A",{href:!0,rel:!0});var nE=s(Ja);oy=r(nE,"lllyasviel/control_v11e_sd15_ip2p"),nE.forEach(t),ay=a(VT,"BR",{}),VT.forEach(t),sy=d(Re),Nd=a(Re,"TD",{});var oE=s(Nd);xd=a(oE,"EM",{});var aE=s(xd);ly=r(aE,"Trained with pixel to pixel instruction"),aE.forEach(t),oE.forEach(t),iy=d(Re),kd=a(Re,"TD",{});var sE=s(kd);ry=r(sE,"No condition ."),sE.forEach(t),cy=d(Re),$d=a(Re,"TD",{});var lE=s($d);ji=a(lE,"A",{href:!0});var iE=s(ji);ln=a(iE,"IMG",{width:!0,style:!0,src:!0}),iE.forEach(t),lE.forEach(t),dy=d(Re),Wd=a(Re,"TD",{});var rE=s(Wd);Zi=a(rE,"A",{href:!0});var cE=s(Zi);Ni=a(cE,"IMG",{width:!0,src:!0}),cE.forEach(t),rE.forEach(t),Re.forEach(t),py=d(D),H=a(D,"TR",{});var Ve=s(H);xi=a(Ve,"TD",{});var XT=s(xi);Ia=a(XT,"A",{href:!0,rel:!0});var dE=s(Ia);fy=r(dE,"lllyasviel/control_v11p_sd15_inpaint"),dE.forEach(t),my=a(XT,"BR",{}),XT.forEach(t),uy=d(Ve),Gd=a(Ve,"TD",{});var pE=s(Gd);hy=r(pE,"Trained with image inpainting"),pE.forEach(t),gy=d(Ve),Dd=a(Ve,"TD",{});var fE=s(Dd);_y=r(fE,"No condition."),fE.forEach(t),by=d(Ve),Sd=a(Ve,"TD",{});var mE=s(Sd);ki=a(mE,"A",{href:!0});var uE=s(ki);rn=a(uE,"IMG",{width:!0,style:!0,src:!0}),uE.forEach(t),mE.forEach(t),vy=d(Ve),Bd=a(Ve,"TD",{});var hE=s(Bd);$i=a(hE,"A",{href:!0});var gE=s($i);Wi=a(gE,"IMG",{width:!0,src:!0}),gE.forEach(t),hE.forEach(t),Ve.forEach(t),yy=d(D),q=a(D,"TR",{});var Xe=s(q);Gi=a(Xe,"TD",{});var AT=s(Gi);Ea=a(AT,"A",{href:!0,rel:!0});var _E=s(Ea);wy=r(_E,"lllyasviel/control_v11p_sd15_mlsd"),_E.forEach(t),My=a(AT,"BR",{}),AT.forEach(t),Ty=d(Xe),Pd=a(Xe,"TD",{});var bE=s(Pd);Uy=r(bE,"Trained with multi-level line segment detection"),bE.forEach(t),Jy=d(Xe),Fd=a(Xe,"TD",{});var vE=s(Fd);Iy=r(vE,"An image with annotated line segments."),vE.forEach(t),Ey=d(Xe),Rd=a(Xe,"TD",{});var yE=s(Rd);Di=a(yE,"A",{href:!0});var wE=s(Di);cn=a(wE,"IMG",{width:!0,style:!0,src:!0}),wE.forEach(t),yE.forEach(t),Cy=d(Xe),Vd=a(Xe,"TD",{});var ME=s(Vd);Si=a(ME,"A",{href:!0});var TE=s(Si);Bi=a(TE,"IMG",{width:!0,src:!0}),TE.forEach(t),ME.forEach(t),Xe.forEach(t),jy=d(D),O=a(D,"TR",{});var Ae=s(O);Pi=a(Ae,"TD",{});var YT=s(Pi);Ca=a(YT,"A",{href:!0,rel:!0});var UE=s(Ca);Zy=r(UE,"lllyasviel/control_v11f1p_sd15_depth"),UE.forEach(t),Ny=a(YT,"BR",{}),YT.forEach(t),xy=d(Ae),Xd=a(Ae,"TD",{});var JE=s(Xd);ky=r(JE,"Trained with depth estimation"),JE.forEach(t),$y=d(Ae),Ad=a(Ae,"TD",{});var IE=s(Ad);Wy=r(IE,"An image with depth information, usually represented as a grayscale image."),IE.forEach(t),Gy=d(Ae),Yd=a(Ae,"TD",{});var EE=s(Yd);Fi=a(EE,"A",{href:!0});var CE=s(Fi);dn=a(CE,"IMG",{width:!0,style:!0,src:!0}),CE.forEach(t),EE.forEach(t),Dy=d(Ae),Qd=a(Ae,"TD",{});var jE=s(Qd);Ri=a(jE,"A",{href:!0});var ZE=s(Ri);Vi=a(ZE,"IMG",{width:!0,src:!0}),ZE.forEach(t),jE.forEach(t),Ae.forEach(t),Sy=d(D),K=a(D,"TR",{});var Ye=s(K);Xi=a(Ye,"TD",{});var QT=s(Xi);ja=a(QT,"A",{href:!0,rel:!0});var NE=s(ja);By=r(NE,"lllyasviel/control_v11p_sd15_normalbae"),NE.forEach(t),Py=a(QT,"BR",{}),QT.forEach(t),Fy=d(Ye),Ld=a(Ye,"TD",{});var xE=s(Ld);Ry=r(xE,"Trained with surface normal estimation"),xE.forEach(t),Vy=d(Ye),zd=a(Ye,"TD",{});var kE=s(zd);Xy=r(kE,"An image with surface normal information, usually represented as a color-coded image."),kE.forEach(t),Ay=d(Ye),Hd=a(Ye,"TD",{});var $E=s(Hd);Ai=a($E,"A",{href:!0});var WE=s(Ai);pn=a(WE,"IMG",{width:!0,style:!0,src:!0}),WE.forEach(t),$E.forEach(t),Yy=d(Ye),qd=a(Ye,"TD",{});var GE=s(qd);Yi=a(GE,"A",{href:!0});var DE=s(Yi);Qi=a(DE,"IMG",{width:!0,src:!0}),DE.forEach(t),GE.forEach(t),Ye.forEach(t),Qy=d(D),ee=a(D,"TR",{});var Qe=s(ee);Li=a(Qe,"TD",{});var LT=s(Li);Za=a(LT,"A",{href:!0,rel:!0});var SE=s(Za);Ly=r(SE,"lllyasviel/control_v11p_sd15_seg"),SE.forEach(t),zy=a(LT,"BR",{}),LT.forEach(t),Hy=d(Qe),Od=a(Qe,"TD",{});var BE=s(Od);qy=r(BE,"Trained with image segmentation"),BE.forEach(t),Oy=d(Qe),Kd=a(Qe,"TD",{});var PE=s(Kd);Ky=r(PE,"An image with segmented regions, usually represented as a color-coded image."),PE.forEach(t),e1=d(Qe),ep=a(Qe,"TD",{});var FE=s(ep);zi=a(FE,"A",{href:!0});var RE=s(zi);fn=a(RE,"IMG",{width:!0,style:!0,src:!0}),RE.forEach(t),FE.forEach(t),t1=d(Qe),tp=a(Qe,"TD",{});var VE=s(tp);Hi=a(VE,"A",{href:!0});var XE=s(Hi);qi=a(XE,"IMG",{width:!0,src:!0}),XE.forEach(t),VE.forEach(t),Qe.forEach(t),n1=d(D),te=a(D,"TR",{});var Le=s(te);Oi=a(Le,"TD",{});var zT=s(Oi);Na=a(zT,"A",{href:!0,rel:!0});var AE=s(Na);o1=r(AE,"lllyasviel/control_v11p_sd15_lineart"),AE.forEach(t),a1=a(zT,"BR",{}),zT.forEach(t),s1=d(Le),np=a(Le,"TD",{});var YE=s(np);l1=r(YE,"Trained with line art generation"),YE.forEach(t),i1=d(Le),op=a(Le,"TD",{});var QE=s(op);r1=r(QE,"An image with line art, usually black lines on a white background."),QE.forEach(t),c1=d(Le),ap=a(Le,"TD",{});var LE=s(ap);Ki=a(LE,"A",{href:!0});var zE=s(Ki);mn=a(zE,"IMG",{width:!0,style:!0,src:!0}),zE.forEach(t),LE.forEach(t),d1=d(Le),sp=a(Le,"TD",{});var HE=s(sp);er=a(HE,"A",{href:!0});var qE=s(er);tr=a(qE,"IMG",{width:!0,src:!0}),qE.forEach(t),HE.forEach(t),Le.forEach(t),p1=d(D),ne=a(D,"TR",{});var ze=s(ne);nr=a(ze,"TD",{});var HT=s(nr);xa=a(HT,"A",{href:!0,rel:!0});var OE=s(xa);f1=r(OE,"lllyasviel/control_v11p_sd15s2_lineart_anime"),OE.forEach(t),m1=a(HT,"BR",{}),HT.forEach(t),u1=d(ze),lp=a(ze,"TD",{});var KE=s(lp);h1=r(KE,"Trained with anime line art generation"),KE.forEach(t),g1=d(ze),ip=a(ze,"TD",{});var eC=s(ip);_1=r(eC,"An image with anime-style line art."),eC.forEach(t),b1=d(ze),rp=a(ze,"TD",{});var tC=s(rp);or=a(tC,"A",{href:!0});var nC=s(or);un=a(nC,"IMG",{width:!0,style:!0,src:!0}),nC.forEach(t),tC.forEach(t),v1=d(ze),cp=a(ze,"TD",{});var oC=s(cp);ar=a(oC,"A",{href:!0});var aC=s(ar);sr=a(aC,"IMG",{width:!0,src:!0}),aC.forEach(t),oC.forEach(t),ze.forEach(t),y1=d(D),oe=a(D,"TR",{});var He=s(oe);lr=a(He,"TD",{});var qT=s(lr);ka=a(qT,"A",{href:!0,rel:!0});var sC=s(ka);w1=r(sC,"lllyasviel/control_v11p_sd15_openpose"),sC.forEach(t),M1=a(qT,"BR",{}),qT.forEach(t),T1=d(He),dp=a(He,"TD",{});var lC=s(dp);U1=r(lC,"Trained with human pose estimation"),lC.forEach(t),J1=d(He),pp=a(He,"TD",{});var iC=s(pp);I1=r(iC,"An image with human poses, usually represented as a set of keypoints or skeletons."),iC.forEach(t),E1=d(He),fp=a(He,"TD",{});var rC=s(fp);ir=a(rC,"A",{href:!0});var cC=s(ir);hn=a(cC,"IMG",{width:!0,style:!0,src:!0}),cC.forEach(t),rC.forEach(t),C1=d(He),mp=a(He,"TD",{});var dC=s(mp);rr=a(dC,"A",{href:!0});var pC=s(rr);cr=a(pC,"IMG",{width:!0,src:!0}),pC.forEach(t),dC.forEach(t),He.forEach(t),j1=d(D),ae=a(D,"TR",{});var qe=s(ae);dr=a(qe,"TD",{});var OT=s(dr);$a=a(OT,"A",{href:!0,rel:!0});var fC=s($a);Z1=r(fC,"lllyasviel/control_v11p_sd15_scribble"),fC.forEach(t),N1=a(OT,"BR",{}),OT.forEach(t),x1=d(qe),up=a(qe,"TD",{});var mC=s(up);k1=r(mC,"Trained with scribble-based image generation"),mC.forEach(t),$1=d(qe),hp=a(qe,"TD",{});var uC=s(hp);W1=r(uC,"An image with scribbles, usually random or user-drawn strokes."),uC.forEach(t),G1=d(qe),gp=a(qe,"TD",{});var hC=s(gp);pr=a(hC,"A",{href:!0});var gC=s(pr);gn=a(gC,"IMG",{width:!0,style:!0,src:!0}),gC.forEach(t),hC.forEach(t),D1=d(qe),_p=a(qe,"TD",{});var _C=s(_p);fr=a(_C,"A",{href:!0});var bC=s(fr);mr=a(bC,"IMG",{width:!0,src:!0}),bC.forEach(t),_C.forEach(t),qe.forEach(t),S1=d(D),se=a(D,"TR",{});var Oe=s(se);ur=a(Oe,"TD",{});var KT=s(ur);Wa=a(KT,"A",{href:!0,rel:!0});var vC=s(Wa);B1=r(vC,"lllyasviel/control_v11p_sd15_softedge"),vC.forEach(t),P1=a(KT,"BR",{}),KT.forEach(t),F1=d(Oe),bp=a(Oe,"TD",{});var yC=s(bp);R1=r(yC,"Trained with soft edge image generation"),yC.forEach(t),V1=d(Oe),vp=a(Oe,"TD",{});var wC=s(vp);X1=r(wC,"An image with soft edges, usually to create a more painterly or artistic effect."),wC.forEach(t),A1=d(Oe),yp=a(Oe,"TD",{});var MC=s(yp);hr=a(MC,"A",{href:!0});var TC=s(hr);_n=a(TC,"IMG",{width:!0,style:!0,src:!0}),TC.forEach(t),MC.forEach(t),Y1=d(Oe),wp=a(Oe,"TD",{});var UC=s(wp);gr=a(UC,"A",{href:!0});var JC=s(gr);_r=a(JC,"IMG",{width:!0,src:!0}),JC.forEach(t),UC.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 IC=s(Ga);L1=r(IC,"lllyasviel/control_v11e_sd15_shuffle"),IC.forEach(t),z1=a(eU,"BR",{}),eU.forEach(t),H1=d(Ke),Mp=a(Ke,"TD",{});var EC=s(Mp);q1=r(EC,"Trained with image shuffling"),EC.forEach(t),O1=d(Ke),Tp=a(Ke,"TD",{});var CC=s(Tp);K1=r(CC,"An image with shuffled patches or regions."),CC.forEach(t),ew=d(Ke),Up=a(Ke,"TD",{});var jC=s(Up);vr=a(jC,"A",{href:!0});var ZC=s(vr);bn=a(ZC,"IMG",{width:!0,style:!0,src:!0}),ZC.forEach(t),jC.forEach(t),tw=d(Ke),Jp=a(Ke,"TD",{});var NC=s(Jp);yr=a(NC,"A",{href:!0});var xC=s(yr);wr=a(xC,"IMG",{width:!0,src:!0}),xC.forEach(t),NC.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 kC=s(Da);ow=r(kC,"lllyasviel/control_v11f1e_sd15_tile"),kC.forEach(t),aw=a(tU,"BR",{}),tU.forEach(t),sw=d(et),Ip=a(et,"TD",{});var $C=s(Ip);lw=r($C,"Trained with image tiling"),$C.forEach(t),iw=d(et),Ep=a(et,"TD",{});var WC=s(Ep);rw=r(WC,"A blurry image or part of an image ."),WC.forEach(t),cw=d(et),Cp=a(et,"TD",{});var GC=s(Cp);Tr=a(GC,"A",{href:!0});var DC=s(Tr);vn=a(DC,"IMG",{width:!0,style:!0,src:!0}),DC.forEach(t),GC.forEach(t),dw=d(et),jp=a(et,"TD",{});var SC=s(jp);Ur=a(SC,"A",{href:!0});var BC=s(Ur);Jr=a(BC,"IMG",{width:!0,src:!0}),BC.forEach(t),SC.forEach(t),et.forEach(t),D.forEach(t),Ou.forEach(t),uu=d(n),yt=a(n,"H2",{class:!0});var Ku=s(yt);yn=a(Ku,"A",{id:!0,class:!0,href:!0});var PC=s(yn);Zp=a(PC,"SPAN",{});var FC=s(Zp);v(Sa.$$.fragment,FC),FC.forEach(t),PC.forEach(t),pw=d(Ku),Np=a(Ku,"SPAN",{});var RC=s(Np);fw=r(RC,"StableDiffusionControlNetPipeline"),RC.forEach(t),Ku.forEach(t),hu=d(n),j=a(n,"DIV",{class:!0});var k=s(j);v(Ba.$$.fragment,k),mw=d(k),xp=a(k,"P",{});var VC=s(xp);uw=r(VC,"Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),VC.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 XC=s(Ir);_w=r(XC,"DiffusionPipeline"),XC.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),vw=d(k),kp=a(k,"P",{});var AC=s(kp);yw=r(AC,"In addition the pipeline inherits the following loading methods:"),AC.forEach(t),ww=d(k),$p=a(k,"UL",{});var YC=s($p);Fa=a(YC,"LI",{});var th=s(Fa);Wp=a(th,"EM",{});var QC=s(Wp);Mw=r(QC,"Textual-Inversion"),QC.forEach(t),Tw=r(th,": "),Er=a(th,"A",{href:!0});var LC=s(Er);Uw=r(LC,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),LC.forEach(t),th.forEach(t),YC.forEach(t),Jw=d(k),Ge=a(k,"DIV",{class:!0});var Fr=s(Ge);v(Ra.$$.fragment,Fr),Iw=d(Fr),Gp=a(Fr,"P",{});var zC=s(Gp);Ew=r(zC,"Function invoked when calling the pipeline for generation."),zC.forEach(t),Cw=d(Fr),v(wn.$$.fragment,Fr),Fr.forEach(t),jw=d(k),Mn=a(k,"DIV",{class:!0});var nh=s(Mn);v(Va.$$.fragment,nh),Zw=d(nh),Dp=a(nh,"P",{});var HC=s(Dp);Nw=r(HC,`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.`),HC.forEach(t),nh.forEach(t),xw=d(k),Tn=a(k,"DIV",{class:!0});var oh=s(Tn);v(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 qC=s(Sp);Ww=r(qC,"enable_attention_slicing"),qC.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);v(Ya.$$.fragment,sh),Sw=d(sh),Bp=a(sh,"P",{});var OC=s(Bp);Bw=r(OC,`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.`),OC.forEach(t),sh.forEach(t),Pw=d(k),Jn=a(k,"DIV",{class:!0});var lh=s(Jn);v(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 KC=s(Pp);Vw=r(KC,"enable_vae_slicing"),KC.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);v(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),v(In.$$.fragment,Mo),qw=d(Mo),v(En.$$.fragment,Mo),Mo.forEach(t),Ow=d(k),Cn=a(k,"DIV",{class:!0});var ch=s(Cn);v(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);v(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),v(jn.$$.fragment,be),p2=d(be),os=a(be,"P",{});var fh=s(os);f2=r(fh,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),as=a(fh,"A",{href:!0,rel:!0});var aj=s(as);m2=r(aj,"civitAI"),aj.forEach(t),u2=r(fh,") and then load the vector"),fh.forEach(t),h2=d(be),v(Zn.$$.fragment,be),be.forEach(t),g2=d(k),Nn=a(k,"DIV",{class:!0});var mh=s(Nn);v(ss.$$.fragment,mh),_2=d(mh),ls=a(mh,"P",{});var uh=s(ls);b2=r(uh,"Disable tiled VAE decoding. If "),Rp=a(uh,"CODE",{});var sj=s(Rp);v2=r(sj,"enable_vae_tiling"),sj.forEach(t),y2=r(uh,` was previously enabled, this method will go back to
computing decoding in one step.`),uh.forEach(t),mh.forEach(t),w2=d(k),xn=a(k,"DIV",{class:!0});var hh=s(xn);v(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);v(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 fj=s(Lp);v(cs.$$.fragment,fj),fj.forEach(t),pj.forEach(t),W2=d(_h),zp=a(_h,"SPAN",{});var mj=s(zp);G2=r(mj,"StableDiffusionControlNetImg2ImgPipeline"),mj.forEach(t),_h.forEach(t),_u=d(n),Z=a(n,"DIV",{class:!0});var $=s(Z);v(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);fs=a(_j,"LI",{});var vh=s(fs);Kp=a(vh,"EM",{});var bj=s(Kp);Y2=r(bj,"Textual-Inversion"),bj.forEach(t),Q2=r(vh,": "),Zr=a(vh,"A",{href:!0});var vj=s(Zr);L2=r(vj,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),vj.forEach(t),vh.forEach(t),_j.forEach(t),z2=d($),De=a($,"DIV",{class:!0});var Rr=s(De);v(ms.$$.fragment,Rr),H2=d(Rr),ef=a(Rr,"P",{});var yj=s(ef);q2=r(yj,"Function invoked when calling the pipeline for generation."),yj.forEach(t),O2=d(Rr),v(Wn.$$.fragment,Rr),Rr.forEach(t),K2=d($),Gn=a($,"DIV",{class:!0});var yh=s(Gn);v(us.$$.fragment,yh),eM=d(yh),tf=a(yh,"P",{});var wj=s(tf);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),yh.forEach(t),nM=d($),Dn=a($,"DIV",{class:!0});var wh=s(Dn);v(hs.$$.fragment,wh),oM=d(wh),gs=a(wh,"P",{});var Mh=s(gs);aM=r(Mh,"Disable sliced attention computation. If "),nf=a(Mh,"CODE",{});var Mj=s(nf);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);v(_s.$$.fragment,Th),rM=d(Th),of=a(Th,"P",{});var Tj=s(of);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);v(bs.$$.fragment,Uh),pM=d(Uh),vs=a(Uh,"P",{});var Jh=s(vs);fM=r(Jh,"Disable sliced VAE decoding. If "),af=a(Jh,"CODE",{});var Uj=s(af);mM=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);v(ys.$$.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),vM=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),yM=d(To),v(Pn.$$.fragment,To),wM=d(To),v(Fn.$$.fragment,To),To.forEach(t),MM=d($),Rn=a($,"DIV",{class:!0});var Eh=s(Rn);v(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 ve=s(R);v(Is.$$.fragment,ve),CM=d(ve),Es=a(ve,"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(ve),sf=a(ve,"P",{});var Cj=s(sf);kM=r(Cj,"Example:"),Cj.forEach(t),$M=d(ve),v(Vn.$$.fragment,ve),WM=d(ve),Cs=a(ve,"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(ve),v(Xn.$$.fragment,ve),ve.forEach(t),PM=d($),An=a($,"DIV",{class:!0});var Nh=s(An);v(Zs.$$.fragment,Nh),FM=d(Nh),Ns=a(Nh,"P",{});var xh=s(Ns);RM=r(xh,"Disable tiled VAE decoding. If "),lf=a(xh,"CODE",{});var Zj=s(lf);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);v(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 `),rf=a(nt,"CODE",{});var Nj=s(rf);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 "),cf=a(nt,"CODE",{});var xj=s(cf);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
`),df=a(nt,"CODE",{});var kj=s(df);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 "),pf=a(nt,"CODE",{});var $j=s(pf);e0=r($j,"unet"),$j.forEach(t),t0=r(nt,"."),nt.forEach(t),kh.forEach(t),n0=d($),Qn=a($,"DIV",{class:!0});var $h=s(Qn);v(ks.$$.fragment,$h),o0=d($h),ff=a($h,"P",{});var Wj=s(ff);a0=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);mf=a(Gj,"SPAN",{});var Dj=s(mf);v($s.$$.fragment,Dj),Dj.forEach(t),Gj.forEach(t),s0=d(Wh),uf=a(Wh,"SPAN",{});var Sj=s(uf);l0=r(Sj,"StableDiffusionControlNetInpaintPipeline"),Sj.forEach(t),Wh.forEach(t),vu=d(n),E=a(n,"DIV",{class:!0});var x=s(E);v(Ws.$$.fragment,x),i0=d(x),hf=a(x,"P",{});var Bj=s(hf);r0=r(Bj,"Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),Bj.forEach(t),c0=d(x),Gs=a(x,"P",{});var Gh=s(Gs);d0=r(Gh,"This model inherits from "),xr=a(Gh,"A",{href:!0});var Pj=s(xr);p0=r(Pj,"DiffusionPipeline"),Pj.forEach(t),f0=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),m0=d(x),gf=a(x,"P",{});var Fj=s(gf);u0=r(Fj,"In addition the pipeline inherits the following loading methods:"),Fj.forEach(t),h0=d(x),_f=a(x,"UL",{});var Rj=s(_f);Ds=a(Rj,"LI",{});var Dh=s(Ds);bf=a(Dh,"EM",{});var Vj=s(bf);g0=r(Vj,"Textual-Inversion"),Vj.forEach(t),_0=r(Dh,": "),kr=a(Dh,"A",{href:!0});var Xj=s(kr);b0=r(Xj,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),Xj.forEach(t),Dh.forEach(t),Rj.forEach(t),v0=d(x),v(zn.$$.fragment,x),y0=d(x),Se=a(x,"DIV",{class:!0});var Vr=s(Se);v(Ss.$$.fragment,Vr),w0=d(Vr),vf=a(Vr,"P",{});var Aj=s(vf);M0=r(Aj,"Function invoked when calling the pipeline for generation."),Aj.forEach(t),T0=d(Vr),v(Hn.$$.fragment,Vr),Vr.forEach(t),U0=d(x),qn=a(x,"DIV",{class:!0});var Sh=s(qn);v(Bs.$$.fragment,Sh),J0=d(Sh),yf=a(Sh,"P",{});var Yj=s(yf);I0=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),E0=d(x),On=a(x,"DIV",{class:!0});var Bh=s(On);v(Ps.$$.fragment,Bh),C0=d(Bh),Fs=a(Bh,"P",{});var Ph=s(Fs);j0=r(Ph,"Disable sliced attention computation. If "),wf=a(Ph,"CODE",{});var Qj=s(wf);Z0=r(Qj,"enable_attention_slicing"),Qj.forEach(t),N0=r(Ph,` was previously called, attention is
computed in one step.`),Ph.forEach(t),Bh.forEach(t),x0=d(x),Kn=a(x,"DIV",{class:!0});var Fh=s(Kn);v(Rs.$$.fragment,Fh),k0=d(Fh),Mf=a(Fh,"P",{});var Lj=s(Mf);$0=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),W0=d(x),eo=a(x,"DIV",{class:!0});var Rh=s(eo);v(Vs.$$.fragment,Rh),G0=d(Rh),Xs=a(Rh,"P",{});var Vh=s(Xs);D0=r(Vh,"Disable sliced VAE decoding. If "),Tf=a(Vh,"CODE",{});var zj=s(Tf);S0=r(zj,"enable_vae_slicing"),zj.forEach(t),B0=r(Vh,` was previously enabled, this method will go back to
computing decoding in one step.`),Vh.forEach(t),Rh.forEach(t),P0=d(x),_e=a(x,"DIV",{class:!0});var Uo=s(_e);v(As.$$.fragment,Uo),F0=d(Uo),Ys=a(Uo,"P",{});var Xh=s(Ys);R0=r(Xh,"Enable memory efficient attention from "),Qs=a(Xh,"A",{href:!0,rel:!0});var Hj=s(Qs);V0=r(Hj,"xFormers"),Hj.forEach(t),X0=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),A0=d(Uo),v(to.$$.fragment,Uo),Y0=d(Uo),v(no.$$.fragment,Uo),Uo.forEach(t),Q0=d(x),oo=a(x,"DIV",{class:!0});var Ah=s(oo);v(Ls.$$.fragment,Ah),L0=d(Ah),zs=a(Ah,"P",{});var Yh=s(zs);z0=r(Yh,"Disable memory efficient attention from "),Hs=a(Yh,"A",{href:!0,rel:!0});var qj=s(Hs);H0=r(qj,"xFormers"),qj.forEach(t),q0=r(Yh,"."),Yh.forEach(t),Ah.forEach(t),O0=d(x),V=a(x,"DIV",{class:!0});var ye=s(V);v(qs.$$.fragment,ye),K0=d(ye),Os=a(ye,"P",{});var Qh=s(Os);eT=r(Qh,"Load textual inversion embeddings into the text encoder of "),$r=a(Qh,"A",{href:!0});var Oj=s($r);tT=r(Oj,"StableDiffusionPipeline"),Oj.forEach(t),nT=r(Qh,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),Qh.forEach(t),oT=d(ye),Uf=a(ye,"P",{});var Kj=s(Uf);aT=r(Kj,"Example:"),Kj.forEach(t),sT=d(ye),v(ao.$$.fragment,ye),lT=d(ye),Ks=a(ye,"P",{});var Lh=s(Ks);iT=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);rT=r(eZ,"civitAI"),eZ.forEach(t),cT=r(Lh,") and then load the vector"),Lh.forEach(t),dT=d(ye),v(so.$$.fragment,ye),ye.forEach(t),pT=d(x),lo=a(x,"DIV",{class:!0});var zh=s(lo);v(tl.$$.fragment,zh),fT=d(zh),nl=a(zh,"P",{});var Hh=s(nl);mT=r(Hh,"Disable tiled VAE decoding. If "),Jf=a(Hh,"CODE",{});var tZ=s(Jf);uT=r(tZ,"enable_vae_tiling"),tZ.forEach(t),hT=r(Hh,` was previously enabled, this method will go back to
computing decoding in one step.`),Hh.forEach(t),zh.forEach(t),gT=d(x),io=a(x,"DIV",{class:!0});var qh=s(io);v(ol.$$.fragment,qh),_T=d(qh),de=a(qh,"P",{});var ot=s(de);bT=r(ot,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),If=a(ot,"CODE",{});var nZ=s(If);vT=r(nZ,"enable_sequential_cpu_offload"),nZ.forEach(t),yT=r(ot,", this method moves one whole model at a time to the GPU when its "),Ef=a(ot,"CODE",{});var oZ=s(Ef);wT=r(oZ,"forward"),oZ.forEach(t),MT=r(ot,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Cf=a(ot,"CODE",{});var aZ=s(Cf);TT=r(aZ,"enable_sequential_cpu_offload"),aZ.forEach(t),UT=r(ot,", but performance is much better due to the iterative execution of the "),jf=a(ot,"CODE",{});var sZ=s(jf);JT=r(sZ,"unet"),sZ.forEach(t),IT=r(ot,"."),ot.forEach(t),qh.forEach(t),ET=d(x),ro=a(x,"DIV",{class:!0});var Oh=s(ro);v(al.$$.fragment,Oh),CT=d(Oh),Zf=a(Oh,"P",{});var lZ=s(Zf);jT=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),yu=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);Nf=a(iZ,"SPAN",{});var rZ=s(Nf);v(sl.$$.fragment,rZ),rZ.forEach(t),iZ.forEach(t),ZT=d(Kh),xf=a(Kh,"SPAN",{});var cZ=s(xf);NT=r(cZ,"FlaxStableDiffusionControlNetPipeline"),cZ.forEach(t),Kh.forEach(t),wu=d(n),pe=a(n,"DIV",{class:!0});var Jo=s(pe);v(ll.$$.fragment,Jo),xT=d(Jo),kf=a(Jo,"P",{});var dZ=s(kf);kT=r(dZ,"Pipeline for text-to-image generation using Stable Diffusion with ControlNet Guidance."),dZ.forEach(t),$T=d(Jo),il=a(Jo,"P",{});var eg=s(il);WT=r(eg,"This model inherits from "),Wr=a(eg,"A",{href:!0});var pZ=s(Wr);GT=r(pZ,"FlaxDiffusionPipeline"),pZ.forEach(t),DT=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),ST=d(Jo),Be=a(Jo,"DIV",{class:!0});var Xr=s(Be);v(rl.$$.fragment,Xr),BT=d(Xr),$f=a(Xr,"P",{});var fZ=s($f);PT=r(fZ,"Function invoked when calling the pipeline for generation."),fZ.forEach(t),FT=d(Xr),v(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/v0.19.0/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(vl.src,nU="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/input_image_vermeer.png")||l(vl,"src",nU),l(vl,"alt","img"),l(yl,"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/v0.19.0/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(ft,"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(mt,"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,fU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_bird_canny.png")||l(Ht,"src",fU),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,mU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_bird_canny_1.png")||l(zl,"src",mU),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,vU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_room_mlsd_0.png")||l(ii,"src",vU),l(li,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_room_mlsd_0.png"),l(fa,"href","https://huggingface.co/lllyasviel/sd-controlnet-normal"),l(fa,"rel","nofollow"),l(ua,"href","https://en.wikipedia.org/wiki/Normal_mapping"),l(ua,"rel","nofollow"),l(ci,"width","64"),I(ci.src,yU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_human_normal.png")||l(ci,"src",yU),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(mi,"width","64"),I(mi.src,MU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_human_openpose.png")||l(mi,"src",MU),l(fi,"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(vi,"width","64"),I(vi.src,JU="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_vermeer_scribble_0.png")||l(vi,"src",JU),l(bi,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_vermeer_scribble_0.png"),l(ya,"href","https://huggingface.co/lllyasviel/sd-controlnet_seg"),l(ya,"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(yi,"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(vt,"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(fn,"width","64"),G(fn,"margin","0"),G(fn,"padding","0"),I(fn.src,PU="https://huggingface.co/lllyasviel/control_v11p_sd15_seg/resolve/main/images/control.png")||l(fn,"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(mn,"width","64"),G(mn,"margin","0"),G(mn,"padding","0"),I(mn.src,RU="https://huggingface.co/lllyasviel/control_v11p_sd15_lineart/resolve/main/images/control.png")||l(mn,"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(mr,"width","64"),I(mr.src,zU="https://huggingface.co/lllyasviel/control_v11p_sd15_scribble/resolve/main/images/image_out.png")||l(mr,"src",zU),l(fr,"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(vr,"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(yr,"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(vn,"width","64"),G(vn,"margin","0"),G(vn,"padding","0"),I(vn.src,eJ="https://huggingface.co/lllyasviel/control_v11f1e_sd15_tile/resolve/main/images/original.png")||l(vn,"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(yn,"id","diffusers.StableDiffusionControlNetPipeline"),l(yn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(yn,"href","#diffusers.StableDiffusionControlNetPipeline"),l(yt,"class","relative group"),l(Ir,"href","/docs/diffusers/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),l(Er,"href","/docs/diffusers/v0.19.0/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/v0.19.0/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/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),l(Zr,"href","/docs/diffusers/v0.19.0/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/v0.19.0/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/v0.19.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),l(kr,"href","/docs/diffusers/v0.19.0/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/v0.19.0/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/v0.19.0/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,f){e(document.head,u),m(n,J,f),m(n,g,f),e(g,h),e(h,U),y(p,U,null),e(g,_),e(g,at),e(at,we),m(n,Ut,f),m(n,Me,f),e(Me,Y),e(Y,A),e(Me,ml),m(n,Io,f),m(n,st,f),e(st,ng),m(n,nm,f),m(n,ul,f),e(ul,og),m(n,om,f),m(n,hl,f),e(hl,Ar),e(Ar,ag),m(n,am,f),m(n,Jt,f),e(Jt,sg),e(Jt,Eo),e(Eo,lg),e(Jt,ig),m(n,sm,f),m(n,It,f),e(It,rg),e(It,Co),e(Co,cg),e(It,dg),m(n,lm,f),m(n,lt,f),e(lt,Et),e(Et,Yr),y(jo,Yr,null),e(lt,pg),e(lt,Qr),e(Qr,fg),m(n,im,f),m(n,Ct,f),e(Ct,mg),e(Ct,Lr),e(Lr,ug),e(Ct,hg),m(n,rm,f),m(n,jt,f),e(jt,zr),e(zr,Hr),e(Hr,qr),e(qr,gg),e(jt,_g),e(jt,Or),e(Or,gl),e(gl,Zo),e(Zo,bg),e(Zo,_l),e(_l,vg),e(Zo,yg),m(n,cm,f),m(n,Zt,f),e(Zt,wg),e(Zt,No),e(No,Mg),e(Zt,Tg),m(n,dm,f),y(xo,n,f),m(n,pm,f),m(n,bl,f),e(bl,vl),m(n,fm,f),m(n,xe,f),e(xe,Ug),e(xe,Kr),e(Kr,Jg),e(xe,Ig),e(xe,yl),e(yl,Eg),e(xe,Cg),m(n,mm,f),m(n,wl,f),e(wl,jg),m(n,um,f),y(ko,n,f),m(n,hm,f),m(n,Ml,f),e(Ml,Zg),m(n,gm,f),y($o,n,f),m(n,_m,f),m(n,Tl,f),e(Tl,Ng),m(n,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),e(ee,ep),e(ep,zi),e(zi,fn),e(ee,t1),e(ee,tp),e(tp,Hi),e(Hi,qi),e(W,n1),e(W,te),e(te,Oi),e(Oi,Na),e(Na,o1),e(Oi,a1),e(te,s1),e(te,np),e(np,l1),e(te,i1),e(te,op),e(op,r1),e(te,c1),e(te,ap),e(ap,Ki),e(Ki,mn),e(te,d1),e(te,sp),e(sp,er),e(er,tr),e(W,p1),e(W,ne),e(ne,nr),e(nr,xa),e(xa,f1),e(nr,m1),e(ne,u1),e(ne,lp),e(lp,h1),e(ne,g1),e(ne,ip),e(ip,_1),e(ne,b1),e(ne,rp),e(rp,or),e(or,un),e(ne,v1),e(ne,cp),e(cp,ar),e(ar,sr),e(W,y1),e(W,oe),e(oe,lr),e(lr,ka),e(ka,w1),e(lr,M1),e(oe,T1),e(oe,dp),e(dp,U1),e(oe,J1),e(oe,pp),e(pp,I1),e(oe,E1),e(oe,fp),e(fp,ir),e(ir,hn),e(oe,C1),e(oe,mp),e(mp,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,fr),e(fr,mr),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,vp),e(vp,X1),e(se,A1),e(se,yp),e(yp,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,vr),e(vr,bn),e(le,tw),e(le,Jp),e(Jp,yr),e(yr,wr),e(W,nw),e(W,ie),e(ie,Mr),e(Mr,Da),e(Da,ow),e(M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c2),e(F,d2),y(jn,F,null),e(F,p2),e(F,os),e(os,f2),e(os,as),e(as,m2),e(os,u2),e(F,h2),y(Zn,F,null),e(j,g2),e(j,Nn),y(ss,Nn,null),e(Nn,_2),e(Nn,ls),e(ls,b2),e(ls,Rp),e(Rp,v2),e(ls,y2),e(j,w2),e(j,xn),y(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),y(rs,kn,null),e(kn,k2),e(kn,Qp),e(Qp,$2),m(n,gu,f),m(n,wt,f),e(wt,$n),e($n,Lp),y(cs,Lp,null),e(wt,W2),e(wt,zp),e(zp,G2),m(n,_u,f),m(n,Z,f),y(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,fs),e(fs,Kp),e(Kp,Y2),e(fs,Q2),e(fs,Zr),e(Zr,L2),e(Z,z2),e(Z,De),y(ms,De,null),e(De,H2),e(De,ef),e(ef,q2),e(De,O2),y(Wn,De,null),e(Z,K2),e(Z,Gn),y(us,Gn,null),e(Gn,eM),e(Gn,tf),e(tf,tM),e(Z,nM),e(Z,Dn),y(hs,Dn,null),e(Dn,oM),e(Dn,gs),e(gs,aM),e(gs,nf),e(nf,sM),e(gs,lM),e(Z,iM),e(Z,Sn),y(_s,Sn,null),e(Sn,rM),e(Sn,of),e(of,cM),e(Z,dM),e(Z,Bn),y(bs,Bn,null),e(Bn,pM),e(Bn,vs),e(vs,fM),e(vs,af),e(af,mM),e(vs,uM),e(Z,hM),e(Z,ge),y(ys,ge,null),e(ge,gM),e(ge,ws),e(ws,_M),e(ws,Ms),e(Ms,bM),e(ws,vM),e(ge,yM),y(Pn,ge,null),e(ge,wM),y(Fn,ge,null),e(Z,MM),e(Z,Rn),y(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),y(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,sf),e(sf,kM),e(R,$M),y(Vn,R,null),e(R,WM),e(R,Cs),e(Cs,GM),e(Cs,js),e(js,DM),e(Cs,SM),e(R,BM),y(Xn,R,null),e(Z,PM),e(Z,An),y(Zs,An,null),e(An,FM),e(An,Ns),e(Ns,RM),e(Ns,lf),e(lf,VM),e(Ns,XM),e(Z,AM),e(Z,Yn),y(xs,Yn,null),e(Yn,YM),e(Yn,ce),e(ce,QM),e(ce,rf),e(rf,LM),e(ce,zM),e(ce,cf),e(cf,HM),e(ce,qM),e(ce,df),e(df,OM),e(ce,KM),e(ce,pf),e(pf,e0),e(ce,t0),e(Z,n0),e(Z,Qn),y(ks,Qn,null),e(Qn,o0),e(Qn,ff),e(ff,a0),m(n,bu,f),m(n,Mt,f),e(Mt,Ln),e(Ln,mf),y($s,mf,null),e(Mt,s0),e(Mt,uf),e(uf,l0),m(n,vu,f),m(n,E,f),y(Ws,E,null),e(E,i0),e(E,hf),e(hf,r0),e(E,c0),e(E,Gs),e(Gs,d0),e(Gs,xr),e(xr,p0),e(Gs,f0),e(E,m0),e(E,gf),e(gf,u0),e(E,h0),e(E,_f),e(_f,Ds),e(Ds,bf),e(bf,g0),e(Ds,_0),e(Ds,kr),e(kr,b0),e(E,v0),y(zn,E,null),e(E,y0),e(E,Se),y(Ss,Se,null),e(Se,w0),e(Se,vf),e(vf,M0),e(Se,T0),y(Hn,Se,null),e(E,U0),e(E,qn),y(Bs,qn,null),e(qn,J0),e(qn,yf),e(yf,I0),e(E,E0),e(E,On),y(Ps,On,null),e(On,C0),e(On,Fs),e(Fs,j0),e(Fs,wf),e(wf,Z0),e(Fs,N0),e(E,x0),e(E,Kn),y(Rs,Kn,null),e(Kn,k0),e(Kn,Mf),e(Mf,$0),e(E,W0),e(E,eo),y(Vs,eo,null),e(eo,G0),e(eo,Xs),e(Xs,D0),e(Xs,Tf),e(Tf,S0),e(Xs,B0),e(E,P0),e(E,_e),y(As,_e,null),e(_e,F0),e(_e,Ys),e(Ys,R0),e(Ys,Qs),e(Qs,V0),e(Ys,X0),e(_e,A0),y(to,_e,null),e(_e,Y0),y(no,_e,null),e(E,Q0),e(E,oo),y(Ls,oo,null),e(oo,L0),e(oo,zs),e(zs,z0),e(zs,Hs),e(Hs,H0),e(zs,q0),e(E,O0),e(E,V),y(qs,V,null),e(V,K0),e(V,Os),e(Os,eT),e(Os,$r),e($r,tT),e(Os,nT),e(V,oT),e(V,Uf),e(Uf,aT),e(V,sT),y(ao,V,null),e(V,lT),e(V,Ks),e(Ks,iT),e(Ks,el),e(el,rT),e(Ks,cT),e(V,dT),y(so,V,null),e(E,pT),e(E,lo),y(tl,lo,null),e(lo,fT),e(lo,nl),e(nl,mT),e(nl,Jf),e(Jf,uT),e(nl,hT),e(E,gT),e(E,io),y(ol,io,null),e(io,_T),e(io,de),e(de,bT),e(de,If),e(If,vT),e(de,yT),e(de,Ef),e(Ef,wT),e(de,MT),e(de,Cf),e(Cf,TT),e(de,UT),e(de,jf),e(jf,JT),e(de,IT),e(E,ET),e(E,ro),y(al,ro,null),e(ro,CT),e(ro,Zf),e(Zf,jT),m(n,yu,f),m(n,Tt,f),e(Tt,co),e(co,Nf),y(sl,Nf,null),e(Tt,ZT),e(Tt,xf),e(xf,NT),m(n,wu,f),m(n,pe,f),y(ll,pe,null),e(pe,xT),e(pe,kf),e(kf,kT),e(pe,$T),e(pe,il),e(il,WT),e(il,Wr),e(Wr,GT),e(il,DT),e(pe,ST),e(pe,Be),y(rl,Be,null),e(Be,BT),e(Be,$f),e($f,PT),e(Be,FT),y(po,Be,null),Mu=!0},p(n,[f]){const cl={};f&2&&(cl.$$scope={dirty:f,ctx:n}),wn.$set(cl);const Wf={};f&2&&(Wf.$$scope={dirty:f,ctx:n}),In.$set(Wf);const Gf={};f&2&&(Gf.$$scope={dirty:f,ctx:n}),En.$set(Gf);const Df={};f&2&&(Df.$$scope={dirty:f,ctx:n}),jn.$set(Df);const Gr={};f&2&&(Gr.$$scope={dirty:f,ctx:n}),Zn.$set(Gr);const Sf={};f&2&&(Sf.$$scope={dirty:f,ctx:n}),Wn.$set(Sf);const Bf={};f&2&&(Bf.$$scope={dirty:f,ctx:n}),Pn.$set(Bf);const Pf={};f&2&&(Pf.$$scope={dirty:f,ctx:n}),Fn.$set(Pf);const Ff={};f&2&&(Ff.$$scope={dirty:f,ctx:n}),Vn.$set(Ff);const Rf={};f&2&&(Rf.$$scope={dirty:f,ctx:n}),Xn.$set(Rf);const dl={};f&2&&(dl.$$scope={dirty:f,ctx:n}),zn.$set(dl);const Vf={};f&2&&(Vf.$$scope={dirty:f,ctx:n}),Hn.$set(Vf);const pl={};f&2&&(pl.$$scope={dirty:f,ctx:n}),to.$set(pl);const Xf={};f&2&&(Xf.$$scope={dirty:f,ctx:n}),no.$set(Xf);const fl={};f&2&&(fl.$$scope={dirty:f,ctx:n}),ao.$set(fl);const Af={};f&2&&(Af.$$scope={dirty:f,ctx:n}),so.$set(Af);const Yf={};f&2&&(Yf.$$scope={dirty:f,ctx:n}),po.$set(Yf)},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(ms.$$.fragment,n),w(Wn.$$.fragment,n),w(us.$$.fragment,n),w(hs.$$.fragment,n),w(_s.$$.fragment,n),w(bs.$$.fragment,n),w(ys.$$.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(ms.$$.fragment,n),M(Wn.$$.fragment,n),M(us.$$.fragment,n),M(hs.$$.fragment,n),M(_s.$$.fragment,n),M(bs.$$.fragment,n),M(ys.$$.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),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ue),n&&t(ou),T(ta,n),n&&t(au),n&&t(ht),T(na),n&&t(su),n&&t(Xt),n&&t(lu),n&&t(gt),T(sa),n&&t(iu),n&&t(We),n&&t(ru),n&&t(Yt),n&&t(cu),n&&t(_t),n&&t(du),n&&t(bt),T(ia),n&&t(pu),n&&t(Lt),n&&t(fu),n&&t(vt),T(Ta),n&&t(mu),n&&t(an),n&&t(uu),n&&t(yt),T(Sa),n&&t(hu),n&&t(j),T(Ba),T(Ra),T(wn),T(Va),T(Xa),T(Ya),T(Qa),T(za),T(In),T(En),T(Oa),T(ts),T(jn),T(Zn),T(ss),T(is),T(rs),n&&t(gu),n&&t(wt),T(cs),n&&t(_u),n&&t(Z),T(ds),T(ms),T(Wn),T(us),T(hs),T(_s),T(bs),T(ys),T(Pn),T(Fn),T(Ts),T(Is),T(Vn),T(Xn),T(Zs),T(xs),T(ks),n&&t(bu),n&&t(Mt),T($s),n&&t(vu),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(yu),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 mZ{constructor(u){super();uZ(this,u,DZ,WZ,hZ,{})}}export{XZ as default,GZ as metadata};
