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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># generate image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generator = torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;futuristic-looking woman&quot;</span>, num_inference_steps=<span class="hljs-number">20</span>, generator=generator, image=canny_image
<span class="hljs-meta">... </span>).images[<span class="hljs-number">0</span>]`}}),{c(){f=o("p"),I=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),v(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function NC(E){let f,I,_,h,J;return{c(){f=o("p"),I=i("\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),_=o("code"),h=i("scaled_dot_product_attention"),J=i(` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),_=a(g,"CODE",{});var P=s(_);h=r(P,"scaled_dot_product_attention"),P.forEach(t),J=r(g,` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`),g.forEach(t)},m(p,g){u(p,f,g),e(f,I),e(f,_),e(_,h),e(f,J)},d(p){p&&t(f)}}}function $C(E){let f,I,_,h,J;return h=new S({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUyQyUwQSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIwb24lMjBtYXJzJTIyJTBBcGlwZS5lbmFibGVfYXR0ZW50aW9uX3NsaWNpbmcoKSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_attention_slicing()
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`}}),{c(){f=o("p"),I=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),v(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function xC(E){let f,I;return{c(){f=o("p"),I=i(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(_){f=a(_,"P",{});var h=s(f);I=r(h,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),h.forEach(t)},m(_,h){u(_,f,h),e(f,I)},d(_){_&&t(f)}}}function kC(E){let f,I,_,h,J;return h=new S({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIweGZvcm1lcnMub3BzJTIwaW1wb3J0JTIwTWVtb3J5RWZmaWNpZW50QXR0ZW50aW9uRmxhc2hBdHRlbnRpb25PcCUwQSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKGF0dGVudGlvbl9vcCUzRE1lbW9yeUVmZmljaWVudEF0dGVudGlvbkZsYXNoQXR0ZW50aW9uT3ApJTBBJTIzJTIwV29ya2Fyb3VuZCUyMGZvciUyMG5vdCUyMGFjY2VwdGluZyUyMGF0dGVudGlvbiUyMHNoYXBlJTIwdXNpbmclMjBWQUUlMjBmb3IlMjBGbGFzaCUyMEF0dGVudGlvbiUwQXBpcGUudmFlLmVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbihhdHRlbnRpb25fb3AlM0ROb25lKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># generate image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generator = torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;futuristic-looking woman&quot;</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">20</span>,
<span class="hljs-meta">... </span>    generator=generator,
<span class="hljs-meta">... </span>    image=image,
<span class="hljs-meta">... </span>    control_image=canny_image,
<span class="hljs-meta">... </span>).images[<span class="hljs-number">0</span>]`}}),{c(){f=o("p"),I=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),v(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function SC(E){let f,I,_,h,J;return{c(){f=o("p"),I=i("\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),_=o("code"),h=i("scaled_dot_product_attention"),J=i(` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),_=a(g,"CODE",{});var P=s(_);h=r(P,"scaled_dot_product_attention"),P.forEach(t),J=r(g,` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`),g.forEach(t)},m(p,g){u(p,f,g),e(f,I),e(f,_),e(_,h),e(f,J)},d(p){p&&t(f)}}}function BC(E){let f,I,_,h,J;return h=new S({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUyQyUwQSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIwb24lMjBtYXJzJTIyJTBBcGlwZS5lbmFibGVfYXR0ZW50aW9uX3NsaWNpbmcoKSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_attention_slicing()
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`}}),{c(){f=o("p"),I=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),v(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function PC(E){let f,I;return{c(){f=o("p"),I=i(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(_){f=a(_,"P",{});var h=s(f);I=r(h,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),h.forEach(t)},m(_,h){u(_,f,h),e(f,I)},d(_){_&&t(f)}}}function FC(E){let f,I,_,h,J;return h=new S({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIweGZvcm1lcnMub3BzJTIwaW1wb3J0JTIwTWVtb3J5RWZmaWNpZW50QXR0ZW50aW9uRmxhc2hBdHRlbnRpb25PcCUwQSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKGF0dGVudGlvbl9vcCUzRE1lbW9yeUVmZmljaWVudEF0dGVudGlvbkZsYXNoQXR0ZW50aW9uT3ApJTBBJTIzJTIwV29ya2Fyb3VuZCUyMGZvciUyMG5vdCUyMGFjY2VwdGluZyUyMGF0dGVudGlvbiUyMHNoYXBlJTIwdXNpbmclMjBWQUUlMjBmb3IlMjBGbGFzaCUyMEF0dGVudGlvbiUwQXBpcGUudmFlLmVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbihhdHRlbnRpb25fb3AlM0ROb25lKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

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

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

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

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

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

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

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

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

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

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

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

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


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

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


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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># generate image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;a handsome man with ray-ban sunglasses&quot;</span>,
<span class="hljs-meta">... </span>    num_inference_steps=<span class="hljs-number">20</span>,
<span class="hljs-meta">... </span>    generator=generator,
<span class="hljs-meta">... </span>    eta=<span class="hljs-number">1.0</span>,
<span class="hljs-meta">... </span>    image=init_image,
<span class="hljs-meta">... </span>    mask_image=mask_image,
<span class="hljs-meta">... </span>    control_image=control_image,
<span class="hljs-meta">... </span>).images[<span class="hljs-number">0</span>]`}}),{c(){f=o("p"),I=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),v(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function YC(E){let f,I,_,h,J;return{c(){f=o("p"),I=i("\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),_=o("code"),h=i("scaled_dot_product_attention"),J=i(` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),_=a(g,"CODE",{});var P=s(_);h=r(P,"scaled_dot_product_attention"),P.forEach(t),J=r(g,` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`),g.forEach(t)},m(p,g){u(p,f,g),e(f,I),e(f,_),e(_,h),e(f,J)},d(p){p&&t(f)}}}function LC(E){let f,I,_,h,J;return h=new S({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUyQyUwQSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIwb24lMjBtYXJzJTIyJTBBcGlwZS5lbmFibGVfYXR0ZW50aW9uX3NsaWNpbmcoKSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_attention_slicing()
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`}}),{c(){f=o("p"),I=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),v(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function QC(E){let f,I;return{c(){f=o("p"),I=i(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(_){f=a(_,"P",{});var h=s(f);I=r(h,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),h.forEach(t)},m(_,h){u(_,f,h),e(f,I)},d(_){_&&t(f)}}}function zC(E){let f,I,_,h,J;return h=new S({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIweGZvcm1lcnMub3BzJTIwaW1wb3J0JTIwTWVtb3J5RWZmaWNpZW50QXR0ZW50aW9uRmxhc2hBdHRlbnRpb25PcCUwQSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKGF0dGVudGlvbl9vcCUzRE1lbW9yeUVmZmljaWVudEF0dGVudGlvbkZsYXNoQXR0ZW50aW9uT3ApJTBBJTIzJTIwV29ya2Fyb3VuZCUyMGZvciUyMG5vdCUyMGFjY2VwdGluZyUyMGF0dGVudGlvbiUyMHNoYXBlJTIwdXNpbmclMjBWQUUlMjBmb3IlMjBGbGFzaCUyMEF0dGVudGlvbiUwQXBpcGUudmFlLmVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbihhdHRlbnRpb25fb3AlM0ROb25lKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

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

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

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

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

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

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

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

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

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


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


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

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>output_images = pipe.numpy_to_pil(np.asarray(output.reshape((num_samples,) + output.shape[-<span class="hljs-number">3</span>:])))
<span class="hljs-meta">&gt;&gt;&gt; </span>output_images = make_image_grid(output_images, num_samples // <span class="hljs-number">4</span>, <span class="hljs-number">4</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>output_images.save(<span class="hljs-string">&quot;generated_image.png&quot;</span>)`}}),{c(){f=o("p"),I=i("Examples:"),_=c(),b(h.$$.fragment)},l(p){f=a(p,"P",{});var g=s(f);I=r(g,"Examples:"),g.forEach(t),_=d(p),y(h.$$.fragment,p)},m(p,g){u(p,f,g),e(f,I),u(p,_,g),v(h,p,g),J=!0},p:L,i(p){J||(w(h.$$.fragment,p),J=!0)},o(p){M(h.$$.fragment,p),J=!1},d(p){p&&t(f),p&&t(_),T(h,p)}}}function KC(E){let f,I,_,h,J,p,g,P,Ie,Et,Ue,z,Q,Il,Wo,rt,mg,bf,Ul,fg,yf,El,oc,ug,vf,jt,hg,Go,gg,_g,wf,Zt,bg,Do,yg,vg,Mf,ct,Ct,ac,So,wg,sc,Mg,Tf,Nt,Tg,lc,Jg,Ig,Jf,$t,ic,rc,cc,Ug,Eg,dc,jl,Bo,jg,Zl,Zg,Cg,If,xt,Ng,Po,$g,xg,Uf,Fo,Ef,Cl,Nl,bJ,jf,Ge,kg,pc,Wg,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bm,B0,P0,Pm,F0,R0,V0,ho,fl,X0,Fm,A0,Gu,Ut,go,Rm,ul,Y0,Vm,L0,Du,ue,hl,Q0,Xm,z0,H0,gl,q0,Lr,O0,K0,eJ,Ve,_l,tJ,Am,nJ,oJ,_o,Su;return p=new F({}),So=new F({}),Fo=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZSUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBJTBBJTIzJTIwTGV0J3MlMjBsb2FkJTIwdGhlJTIwcG9wdWxhciUyMHZlcm1lZXIlMjBpbWFnZSUwQWltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmhmLmNvJTJGZGF0YXNldHMlMkZodWdnaW5nZmFjZSUyRmRvY3VtZW50YXRpb24taW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZkaWZmdXNlcnMlMkZpbnB1dF9pbWFnZV92ZXJtZWVyLnBuZyUyMiUwQSk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

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

image = np.array(image)

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

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

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

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

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

out_image = pipe(
    <span class="hljs-string">&quot;disco dancer with colorful lights&quot;</span>, num_inference_steps=<span class="hljs-number">20</span>, generator=generator, image=canny_image
).images[<span class="hljs-number">0</span>]`}}),Qo=new F({}),zo=new F({}),Ho=new S({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjBjdjIlMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQSUwQWNhbm55X2ltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZ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Q==",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 S({props:{code:"ZnJvbSUyMGNvbnRyb2xuZXRfYXV4JTIwaW1wb3J0JTIwT3BlbnBvc2VEZXRlY3RvciUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBJTBBb3BlbnBvc2UlMjAlM0QlMjBPcGVucG9zZURldGVjdG9yLmZyb21fcHJldHJhaW5lZCglMjJsbGx5YXN2aWVsJTJGQ29udHJvbE5ldCUyMiklMEElMEFvcGVucG9zZV9pbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGaHVnZ2luZ2ZhY2UlMkZkb2N1bWVudGF0aW9uLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGZGlmZnVzZXJzJTJGcGVyc29uLnBuZyUyMiUwQSklMEFvcGVucG9zZV9pbWFnZSUyMCUzRCUyMG9wZW5wb3NlKG9wZW5wb3NlX2ltYWdlKQ==",highlighted:`<span class="hljs-keyword">from</span> controlnet_aux <span class="hljs-keyword">import</span> OpenposeDetector
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

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

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

controlnet = ControlNetModel.from_pretrained(<span class="hljs-string">&quot;lllyasviel/sd-controlnet-canny&quot;</span>)
pipe = StableDiffusionControlNetPipeline.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, controlnet=controlnet).to(
    <span class="hljs-string">&quot;cuda&quot;</span>
)
image = pipe(<span class="hljs-string">&quot;&quot;</span>, image=canny_image, guess_mode=<span class="hljs-literal">True</span>, guidance_scale=<span class="hljs-number">3.0</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;guess_mode_generated.png&quot;</span>)`}}),pa=new F({}),ua=new F({}),ga=new F({}),$a=new F({}),La=new F({}),Qa=new Z({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 Z({props:{name:"__call__",anchor:"diffusers.StableDiffusionControlNetPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 1.0"},{name:"guess_mode",val:": bool = False"},{name:"control_guidance_start",val:": typing.Union[float, typing.List[float]] = 0.0"},{name:"control_guidance_end",val:": typing.Union[float, typing.List[float]] = 1.0"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, <code>List[List[np.ndarray]]</code> or <code>List[List[PIL.Image.Image]]</code>):
The ControlNet input condition. ControlNet uses this input condition to generate guidance to Unet. If
the type is specified as <code>Torch.FloatTensor</code>, it is passed to ControlNet as is. <code>PIL.Image.Image</code> can
also be accepted as an image. The dimensions of the output image defaults to <code>image</code>&#x2019;s dimensions. If
height and/or width are passed, <code>image</code> is resized according to them. If multiple ControlNets are
specified in init, images must be passed as a list such that each element of the list can be correctly
batched for input to a single controlnet.`,name:"image"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet. If multiple ControlNets are specified in init, you can set the
corresponding scale as a list.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.guess_mode",description:`<strong>guess_mode</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
In this mode, the ControlNet encoder will try best to recognize the content of the input image even if
you remove all prompts. The <code>guidance_scale</code> between 3.0 and 5.0 is recommended.`,name:"guess_mode"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.control_guidance_start",description:`<strong>control_guidance_start</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The percentage of total steps at which the controlnet starts applying.`,name:"control_guidance_start"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.control_guidance_end",description:`<strong>control_guidance_end</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The percentage of total steps at which the controlnet stops applying.`,name:"control_guidance_end"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L676",returnDescription:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Jn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.example",$$slots:{default:[CC]},$$scope:{ctx:E}}}),Oa=new Z({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1694"}}),In=new Jl({props:{warning:!0,$$slots:{default:[NC]},$$scope:{ctx:E}}}),Un=new Y({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_attention_slicing.example",$$slots:{default:[$C]},$$scope:{ctx:E}}}),Ka=new Z({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1734"}}),ts=new Z({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 Z({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 Z({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1633"}}),Cn=new Jl({props:{warning:!0,$$slots:{default:[xC]},$$scope:{ctx:E}}}),Nn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[kC]},$$scope:{ctx:E}}}),is=new Z({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1668"}}),ds=new Z({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.List[str], typing.Dict[str, torch.Tensor], typing.List[typing.Dict[str, torch.Tensor]]]"},{name:"token",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L591"}}),xn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.example",$$slots:{default:[WC]},$$scope:{ctx:E}}}),kn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.example-2",$$slots:{default:[GC]},$$scope:{ctx:E}}}),us=new Z({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 Z({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 Z({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 Z({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 Z({props:{name:"__call__",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"control_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"strength",val:": float = 0.8"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 0.8"},{name:"guess_mode",val:": bool = False"},{name:"control_guidance_start",val:": typing.Union[float, typing.List[float]] = 0.0"},{name:"control_guidance_end",val:": typing.Union[float, typing.List[float]] = 1.0"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, <code>List[List[np.ndarray]]</code> or <code>List[List[PIL.Image.Image]]</code>):
The initial image will be used as the starting point for the image generation process. Can also accept
image latents as <code>image</code>, if passing latents directly, it will not be encoded again.`,name:"image"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.control_image",description:`<strong>control_image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, <code>List[List[np.ndarray]]</code> or <code>List[List[PIL.Image.Image]]</code>):
The ControlNet input condition. ControlNet uses this input condition to generate guidance to Unet. If
the type is specified as <code>Torch.FloatTensor</code>, it is passed to ControlNet as is. <code>PIL.Image.Image</code> can
also be accepted as an image. The dimensions of the output image defaults to <code>image</code>&#x2019;s dimensions. If
height and/or width are passed, <code>image</code> is resized according to them. If multiple ControlNets are
specified in init, images must be passed as a list such that each element of the list can be correctly
batched for input to a single controlnet.`,name:"control_image"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet. If multiple ControlNets are specified in init, you can set the
corresponding scale as a list. Note that by default, we use a smaller conditioning scale for inpainting
than for <a href="/docs/diffusers/main/en/api/pipelines/controlnet#diffusers.StableDiffusionControlNetPipeline.__call__"><strong>call</strong>()</a>.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.guess_mode",description:`<strong>guess_mode</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
In this mode, the ControlNet encoder will try best to recognize the content of the input image even if
you remove all prompts. The <code>guidance_scale</code> between 3.0 and 5.0 is recommended.`,name:"guess_mode"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.control_guidance_start",description:`<strong>control_guidance_start</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The percentage of total steps at which the controlnet starts applying.`,name:"control_guidance_start"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.control_guidance_end",description:`<strong>control_guidance_end</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The percentage of total steps at which the controlnet stops applying.`,name:"control_guidance_end"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L748",returnDescription:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Bn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.example",$$slots:{default:[DC]},$$scope:{ctx:E}}}),Ts=new Z({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1694"}}),Pn=new Jl({props:{warning:!0,$$slots:{default:[SC]},$$scope:{ctx:E}}}),Fn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_attention_slicing.example",$$slots:{default:[BC]},$$scope:{ctx:E}}}),Js=new Z({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1734"}}),Us=new Z({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"}}),Es=new Z({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"}}),Zs=new Z({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1633"}}),An=new Jl({props:{warning:!0,$$slots:{default:[PC]},$$scope:{ctx:E}}}),Yn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[FC]},$$scope:{ctx:E}}}),$s=new Z({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1668"}}),Ws=new Z({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.List[str], typing.Dict[str, torch.Tensor], typing.List[typing.Dict[str, torch.Tensor]]]"},{name:"token",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L591"}}),Qn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.example",$$slots:{default:[RC]},$$scope:{ctx:E}}}),zn=new Y({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.example-2",$$slots:{default:[VC]},$$scope:{ctx:E}}}),Bs=new Z({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 Z({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 Z({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 Z({props:{name:"class diffusers.StableDiffusionControlNetInpaintPipeline",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"controlnet",val:": typing.Union[diffusers.models.controlnet.ControlNetModel, typing.List[diffusers.models.controlnet.ControlNetModel], typing.Tuple[diffusers.models.controlnet.ControlNetModel], diffusers.pipelines.controlnet.multicontrolnet.MultiControlNetModel]"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/main/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code>) &#x2014;
Provides additional conditioning to the unet during the denoising process. If you set multiple ControlNets
as a list, the outputs from each ControlNet are added together to create one combined additional
conditioning.`,name:"controlnet"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L231"}}),eo=new Jl({props:{$$slots:{default:[XC]},$$scope:{ctx:E}}}),Ls=new Z({props:{name:"__call__",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"mask_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"control_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"strength",val:": float = 1.0"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 0.5"},{name:"guess_mode",val:": bool = False"},{name:"control_guidance_start",val:": typing.Union[float, typing.List[float]] = 0.0"},{name:"control_guidance_end",val:": typing.Union[float, typing.List[float]] = 1.0"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, &#x2014;
<code>List[PIL.Image.Image]</code>, or <code>List[np.ndarray]</code>):
<code>Image</code>, numpy array or tensor representing an image batch to be inpainted (which parts of the image to
be masked out with <code>mask_image</code> and repainted according to <code>prompt</code>). For both numpy array and pytorch
tensor, the expected value range is between <code>[0, 1]</code> If it&#x2019;s a tensor or a list or tensors, the
expected shape should be <code>(B, C, H, W)</code> or <code>(C, H, W)</code>. If it is a numpy array or a list of arrays, the
expected shape should be <code>(B, H, W, C)</code> or <code>(H, W, C)</code> It can also accept image latents as <code>image</code>, but
if passing latents directly it is not encoded again.`,name:"image"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.mask_image",description:`<strong>mask_image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, &#x2014;
<code>List[PIL.Image.Image]</code>, or <code>List[np.ndarray]</code>):
<code>Image</code>, numpy array or tensor representing an image batch to mask <code>image</code>. White pixels in the mask
are repainted while black pixels are preserved. If <code>mask_image</code> is a PIL image, it is converted to a
single channel (luminance) before use. If it&#x2019;s a numpy array or pytorch tensor, it should contain one
color channel (L) instead of 3, so the expected shape for pytorch tensor would be <code>(B, 1, H, W)</code>, <code>(B, H, W)</code>, <code>(1, H, W)</code>, <code>(H, W)</code>. And for numpy array would be for <code>(B, H, W, 1)</code>, <code>(B, H, W)</code>, <code>(H, W, 1)</code>, or <code>(H, W)</code>.`,name:"mask_image"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.control_image",description:`<strong>control_image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, or <code>List[List[PIL.Image.Image]]</code>):
The ControlNet input condition. ControlNet uses this input condition to generate guidance to Unet. The
dimensions of the output image defaults to <code>image</code>&#x2019;s dimensions. If height and/or width are passed,
<code>image</code> is resized according to them. If multiple ControlNets are specified in init, images must be
passed as a list such that each element of the list can be correctly batched for input to a single
controlnet.`,name:"control_image"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 1.) &#x2014;
Conceptually, indicates how much to transform the masked portion of the reference <code>image</code>. Must be
between 0 and 1. <code>image</code> will be used as a starting point, adding more noise to it the larger the
<code>strength</code>. The number of denoising steps depends on the amount of noise initially added. When
<code>strength</code> is 1, added noise will be maximum and the denoising process will run for the full number of
iterations specified in <code>num_inference_steps</code>. A value of 1, therefore, essentially ignores the masked
portion of the reference <code>image</code>.`,name:"strength"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.5) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet. If multiple ControlNets are specified in init, you can set the
corresponding scale as a list. Note that by default, we use a smaller conditioning scale for inpainting
than for <a href="/docs/diffusers/main/en/api/pipelines/controlnet#diffusers.StableDiffusionControlNetPipeline.__call__"><strong>call</strong>()</a>.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.guess_mode",description:`<strong>guess_mode</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
In this mode, the ControlNet encoder will try best to recognize the content of the input image even if
you remove all prompts. The <code>guidance_scale</code> between 3.0 and 5.0 is recommended.`,name:"guess_mode"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.control_guidance_start",description:`<strong>control_guidance_start</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The percentage of total steps at which the controlnet starts applying.`,name:"control_guidance_start"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.control_guidance_end",description:`<strong>control_guidance_end</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The percentage of total steps at which the controlnet stops applying.`,name:"control_guidance_end"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L932",returnDescription:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),to=new Y({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.example",$$slots:{default:[AC]},$$scope:{ctx:E}}}),Qs=new Z({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1694"}}),no=new Jl({props:{warning:!0,$$slots:{default:[YC]},$$scope:{ctx:E}}}),oo=new Y({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_attention_slicing.example",$$slots:{default:[LC]},$$scope:{ctx:E}}}),zs=new Z({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1734"}}),qs=new Z({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L334"}}),Os=new Z({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L342"}}),el=new Z({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1633"}}),io=new Jl({props:{warning:!0,$$slots:{default:[QC]},$$scope:{ctx:E}}}),ro=new Y({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[zC]},$$scope:{ctx:E}}}),ol=new Z({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1668"}}),ll=new Z({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.List[str], typing.Dict[str, torch.Tensor], typing.List[typing.Dict[str, torch.Tensor]]]"},{name:"token",val:": typing.Union[typing.List[str], str, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/loaders.py#L591"}}),po=new Y({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.example",$$slots:{default:[HC]},$$scope:{ctx:E}}}),mo=new Y({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.example-2",$$slots:{default:[qC]},$$scope:{ctx:E}}}),dl=new Z({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L359"}}),ml=new Z({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L366"}}),fl=new Z({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L350"}}),ul=new F({}),hl=new Z({props:{name:"class diffusers.FlaxStableDiffusionControlNetPipeline",anchor:"diffusers.FlaxStableDiffusionControlNetPipeline",parameters:[{name:"vae",val:": FlaxAutoencoderKL"},{name:"text_encoder",val:": FlaxCLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": FlaxUNet2DConditionModel"},{name:"controlnet",val:": FlaxControlNetModel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim_flax.FlaxDDIMScheduler, diffusers.schedulers.scheduling_pndm_flax.FlaxPNDMScheduler, diffusers.schedulers.scheduling_lms_discrete_flax.FlaxLMSDiscreteScheduler, diffusers.schedulers.scheduling_dpmsolver_multistep_flax.FlaxDPMSolverMultistepScheduler]"},{name:"safety_checker",val:": FlaxStableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPFeatureExtractor"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"}],parametersDescription:[{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.FlaxAutoencoderKL">FlaxAutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>FlaxCLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.FlaxCLIPTextModel" rel="nofollow">CLIP</a>,
specifically the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.FlaxUNet2DConditionModel">FlaxUNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/main/en/api/models/controlnet#diffusers.FlaxControlNetModel">FlaxControlNetModel</a> &#x2014;
Provides additional conditioning to the unet during the denoising process.`,name:"controlnet"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<code>FlaxDDIMScheduler</code>, <code>FlaxLMSDiscreteScheduler</code>, <code>FlaxPNDMScheduler</code>, or
<code>FlaxDPMSolverMultistepScheduler</code>.`,name:"scheduler"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>FlaxStableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPFeatureExtractor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py#L111"}}),_l=new Z({props:{name:"__call__",anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__",parameters:[{name:"prompt_ids",val:": array"},{name:"image",val:": array"},{name:"params",val:": typing.Union[typing.Dict, flax.core.frozen_dict.FrozenDict]"},{name:"prng_seed",val:": PRNGKeyArray"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": typing.Union[float, array] = 7.5"},{name:"latents",val:": array = None"},{name:"neg_prompt_ids",val:": array = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, array] = 1.0"},{name:"return_dict",val:": bool = True"},{name:"jit",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.prompt_ids",description:`<strong>prompt_ids</strong> (<code>jnp.array</code>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt_ids"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.image",description:`<strong>image</strong> (<code>jnp.array</code>) &#x2014;
Array representing the ControlNet input condition. ControlNet use this input condition to generate
guidance to Unet.`,name:"image"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.params",description:"<strong>params</strong> (<code>Dict</code> or <code>FrozenDict</code>) &#x2014; Dictionary containing the model parameters/weights",name:"params"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.prng_seed",description:"<strong>prng_seed</strong> (<code>jax.random.KeyArray</code> or <code>jax.Array</code>) &#x2014; Array containing random number generator key",name:"prng_seed"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.latents",description:`<strong>latents</strong> (<code>jnp.array</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>jnp.array</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput">FlaxStableDiffusionPipelineOutput</a> instead of
a plain tuple.`,name:"return_dict"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.jit",description:`<strong>jit</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to run <code>pmap</code> versions of the generation and safety scoring functions. NOTE: This argument
exists because <code>__call__</code> is not yet end-to-end pmap-able. It will be removed in a future release.`,name:"jit"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py#L349",returnDescription:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"
>FlaxStableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a
<code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"
>FlaxStableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),_o=new Y({props:{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.example",$$slots:{default:[OC]},$$scope:{ctx:E}}}),{c(){f=o("meta"),I=c(),_=o("h1"),h=o("a"),J=o("span"),b(p.$$.fragment),g=c(),P=o("span"),Ie=i("ControlNet"),Et=c(),Ue=o("p"),z=o("a"),Q=i("Adding Conditional Control to Text-to-Image Diffusion Models"),Il=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(),Ul=o("p"),fg=i("The abstract from the paper is:"),yf=c(),El=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(),jt=o("p"),hg=i("This model was contributed by "),Go=o("a"),gg=i("takuma104"),_g=i(". \u2764\uFE0F"),wf=c(),Zt=o("p"),bg=i("The original codebase can be found at "),Do=o("a"),yg=i("lllyasviel/ControlNet"),vg=i("."),Mf=c(),ct=o("h2"),Ct=o("a"),ac=o("span"),b(So.$$.fragment),wg=c(),sc=o("span"),Mg=i("Usage example"),Tf=c(),Nt=o("p"),Tg=i("In the following we give a simple example of how to use a "),lc=o("em"),Jg=i("ControlNet"),Ig=i(` checkpoint with Diffusers for inference.
The inference pipeline is the same for all pipelines:`),Jf=c(),$t=o("ul"),ic=o("li"),rc=o("ol"),cc=o("li"),Ug=i("Take an image and run it through a pre-conditioning processor."),Eg=c(),dc=o("li"),jl=o("ol"),Bo=o("li"),jg=i("Run the pre-processed image through the "),Zl=o("a"),Zg=i("StableDiffusionControlNetPipeline"),Cg=i("."),If=c(),xt=o("p"),Ng=i("Let\u2019s have a look at a simple example using the "),Po=o("a"),$g=i("Canny Edge ControlNet"),xg=i("."),Uf=c(),b(Fo.$$.fragment),Ef=c(),Cl=o("p"),Nl=o("img"),jf=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 "),$l=o("a"),Dg=i("official checkpoints"),Sg=i(" for more information about other models."),Zf=c(),xl=o("p"),Bg=i("First, we need to install opencv:"),Cf=c(),b(Ro.$$.fragment),Nf=c(),kl=o("p"),Pg=i("Next, let\u2019s also install all required Hugging Face libraries:"),$f=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(),Dl=o("p"),Sl=o("img"),Df=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."),Sf=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"),Lg=i("UniPCMultistepScheduler"),Qg=i("."),Pf=c(),b(Yo.$$.fragment),Ff=c(),Fl=o("p"),zg=i("Finally, we can run the pipeline:"),Rf=c(),b(Lo.$$.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(Qo.$$.fragment),t_=c(),uc=o("span"),n_=i("Combining multiple conditionings"),Lf=c(),Dt=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("."),Qf=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(),St=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(),Ll=o("p"),m_=i("The original image:"),Of=c(),Ql=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(),De=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"),I_=i("the paper"),U_=i(". The description states:"),fu=c(),Kl=o("blockquote"),Ic=o("p"),E_=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"),Uc=o("span"),b(ia.$$.fragment),j_=c(),Ec=o("span"),Z_=i("The core implementation:"),hu=c(),Se=o("p"),C_=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 "),jc=o("code"),N_=i("0.1"),$_=i(". As the blocks get deeper, the scale increases exponentially, and the scale for the output of the MidBlock becomes "),Zc=o("code"),x_=i("1.0"),k_=i("."),gu=c(),Xt=o("p"),W_=i("Since the core implementation is just this, "),Cc=o("strong"),G_=i("it does not have any impact on prompt conditioning"),D_=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"),Nc=o("span"),b(ra.$$.fragment),S_=c(),$c=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),L_=c(),Gc=o("span"),Q_=i("Output image comparison:"),wu=i(`

Canny Control Example
`),Lt=o("table"),Dc=o("thead"),ma=o("tr"),Sc=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"),Qt=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("."),Iu=c(),vt=o("p"),Lc=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("."),Uu=c(),wt=o("h3"),Ht=o("a"),Qc=o("span"),b(ga.$$.fragment),ub=c(),zc=o("span"),hb=i("ControlNet v1.0"),Eu=c(),qt=o("table"),Hc=o("thead"),Ee=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"),je=o("tr"),Ot=o("td"),_a=o("a"),Jb=i("lllyasviel/sd-controlnet-canny"),Ib=o("br"),Ub=c(),td=o("em"),Eb=i("Trained with canny edge detection"),jb=c(),nd=o("td"),Zb=i("A monochrome image with white edges on a black background."),Cb=c(),od=o("td"),si=o("a"),Kt=o("img"),Nb=c(),ad=o("td"),li=o("a"),ii=o("img"),$b=c(),Ze=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"),Db=c(),ld=o("td"),Sb=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(),Ce=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"),Lb=i("A monochrome image with white soft edges on a black background."),Qb=c(),pd=o("td"),mi=o("a"),fi=o("img"),zb=c(),md=o("td"),ui=o("a"),hi=o("img"),Hb=c(),Ne=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(),$e=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(),Ia=o("td"),My=i("A "),Ua=o("a"),Ty=i("OpenPose bone"),Jy=i(" image."),Iy=c(),wd=o("td"),Ji=o("a"),Ii=o("img"),Uy=c(),Md=o("td"),Ui=o("a"),Ei=o("img"),Ey=c(),ke=o("tr"),sn=o("td"),Ea=o("a"),jy=i("lllyasviel/sd-controlnet-scribble"),Zy=o("br"),Cy=c(),Td=o("em"),Ny=i("Trained with human scribbles"),$y=c(),Jd=o("td"),xy=i("A hand-drawn monochrome image with white outlines on a black background."),ky=c(),Id=o("td"),ji=o("a"),Zi=o("img"),Wy=c(),Ud=o("td"),Ci=o("a"),Ni=o("img"),Gy=c(),We=o("tr"),ja=o("td"),Za=o("a"),Dy=i("lllyasviel/sd-controlnet-seg"),Sy=o("br"),Ed=o("em"),By=i("Trained with semantic segmentation"),Py=c(),Ca=o("td"),Fy=i("An "),Na=o("a"),Ry=i("ADE20K"),Vy=i("\u2019s segmentation protocol image."),Xy=c(),jd=o("td"),$i=o("a"),xi=o("img"),Ay=c(),Zd=o("td"),ki=o("a"),Wi=o("img"),ju=c(),Mt=o("h3"),ln=o("a"),Cd=o("span"),b($a.$$.fragment),Yy=c(),Nd=o("span"),Ly=i("ControlNet v1.1"),Zu=c(),rn=o("table"),$d=o("thead"),H=o("tr"),xd=o("th"),Qy=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(),Dd=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(),Sd=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"),Di=o("a"),cn=o("img"),pv=c(),Rd=o("td"),Si=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(),Ld=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(),Qd=o("td"),Iv=i("Trained with image inpainting"),Uv=c(),zd=o("td"),Ev=i("No condition."),jv=c(),Hd=o("td"),Ai=o("a"),pn=o("img"),Zv=c(),qd=o("td"),Yi=o("a"),Li=o("img"),Cv=c(),ee=o("tr"),Qi=o("td"),Ga=o("a"),Nv=i("lllyasviel/control_v11p_sd15_mlsd"),$v=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."),Dv=c(),ep=o("td"),zi=o("a"),mn=o("img"),Sv=c(),tp=o("td"),Hi=o("a"),qi=o("img"),Bv=c(),te=o("tr"),Oi=o("td"),Da=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"),Lv=c(),sp=o("td"),er=o("a"),tr=o("img"),Qv=c(),ne=o("tr"),nr=o("td"),Sa=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"),I1=i("Trained with anime line art generation"),U1=c(),yp=o("td"),E1=i("An image with anime-style line art."),j1=c(),vp=o("td"),hr=o("a"),_n=o("img"),Z1=c(),wp=o("td"),gr=o("a"),_r=o("img"),C1=c(),le=o("tr"),br=o("td"),Ra=o("a"),N1=i("lllyasviel/control_v11p_sd15_openpose"),$1=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."),D1=c(),Jp=o("td"),yr=o("a"),bn=o("img"),S1=c(),Ip=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(),Up=o("td"),V1=i("Trained with scribble-based image generation"),X1=c(),Ep=o("td"),A1=i("An image with scribbles, usually random or user-drawn strokes."),Y1=c(),jp=o("td"),Tr=o("a"),yn=o("img"),L1=c(),Zp=o("td"),Jr=o("a"),Ir=o("img"),Q1=c(),re=o("tr"),Ur=o("td"),Xa=o("a"),z1=i("lllyasviel/control_v11p_sd15_softedge"),H1=o("br"),q1=c(),Cp=o("td"),O1=i("Trained with soft edge image generation"),K1=c(),Np=o("td"),ew=i("An image with soft edges, usually to create a more painterly or artistic effect."),tw=c(),$p=o("td"),Er=o("a"),vn=o("img"),nw=c(),xp=o("td"),jr=o("a"),Zr=o("img"),ow=c(),ce=o("tr"),Cr=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"),Nr=o("a"),wn=o("img"),pw=c(),Dp=o("td"),$r=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(),Sp=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"),Dr=o("img"),Cu=c(),Tt=o("h2"),Tn=o("a"),Rp=o("span"),b(La.$$.fragment),ww=c(),Vp=o("span"),Mw=i("StableDiffusionControlNetPipeline"),Nu=c(),C=o("div"),b(Qa.$$.fragment),Tw=c(),Xp=o("p"),Jw=i("Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),Iw=c(),za=o("p"),Uw=i("This model inherits from "),Sr=o("a"),Ew=i("DiffusionPipeline"),jw=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.)`),Zw=c(),Ap=o("p"),Cw=i("In addition the pipeline inherits the following loading methods:"),Nw=c(),Yp=o("ul"),Ha=o("li"),Lp=o("em"),$w=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(),Qp=o("p"),Dw=i("Function invoked when calling the pipeline for generation."),Sw=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(In.$$.fragment),Vw=c(),b(Un.$$.fragment),Xw=c(),En=o("div"),b(Ka.$$.fragment),Aw=c(),es=o("p"),Yw=i("Disable sliced attention computation. If "),Hp=o("code"),Lw=i("enable_attention_slicing"),Qw=i(` was previously called, attention is
computed in one step.`),zw=c(),jn=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(),Zn=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(Cn.$$.fragment),c2=c(),b(Nn.$$.fragment),d2=c(),$n=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"),I2=i("civitAI"),U2=i(") and then load the vector"),E2=c(),b(kn.$$.fragment),j2=c(),Wn=o("div"),b(us.$$.fragment),Z2=c(),hs=o("p"),C2=i("Disable tiled VAE decoding. If "),em=o("code"),N2=i("enable_vae_tiling"),$2=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"),D2=i(", this method moves one whole model at a time to the GPU when its "),nm=o("code"),S2=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(),Dn=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.`),$u=c(),Jt=o("h2"),Sn=o("a"),lm=o("span"),b(bs.$$.fragment),L2=c(),im=o("span"),Q2=i("StableDiffusionControlNetImg2ImgPipeline"),xu=c(),N=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(),Is=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(Us.$$.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(Es.$$.fragment),IM=c(),js=o("p"),UM=i("Disable sliced VAE decoding. If "),gm=o("code"),EM=i("enable_vae_slicing"),jM=i(` was previously enabled, this method will go back to
computing decoding in one step.`),ZM=c(),ye=o("div"),b(Zs.$$.fragment),CM=c(),Cs=o("p"),NM=i("Enable memory efficient attention from "),Ns=o("a"),$M=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(),Ln=o("div"),b($s.$$.fragment),DM=c(),xs=o("p"),SM=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"),LM=i("Example:"),QM=c(),b(Qn.$$.fragment),zM=c(),Ds=o("p"),HM=i(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Ss=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(),It=o("h2"),Kn=o("a"),Jm=o("span"),b(Vs.$$.fragment),yT=c(),Im=o("span"),vT=i("StableDiffusionControlNetInpaintPipeline"),Wu=c(),j=o("div"),b(Xs.$$.fragment),wT=c(),Um=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"),IT=i("DiffusionPipeline"),UT=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.)`),ET=c(),Em=o("p"),jT=i("In addition the pipeline inherits the following loading methods:"),ZT=c(),jm=o("ul"),Ys=o("li"),Zm=o("em"),CT=i("Textual-Inversion"),NT=i(": "),Ar=o("a"),$T=i("loaders.TextualInversionLoaderMixin.load_textual_inversion()"),xT=c(),b(eo.$$.fragment),kT=c(),Re=o("div"),b(Ls.$$.fragment),WT=c(),Cm=o("p"),GT=i("Function invoked when calling the pipeline for generation."),DT=c(),b(to.$$.fragment),ST=c(),ve=o("div"),b(Qs.$$.fragment),BT=c(),Nm=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 "),$m=o("code"),YT=i("enable_attention_slicing"),LT=i(` was previously called, attention is
computed in one step.`),QT=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"),I0=i(") and then load the vector"),U0=c(),b(mo.$$.fragment),E0=c(),fo=o("div"),b(dl.$$.fragment),j0=c(),pl=o("p"),Z0=i("Disable tiled VAE decoding. If "),Gm=o("code"),C0=i("enable_vae_tiling"),N0=i(` was previously enabled, this method will go back to
computing decoding in one step.`),$0=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 `),Dm=o("code"),W0=i("enable_sequential_cpu_offload"),G0=i(", this method moves one whole model at a time to the GPU when its "),Sm=o("code"),D0=i("forward"),S0=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(),Ut=o("h2"),go=o("a"),Rm=o("span"),b(ul.$$.fragment),Y0=c(),Vm=o("span"),L0=i("FlaxStableDiffusionControlNetPipeline"),Du=c(),ue=o("div"),b(hl.$$.fragment),Q0=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 "),Lr=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=jC('[data-svelte="svelte-1phssyn"]',document.head);f=a(m,"META",{name:!0,content:!0}),m.forEach(t),I=d(n),_=a(n,"H1",{class:!0});var bl=s(_);h=a(bl,"A",{id:!0,class:!0,href:!0});var Ym=s(h);J=a(Ym,"SPAN",{});var Lm=s(J);y(p.$$.fragment,Lm),Lm.forEach(t),Ym.forEach(t),g=d(bl),P=a(bl,"SPAN",{});var Qm=s(P);Ie=r(Qm,"ControlNet"),Qm.forEach(t),bl.forEach(t),Et=d(n),Ue=a(n,"P",{});var Qr=s(Ue);z=a(Qr,"A",{href:!0,rel:!0});var zm=s(z);Q=r(zm,"Adding Conditional Control to Text-to-Image Diffusion Models"),zm.forEach(t),Il=r(Qr," by Lvmin Zhang and Maneesh Agrawala."),Qr.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),Ul=a(n,"P",{});var qm=s(Ul);fg=r(qm,"The abstract from the paper is:"),qm.forEach(t),yf=d(n),El=a(n,"P",{});var Om=s(El);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),jt=a(n,"P",{});var yl=s(jt);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),Zt=a(n,"P",{});var vl=s(Zt);bg=r(vl,"The original codebase can be found at "),Do=a(vl,"A",{href:!0,rel:!0});var tf=s(Do);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);Ct=a(wl,"A",{id:!0,class:!0,href:!0});var nf=s(Ct);ac=a(nf,"SPAN",{});var of=s(ac);y(So.$$.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),Nt=a(n,"P",{});var Ml=s(Nt);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),Ig=r(Ml,` checkpoint with Diffusers for inference.
The inference pipeline is the same for all pipelines:`),Ml.forEach(t),Jf=d(n),$t=a(n,"UL",{});var Tl=s($t);ic=a(Tl,"LI",{});var lf=s(ic);rc=a(lf,"OL",{});var rf=s(rc);cc=a(rf,"LI",{});var bI=s(cc);Ug=r(bI,"Take an image and run it through a pre-conditioning processor."),bI.forEach(t),rf.forEach(t),lf.forEach(t),Eg=d(Tl),dc=a(Tl,"LI",{});var yI=s(dc);jl=a(yI,"OL",{start:!0});var vI=s(jl);Bo=a(vI,"LI",{});var Bu=s(Bo);jg=r(Bu,"Run the pre-processed image through the "),Zl=a(Bu,"A",{href:!0});var wI=s(Zl);Zg=r(wI,"StableDiffusionControlNetPipeline"),wI.forEach(t),Cg=r(Bu,"."),Bu.forEach(t),vI.forEach(t),yI.forEach(t),Tl.forEach(t),If=d(n),xt=a(n,"P",{});var Pu=s(xt);Ng=r(Pu,"Let\u2019s have a look at a simple example using the "),Po=a(Pu,"A",{href:!0,rel:!0});var MI=s(Po);$g=r(MI,"Canny Edge ControlNet"),MI.forEach(t),xg=r(Pu,"."),Pu.forEach(t),Uf=d(n),y(Fo.$$.fragment,n),Ef=d(n),Cl=a(n,"P",{});var TI=s(Cl);Nl=a(TI,"IMG",{src:!0,alt:!0}),TI.forEach(t),jf=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 JI=s(pc);Wg=r(JI,"1."),JI.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 "),$l=a(zr,"A",{href:!0});var II=s($l);Dg=r(II,"official checkpoints"),II.forEach(t),Sg=r(zr," for more information about other models."),zr.forEach(t),Zf=d(n),xl=a(n,"P",{});var UI=s(xl);Bg=r(UI,"First, we need to install opencv:"),UI.forEach(t),Cf=d(n),y(Ro.$$.fragment,n),Nf=d(n),kl=a(n,"P",{});var EI=s(kl);Pg=r(EI,"Next, let\u2019s also install all required Hugging Face libraries:"),EI.forEach(t),$f=d(n),y(Vo.$$.fragment,n),xf=d(n),Wl=a(n,"P",{});var jI=s(Wl);Fg=r(jI,"Then we can retrieve the canny edges of the image."),jI.forEach(t),kf=d(n),y(Xo.$$.fragment,n),Wf=d(n),Gl=a(n,"P",{});var ZI=s(Gl);Rg=r(ZI,"Let\u2019s take a look at the processed image."),ZI.forEach(t),Gf=d(n),Dl=a(n,"P",{});var CI=s(Dl);Sl=a(CI,"IMG",{src:!0,alt:!0}),CI.forEach(t),Df=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 NI=s(Bl);Xg=r(NI,"Stable Diffusion 1.5 Model"),NI.forEach(t),Ag=r(Fu," as well as the ControlNet for canny edges."),Fu.forEach(t),Sf=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 $I=s(Pl);Lg=r($I,"UniPCMultistepScheduler"),$I.forEach(t),Qg=r(Ru,"."),Ru.forEach(t),Pf=d(n),y(Yo.$$.fragment,n),Ff=d(n),Fl=a(n,"P",{});var xI=s(Fl);zg=r(xI,"Finally, we can run the pipeline:"),xI.forEach(t),Rf=d(n),y(Lo.$$.fragment,n),Vf=d(n),Rl=a(n,"P",{});var kI=s(Rl);Hg=r(kI,"This should take only around 3-4 seconds on GPU (depending on hardware). The output image then looks as follows:"),kI.forEach(t),Xf=d(n),Vl=a(n,"P",{});var WI=s(Vl);Xl=a(WI,"IMG",{src:!0,alt:!0}),WI.forEach(t),Af=d(n),dt=a(n,"P",{});var cf=s(dt);mc=a(cf,"STRONG",{});var GI=s(mc);qg=r(GI,"Note"),GI.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 DI=s(Al);Kg=r(DI,"ControlNet with Stable Diffusion 1.5"),DI.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 SI=s(Gt);fc=a(SI,"SPAN",{});var BI=s(fc);y(Qo.$$.fragment,BI),BI.forEach(t),SI.forEach(t),t_=d(Vu),uc=a(Vu,"SPAN",{});var PI=s(uc);n_=r(PI,"Combining multiple conditionings"),PI.forEach(t),Vu.forEach(t),Lf=d(n),Dt=a(n,"P",{});var Xu=s(Dt);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 FI=s(hc);a_=r(FI,"__call__"),FI.forEach(t),s_=r(Xu,"."),Xu.forEach(t),Qf=d(n),Yl=a(n,"P",{});var RI=s(Yl);l_=r(RI,"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."),RI.forEach(t),zf=d(n),St=a(n,"P",{});var Au=s(St);i_=r(Au,"It can also be helpful to vary the "),gc=a(Au,"CODE",{});var VI=s(gc);r_=r(VI,"controlnet_conditioning_scales"),VI.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 XI=s(Bt);_c=a(XI,"SPAN",{});var AI=s(_c);y(zo.$$.fragment,AI),AI.forEach(t),XI.forEach(t),d_=d(Yu),bc=a(Yu,"SPAN",{});var YI=s(bc);p_=r(YI,"Canny conditioning"),YI.forEach(t),Yu.forEach(t),qf=d(n),Ll=a(n,"P",{});var LI=s(Ll);m_=r(LI,"The original image:"),LI.forEach(t),Of=d(n),Ql=a(n,"IMG",{src:!0}),Kf=d(n),zl=a(n,"P",{});var QI=s(zl);f_=r(QI,"Prepare the conditioning:"),QI.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 Lu=s(ft);Pt=a(Lu,"A",{id:!0,class:!0,href:!0});var zI=s(Pt);yc=a(zI,"SPAN",{});var HI=s(yc);y(qo.$$.fragment,HI),HI.forEach(t),zI.forEach(t),u_=d(Lu),vc=a(Lu,"SPAN",{});var qI=s(vc);h_=r(qI,"Openpose conditioning"),qI.forEach(t),Lu.forEach(t),ou=d(n),ql=a(n,"P",{});var OI=s(ql);g_=r(OI,"The original image:"),OI.forEach(t),au=d(n),Oo=a(n,"IMG",{src:!0,width:!0}),su=d(n),Ol=a(n,"P",{});var KI=s(Ol);__=r(KI,"Prepare the conditioning:"),KI.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 Qu=s(ut);Ft=a(Qu,"A",{id:!0,class:!0,href:!0});var eU=s(Ft);wc=a(eU,"SPAN",{});var tU=s(wc);y(ta.$$.fragment,tU),tU.forEach(t),eU.forEach(t),b_=d(Qu),Mc=a(Qu,"SPAN",{});var nU=s(Mc);y_=r(nU,"Running ControlNet with multiple conditionings"),nU.forEach(t),Qu.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 oU=s(Rt);Tc=a(oU,"SPAN",{});var aU=s(Tc);y(aa.$$.fragment,aU),aU.forEach(t),oU.forEach(t),v_=d(zu),Jc=a(zu,"SPAN",{});var sU=s(Jc);w_=r(sU,"Guess Mode"),sU.forEach(t),zu.forEach(t),mu=d(n),De=a(n,"P",{});var Hr=s(De);M_=r(Hr,"Guess Mode is "),sa=a(Hr,"A",{href:!0,rel:!0});var lU=s(sa);T_=r(lU,"a ControlNet feature that was implemented"),lU.forEach(t),J_=r(Hr," after the publication of "),la=a(Hr,"A",{href:!0,rel:!0});var iU=s(la);I_=r(iU,"the paper"),iU.forEach(t),U_=r(Hr,". The description states:"),Hr.forEach(t),fu=d(n),Kl=a(n,"BLOCKQUOTE",{});var rU=s(Kl);Ic=a(rU,"P",{});var cU=s(Ic);E_=r(cU,"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."),cU.forEach(t),rU.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 dU=s(Vt);Uc=a(dU,"SPAN",{});var pU=s(Uc);y(ia.$$.fragment,pU),pU.forEach(t),dU.forEach(t),j_=d(Hu),Ec=a(Hu,"SPAN",{});var mU=s(Ec);Z_=r(mU,"The core implementation:"),mU.forEach(t),Hu.forEach(t),hu=d(n),Se=a(n,"P",{});var qr=s(Se);C_=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 "),jc=a(qr,"CODE",{});var fU=s(jc);N_=r(fU,"0.1"),fU.forEach(t),$_=r(qr,". As the blocks get deeper, the scale increases exponentially, and the scale for the output of the MidBlock becomes "),Zc=a(qr,"CODE",{});var uU=s(Zc);x_=r(uU,"1.0"),uU.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, "),Cc=a(qu,"STRONG",{});var hU=s(Cc);G_=r(hU,"it does not have any impact on prompt conditioning"),hU.forEach(t),D_=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 gU=s(At);Nc=a(gU,"SPAN",{});var _U=s(Nc);y(ra.$$.fragment,_U),_U.forEach(t),gU.forEach(t),S_=d(Ou),$c=a(Ou,"SPAN",{});var bU=s($c);B_=r(bU,"Usage:"),bU.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 yU=s(xc);F_=r(yU,"guess_mode=True"),yU.forEach(t),R_=r(bo," in the pipe() function. A "),kc=a(bo,"CODE",{});var vU=s(kc);V_=r(vU,"guidance_scale"),vU.forEach(t),X_=r(bo," between 3.0 and 5.0 is "),ca=a(bo,"A",{href:!0,rel:!0});var wU=s(ca);A_=r(wU,"recommended"),wU.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 MU=s(Yt);Wc=a(MU,"SPAN",{});var TU=s(Wc);y(pa.$$.fragment,TU),TU.forEach(t),MU.forEach(t),L_=d(Ku),Gc=a(Ku,"SPAN",{});var JU=s(Gc);Q_=r(JU,"Output image comparison:"),JU.forEach(t),Ku.forEach(t),wu=r(n,`

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