import{S as zx,i as Hx,s as qx,e as o,k as c,w as b,t as i,M as Ox,c as a,d as t,m as d,a as s,x as v,h as r,b as l,N as U,f as D,G as e,g as u,y,q as w,o as M,B as T,v as Kx,L}from"../../../chunks/vendor-hf-doc-builder.js";import{T as xl}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 F}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Y}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function eN(E){let f,I,_,h,J;return h=new S({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjBvcGVuY3YtcHl0aG9uJTIwdHJhbnNmb3JtZXJzJTIwYWNjZWxlcmF0ZSUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBTdGFibGVEaWZmdXNpb25Db250cm9sTmV0UGlwZWxpbmUlMkMlMjBDb250cm9sTmV0TW9kZWwlMkMlMjBVbmlQQ011bHRpc3RlcFNjaGVkdWxlciUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBaW1wb3J0JTIwdG9yY2glMEElMEFpbXBvcnQlMjBjdjIlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEElMjMlMjBkb3dubG9hZCUyMGFuJTIwaW1hZ2UlMEFpbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZoZi5jbyUyRmRhdGFzZXRzJTJGaHVnZ2luZ2ZhY2UlMkZkb2N1bWVudGF0aW9uLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGZGlmZnVzZXJzJTJGaW5wdXRfaW1hZ2VfdmVybWVlci5wbmclMjIlMEEpJTBBaW1hZ2UlMjAl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lQQ011bHRpc3RlcFNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlLnNjaGVkdWxlci5jb25maWcpJTBBJTIzJTIwcmVtb3ZlJTIwZm9sbG93aW5nJTIwbGluZSUyMGlmJTIweGZvcm1lcnMlMjBpcyUyMG5vdCUyMGluc3RhbGxlZCUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKCklMEElMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBJTIzJTIwZ2VuZXJhdGUlMjBpbWFnZSUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLm1hbnVhbF9zZWVkKDApJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMCUyMmZ1dHVyaXN0aWMtbG9va2luZyUyMHdvbWFuJTIyJTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTIwaW1hZ2UlM0RjYW5ueV9pbWFnZSUwQSkuaW1hZ2VzJTVCMCU1RA==",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(){f=o("p"),I=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),_=d(p),v(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),y(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function tN(E){let f,I,_,h,J;return{c(){f=o("p"),I=i("\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),_=o("code"),h=i("scaled_dot_product_attention"),J=i(` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),_=a(g,"CODE",{});var P=s(_);h=r(P,"scaled_dot_product_attention"),P.forEach(t),J=r(g,` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`),g.forEach(t)},m(p,g){u(p,f,g),e(f,I),e(f,_),e(_,h),e(f,J)},d(p){p&&t(f)}}}function nN(E){let f,I,_,h,J;return h=new S({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUyQyUwQSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIwb24lMjBtYXJzJTIyJTBBcGlwZS5lbmFibGVfYXR0ZW50aW9uX3NsaWNpbmcoKSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",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> StableDiffusionPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>    use_safetensors=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_attention_slicing()
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`}}),{c(){f=o("p"),I=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),_=d(p),v(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),y(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function oN(E){let f,I;return{c(){f=o("p"),I=i(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(_){f=a(_,"P",{});var h=s(f);I=r(h,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),h.forEach(t)},m(_,h){u(_,f,h),e(f,I)},d(_){_&&t(f)}}}function aN(E){let f,I,_,h,J;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(){f=o("p"),I=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),_=d(p),v(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),y(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function sN(E){let f,I,_,h,J;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(){f=o("p"),I=i("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),g.forEach(t),_=d(p),v(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),y(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function lN(E){let f,I,_,h,J;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(){f=o("p"),I=i("locally:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"locally:"),g.forEach(t),_=d(p),v(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),y(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function iN(E){let f,I,_,h,J;return h=new S({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjBvcGVuY3YtcHl0aG9uJTIwdHJhbnNmb3JtZXJzJTIwYWNjZWxlcmF0ZSUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBTdGFibGVEaWZmdXNpb25Db250cm9sTmV0SW1nMkltZ1BpcGVsaW5lJTJDJTIwQ29udHJvbE5ldE1vZGVsJTJDJTIwV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UlM0RjYW5ueV9pbWFnZSUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",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(){f=o("p"),I=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),_=d(p),v(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),y(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function rN(E){let f,I,_,h,J;return{c(){f=o("p"),I=i("\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),_=o("code"),h=i("scaled_dot_product_attention"),J=i(` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),_=a(g,"CODE",{});var P=s(_);h=r(P,"scaled_dot_product_attention"),P.forEach(t),J=r(g,` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`),g.forEach(t)},m(p,g){u(p,f,g),e(f,I),e(f,_),e(_,h),e(f,J)},d(p){p&&t(f)}}}function cN(E){let f,I,_,h,J;return h=new S({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUyQyUwQSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIwb24lMjBtYXJzJTIyJTBBcGlwZS5lbmFibGVfYXR0ZW50aW9uX3NsaWNpbmcoKSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",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> StableDiffusionPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>    use_safetensors=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_attention_slicing()
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`}}),{c(){f=o("p"),I=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),_=d(p),v(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),y(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function dN(E){let f,I;return{c(){f=o("p"),I=i(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(_){f=a(_,"P",{});var h=s(f);I=r(h,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),h.forEach(t)},m(_,h){u(_,f,h),e(f,I)},d(_){_&&t(f)}}}function pN(E){let f,I,_,h,J;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(){f=o("p"),I=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),_=d(p),v(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),y(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function mN(E){let f,I,_,h,J;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(){f=o("p"),I=i("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),g.forEach(t),_=d(p),v(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),y(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function fN(E){let f,I,_,h,J;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(){f=o("p"),I=i("locally:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"locally:"),g.forEach(t),_=d(p),v(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),y(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function uN(E){let f,I,_,h,J,p,g,P,Ie,Et,Ue;return{c(){f=o("p"),I=i(`This pipeline can be used both with checkpoints that have been specifically fine-tuned for inpainting, such as
`),_=o("a"),h=i("runwayml/stable-diffusion-inpainting"),J=i(`
as well as default text-to-image stable diffusion checkpoints, such as
`),p=o("a"),g=i("runwayml/stable-diffusion-v1-5"),P=i(`.
Default text-to-image stable diffusion checkpoints might be preferable for controlnets that have been fine-tuned on
those, such as `),Ie=o("a"),Et=i("lllyasviel/control_v11p_sd15_inpaint"),Ue=i("."),this.h()},l(z){f=a(z,"P",{});var Q=s(f);I=r(Q,`This pipeline can be used both with checkpoints that have been specifically fine-tuned for inpainting, such as
`),_=a(Q,"A",{href:!0,rel:!0});var Nl=s(_);h=r(Nl,"runwayml/stable-diffusion-inpainting"),Nl.forEach(t),J=r(Q,`
as well as default text-to-image stable diffusion checkpoints, such as
`),p=a(Q,"A",{href:!0,rel:!0});var So=s(p);g=r(So,"runwayml/stable-diffusion-v1-5"),So.forEach(t),P=r(Q,`.
Default text-to-image stable diffusion checkpoints might be preferable for controlnets that have been fine-tuned on
those, such as `),Ie=a(Q,"A",{href:!0,rel:!0});var rt=s(Ie);Et=r(rt,"lllyasviel/control_v11p_sd15_inpaint"),rt.forEach(t),Ue=r(Q,"."),Q.forEach(t),this.h()},h(){l(_,"href","https://huggingface.co/runwayml/stable-diffusion-inpainting"),l(_,"rel","nofollow"),l(p,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5"),l(p,"rel","nofollow"),l(Ie,"href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G9yJTJDJTBBJTIwJTIwJTIwJTIwZXRhJTNEMS4wJTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0Rpbml0X2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwbWFza19pbWFnZSUzRG1hc2tfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBjb250cm9sX2ltYWdlJTNEY29udHJvbF9pbWFnZSUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",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(){f=o("p"),I=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),_=d(p),v(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),y(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function gN(E){let f,I,_,h,J;return{c(){f=o("p"),I=i("\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),_=o("code"),h=i("scaled_dot_product_attention"),J=i(` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),_=a(g,"CODE",{});var P=s(_);h=r(P,"scaled_dot_product_attention"),P.forEach(t),J=r(g,` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`),g.forEach(t)},m(p,g){u(p,f,g),e(f,I),e(f,_),e(_,h),e(f,J)},d(p){p&&t(f)}}}function _N(E){let f,I,_,h,J;return h=new S({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUyQyUwQSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIwb24lMjBtYXJzJTIyJTBBcGlwZS5lbmFibGVfYXR0ZW50aW9uX3NsaWNpbmcoKSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",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> StableDiffusionPipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>    use_safetensors=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_attention_slicing()
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`}}),{c(){f=o("p"),I=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),_=d(p),v(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),y(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function bN(E){let f,I;return{c(){f=o("p"),I=i(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(_){f=a(_,"P",{});var h=s(f);I=r(h,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),h.forEach(t)},m(_,h){u(_,f,h),e(f,I)},d(_){_&&t(f)}}}function vN(E){let f,I,_,h,J;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(){f=o("p"),I=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),_=d(p),v(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),y(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function yN(E){let f,I,_,h,J;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(){f=o("p"),I=i("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),g.forEach(t),_=d(p),v(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),y(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function wN(E){let f,I,_,h,J;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(){f=o("p"),I=i("locally:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"locally:"),g.forEach(t),_=d(p),v(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),y(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function MN(E){let f,I,_,h,J;return h=new S({props:{code:"aW1wb3J0JTIwamF4JTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBaW1wb3J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9pbWFnZXMlMkMlMjBudW1fc2FtcGxlcyUyMCUyRiUyRiUyMDQlMkMlMjA0KSUwQW91dHB1dF9pbWFnZXMuc2F2ZSglMjJnZW5lcmF0ZWRfaW1hZ2UucG5nJTIyKQ==",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, make_image_grid
<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_">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 = make_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(){f=o("p"),I=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),_=d(p),v(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),y(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function TN(E){let f,I,_,h,J,p,g,P,Ie,Et,Ue,z,Q,Nl,So,rt,Jg,Ef,Zl,Ig,jf,$l,cc,Ug,Cf,jt,Eg,Bo,jg,Cg,xf,Ct,xg,Po,Ng,Zg,Nf,ct,xt,dc,Fo,$g,pc,kg,Zf,Nt,Wg,mc,Dg,Gg,$f,Zt,fc,uc,hc,Sg,Bg,gc,kl,Ro,Pg,Wl,Fg,Rg,kf,$t,Vg,Vo,Xg,Ag,Wf,Xo,Df,Dl,Gl,BJ,Gf,De,Y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,Am,K0,eJ,Ym,tJ,nJ,Lm,oJ,aJ,Qm,sJ,lJ,iJ,_o,bl,rJ,zm,cJ,dJ,bo,vl,pJ,Hm,mJ,Au,Ut,vo,qm,yl,fJ,Om,uJ,Yu,ue,wl,hJ,Km,gJ,_J,Ml,bJ,Kr,vJ,yJ,wJ,Ve,Tl,MJ,ef,TJ,JJ,yo,Lu;return p=new F({}),Fo=new F({}),Xo=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBJTBBJTIzJTIwTGV0J3MlMjBsb2FkJTIwdGhlJTIwcG9wdWxhciUyMHZlcm1lZXIlMjBpbWFnZSUwQWltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmhmLmNvJTJGZGF0YXNldHMlMkZodWdnaW5nZmFjZSUyRmRvY3VtZW50YXRpb24taW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZkaWZmdXNlcnMlMkZpbnB1dF9pbWFnZV92ZXJtZWVyLnBuZyUyMiUwQSk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

<span class="hljs-comment"># Let&#x27;s load the popular vermeer image</span>
image = load_image(
    <span class="hljs-string">&quot;https://hf.co/datasets/huggingface/documentation-images/resolve/main/diffusers/input_image_vermeer.png&quot;</span>
)`}}),Ao=new S({props:{code:"cGlwJTIwaW5zdGFsbCUyMG9wZW5jdi1jb250cmliLXB5dGhvbg==",highlighted:'pip <span class="hljs-keyword">install</span> opencv-contrib-python'}}),Yo=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'}}),Lo=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)`}}),Qo=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
)`}}),zo=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()`}}),Ho=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>]`}}),qo=new F({}),Oo=new F({}),Ko=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjBjdjIlMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQSUwQWNhbm55X2ltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjA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bm55X2ltYWdlJTIwJTNEJTIwSW1hZ2UuZnJvbWFycmF5KGNhbm55X2ltYWdlKQ==",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)`}}),ea=new F({}),na=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)`}}),aa=new F({}),sa=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZSUyQyUyMENvbnRyb2xOZXRNb2RlbCUyQyUyMFVuaVBDTXVsdGlzdGVwU2NoZWR1bGVyJTBBaW1wb3J0JTIwdG9yY2glMEElMEFjb250cm9sbmV0JTIwJTNEJTIwJTVCJTBBJTIwJTIwJTIwJTIwQ29udHJvbE5ldE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJsbGx5YXN2aWVsJTJGc2QtY29udHJvbG5ldC1vcGVucG9zZSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMkMlMEElMjAlMjAlMjAlMjBDb250cm9sTmV0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmxsbHlhc3ZpZWwlMkZzZC1jb250cm9sbmV0LWNhbm55JTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUyQyUwQSU1RCUwQSUwQXBpcGUlMjAlM0QlMjB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zJTNEMjAlMkMlMEElMjAlMjAlMjAlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3IlMkMlMEElMjAlMjAlMjAlMjBuZWdhdGl2ZV9wcm9tcHQlM0RuZWdhdGl2ZV9wcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBjb250cm9sbmV0X2NvbmRpdGlvbmluZ19zY2FsZSUzRCU1QjEuMCUyQyUyMDAuOCU1RCUyQyUwQSkuaW1hZ2VzJTVCMCU1RCUwQSUwQWltYWdlLnNhdmUoJTIyLiUyRm11bHRpX2NvbnRyb2xuZXRfb3V0cHV0LnBuZyUyMik=",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>)`}}),ia=new F({}),da=new F({}),pa=new F({}),fa=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZSUyQyUyMENvbnRyb2xOZXRNb2RlbCUwQWltcG9ydCUyMHRvcmNoJTBBJTBBY29udHJvbG5ldCUyMCUzRCUyMENvbnRyb2xOZXRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIybGxseWFzdmllbCUyRnNkLWNvbnRyb2xuZXQtY2FubnklMjIpJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMkMlMjBjb250cm9sbmV0JTNEY29udHJvbG5ldCkudG8oJTBBJTIwJTIwJTIwJTIwJTIyY3VkYSUyMiUwQSklMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTIyJTIyJTJDJTIwaW1hZ2UlM0RjYW5ueV9pbWFnZSUyQyUyMGd1ZXNzX21vZGUlM0RUcnVlJTJDJTIwZ3VpZGFuY2Vfc2NhbGUlM0QzLjApLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMmd1ZXNzX21vZGVfZ2VuZXJhdGVkLnBuZyUyMik=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline, ControlNetModel
<span class="hljs-keyword">import</span> torch

controlnet = ControlNetModel.from_pretrained(<span class="hljs-string">&quot;lllyasviel/sd-controlnet-canny&quot;</span>)
pipe = StableDiffusionControlNetPipeline.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, controlnet=controlnet).to(
    <span class="hljs-string">&quot;cuda&quot;</span>
)
image = pipe(<span class="hljs-string">&quot;&quot;</span>, image=canny_image, guess_mode=<span class="hljs-literal">True</span>, guidance_scale=<span class="hljs-number">3.0</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;guess_mode_generated.png&quot;</span>)`}}),ua=new F({}),_a=new F({}),va=new F({}),Wa=new F({}),Ha=new F({}),qa=new C({props:{name:"class diffusers.StableDiffusionControlNetPipeline",anchor:"diffusers.StableDiffusionControlNetPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"controlnet",val:": typing.Union[diffusers.models.controlnet.ControlNetModel, typing.List[diffusers.models.controlnet.ControlNetModel], typing.Tuple[diffusers.models.controlnet.ControlNetModel], diffusers.pipelines.controlnet.multicontrolnet.MultiControlNetModel]"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionControlNetPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionControlNetPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/main/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code>) &#x2014;
Provides additional conditioning to the unet during the denoising process. If you set multiple ControlNets
as a list, the outputs from each ControlNet are added together to create one combined additional
conditioning.`,name:"controlnet"},{anchor:"diffusers.StableDiffusionControlNetPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionControlNetPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionControlNetPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L94"}}),es=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[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 1.0"},{name:"guess_mode",val:": bool = False"},{name:"control_guidance_start",val:": typing.Union[float, typing.List[float]] = 0.0"},{name:"control_guidance_end",val:": typing.Union[float, typing.List[float]] = 1.0"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, <code>List[List[np.ndarray]]</code> or <code>List[List[PIL.Image.Image]]</code>):
The ControlNet input condition. ControlNet uses this input condition to generate guidance to Unet. If
the type is specified as <code>Torch.FloatTensor</code>, it is passed to ControlNet as is. <code>PIL.Image.Image</code> can
also be accepted as an image. The dimensions of the output image defaults to <code>image</code>&#x2019;s dimensions. If
height and/or width are passed, <code>image</code> is resized according to them. If multiple ControlNets are
specified in init, images must be passed as a list such that each element of the list can be correctly
batched for input to a single controlnet.`,name:"image"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet. If multiple ControlNets are specified in init, you can set the
corresponding scale as a list.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.guess_mode",description:`<strong>guess_mode</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
In this mode, the ControlNet encoder will try best to recognize the content of the input image even if
you remove all prompts. The <code>guidance_scale</code> between 3.0 and 5.0 is recommended.`,name:"guess_mode"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.control_guidance_start",description:`<strong>control_guidance_start</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The percentage of total steps at which the controlnet starts applying.`,name:"control_guidance_start"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.control_guidance_end",description:`<strong>control_guidance_end</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The percentage of total steps at which the controlnet stops applying.`,name:"control_guidance_end"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L703",returnDescription:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Jn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.example",$$slots:{default:[eN]},$$scope:{ctx:E}}}),ts=new C({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1694"}}),In=new xl({props:{warning:!0,$$slots:{default:[tN]},$$scope:{ctx:E}}}),Un=new Y({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_attention_slicing.example",$$slots:{default:[nN]},$$scope:{ctx:E}}}),ns=new C({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1734"}}),as=new C({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L183"}}),ss=new C({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L191"}}),is=new C({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1633"}}),xn=new xl({props:{warning:!0,$$slots:{default:[oN]},$$scope:{ctx:E}}}),Nn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[aN]},$$scope:{ctx:E}}}),ds=new C({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1668"}}),fs=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[typing.List[str], str, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L656"}}),$n=new Y({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.example",$$slots:{default:[sN]},$$scope:{ctx:E}}}),kn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.example-2",$$slots:{default:[lN]},$$scope:{ctx:E}}}),_s=new C({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L208"}}),vs=new C({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L215"}}),ys=new C({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L199"}}),ws=new C({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionControlNetPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"device",val:""},{name:"num_images_per_prompt",val:""},{name:"do_classifier_free_guidance",val:""},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableDiffusionControlNetPipeline.encode_prompt.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.encode_prompt.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.encode_prompt.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.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L275"}}),Ms=new F({}),Ts=new C({props:{name:"class diffusers.StableDiffusionControlNetImg2ImgPipeline",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"controlnet",val:": typing.Union[diffusers.models.controlnet.ControlNetModel, typing.List[diffusers.models.controlnet.ControlNetModel], typing.Tuple[diffusers.models.controlnet.ControlNetModel], diffusers.pipelines.controlnet.multicontrolnet.MultiControlNetModel]"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/main/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code>) &#x2014;
Provides additional conditioning to the unet during the denoising process. If you set multiple ControlNets
as a list, the outputs from each ControlNet are added together to create one combined additional
conditioning.`,name:"controlnet"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L119"}}),Us=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[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"control_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = 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 accept
image latents as <code>image</code>, if passing latents directly, it will not be encoded again.`,name:"image"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.control_image",description:`<strong>control_image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, <code>List[List[np.ndarray]]</code> or <code>List[List[PIL.Image.Image]]</code>):
The ControlNet input condition. ControlNet uses this input condition to generate guidance to Unet. If
the type is specified as <code>Torch.FloatTensor</code>, it is passed to ControlNet as is. <code>PIL.Image.Image</code> can
also be accepted as an image. The dimensions of the output image defaults to <code>image</code>&#x2019;s dimensions. If
height and/or width are passed, <code>image</code> is resized according to them. If multiple ControlNets are
specified in init, images must be passed as a list such that each element of the list can be correctly
batched for input to a single controlnet.`,name:"control_image"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet. If multiple ControlNets are specified in init, you can set the
corresponding scale as a list. Note that by default, we use a smaller conditioning scale for inpainting
than for <a href="/docs/diffusers/main/en/api/pipelines/controlnet#diffusers.StableDiffusionControlNetPipeline.__call__"><strong>call</strong>()</a>.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.guess_mode",description:`<strong>guess_mode</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
In this mode, the ControlNet encoder will try best to recognize the content of the input image even if
you remove all prompts. The <code>guidance_scale</code> between 3.0 and 5.0 is recommended.`,name:"guess_mode"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.control_guidance_start",description:`<strong>control_guidance_start</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The percentage of total steps at which the controlnet starts applying.`,name:"control_guidance_start"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.control_guidance_end",description:`<strong>control_guidance_end</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The percentage of total steps at which the controlnet stops applying.`,name:"control_guidance_end"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L774",returnDescription:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Pn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.example",$$slots:{default:[iN]},$$scope:{ctx:E}}}),Es=new C({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1694"}}),Fn=new xl({props:{warning:!0,$$slots:{default:[rN]},$$scope:{ctx:E}}}),Rn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_attention_slicing.example",$$slots:{default:[cN]},$$scope:{ctx:E}}}),js=new C({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1734"}}),xs=new C({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L208"}}),Ns=new C({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L216"}}),$s=new C({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1633"}}),Yn=new xl({props:{warning:!0,$$slots:{default:[dN]},$$scope:{ctx:E}}}),Ln=new Y({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[pN]},$$scope:{ctx:E}}}),Ds=new C({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1668"}}),Bs=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[typing.List[str], str, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L656"}}),zn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.example",$$slots:{default:[mN]},$$scope:{ctx:E}}}),Hn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.example-2",$$slots:{default:[fN]},$$scope:{ctx:E}}}),Vs=new C({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L233"}}),As=new C({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L240"}}),Ys=new C({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L224"}}),Ls=new C({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"device",val:""},{name:"num_images_per_prompt",val:""},{name:"do_classifier_free_guidance",val:""},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.encode_prompt.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.encode_prompt.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.encode_prompt.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.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L300"}}),Qs=new F({}),zs=new C({props:{name:"class diffusers.StableDiffusionControlNetInpaintPipeline",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"controlnet",val:": typing.Union[diffusers.models.controlnet.ControlNetModel, typing.List[diffusers.models.controlnet.ControlNetModel], typing.Tuple[diffusers.models.controlnet.ControlNetModel], diffusers.pipelines.controlnet.multicontrolnet.MultiControlNetModel]"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/main/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code>) &#x2014;
Provides additional conditioning to the unet during the denoising process. If you set multiple ControlNets
as a list, the outputs from each ControlNet are added together to create one combined additional
conditioning.`,name:"controlnet"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L231"}}),no=new xl({props:{$$slots:{default:[uN]},$$scope:{ctx:E}}}),Os=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[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"mask_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"control_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = 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>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, &#x2014;
<code>List[PIL.Image.Image]</code>, or <code>List[np.ndarray]</code>):
<code>Image</code>, numpy array or tensor representing an image batch to be inpainted (which parts of the image to
be masked out with <code>mask_image</code> and repainted according to <code>prompt</code>). For both numpy array and pytorch
tensor, the expected value range is between <code>[0, 1]</code> If it&#x2019;s a tensor or a list or tensors, the
expected shape should be <code>(B, C, H, W)</code> or <code>(C, H, W)</code>. If it is a numpy array or a list of arrays, the
expected shape should be <code>(B, H, W, C)</code> or <code>(H, W, C)</code> It can also accept image latents as <code>image</code>, but
if passing latents directly it is not encoded again.`,name:"image"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.mask_image",description:`<strong>mask_image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, &#x2014;
<code>List[PIL.Image.Image]</code>, or <code>List[np.ndarray]</code>):
<code>Image</code>, numpy array or tensor representing an image batch to mask <code>image</code>. White pixels in the mask
are repainted while black pixels are preserved. If <code>mask_image</code> is a PIL image, it is converted to a
single channel (luminance) before use. If it&#x2019;s a numpy array or pytorch tensor, it should contain one
color channel (L) instead of 3, so the expected shape for pytorch tensor would be <code>(B, 1, H, W)</code>, <code>(B, H, W)</code>, <code>(1, H, W)</code>, <code>(H, W)</code>. And for numpy array would be for <code>(B, H, W, 1)</code>, <code>(B, H, W)</code>, <code>(H, W, 1)</code>, or <code>(H, W)</code>.`,name:"mask_image"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.control_image",description:`<strong>control_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. 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.StableDiffusionControlNetInpaintPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 1.) &#x2014;
Conceptually, indicates how much to transform the masked portion of the reference <code>image</code>. Must be
between 0 and 1. <code>image</code> will be used as a starting point, adding more noise to it the larger the
<code>strength</code>. The number of denoising steps depends on the amount of noise initially added. When
<code>strength</code> is 1, added noise will be maximum and the denoising process will run for the full number of
iterations specified in <code>num_inference_steps</code>. A value of 1, therefore, essentially ignores the masked
portion of the reference <code>image</code>.`,name:"strength"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.5) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet. If multiple ControlNets are specified in init, you can set the
corresponding scale as a list. Note that by default, we use a smaller conditioning scale for inpainting
than for <a href="/docs/diffusers/main/en/api/pipelines/controlnet#diffusers.StableDiffusionControlNetPipeline.__call__"><strong>call</strong>()</a>.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.guess_mode",description:`<strong>guess_mode</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
In this mode, the ControlNet encoder will try best to recognize the content of the input image even if
you remove all prompts. The <code>guidance_scale</code> between 3.0 and 5.0 is recommended.`,name:"guess_mode"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.control_guidance_start",description:`<strong>control_guidance_start</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The percentage of total steps at which the controlnet starts applying.`,name:"control_guidance_start"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.control_guidance_end",description:`<strong>control_guidance_end</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The percentage of total steps at which the controlnet stops applying.`,name:"control_guidance_end"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L958",returnDescription:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),oo=new Y({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.example",$$slots:{default:[hN]},$$scope:{ctx:E}}}),Ks=new C({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1694"}}),ao=new xl({props:{warning:!0,$$slots:{default:[gN]},$$scope:{ctx:E}}}),so=new Y({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_attention_slicing.example",$$slots:{default:[_N]},$$scope:{ctx:E}}}),el=new C({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1734"}}),nl=new C({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L334"}}),ol=new C({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L342"}}),sl=new C({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1633"}}),co=new xl({props:{warning:!0,$$slots:{default:[bN]},$$scope:{ctx:E}}}),po=new Y({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[vN]},$$scope:{ctx:E}}}),rl=new C({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1668"}}),pl=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[typing.List[str], str, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L656"}}),fo=new Y({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.example",$$slots:{default:[yN]},$$scope:{ctx:E}}}),uo=new Y({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.example-2",$$slots:{default:[wN]},$$scope:{ctx:E}}}),hl=new C({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L359"}}),_l=new C({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L366"}}),bl=new C({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L350"}}),vl=new C({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"device",val:""},{name:"num_images_per_prompt",val:""},{name:"do_classifier_free_guidance",val:""},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.encode_prompt.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.encode_prompt.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.encode_prompt.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.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L426"}}),yl=new F({}),wl=new C({props:{name:"class diffusers.FlaxStableDiffusionControlNetPipeline",anchor:"diffusers.FlaxStableDiffusionControlNetPipeline",parameters:[{name:"vae",val:": FlaxAutoencoderKL"},{name:"text_encoder",val:": FlaxCLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": FlaxUNet2DConditionModel"},{name:"controlnet",val:": FlaxControlNetModel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim_flax.FlaxDDIMScheduler, diffusers.schedulers.scheduling_pndm_flax.FlaxPNDMScheduler, diffusers.schedulers.scheduling_lms_discrete_flax.FlaxLMSDiscreteScheduler, diffusers.schedulers.scheduling_dpmsolver_multistep_flax.FlaxDPMSolverMultistepScheduler]"},{name:"safety_checker",val:": FlaxStableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPFeatureExtractor"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"}],parametersDescription:[{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.FlaxAutoencoderKL">FlaxAutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>FlaxCLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.FlaxCLIPTextModel" rel="nofollow">CLIP</a>,
specifically the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.FlaxUNet2DConditionModel">FlaxUNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/main/en/api/models/controlnet#diffusers.FlaxControlNetModel">FlaxControlNetModel</a> &#x2014;
Provides additional conditioning to the unet during the denoising process.`,name:"controlnet"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<code>FlaxDDIMScheduler</code>, <code>FlaxLMSDiscreteScheduler</code>, <code>FlaxPNDMScheduler</code>, or
<code>FlaxDPMSolverMultistepScheduler</code>.`,name:"scheduler"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>FlaxStableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPFeatureExtractor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py#L111"}}),Tl=new C({props:{name:"__call__",anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__",parameters:[{name:"prompt_ids",val:": array"},{name:"image",val:": array"},{name:"params",val:": typing.Union[typing.Dict, flax.core.frozen_dict.FrozenDict]"},{name:"prng_seed",val:": PRNGKeyArray"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": typing.Union[float, array] = 7.5"},{name:"latents",val:": array = None"},{name:"neg_prompt_ids",val:": array = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, array] = 1.0"},{name:"return_dict",val:": bool = True"},{name:"jit",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.prompt_ids",description:`<strong>prompt_ids</strong> (<code>jnp.array</code>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt_ids"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.image",description:`<strong>image</strong> (<code>jnp.array</code>) &#x2014;
Array representing the ControlNet input condition. ControlNet use this input condition to generate
guidance to Unet.`,name:"image"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.params",description:"<strong>params</strong> (<code>Dict</code> or <code>FrozenDict</code>) &#x2014; Dictionary containing the model parameters/weights",name:"params"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.prng_seed",description:"<strong>prng_seed</strong> (<code>jax.random.KeyArray</code> or <code>jax.Array</code>) &#x2014; Array containing random number generator key",name:"prng_seed"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.latents",description:`<strong>latents</strong> (<code>jnp.array</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>jnp.array</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput">FlaxStableDiffusionPipelineOutput</a> instead of
a plain tuple.`,name:"return_dict"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.jit",description:`<strong>jit</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to run <code>pmap</code> versions of the generation and safety scoring functions. NOTE: This argument
exists because <code>__call__</code> is not yet end-to-end pmap-able. It will be removed in a future release.`,name:"jit"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py#L349",returnDescription:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"
>FlaxStableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a
<code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"
>FlaxStableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),yo=new Y({props:{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.example",$$slots:{default:[MN]},$$scope:{ctx:E}}}),{c(){f=o("meta"),I=c(),_=o("h1"),h=o("a"),J=o("span"),b(p.$$.fragment),g=c(),P=o("span"),Ie=i("ControlNet"),Et=c(),Ue=o("p"),z=o("a"),Q=i("Adding Conditional Control to Text-to-Image Diffusion Models"),Nl=i(" by Lvmin Zhang and Maneesh Agrawala."),So=c(),rt=o("p"),Jg=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."),Ef=c(),Zl=o("p"),Ig=i("The abstract from the paper is:"),jf=c(),$l=o("p"),cc=o("em"),Ug=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."),Cf=c(),jt=o("p"),Eg=i("This model was contributed by "),Bo=o("a"),jg=i("takuma104"),Cg=i(". \u2764\uFE0F"),xf=c(),Ct=o("p"),xg=i("The original codebase can be found at "),Po=o("a"),Ng=i("lllyasviel/ControlNet"),Zg=i("."),Nf=c(),ct=o("h2"),xt=o("a"),dc=o("span"),b(Fo.$$.fragment),$g=c(),pc=o("span"),kg=i("Usage example"),Zf=c(),Nt=o("p"),Wg=i("In the following we give a simple example of how to use a "),mc=o("em"),Dg=i("ControlNet"),Gg=i(` checkpoint with Diffusers for inference.
The inference pipeline is the same for all pipelines:`),$f=c(),Zt=o("ul"),fc=o("li"),uc=o("ol"),hc=o("li"),Sg=i("Take an image and run it through a pre-conditioning processor."),Bg=c(),gc=o("li"),kl=o("ol"),Ro=o("li"),Pg=i("Run the pre-processed image through the "),Wl=o("a"),Fg=i("StableDiffusionControlNetPipeline"),Rg=i("."),kf=c(),$t=o("p"),Vg=i("Let\u2019s have a look at a simple example using the "),Vo=o("a"),Xg=i("Canny Edge ControlNet"),Ag=i("."),Wf=c(),b(Xo.$$.fragment),Df=c(),Dl=o("p"),Gl=o("img"),Gf=c(),De=o("p"),Yg=i("Next, we process the image to get the canny image. This is step "),_c=o("em"),Lg=i("1."),Qg=i(" - running the pre-conditioning processor. The pre-conditioning processor is different for every ControlNet. Please see the model cards of the "),Sl=o("a"),zg=i("official checkpoints"),Hg=i(" for more information about other models."),Sf=c(),Bl=o("p"),qg=i("First, we need to install opencv:"),Bf=c(),b(Ao.$$.fragment),Pf=c(),Pl=o("p"),Og=i("Next, let\u2019s also install all required Hugging Face libraries:"),Ff=c(),b(Yo.$$.fragment),Rf=c(),Fl=o("p"),Kg=i("Then we can retrieve the canny edges of the image."),Vf=c(),b(Lo.$$.fragment),Xf=c(),Rl=o("p"),e_=i("Let\u2019s take a look at the processed image."),Af=c(),Vl=o("p"),Xl=o("img"),Yf=c(),kt=o("p"),t_=i("Now, we load the official "),Al=o("a"),n_=i("Stable Diffusion 1.5 Model"),o_=i(" as well as the ControlNet for canny edges."),Lf=c(),b(Qo.$$.fragment),Qf=c(),Wt=o("p"),a_=i("To speed-up things and reduce memory, let\u2019s enable model offloading and use the fast "),Yl=o("a"),s_=i("UniPCMultistepScheduler"),l_=i("."),zf=c(),b(zo.$$.fragment),Hf=c(),Ll=o("p"),i_=i("Finally, we can run the pipeline:"),qf=c(),b(Ho.$$.fragment),Of=c(),Ql=o("p"),r_=i("This should take only around 3-4 seconds on GPU (depending on hardware). The output image then looks as follows:"),Kf=c(),zl=o("p"),Hl=o("img"),eu=c(),dt=o("p"),bc=o("strong"),c_=i("Note"),d_=i(": To see how to run all other ControlNet checkpoints, please have a look at "),ql=o("a"),p_=i("ControlNet with Stable Diffusion 1.5"),m_=i("."),tu=c(),pt=o("h2"),Dt=o("a"),vc=o("span"),b(qo.$$.fragment),f_=c(),yc=o("span"),u_=i("Combining multiple conditionings"),nu=c(),Gt=o("p"),h_=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 "),wc=o("code"),g_=i("__call__"),__=i("."),ou=c(),Ol=o("p"),b_=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."),au=c(),St=o("p"),v_=i("It can also be helpful to vary the "),Mc=o("code"),y_=i("controlnet_conditioning_scales"),w_=i(" to emphasize one conditioning over the other."),su=c(),mt=o("h3"),Bt=o("a"),Tc=o("span"),b(Oo.$$.fragment),M_=c(),Jc=o("span"),T_=i("Canny conditioning"),lu=c(),Kl=o("p"),J_=i("The original image:"),iu=c(),ei=o("img"),ru=c(),ti=o("p"),I_=i("Prepare the conditioning:"),cu=c(),b(Ko.$$.fragment),du=c(),ni=o("img"),pu=c(),ft=o("h3"),Pt=o("a"),Ic=o("span"),b(ea.$$.fragment),U_=c(),Uc=o("span"),E_=i("Openpose conditioning"),mu=c(),oi=o("p"),j_=i("The original image:"),fu=c(),ta=o("img"),uu=c(),ai=o("p"),C_=i("Prepare the conditioning:"),hu=c(),b(na.$$.fragment),gu=c(),oa=o("img"),_u=c(),ut=o("h3"),Ft=o("a"),Ec=o("span"),b(aa.$$.fragment),x_=c(),jc=o("span"),N_=i("Running ControlNet with multiple conditionings"),bu=c(),b(sa.$$.fragment),vu=c(),la=o("img"),yu=c(),ht=o("h3"),Rt=o("a"),Cc=o("span"),b(ia.$$.fragment),Z_=c(),xc=o("span"),$_=i("Guess Mode"),wu=c(),Ge=o("p"),k_=i("Guess Mode is "),ra=o("a"),W_=i("a ControlNet feature that was implemented"),D_=i(" after the publication of "),ca=o("a"),G_=i("the paper"),S_=i(". The description states:"),Mu=c(),si=o("blockquote"),Nc=o("p"),B_=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."),Tu=c(),gt=o("h4"),Vt=o("a"),Zc=o("span"),b(da.$$.fragment),P_=c(),$c=o("span"),F_=i("The core implementation:"),Ju=c(),Se=o("p"),R_=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 "),kc=o("code"),V_=i("0.1"),X_=i(". As the blocks get deeper, the scale increases exponentially, and the scale for the output of the MidBlock becomes "),Wc=o("code"),A_=i("1.0"),Y_=i("."),Iu=c(),Xt=o("p"),L_=i("Since the core implementation is just this, "),Dc=o("strong"),Q_=i("it does not have any impact on prompt conditioning"),z_=i(". While it is common to use it without specifying any prompts, it is also possible to provide prompts if desired."),Uu=c(),_t=o("h4"),At=o("a"),Gc=o("span"),b(pa.$$.fragment),H_=c(),Sc=o("span"),q_=i("Usage:"),Eu=c(),he=o("p"),O_=i("Just specify "),Bc=o("code"),K_=i("guess_mode=True"),eb=i(" in the pipe() function. A "),Pc=o("code"),tb=i("guidance_scale"),nb=i(" between 3.0 and 5.0 is "),ma=o("a"),ob=i("recommended"),ab=i("."),ju=c(),b(fa.$$.fragment),Cu=c(),bt=o("h4"),Yt=o("a"),Fc=o("span"),b(ua.$$.fragment),sb=c(),Rc=o("span"),lb=i("Output image comparison:"),xu=i(`

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

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