import{S as UZ,i as IZ,s as jZ,e as o,k as c,w as b,t as i,M as EZ,c as a,d as t,m as d,a as s,x as y,h as r,b as l,N as I,f as G,G as e,g as u,y as v,q as w,o as M,B as T,v as CZ,L as Q}from"../../../chunks/vendor-hf-doc-builder.js";import{T as Jl}from"../../../chunks/Tip-hf-doc-builder.js";import{D as C}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as D}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 ZZ(j){let f,U,_,h,J;return h=new D({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjBvcGVuY3YtcHl0aG9uJTIwdHJhbnNmb3JtZXJzJTIwYWNjZWxlcmF0ZSUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBTdGFibGVEaWZmdXNpb25Db250cm9sTmV0UGlwZWxpbmUlMkMlMjBDb250cm9sTmV0TW9kZWwlMkMlMjBVbmlQQ011bHRpc3RlcFNjaGVkdWxlciUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBaW1wb3J0JTIwdG9yY2glMEElMEFpbXBvcnQlMjBjdjIlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEElMjMlMjBkb3dubG9hZCUyMGFuJTIwaW1hZ2UlMEFpbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZoZi5jbyUyRmRhdGFzZXRzJTJGaHVnZ2luZ2ZhY2UlMkZkb2N1bWVudGF0aW9uLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGZGlmZnVzZXJzJTJGaW5wdXRfaW1hZ2VfdmVybWVlci5wbmclMjIlMEEpJTBBaW1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M0QlMjBVbmlQQ011bHRpc3RlcFNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlLnNjaGVkdWxlci5jb25maWcpJTBBJTIzJTIwcmVtb3ZlJTIwZm9sbG93aW5nJTIwbGluZSUyMGlmJTIweGZvcm1lcnMlMjBpcyUyMG5vdCUyMGluc3RhbGxlZCUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKCklMEElMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBJTIzJTIwZ2VuZXJhdGUlMjBpbWFnZSUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLm1hbnVhbF9zZWVkKDApJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMCUyMmZ1dHVyaXN0aWMtbG9va2luZyUyMHdvbWFuJTIyJTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTIwaW1hZ2UlM0RjYW5ueV9pbWFnZSUwQSkuaW1hZ2VzJTVCMCU1RA==",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"),U=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);U=r(g,"Examples:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,U),u(p,_,g),v(h,p,g),J=!0},p:Q,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 $Z(j){let f,U,_,h,J;return{c(){f=o("p"),U=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);U=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,U),e(f,_),e(_,h),e(f,J)},d(p){p&&t(f)}}}function NZ(j){let f,U,_,h,J;return h=new D({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"),U=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);U=r(g,"Examples:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,U),u(p,_,g),v(h,p,g),J=!0},p:Q,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 xZ(j){let f,U;return{c(){f=o("p"),U=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);U=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,U)},d(_){_&&t(f)}}}function kZ(j){let f,U,_,h,J;return h=new D({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"),U=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);U=r(g,"Examples:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,U),u(p,_,g),v(h,p,g),J=!0},p:Q,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 WZ(j){let f,U,_,h,J;return h=new D({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"),U=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);U=r(g,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,U),u(p,_,g),v(h,p,g),J=!0},p:Q,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 GZ(j){let f,U,_,h,J;return h=new D({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"),U=i("locally:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);U=r(g,"locally:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,U),u(p,_,g),v(h,p,g),J=!0},p:Q,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 SZ(j){let f,U,_,h,J;return h=new D({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjBvcGVuY3YtcHl0aG9uJTIwdHJhbnNmb3JtZXJzJTIwYWNjZWxlcmF0ZSUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBTdGFibGVEaWZmdXNpb25Db250cm9sTmV0SW1nMkltZ1BpcGVsaW5lJTJDJTIwQ29udHJ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CUyMGNvbnRyb2xfaW1hZ2UlM0RjYW5ueV9pbWFnZSUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",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"),U=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);U=r(g,"Examples:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,U),u(p,_,g),v(h,p,g),J=!0},p:Q,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 DZ(j){let f,U,_,h,J;return{c(){f=o("p"),U=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);U=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,U),e(f,_),e(_,h),e(f,J)},d(p){p&&t(f)}}}function BZ(j){let f,U,_,h,J;return h=new D({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"),U=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);U=r(g,"Examples:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,U),u(p,_,g),v(h,p,g),J=!0},p:Q,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 PZ(j){let f,U;return{c(){f=o("p"),U=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);U=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,U)},d(_){_&&t(f)}}}function FZ(j){let f,U,_,h,J;return h=new D({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"),U=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);U=r(g,"Examples:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,U),u(p,_,g),v(h,p,g),J=!0},p:Q,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 RZ(j){let f,U,_,h,J;return h=new D({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"),U=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);U=r(g,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,U),u(p,_,g),v(h,p,g),J=!0},p:Q,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 VZ(j){let f,U,_,h,J;return h=new D({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"),U=i("locally:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);U=r(g,"locally:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,U),u(p,_,g),v(h,p,g),J=!0},p:Q,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 XZ(j){let f,U,_,h,J,p,g,P,Ue,jt,Ie;return{c(){f=o("p"),U=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 `),Ue=o("a"),jt=i("lllyasviel/control_v11p_sd15_inpaint"),Ie=i("."),this.h()},l(z){f=a(z,"P",{});var L=s(f);U=r(L,`This pipeline can be used both with checkpoints that have been specifically fine-tuned for inpainting, such as
`),_=a(L,"A",{href:!0,rel:!0});var Ul=s(_);h=r(Ul,"runwayml/stable-diffusion-inpainting"),Ul.forEach(t),J=r(L,`
as well as default text-to-image stable diffusion checkpoints, such as
`),p=a(L,"A",{href:!0,rel:!0});var Wo=s(p);g=r(Wo,"runwayml/stable-diffusion-v1-5"),Wo.forEach(t),P=r(L,`.
Default text-to-image stable diffusion checkpoints might be preferable for controlnets that have been fine-tuned on
those, such as `),Ue=a(L,"A",{href:!0,rel:!0});var rt=s(Ue);jt=r(rt,"lllyasviel/control_v11p_sd15_inpaint"),rt.forEach(t),Ie=r(L,"."),L.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(Ue,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint"),l(Ue,"rel","nofollow")},m(z,L){u(z,f,L),e(f,U),e(f,_),e(_,h),e(f,J),e(f,p),e(p,g),e(f,P),e(f,Ue),e(Ue,jt),e(f,Ie)},d(z){z&&t(f)}}}function AZ(j){let f,U,_,h,J;return h=new D({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjB0cmFuc2Zvcm1lcnMlMjBhY2NlbGVyYXRlJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRJbnBhaW50UGlwZWxpbmUlMkMlMjBDb250cm9sTmV0TW9kZWwlMkMlMjBERElNU2NoZWR1bGVyJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQWluaXRfaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmRpZmZ1c2VycyUyRnRlc3QtYXJyYXlzJTJGcmVzb2x2ZSUyRm1haW4lMkZzdGFibGVfZGlmZnVzaW9uX2lucGFpbnQlMkZib3kucG5nJTIyJTBBKSUwQWluaXRfaW1hZ2UlMjAlM0QlMjBpbml0X2ltYWdlLnJlc2l6ZSgoNTEyJTJDJTIwNTEyKSklMEElMEFnZW5lcmF0b3IlMjAlM0QlMjB0b3JjaC5HZW5lcmF0b3IoZGV2aWNlJTNEJTIyY3B1JTIyKS5tYW51YWxfc2VlZCgxKSUwQSUwQW1hc2tfaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJG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TIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTBBJTIwJTIwJTIwJTIwZXRhJTNEMS4wJTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0Rpbml0X2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwbWFza19pbWFnZSUzRG1hc2tfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBjb250cm9sX2ltYWdlJTNEY29udHJvbF9pbWFnZSUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",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"),U=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);U=r(g,"Examples:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,U),u(p,_,g),v(h,p,g),J=!0},p:Q,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 YZ(j){let f,U,_,h,J;return{c(){f=o("p"),U=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);U=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,U),e(f,_),e(_,h),e(f,J)},d(p){p&&t(f)}}}function QZ(j){let f,U,_,h,J;return h=new D({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"),U=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);U=r(g,"Examples:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,U),u(p,_,g),v(h,p,g),J=!0},p:Q,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 LZ(j){let f,U;return{c(){f=o("p"),U=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);U=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,U)},d(_){_&&t(f)}}}function zZ(j){let f,U,_,h,J;return h=new D({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"),U=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);U=r(g,"Examples:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,U),u(p,_,g),v(h,p,g),J=!0},p:Q,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 HZ(j){let f,U,_,h,J;return h=new D({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"),U=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);U=r(g,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,U),u(p,_,g),v(h,p,g),J=!0},p:Q,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 qZ(j){let f,U,_,h,J;return h=new D({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"),U=i("locally:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);U=r(g,"locally:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,U),u(p,_,g),v(h,p,g),J=!0},p:Q,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 OZ(j){let f,U,_,h,J;return h=new D({props:{code:"aW1wb3J0JTIwamF4JTBB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aW1hZ2UlM0Rwcm9jZXNzZWRfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBwYXJhbXMlM0RwX3BhcmFtcyUyQyUwQSUyMCUyMCUyMCUyMHBybmdfc2VlZCUzRHJuZyUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q1MCUyQyUwQSUyMCUyMCUyMCUyMG5lZ19wcm9tcHRfaWRzJTNEbmVnYXRpdmVfcHJvbXB0X2lkcyUyQyUwQSUyMCUyMCUyMCUyMGppdCUzRFRydWUlMkMlMEEpLmltYWdlcyUwQSUwQW91dHB1dF9pbWFnZXMlMjAlM0QlMjBwaXBlLm51bXB5X3RvX3BpbChucC5hc2FycmF5KG91dHB1dC5yZXNoYXBlKChudW1fc2FtcGxlcyUyQyklMjAlMkIlMjBvdXRwdXQuc2hhcGUlNUItMyUzQSU1RCkpKSUwQW91dHB1dF9pbWFnZXMlMjAlM0QlMjBpbWFnZV9ncmlkKG91dHB1dF9pbWFnZXMlMkMlMjBudW1fc2FtcGxlcyUyMCUyRiUyRiUyMDQlMkMlMjA0KSUwQW91dHB1dF9pbWFnZXMuc2F2ZSglMjJnZW5lcmF0ZWRfaW1hZ2UucG5nJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax.jax_utils <span class="hljs-keyword">import</span> replicate
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax.training.common_utils <span class="hljs-keyword">import</span> shard
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlaxStableDiffusionControlNetPipeline, FlaxControlNetModel


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


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


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

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>output_images = pipe.numpy_to_pil(np.asarray(output.reshape((num_samples,) + output.shape[-<span class="hljs-number">3</span>:])))
<span class="hljs-meta">&gt;&gt;&gt; </span>output_images = image_grid(output_images, num_samples // <span class="hljs-number">4</span>, <span class="hljs-number">4</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>output_images.save(<span class="hljs-string">&quot;generated_image.png&quot;</span>)`}}),{c(){f=o("p"),U=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);U=r(g,"Examples:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,U),u(p,_,g),v(h,p,g),J=!0},p:Q,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 KZ(j){let f,U,_,h,J,p,g,P,Ue,jt,Ie,z,L,Ul,Wo,rt,mg,bf,Il,fg,yf,jl,oc,ug,vf,Et,hg,Go,gg,_g,wf,Ct,bg,So,yg,vg,Mf,ct,Zt,ac,Do,wg,sc,Mg,Tf,$t,Tg,lc,Jg,Ug,Jf,Nt,ic,rc,cc,Ig,jg,dc,El,Bo,Eg,Cl,Cg,Zg,Uf,xt,$g,Po,Ng,xg,If,Fo,jf,Zl,$l,bJ,Ef,Ge,kg,pc,Wg,Gg,Nl,Sg,Dg,Cf,xl,Bg,Zf,Ro,$f,kl,Pg,Nf,Vo,xf,Wl,Fg,kf,Xo,Wf,Gl,Rg,Gf,Sl,Dl,yJ,Sf,kt,Vg,Bl,Xg,Ag,Df,Ao,Bf,Wt,Yg,Pl,Qg,Lg,Pf,Yo,Ff,Fl,zg,Rf,Qo,Vf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Z1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBJTBBJTIzJTIwTGV0J3MlMjBsb2FkJTIwdGhlJTIwcG9wdWxhciUyMHZlcm1lZXIlMjBpbWFnZSUwQWltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmhmLmNvJTJGZGF0YXNldHMlMkZodWdnaW5nZmFjZSUyRmRvY3VtZW50YXRpb24taW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZkaWZmdXNlcnMlMkZpbnB1dF9pbWFnZV92ZXJtZWVyLnBuZyUyMiUwQSk=",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>
)`}}),Ro=new D({props:{code:"cGlwJTIwaW5zdGFsbCUyMG9wZW5jdi1jb250cmliLXB5dGhvbg==",highlighted:'pip <span class="hljs-keyword">install</span> opencv-contrib-python'}}),Vo=new D({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'}}),Xo=new D({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)`}}),Ao=new D({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
)`}}),Yo=new D({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()`}}),Qo=new D({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>]`}}),Lo=new F({}),zo=new F({}),Ho=new D({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjBjdjIlMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQSUwQWNhbm55X2ltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZodWdnaW5nZmFjZSUyRmRvY3VtZW50YXRpb24taW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZkaWZmdXNlcnMlMkZsYW5kc2NhcGUucG5nJTIyJTBBKSUwQWNhbm55X2ltYWdlJTIwJTNEJTIwbnAuYXJyYXkoY2FubnlfaW1hZ2UpJTBBJTBBbG93X3RocmVzaG9sZCUyMCUzRCUyMDEwMCUwQWhpZ2hfdGhyZXNob2xkJTIwJTNEJTIwMjAwJTBBJTBBY2FubnlfaW1hZ2UlMjAlM0QlMjBjdjIuQ2FubnkoY2FubnlfaW1hZ2UlMkMlMjBsb3dfdGhyZXNob2xkJTJDJTIwaGlnaF90aHJlc2hvbGQpJTBBJTBBJTIzJTIwemVybyUyMG91dCUyMG1pZGRsZSUyMGNvbHVtbnMlMjBvZiUyMGltYWdlJTIwd2hlcmUlMjBwb3NlJTIwd2lsbCUyMGJlJTIwb3ZlcmxheWVkJTBBemVyb19zdGFydCUyMCUzRCUyMGNhbm55X2ltYWdlLnNoYXBlJTVCMSU1RCUyMCUyRiUyRiUyMDQlMEF6ZXJvX2VuZCUyMCUzRCUyMHplcm9fc3RhcnQlMjAlMkIlMjBjYW5ueV9pbWFnZS5zaGFwZSU1QjElNUQlMjAlMkYlMkYlMjAyJTBBY2FubnlfaW1hZ2UlNUIlM0ElMkMlMjB6ZXJvX3N0YXJ0JTNBemVyb19lbmQlNUQlMjAlM0QlMjAwJTBBJTBBY2FubnlfaW1hZ2UlMjAlM0QlMjBjYW5ueV9pbWFnZSU1QiUzQSUyQyUyMCUzQSUyQyUyME5vbmUlNUQlMEFjYW5ueV9pbWFnZSUyMCUzRCUyMG5wLmNvbmNhdGVuYXRlKCU1QmNhbm55X2ltYWdlJTJDJTIwY2FubnlfaW1hZ2UlMkMlMjBjYW5ueV9pbWFnZSU1RCUyQyUyMGF4aXMlM0QyKSUwQWNhbm55X2ltYWdlJTIwJTNEJTIwSW1hZ2UuZnJvbWFycmF5KGNhbm55X2ltYWdlKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> cv2
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

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

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

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

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

canny_image = canny_image[:, :, <span class="hljs-literal">None</span>]
canny_image = np.concatenate([canny_image, canny_image, canny_image], axis=<span class="hljs-number">2</span>)
canny_image = Image.fromarray(canny_image)`}}),qo=new F({}),Ko=new D({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)`}}),ta=new F({}),na=new D({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZSUyQyUyMENvbnRyb2xOZXRNb2RlbCUyQyUyMFVuaVBDTXVsdGlzdGVwU2NoZWR1bGVyJTBBaW1wb3J0JTIwdG9yY2glMEElMEFjb250cm9sbmV0JTIwJTNEJTIwJTVCJTBBJTIwJTIwJTIwJTIwQ29udHJvbE5ldE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJsbGx5YXN2aWVsJTJGc2QtY29udHJvbG5ldC1vcGVucG9zZSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMkMlMEElMjAlMjAlMjAlMjBDb250cm9sTmV0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmxsbHlhc3ZpZWwlMkZzZC1jb250cm9sbmV0LWNhbm55JTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUyQyUwQSU1RCUwQSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25Db250cm9sTmV0UGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTIwY29udHJvbG5ldCUzRGNvbnRyb2xuZXQlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTBBcGlwZS5zY2hlZHVsZ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MCU1RCUwQSUwQWltYWdlLnNhdmUoJTIyLiUyRm11bHRpX2NvbnRyb2xuZXRfb3V0cHV0LnBuZyUyMik=",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>)`}}),aa=new F({}),ia=new F({}),ra=new F({}),da=new D({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>)`}}),pa=new F({}),ua=new F({}),ga=new F({}),Na=new F({}),Qa=new F({}),La=new C({props:{name:"class diffusers.StableDiffusionControlNetPipeline",anchor:"diffusers.StableDiffusionControlNetPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"controlnet",val:": typing.Union[diffusers.models.controlnet.ControlNetModel, typing.List[diffusers.models.controlnet.ControlNetModel], typing.Tuple[diffusers.models.controlnet.ControlNetModel], diffusers.pipelines.controlnet.multicontrolnet.MultiControlNetModel]"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionControlNetPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionControlNetPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/main/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code>) &#x2014;
Provides additional conditioning to the unet during the denoising process. If you set multiple ControlNets
as a list, the outputs from each ControlNet are added together to create one combined additional
conditioning.`,name:"controlnet"},{anchor:"diffusers.StableDiffusionControlNetPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionControlNetPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionControlNetPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L93"}}),qa=new C({props:{name:"__call__",anchor:"diffusers.StableDiffusionControlNetPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, numpy.ndarray, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image], typing.List[numpy.ndarray]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 1.0"},{name:"guess_mode",val:": bool = False"},{name:"control_guidance_start",val:": typing.Union[float, typing.List[float]] = 0.0"},{name:"control_guidance_end",val:": typing.Union[float, typing.List[float]] = 1.0"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, <code>List[List[np.ndarray]]</code> or <code>List[List[PIL.Image.Image]]</code>):
The ControlNet input condition. ControlNet uses this input condition to generate guidance to Unet. If
the type is specified as <code>Torch.FloatTensor</code>, it is passed to ControlNet as is. <code>PIL.Image.Image</code> can
also be accepted as an image. The dimensions of the output image defaults to <code>image</code>&#x2019;s dimensions. If
height and/or width are passed, <code>image</code> is resized according to them. If multiple ControlNets are
specified in init, images must be passed as a list such that each element of the list can be correctly
batched for input to a single controlnet.`,name:"image"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/upscale#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#L676",returnDescription:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/upscale#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/upscale#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Jn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.example",$$slots:{default:[ZZ]},$$scope:{ctx:j}}}),Oa=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#L1663"}}),Un=new Jl({props:{warning:!0,$$slots:{default:[$Z]},$$scope:{ctx:j}}}),In=new Y({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_attention_slicing.example",$$slots:{default:[NZ]},$$scope:{ctx:j}}}),Ka=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#L1703"}}),ts=new C({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L182"}}),ns=new C({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L190"}}),as=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#L1602"}}),Zn=new Jl({props:{warning:!0,$$slots:{default:[xZ]},$$scope:{ctx:j}}}),$n=new Y({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[kZ]},$$scope:{ctx:j}}}),is=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#L1637"}}),ds=new C({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.List[str], typing.Dict[str, torch.Tensor], typing.List[typing.Dict[str, torch.Tensor]]]"},{name:"token",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L632"}}),xn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.example",$$slots:{default:[WZ]},$$scope:{ctx:j}}}),kn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.example-2",$$slots:{default:[GZ]},$$scope:{ctx:j}}}),us=new C({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L207"}}),gs=new C({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L214"}}),_s=new C({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L198"}}),bs=new F({}),ys=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"}}),Ms=new C({props:{name:"__call__",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, numpy.ndarray, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image], typing.List[numpy.ndarray]] = None"},{name:"control_image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, numpy.ndarray, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image], typing.List[numpy.ndarray]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"strength",val:": float = 0.8"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 0.8"},{name:"guess_mode",val:": bool = False"},{name:"control_guidance_start",val:": typing.Union[float, typing.List[float]] = 0.0"},{name:"control_guidance_end",val:": typing.Union[float, typing.List[float]] = 1.0"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, <code>List[List[np.ndarray]]</code> or <code>List[List[PIL.Image.Image]]</code>):
The initial image will be used as the starting point for the image generation process. Can also 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/upscale#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#L748",returnDescription:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/upscale#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/upscale#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Bn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.example",$$slots:{default:[SZ]},$$scope:{ctx:j}}}),Ts=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#L1663"}}),Pn=new Jl({props:{warning:!0,$$slots:{default:[DZ]},$$scope:{ctx:j}}}),Fn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_attention_slicing.example",$$slots:{default:[BZ]},$$scope:{ctx:j}}}),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#L1703"}}),Is=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"}}),js=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"}}),Cs=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#L1602"}}),An=new Jl({props:{warning:!0,$$slots:{default:[PZ]},$$scope:{ctx:j}}}),Yn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[FZ]},$$scope:{ctx:j}}}),Ns=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#L1637"}}),Ws=new C({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.List[str], typing.Dict[str, torch.Tensor], typing.List[typing.Dict[str, torch.Tensor]]]"},{name:"token",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L632"}}),Ln=new Y({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.example",$$slots:{default:[RZ]},$$scope:{ctx:j}}}),zn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.example-2",$$slots:{default:[VZ]},$$scope:{ctx:j}}}),Bs=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"}}),Fs=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"}}),Rs=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"}}),Vs=new F({}),Xs=new C({props:{name:"class diffusers.StableDiffusionControlNetInpaintPipeline",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"controlnet",val:": typing.Union[diffusers.models.controlnet.ControlNetModel, typing.List[diffusers.models.controlnet.ControlNetModel], typing.Tuple[diffusers.models.controlnet.ControlNetModel], diffusers.pipelines.controlnet.multicontrolnet.MultiControlNetModel]"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/main/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code>) &#x2014;
Provides additional conditioning to the unet during the denoising process. If you set multiple ControlNets
as a list, the outputs from each ControlNet are added together to create one combined additional
conditioning.`,name:"controlnet"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L225"}}),eo=new Jl({props:{$$slots:{default:[XZ]},$$scope:{ctx:j}}}),Qs=new C({props:{name:"__call__",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[torch.Tensor, PIL.Image.Image] = None"},{name:"mask_image",val:": typing.Union[torch.Tensor, PIL.Image.Image] = None"},{name:"control_image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, numpy.ndarray, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image], typing.List[numpy.ndarray]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"strength",val:": float = 1.0"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 0.5"},{name:"guess_mode",val:": bool = False"},{name:"control_guidance_start",val:": typing.Union[float, typing.List[float]] = 0.0"},{name:"control_guidance_end",val:": typing.Union[float, typing.List[float]] = 1.0"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, or <code>List[List[PIL.Image.Image]]</code>):
The ControlNet input condition. ControlNet uses this input condition to generate guidance to Unet. If
the type is specified as <code>Torch.FloatTensor</code>, it is passed to ControlNet as is. <code>PIL.Image.Image</code> can
also be accepted as an image. The dimensions of the output image defaults to <code>image</code>&#x2019;s dimensions. If
height and/or width are passed, <code>image</code> is resized according to them. If multiple ControlNets are
specified in init, images must be passed as a list such that each element of the list can be correctly
batched for input to a single controlnet.`,name:"image"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 1.) &#x2014;
Conceptually, indicates how much to transform the masked portion of the reference <code>image</code>. Must be
between 0 and 1. <code>image</code> will be used as a starting point, adding more noise to it the larger the
<code>strength</code>. The number of denoising steps depends on the amount of noise initially added. When
<code>strength</code> is 1, added noise will be maximum and the denoising process will run for the full number of
iterations specified in <code>num_inference_steps</code>. A value of 1, therefore, essentially ignores the masked
portion of the reference <code>image</code>.`,name:"strength"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/upscale#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#L948",returnDescription:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/upscale#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/upscale#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),to=new Y({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.example",$$slots:{default:[AZ]},$$scope:{ctx:j}}}),Ls=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#L1663"}}),no=new Jl({props:{warning:!0,$$slots:{default:[YZ]},$$scope:{ctx:j}}}),oo=new Y({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_attention_slicing.example",$$slots:{default:[QZ]},$$scope:{ctx:j}}}),zs=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#L1703"}}),qs=new C({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L325"}}),Os=new C({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L333"}}),el=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#L1602"}}),io=new Jl({props:{warning:!0,$$slots:{default:[LZ]},$$scope:{ctx:j}}}),ro=new Y({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[zZ]},$$scope:{ctx:j}}}),ol=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#L1637"}}),ll=new C({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.List[str], typing.Dict[str, torch.Tensor], typing.List[typing.Dict[str, torch.Tensor]]]"},{name:"token",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L632"}}),po=new Y({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.example",$$slots:{default:[HZ]},$$scope:{ctx:j}}}),mo=new Y({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.example-2",$$slots:{default:[qZ]},$$scope:{ctx:j}}}),dl=new C({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L350"}}),ml=new C({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L357"}}),fl=new C({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L341"}}),ul=new F({}),hl=new C({props:{name:"class diffusers.FlaxStableDiffusionControlNetPipeline",anchor:"diffusers.FlaxStableDiffusionControlNetPipeline",parameters:[{name:"vae",val:": FlaxAutoencoderKL"},{name:"text_encoder",val:": FlaxCLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": FlaxUNet2DConditionModel"},{name:"controlnet",val:": FlaxControlNetModel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim_flax.FlaxDDIMScheduler, diffusers.schedulers.scheduling_pndm_flax.FlaxPNDMScheduler, diffusers.schedulers.scheduling_lms_discrete_flax.FlaxLMSDiscreteScheduler, diffusers.schedulers.scheduling_dpmsolver_multistep_flax.FlaxDPMSolverMultistepScheduler]"},{name:"safety_checker",val:": FlaxStableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPFeatureExtractor"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"}],parametersDescription:[{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.FlaxAutoencoderKL">FlaxAutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>FlaxCLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.FlaxCLIPTextModel" rel="nofollow">CLIP</a>,
specifically the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.FlaxUNet2DConditionModel">FlaxUNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/main/en/api/models/controlnet#diffusers.FlaxControlNetModel">FlaxControlNetModel</a> &#x2014;
Provides additional conditioning to the unet during the denoising process.`,name:"controlnet"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<code>FlaxDDIMScheduler</code>, <code>FlaxLMSDiscreteScheduler</code>, <code>FlaxPNDMScheduler</code>, or
<code>FlaxDPMSolverMultistepScheduler</code>.`,name:"scheduler"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>FlaxStableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPFeatureExtractor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py#L119"}}),_l=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/text2img#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput">FlaxStableDiffusionPipelineOutput</a> instead of
a plain tuple.`,name:"return_dict"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.jit",description:`<strong>jit</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to run <code>pmap</code> versions of the generation and safety scoring functions. NOTE: This argument
exists because <code>__call__</code> is not yet end-to-end pmap-able. It will be removed in a future release.`,name:"jit"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py#L357",returnDescription:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/text2img#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/text2img#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"
>FlaxStableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),_o=new Y({props:{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.example",$$slots:{default:[OZ]},$$scope:{ctx:j}}}),{c(){f=o("meta"),U=c(),_=o("h1"),h=o("a"),J=o("span"),b(p.$$.fragment),g=c(),P=o("span"),Ue=i("ControlNet"),jt=c(),Ie=o("p"),z=o("a"),L=i("Adding Conditional Control to Text-to-Image Diffusion Models"),Ul=i(" by Lvmin Zhang and Maneesh Agrawala."),Wo=c(),rt=o("p"),mg=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."),bf=c(),Il=o("p"),fg=i("The abstract from the paper is:"),yf=c(),jl=o("p"),oc=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."),vf=c(),Et=o("p"),hg=i("This model was contributed by "),Go=o("a"),gg=i("takuma104"),_g=i(". \u2764\uFE0F"),wf=c(),Ct=o("p"),bg=i("The original codebase can be found at "),So=o("a"),yg=i("lllyasviel/ControlNet"),vg=i("."),Mf=c(),ct=o("h2"),Zt=o("a"),ac=o("span"),b(Do.$$.fragment),wg=c(),sc=o("span"),Mg=i("Usage example"),Tf=c(),$t=o("p"),Tg=i("In the following we give a simple example of how to use a "),lc=o("em"),Jg=i("ControlNet"),Ug=i(` checkpoint with Diffusers for inference.
The inference pipeline is the same for all pipelines:`),Jf=c(),Nt=o("ul"),ic=o("li"),rc=o("ol"),cc=o("li"),Ig=i("Take an image and run it through a pre-conditioning processor."),jg=c(),dc=o("li"),El=o("ol"),Bo=o("li"),Eg=i("Run the pre-processed image through the "),Cl=o("a"),Cg=i("StableDiffusionControlNetPipeline"),Zg=i("."),Uf=c(),xt=o("p"),$g=i("Let\u2019s have a look at a simple example using the "),Po=o("a"),Ng=i("Canny Edge ControlNet"),xg=i("."),If=c(),b(Fo.$$.fragment),jf=c(),Zl=o("p"),$l=o("img"),Ef=c(),Ge=o("p"),kg=i("Next, we process the image to get the canny image. This is step "),pc=o("em"),Wg=i("1."),Gg=i(" - running the pre-conditioning processor. The pre-conditioning processor is different for every ControlNet. Please see the model cards of the "),Nl=o("a"),Sg=i("official checkpoints"),Dg=i(" for more information about other models."),Cf=c(),xl=o("p"),Bg=i("First, we need to install opencv:"),Zf=c(),b(Ro.$$.fragment),$f=c(),kl=o("p"),Pg=i("Next, let\u2019s also install all required Hugging Face libraries:"),Nf=c(),b(Vo.$$.fragment),xf=c(),Wl=o("p"),Fg=i("Then we can retrieve the canny edges of the image."),kf=c(),b(Xo.$$.fragment),Wf=c(),Gl=o("p"),Rg=i("Let\u2019s take a look at the processed image."),Gf=c(),Sl=o("p"),Dl=o("img"),Sf=c(),kt=o("p"),Vg=i("Now, we load the official "),Bl=o("a"),Xg=i("Stable Diffusion 1.5 Model"),Ag=i(" as well as the ControlNet for canny edges."),Df=c(),b(Ao.$$.fragment),Bf=c(),Wt=o("p"),Yg=i("To speed-up things and reduce memory, let\u2019s enable model offloading and use the fast "),Pl=o("a"),Qg=i("UniPCMultistepScheduler"),Lg=i("."),Pf=c(),b(Yo.$$.fragment),Ff=c(),Fl=o("p"),zg=i("Finally, we can run the pipeline:"),Rf=c(),b(Qo.$$.fragment),Vf=c(),Rl=o("p"),Hg=i("This should take only around 3-4 seconds on GPU (depending on hardware). The output image then looks as follows:"),Xf=c(),Vl=o("p"),Xl=o("img"),Af=c(),dt=o("p"),mc=o("strong"),qg=i("Note"),Og=i(": To see how to run all other ControlNet checkpoints, please have a look at "),Al=o("a"),Kg=i("ControlNet with Stable Diffusion 1.5"),e_=i("."),Yf=c(),pt=o("h2"),Gt=o("a"),fc=o("span"),b(Lo.$$.fragment),t_=c(),uc=o("span"),n_=i("Combining multiple conditionings"),Qf=c(),St=o("p"),o_=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 "),hc=o("code"),a_=i("__call__"),s_=i("."),Lf=c(),Yl=o("p"),l_=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."),zf=c(),Dt=o("p"),i_=i("It can also be helpful to vary the "),gc=o("code"),r_=i("controlnet_conditioning_scales"),c_=i(" to emphasize one conditioning over the other."),Hf=c(),mt=o("h3"),Bt=o("a"),_c=o("span"),b(zo.$$.fragment),d_=c(),bc=o("span"),p_=i("Canny conditioning"),qf=c(),Ql=o("p"),m_=i("The original image:"),Of=c(),Ll=o("img"),Kf=c(),zl=o("p"),f_=i("Prepare the conditioning:"),eu=c(),b(Ho.$$.fragment),tu=c(),Hl=o("img"),nu=c(),ft=o("h3"),Pt=o("a"),yc=o("span"),b(qo.$$.fragment),u_=c(),vc=o("span"),h_=i("Openpose conditioning"),ou=c(),ql=o("p"),g_=i("The original image:"),au=c(),Oo=o("img"),su=c(),Ol=o("p"),__=i("Prepare the conditioning:"),lu=c(),b(Ko.$$.fragment),iu=c(),ea=o("img"),ru=c(),ut=o("h3"),Ft=o("a"),wc=o("span"),b(ta.$$.fragment),b_=c(),Mc=o("span"),y_=i("Running ControlNet with multiple conditionings"),cu=c(),b(na.$$.fragment),du=c(),oa=o("img"),pu=c(),ht=o("h3"),Rt=o("a"),Tc=o("span"),b(aa.$$.fragment),v_=c(),Jc=o("span"),w_=i("Guess Mode"),mu=c(),Se=o("p"),M_=i("Guess Mode is "),sa=o("a"),T_=i("a ControlNet feature that was implemented"),J_=i(" after the publication of "),la=o("a"),U_=i("the paper"),I_=i(". The description states:"),fu=c(),Kl=o("blockquote"),Uc=o("p"),j_=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."),uu=c(),gt=o("h4"),Vt=o("a"),Ic=o("span"),b(ia.$$.fragment),E_=c(),jc=o("span"),C_=i("The core implementation:"),hu=c(),De=o("p"),Z_=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 "),Ec=o("code"),$_=i("0.1"),N_=i(". As the blocks get deeper, the scale increases exponentially, and the scale for the output of the MidBlock becomes "),Cc=o("code"),x_=i("1.0"),k_=i("."),gu=c(),Xt=o("p"),W_=i("Since the core implementation is just this, "),Zc=o("strong"),G_=i("it does not have any impact on prompt conditioning"),S_=i(". While it is common to use it without specifying any prompts, it is also possible to provide prompts if desired."),_u=c(),_t=o("h4"),At=o("a"),$c=o("span"),b(ra.$$.fragment),D_=c(),Nc=o("span"),B_=i("Usage:"),bu=c(),he=o("p"),P_=i("Just specify "),xc=o("code"),F_=i("guess_mode=True"),R_=i(" in the pipe() function. A "),kc=o("code"),V_=i("guidance_scale"),X_=i(" between 3.0 and 5.0 is "),ca=o("a"),A_=i("recommended"),Y_=i("."),yu=c(),b(da.$$.fragment),vu=c(),bt=o("h4"),Yt=o("a"),Wc=o("span"),b(pa.$$.fragment),Q_=c(),Gc=o("span"),L_=i("Output image comparison:"),wu=i(`

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

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