import{S as Qk,i as Lk,s as zk,e as o,k as c,w as v,t as s,M as Hk,c as a,d as t,m as d,a as l,x as y,h as i,b as r,N as C,f as P,G as e,g as f,y as w,q as M,o as T,B as U,v as qk,L as Te}from"../../../chunks/vendor-hf-doc-builder.js";import{T as Ts}from"../../../chunks/Tip-hf-doc-builder.js";import{D as $}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as F}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as L}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Me}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ok(Z){let h,I,u,_,J;return _=new F({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjBvcGVuY3YtcHl0aG9uJTIwdHJhbnNmb3JtZXJzJTIwYWNjZWxlcmF0ZSUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBTdGFibGVEaWZmdXNpb25Db250cm9sTmV0UGlwZWxpbmUlMkMlMjBDb250cm9sTmV0TW9kZWwlMkMlMjBVbmlQQ011bHRpc3RlcFNjaGVkdWxlciUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBaW1wb3J0JTIwdG9yY2glMEElMEFpbXBvcnQlMjBjdjIlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEElMjMlMjBkb3dubG9hZCUyMGFuJTIwaW1hZ2UlMEFpbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZoZi5jbyUyRmRhdGFzZXRzJTJGaHVnZ2luZ2ZhY2UlMkZkb2N1bWVudGF0aW9uLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGZGlmZnVzZXJzJTJGaW5wdXRfaW1hZ2VfdmVybWVlci5wbmclMjIlMEEpJTBBaW1hZ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QlMjBVbmlQQ011bHRpc3RlcFNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlLnNjaGVkdWxlci5jb25maWcpJTBBJTIzJTIwcmVtb3ZlJTIwZm9sbG93aW5nJTIwbGluZSUyMGlmJTIweGZvcm1lcnMlMjBpcyUyMG5vdCUyMGluc3RhbGxlZCUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKCklMEElMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBJTIzJTIwZ2VuZXJhdGUlMjBpbWFnZSUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLm1hbnVhbF9zZWVkKDApJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMCUyMmZ1dHVyaXN0aWMtbG9va2luZyUyMHdvbWFuJTIyJTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTIwaW1hZ2UlM0RjYW5ueV9pbWFnZSUwQSkuaW1hZ2VzJTVCMCU1RA==",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(){h=o("p"),I=s("Examples:"),u=c(),v(_.$$.fragment)},l(m){h=a(m,"P",{});var b=l(h);I=i(b,"Examples:"),b.forEach(t),u=d(m),y(_.$$.fragment,m)},m(m,b){f(m,h,b),e(h,I),f(m,u,b),w(_,m,b),J=!0},p:Te,i(m){J||(M(_.$$.fragment,m),J=!0)},o(m){T(_.$$.fragment,m),J=!1},d(m){m&&t(h),m&&t(u),U(_,m)}}}function Kk(Z){let h,I,u,_,J;return _=new F({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(){h=o("p"),I=s("Examples:"),u=c(),v(_.$$.fragment)},l(m){h=a(m,"P",{});var b=l(h);I=i(b,"Examples:"),b.forEach(t),u=d(m),y(_.$$.fragment,m)},m(m,b){f(m,h,b),e(h,I),f(m,u,b),w(_,m,b),J=!0},p:Te,i(m){J||(M(_.$$.fragment,m),J=!0)},o(m){T(_.$$.fragment,m),J=!1},d(m){m&&t(h),m&&t(u),U(_,m)}}}function ex(Z){let h,I;return{c(){h=o("p"),I=s("This function is experimental and might change in the future.")},l(u){h=a(u,"P",{});var _=l(h);I=i(_,"This function is experimental and might change in the future."),_.forEach(t)},m(u,_){f(u,h,_),e(h,I)},d(u){u&&t(h)}}}function tx(Z){let h,I,u,_,J,m,b,j;return{c(){h=o("p"),I=s("It is required to be logged in ("),u=o("code"),_=s("huggingface-cli login"),J=s(") when you want to use private or "),m=o("a"),b=s(`gated
models`),j=s("."),this.h()},l(g){h=a(g,"P",{});var E=l(h);I=i(E,"It is required to be logged in ("),u=a(E,"CODE",{});var k=l(u);_=i(k,"huggingface-cli login"),k.forEach(t),J=i(E,") when you want to use private or "),m=a(E,"A",{href:!0,rel:!0});var V=l(m);b=i(V,`gated
models`),V.forEach(t),j=i(E,"."),E.forEach(t),this.h()},h(){r(m,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),r(m,"rel","nofollow")},m(g,E){f(g,h,E),e(h,I),e(h,u),e(u,_),e(h,J),e(h,m),e(m,b),e(h,j)},d(g){g&&t(h)}}}function nx(Z){let h,I,u,_,J,m,b,j;return b=new F({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(){h=o("p"),I=s("To load a textual inversion embedding vector in "),u=o("code"),_=s("diffusers"),J=s(" format:"),m=c(),v(b.$$.fragment)},l(g){h=a(g,"P",{});var E=l(h);I=i(E,"To load a textual inversion embedding vector in "),u=a(E,"CODE",{});var k=l(u);_=i(k,"diffusers"),k.forEach(t),J=i(E," format:"),E.forEach(t),m=d(g),y(b.$$.fragment,g)},m(g,E){f(g,h,E),e(h,I),e(h,u),e(u,_),e(h,J),f(g,m,E),w(b,g,E),j=!0},p:Te,i(g){j||(M(b.$$.fragment,g),j=!0)},o(g){T(b.$$.fragment,g),j=!1},d(g){g&&t(h),g&&t(m),U(b,g)}}}function ox(Z){let h,I,u,_,J,m,b,j;return b=new F({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(){h=o("p"),I=s("e.g. from "),u=o("a"),_=s("civitAI"),J=s(" and then load the vector locally:"),m=c(),v(b.$$.fragment),this.h()},l(g){h=a(g,"P",{});var E=l(h);I=i(E,"e.g. from "),u=a(E,"A",{href:!0,rel:!0});var k=l(u);_=i(k,"civitAI"),k.forEach(t),J=i(E," and then load the vector locally:"),E.forEach(t),m=d(g),y(b.$$.fragment,g),this.h()},h(){r(u,"href","https://civitai.com/models/3036?modelVersionId=9857"),r(u,"rel","nofollow")},m(g,E){f(g,h,E),e(h,I),e(h,u),e(u,_),e(h,J),f(g,m,E),w(b,g,E),j=!0},p:Te,i(g){j||(M(b.$$.fragment,g),j=!0)},o(g){T(b.$$.fragment,g),j=!1},d(g){g&&t(h),g&&t(m),U(b,g)}}}function ax(Z){let h,I,u,_,J;return _=new F({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjBvcGVuY3YtcHl0aG9uJTIwdHJhbnNmb3JtZXJzJTIwYWNjZWxlcmF0ZSUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBTdGFibGVEaWZmdXNpb25Db250cm9sTmV0SW1nMkltZ1BpcGVsaW5lJTJDJTIwQ29udHJvbE5ldE1vZGVsJTJDJTIwVW5pUENNdWx0aXN0ZXBTY2hlZHVsZXIlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQWltcG9ydCUyMG51bXB5JTIwYXMlMjBucCUwQ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TIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uQ29udHJvbE5ldEltZzJJbWdQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMkMlMjBjb250cm9sbmV0JTNEY29udHJvbG5ldCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUwQSklMEElMEElMjMlMjBzcGVlZCUyMHVwJTIwZGlmZnVzaW9uJTIwcHJvY2VzcyUyMHdpdGglMjBmYXN0ZXIlMjBzY2hlZHVsZXIlMjBhbmQlMjBtZW1vcnklMjBvcHRpbWl6YXRpb24lMEFwaXBlLnNjaGVkdWxlciUyMCUzRCUyMFVuaVBDTXVsdGlzdGVwU2NoZWR1bGVyLmZyb21fY29uZmlnKHBpcGUuc2NoZWR1bGVyLmNvbmZpZyklMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBJTIzJTIwZ2VuZXJhdGUlMjBpbWFnZSUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLm1hbnVhbF9zZWVkKDApJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMCUyMmZ1dHVyaXN0aWMtbG9va2luZyUyMHdvbWFuJTIyJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0RpbWFnZSUyQyUwQSUyMCUyMCUyMCUyMGNvbnRyb2xfaW1hZ2UlM0RjYW5ueV9pbWFnZSUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",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(){h=o("p"),I=s("Examples:"),u=c(),v(_.$$.fragment)},l(m){h=a(m,"P",{});var b=l(h);I=i(b,"Examples:"),b.forEach(t),u=d(m),y(_.$$.fragment,m)},m(m,b){f(m,h,b),e(h,I),f(m,u,b),w(_,m,b),J=!0},p:Te,i(m){J||(M(_.$$.fragment,m),J=!0)},o(m){T(_.$$.fragment,m),J=!1},d(m){m&&t(h),m&&t(u),U(_,m)}}}function lx(Z){let h,I,u,_,J;return _=new F({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(){h=o("p"),I=s("Examples:"),u=c(),v(_.$$.fragment)},l(m){h=a(m,"P",{});var b=l(h);I=i(b,"Examples:"),b.forEach(t),u=d(m),y(_.$$.fragment,m)},m(m,b){f(m,h,b),e(h,I),f(m,u,b),w(_,m,b),J=!0},p:Te,i(m){J||(M(_.$$.fragment,m),J=!0)},o(m){T(_.$$.fragment,m),J=!1},d(m){m&&t(h),m&&t(u),U(_,m)}}}function sx(Z){let h,I;return{c(){h=o("p"),I=s("This function is experimental and might change in the future.")},l(u){h=a(u,"P",{});var _=l(h);I=i(_,"This function is experimental and might change in the future."),_.forEach(t)},m(u,_){f(u,h,_),e(h,I)},d(u){u&&t(h)}}}function ix(Z){let h,I,u,_,J,m,b,j;return{c(){h=o("p"),I=s("It is required to be logged in ("),u=o("code"),_=s("huggingface-cli login"),J=s(") when you want to use private or "),m=o("a"),b=s(`gated
models`),j=s("."),this.h()},l(g){h=a(g,"P",{});var E=l(h);I=i(E,"It is required to be logged in ("),u=a(E,"CODE",{});var k=l(u);_=i(k,"huggingface-cli login"),k.forEach(t),J=i(E,") when you want to use private or "),m=a(E,"A",{href:!0,rel:!0});var V=l(m);b=i(V,`gated
models`),V.forEach(t),j=i(E,"."),E.forEach(t),this.h()},h(){r(m,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),r(m,"rel","nofollow")},m(g,E){f(g,h,E),e(h,I),e(h,u),e(u,_),e(h,J),e(h,m),e(m,b),e(h,j)},d(g){g&&t(h)}}}function rx(Z){let h,I,u,_,J,m,b,j;return b=new F({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(){h=o("p"),I=s("To load a textual inversion embedding vector in "),u=o("code"),_=s("diffusers"),J=s(" format:"),m=c(),v(b.$$.fragment)},l(g){h=a(g,"P",{});var E=l(h);I=i(E,"To load a textual inversion embedding vector in "),u=a(E,"CODE",{});var k=l(u);_=i(k,"diffusers"),k.forEach(t),J=i(E," format:"),E.forEach(t),m=d(g),y(b.$$.fragment,g)},m(g,E){f(g,h,E),e(h,I),e(h,u),e(u,_),e(h,J),f(g,m,E),w(b,g,E),j=!0},p:Te,i(g){j||(M(b.$$.fragment,g),j=!0)},o(g){T(b.$$.fragment,g),j=!1},d(g){g&&t(h),g&&t(m),U(b,g)}}}function cx(Z){let h,I,u,_,J,m,b,j;return b=new F({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(){h=o("p"),I=s("e.g. from "),u=o("a"),_=s("civitAI"),J=s(" and then load the vector locally:"),m=c(),v(b.$$.fragment),this.h()},l(g){h=a(g,"P",{});var E=l(h);I=i(E,"e.g. from "),u=a(E,"A",{href:!0,rel:!0});var k=l(u);_=i(k,"civitAI"),k.forEach(t),J=i(E," and then load the vector locally:"),E.forEach(t),m=d(g),y(b.$$.fragment,g),this.h()},h(){r(u,"href","https://civitai.com/models/3036?modelVersionId=9857"),r(u,"rel","nofollow")},m(g,E){f(g,h,E),e(h,I),e(h,u),e(u,_),e(h,J),f(g,m,E),w(b,g,E),j=!0},p:Te,i(g){j||(M(b.$$.fragment,g),j=!0)},o(g){T(b.$$.fragment,g),j=!1},d(g){g&&t(h),g&&t(m),U(b,g)}}}function dx(Z){let h,I,u,_,J,m,b,j,g,E,k;return{c(){h=o("p"),I=s(`This pipeline can be used both with checkpoints that have been specifically fine-tuned for inpainting, such as
`),u=o("a"),_=s("runwayml/stable-diffusion-inpainting"),J=s(`
as well as default text-to-image stable diffusion checkpoints, such as
`),m=o("a"),b=s("runwayml/stable-diffusion-v1-5"),j=s(`.
Default text-to-image stable diffusion checkpoints might be preferable for controlnets that have been fine-tuned on
those, such as `),g=o("a"),E=s("lllyasviel/control_v11p_sd15_inpaint"),k=s("."),this.h()},l(V){h=a(V,"P",{});var z=l(h);I=i(z,`This pipeline can be used both with checkpoints that have been specifically fine-tuned for inpainting, such as
`),u=a(z,"A",{href:!0,rel:!0});var xe=l(u);_=i(xe,"runwayml/stable-diffusion-inpainting"),xe.forEach(t),J=i(z,`
as well as default text-to-image stable diffusion checkpoints, such as
`),m=a(z,"A",{href:!0,rel:!0});var Us=l(m);b=i(Us,"runwayml/stable-diffusion-v1-5"),Us.forEach(t),j=i(z,`.
Default text-to-image stable diffusion checkpoints might be preferable for controlnets that have been fine-tuned on
those, such as `),g=a(z,"A",{href:!0,rel:!0});var zt=l(g);E=i(zt,"lllyasviel/control_v11p_sd15_inpaint"),zt.forEach(t),k=i(z,"."),z.forEach(t),this.h()},h(){r(u,"href","https://huggingface.co/runwayml/stable-diffusion-inpainting"),r(u,"rel","nofollow"),r(m,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5"),r(m,"rel","nofollow"),r(g,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint"),r(g,"rel","nofollow")},m(V,z){f(V,h,z),e(h,I),e(h,u),e(u,_),e(h,J),e(h,m),e(m,b),e(h,j),e(h,g),e(g,E),e(h,k)},d(V){V&&t(h)}}}function px(Z){let h,I,u,_,J;return _=new F({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjB0cmFuc2Zvcm1lcnMlMjBhY2NlbGVyYXRlJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnR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MXBfc2QxNV9pbnBhaW50JTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25Db250cm9sTmV0SW5wYWludFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUyQyUyMGNvbnRyb2xuZXQlM0Rjb250cm9sbmV0JTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQSUwQXBpcGUuc2NoZWR1bGVyJTIwJTNEJTIwRERJTVNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlLnNjaGVkdWxlci5jb25maWcpJTBBcGlwZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQSUwQSUyMyUyMGdlbmVyYXRlJTIwaW1hZ2UlMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwJTIyYSUyMGhhbmRzb21lJTIwbWFuJTIwd2l0aCUyMHJheS1iYW4lMjBzdW5nbGFzc2VzJTIyJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTBBJTIwJTIwJTIwJTIwZXRhJTNEMS4wJTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0Rpbml0X2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwbWFza19pbWFnZSUzRG1hc2tfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBjb250cm9sX2ltYWdlJTNEY29udHJvbF9pbWFnZSUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",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(){h=o("p"),I=s("Examples:"),u=c(),v(_.$$.fragment)},l(m){h=a(m,"P",{});var b=l(h);I=i(b,"Examples:"),b.forEach(t),u=d(m),y(_.$$.fragment,m)},m(m,b){f(m,h,b),e(h,I),f(m,u,b),w(_,m,b),J=!0},p:Te,i(m){J||(M(_.$$.fragment,m),J=!0)},o(m){T(_.$$.fragment,m),J=!1},d(m){m&&t(h),m&&t(u),U(_,m)}}}function fx(Z){let h,I,u,_,J;return _=new F({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(){h=o("p"),I=s("Examples:"),u=c(),v(_.$$.fragment)},l(m){h=a(m,"P",{});var b=l(h);I=i(b,"Examples:"),b.forEach(t),u=d(m),y(_.$$.fragment,m)},m(m,b){f(m,h,b),e(h,I),f(m,u,b),w(_,m,b),J=!0},p:Te,i(m){J||(M(_.$$.fragment,m),J=!0)},o(m){T(_.$$.fragment,m),J=!1},d(m){m&&t(h),m&&t(u),U(_,m)}}}function mx(Z){let h,I;return{c(){h=o("p"),I=s("This function is experimental and might change in the future.")},l(u){h=a(u,"P",{});var _=l(h);I=i(_,"This function is experimental and might change in the future."),_.forEach(t)},m(u,_){f(u,h,_),e(h,I)},d(u){u&&t(h)}}}function hx(Z){let h,I,u,_,J,m,b,j;return{c(){h=o("p"),I=s("It is required to be logged in ("),u=o("code"),_=s("huggingface-cli login"),J=s(") when you want to use private or "),m=o("a"),b=s(`gated
models`),j=s("."),this.h()},l(g){h=a(g,"P",{});var E=l(h);I=i(E,"It is required to be logged in ("),u=a(E,"CODE",{});var k=l(u);_=i(k,"huggingface-cli login"),k.forEach(t),J=i(E,") when you want to use private or "),m=a(E,"A",{href:!0,rel:!0});var V=l(m);b=i(V,`gated
models`),V.forEach(t),j=i(E,"."),E.forEach(t),this.h()},h(){r(m,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),r(m,"rel","nofollow")},m(g,E){f(g,h,E),e(h,I),e(h,u),e(u,_),e(h,J),e(h,m),e(m,b),e(h,j)},d(g){g&&t(h)}}}function ux(Z){let h,I,u,_,J,m,b,j;return b=new F({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(){h=o("p"),I=s("To load a textual inversion embedding vector in "),u=o("code"),_=s("diffusers"),J=s(" format:"),m=c(),v(b.$$.fragment)},l(g){h=a(g,"P",{});var E=l(h);I=i(E,"To load a textual inversion embedding vector in "),u=a(E,"CODE",{});var k=l(u);_=i(k,"diffusers"),k.forEach(t),J=i(E," format:"),E.forEach(t),m=d(g),y(b.$$.fragment,g)},m(g,E){f(g,h,E),e(h,I),e(h,u),e(u,_),e(h,J),f(g,m,E),w(b,g,E),j=!0},p:Te,i(g){j||(M(b.$$.fragment,g),j=!0)},o(g){T(b.$$.fragment,g),j=!1},d(g){g&&t(h),g&&t(m),U(b,g)}}}function gx(Z){let h,I,u,_,J,m,b,j;return b=new F({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(){h=o("p"),I=s("e.g. from "),u=o("a"),_=s("civitAI"),J=s(" and then load the vector locally:"),m=c(),v(b.$$.fragment),this.h()},l(g){h=a(g,"P",{});var E=l(h);I=i(E,"e.g. from "),u=a(E,"A",{href:!0,rel:!0});var k=l(u);_=i(k,"civitAI"),k.forEach(t),J=i(E," and then load the vector locally:"),E.forEach(t),m=d(g),y(b.$$.fragment,g),this.h()},h(){r(u,"href","https://civitai.com/models/3036?modelVersionId=9857"),r(u,"rel","nofollow")},m(g,E){f(g,h,E),e(h,I),e(h,u),e(u,_),e(h,J),f(g,m,E),w(b,g,E),j=!0},p:Te,i(g){j||(M(b.$$.fragment,g),j=!0)},o(g){T(b.$$.fragment,g),j=!1},d(g){g&&t(h),g&&t(m),U(b,g)}}}function _x(Z){let h,I,u,_,J;return _=new F({props:{code:"aW1wb3J0JTIwamF4JTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBaW1wb3J0JTIwamF4Lm51bXB5JTIwYXMlMjBqbnAlMEFmcm9tJTIwZmxheC5qYXhfdXRpbHMlMjBpbXBvcnQlMjByZXBsaWNhdGUlMEFmcm9tJTIwZmxheC50cmFpbmluZy5jb21tb25fdXRpbHMlMjBpbXBvcnQlMjBzaGFyZCUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEZsYXhTdGFibGVEaWZmdXNpb25Db250cm9sTmV0UGlwZWxpbmUlMkMlMjBGbGF4Q29udHJvbE5ldE1vZGVsJTBBJTBBJTBBZGVmJTIwaW1hZ2VfZ3JpZChpbWdzJTJDJTIwcm93cyUyQyUyMGNvbHMpJTNBJ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QlMjBpbWFnZV9ncmlkKG91dHB1dF9pbWFnZXMlMkMlMjBudW1fc2FtcGxlcyUyMCUyRiUyRiUyMDQlMkMlMjA0KSUwQW91dHB1dF9pbWFnZXMuc2F2ZSglMjJnZW5lcmF0ZWRfaW1hZ2UucG5nJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax.jax_utils <span class="hljs-keyword">import</span> replicate
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax.training.common_utils <span class="hljs-keyword">import</span> shard
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlaxStableDiffusionControlNetPipeline, FlaxControlNetModel


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


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


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

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>output_images = pipe.numpy_to_pil(np.asarray(output.reshape((num_samples,) + output.shape[-<span class="hljs-number">3</span>:])))
<span class="hljs-meta">&gt;&gt;&gt; </span>output_images = image_grid(output_images, num_samples // <span class="hljs-number">4</span>, <span class="hljs-number">4</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>output_images.save(<span class="hljs-string">&quot;generated_image.png&quot;</span>)`}}),{c(){h=o("p"),I=s("Examples:"),u=c(),v(_.$$.fragment)},l(m){h=a(m,"P",{});var b=l(h);I=i(b,"Examples:"),b.forEach(t),u=d(m),y(_.$$.fragment,m)},m(m,b){f(m,h,b),e(h,I),f(m,u,b),w(_,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XNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBJTBBJTIzJTIwTGV0J3MlMjBsb2FkJTIwdGhlJTIwcG9wdWxhciUyMHZlcm1lZXIlMjBpbWFnZSUwQWltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmhmLmNvJTJGZGF0YXNldHMlMkZodWdnaW5nZmFjZSUyRmRvY3VtZW50YXRpb24taW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZkaWZmdXNlcnMlMkZpbnB1dF9pbWFnZV92ZXJtZWVyLnBuZyUyMiUwQSk=",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>
)`}}),ia=new F({props:{code:"cGlwJTIwaW5zdGFsbCUyMG9wZW5jdi1jb250cmliLXB5dGhvbg==",highlighted:'pip <span class="hljs-keyword">install</span> opencv-contrib-python'}}),ra=new F({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'}}),ca=new F({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)`}}),da=new F({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
)`}}),pa=new F({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()`}}),fa=new F({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>]`}}),ma=new L({}),ha=new L({}),ua=new F({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEFpbXBvcnQlMjBjdjIlMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUwQSUwQWNhbm55X2ltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZodWdnaW5nZmFjZSUyRmRvY3VtZW50YXRpb24taW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZkaWZmdXNlcnMlMkZsYW5kc2NhcGUucG5nJTIyJTBBKSUwQWNhbm55X2ltYWdlJTIwJTNEJTIwbnAuYXJyYXkoY2FubnlfaW1hZ2UpJTBBJTBBbG93X3RocmVzaG9sZCUyMCUzRCUyMDEwMCUwQWhpZ2hfdGhyZXNob2xkJTIwJTNEJTIwMjAwJTBBJTBBY2FubnlfaW1hZ2UlMjAlM0QlMjBjdjIuQ2FubnkoY2FubnlfaW1hZ2UlMkMlMjBsb3dfdGhyZXNob2xkJTJDJTIwaGlnaF90aHJlc2hvbGQpJTBBJTBBJTIzJTIwemVybyUyMG91dCUyMG1pZGRsZSUyMGNvbHVtbnMlMjBvZiUyMGltYWdlJTIwd2hlcmUlMjBwb3NlJTIwd2lsbCUyMGJlJTIwb3ZlcmxheWVkJTBBemVyb19zdGFydCUyMCUzRCUyMGNhbm55X2ltYWdlLnNoYXBlJTVCMSU1RCUyMCUyRiUyRiUyMDQlMEF6ZXJvX2VuZCUyMCUzRCUyMHplcm9fc3RhcnQlMjAlMkIlMjBjYW5ueV9pbWFnZS5zaGFwZSU1QjElNUQlMjAlMkYlMkYlMjAyJTBBY2FubnlfaW1hZ2UlNUIlM0ElMkMlMjB6ZXJvX3N0YXJ0JTNBemVyb19lbmQlNUQlMjAlM0QlMjAwJTBBJTBBY2FubnlfaW1hZ2UlMjAlM0QlMjBjYW5ueV9pbWFnZSU1QiUzQSUyQyUyMCUzQSUyQyUyME5vbmUlNUQlMEFjYW5ueV9pbWFnZSUyMCUzRCUyMG5wLmNvbmNhdGVuYXRlKCU1QmNhbm55X2ltYWdlJTJDJTIwY2FubnlfaW1hZ2UlMkMlMjBjYW5ueV9pbWFnZSU1RCUyQyUyMGF4aXMlM0QyKSUwQWNhbm55X2ltYWdlJTIwJTNEJTIwSW1hZ2UuZnJvbWFycmF5KGNhbm55X2ltYWdlKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> cv2
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

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

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

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

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

canny_image = canny_image[:, :, <span class="hljs-literal">None</span>]
canny_image = np.concatenate([canny_image, canny_image, canny_image], axis=<span class="hljs-number">2</span>)
canny_image = Image.fromarray(canny_image)`}}),ga=new L({}),ba=new F({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)`}}),ya=new L({}),wa=new F({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRQaXBlbGluZSUyQyUyMENvbnRyb2xOZXRNb2RlbCUyQyUyMFVuaVBDTXVsdGlzdGVwU2NoZWR1bGVyJTBBaW1wb3J0JTIwdG9yY2glMEElMEFjb250cm9sbmV0JTIwJTNEJTIwJTVCJTBBJTIwJTIwJTIwJTIwQ29udHJvbE5ldE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJsbGx5YXN2aWVsJTJGc2QtY29udHJvbG5ldC1vcGVucG9zZSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMkMlMEElMjAlMjAlMjAlMjBDb250cm9sTmV0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmxsbHlhc3ZpZWwlMkZzZC1jb250cm9sbmV0LWNhbm55JTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUyQyUwQSU1RCUwQSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25Db250cm9sTmV0UGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTIwY29udHJvbG5ldCUzRGNvbnRyb2xuZXQlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTBBcGlwZS5zY2hlZHVsZXIlMjAlM0QlMjBVbmlQQ011bHRpc3RlcFNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlLnNjaGVkdWxlci5jb25maWcpJTBBJTB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yword">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>)`}}),Ta=new L({}),Ia=new L({}),Ja=new L({}),ja=new F({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>)`}}),Za=new L({}),ka=new L({}),Wa=new L({}),qa=new L({}),fl=new L({}),ml=new $({props:{name:"class diffusers.StableDiffusionControlNetPipeline",anchor:"diffusers.StableDiffusionControlNetPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"controlnet",val:": typing.Union[diffusers.models.controlnet.ControlNetModel, typing.List[diffusers.models.controlnet.ControlNetModel], typing.Tuple[diffusers.models.controlnet.ControlNetModel], diffusers.pipelines.controlnet.multicontrolnet.MultiControlNetModel]"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.17.1/en/api/models#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionControlNetPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.17.1/en/api/models#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionControlNetPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/v0.17.1/en/api/models#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code>) &#x2014;
Provides additional conditioning to the unet during the denoising process. If you set multiple ControlNets
as a list, the outputs from each ControlNet are added together to create one combined additional
conditioning.`,name:"controlnet"},{anchor:"diffusers.StableDiffusionControlNetPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.17.1/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.17.1/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.17.1/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.17.1/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionControlNetPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionControlNetPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L94"}}),gl=new $({props:{name:"__call__",anchor:"diffusers.StableDiffusionControlNetPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, numpy.ndarray, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image], typing.List[numpy.ndarray]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 1.0"},{name:"guess_mode",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, <code>List[List[np.ndarray]]</code> or <code>List[List[PIL.Image.Image]]</code>):
The ControlNet input condition. ControlNet uses this input condition to generate guidance to Unet. If
the type is specified as <code>Torch.FloatTensor</code>, it is passed to ControlNet as is. <code>PIL.Image.Image</code> can
also be accepted as an image. The dimensions of the output image defaults to <code>image</code>&#x2019;s dimensions. If
height and/or width are passed, <code>image</code> is resized according to them. If multiple ControlNets are
specified in init, images must be passed as a list such that each element of the list can be correctly
batched for input to a single controlnet.`,name:"image"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.17.1/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.17.1/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet. If multiple ControlNets are specified in init, you can set the
corresponding scale as a list.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.guess_mode",description:`<strong>guess_mode</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
In this mode, the ControlNet encoder will try best to recognize the content of the input image even if
you remove all prompts. The <code>guidance_scale</code> between 3.0 and 5.0 is recommended.`,name:"guess_mode"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L694",returnDescription:`
<p><a
  href="/docs/diffusers/v0.17.1/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.17.1/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Ln=new Me({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.example",$$slots:{default:[Ok]},$$scope:{ctx:Z}}}),_l=new $({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/pipeline_utils.py#L1492"}}),bl=new $({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/pipeline_utils.py#L1508"}}),yl=new $({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L181"}}),wl=new $({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L191"}}),Tl=new $({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/pipeline_utils.py#L1434"}}),qn=new Me({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[Kk]},$$scope:{ctx:Z}}}),Ul=new $({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/pipeline_utils.py#L1466"}}),El=new $({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.List[str], typing.Dict[str, torch.Tensor], typing.List[typing.Dict[str, torch.Tensor]]]"},{name:"token",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids should have an organization name, like
<code>&quot;sd-concepts-library/low-poly-hd-logos-icons&quot;</code>.</li>
<li>A path to a <em>directory</em> containing textual inversion weights, e.g.
<code>./my_text_inversion_directory/</code>.</li>
<li>A path to a <em>file</em> containing textual inversion weights, e.g. <code>./my_text_inversions.pt</code>.</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>
<p>Or a list of those elements.`,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 in two cases:</p>
<ul>
<li>The saved textual inversion file is in <code>diffusers</code> 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 &#x201C;Automatic1111&#x201D; form.</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 in which a downloaded pretrained model configuration should be cached if the
standard cache should not be 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 delete incompletely received files. Will attempt to resume the download if such a
file exists.`,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, e.g., <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(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{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>, will use the token generated
when running <code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>).`,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, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be 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;
In case the relevant files are located inside a subfolder of the model repo (either remote in
huggingface.co or downloaded locally), you can specify the folder name here.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to accelerate downloads in China. If you are from China and have an accessibility
problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.
Please refer to the mirror site for more information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/loaders.py#L482"}}),Kn=new Ts({props:{warning:!0,$$slots:{default:[ex]},$$scope:{ctx:Z}}}),eo=new Ts({props:{$$slots:{default:[tx]},$$scope:{ctx:Z}}}),to=new Me({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.example",$$slots:{default:[nx]},$$scope:{ctx:Z}}}),no=new Me({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.example-2",$$slots:{default:[ox]},$$scope:{ctx:Z}}}),Il=new $({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L209"}}),Cl=new $({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L237"}}),jl=new $({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L216"}}),Zl=new $({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L199"}}),Nl=new L({}),$l=new $({props:{name:"class diffusers.StableDiffusionControlNetImg2ImgPipeline",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"controlnet",val:": typing.Union[diffusers.models.controlnet.ControlNetModel, typing.List[diffusers.models.controlnet.ControlNetModel], typing.Tuple[diffusers.models.controlnet.ControlNetModel], diffusers.pipelines.controlnet.multicontrolnet.MultiControlNetModel]"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.17.1/en/api/models#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.17.1/en/api/models#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/v0.17.1/en/api/models#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code>) &#x2014;
Provides additional conditioning to the unet during the denoising process. If you set multiple ControlNets
as a list, the outputs from each ControlNet are added together to create one combined additional
conditioning.`,name:"controlnet"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.17.1/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.17.1/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.17.1/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.17.1/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L120"}}),Wl=new $({props:{name:"__call__",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, numpy.ndarray, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image], typing.List[numpy.ndarray]] = None"},{name:"control_image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, numpy.ndarray, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image], typing.List[numpy.ndarray]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"strength",val:": float = 0.8"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 0.8"},{name:"guess_mode",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, <code>List[List[np.ndarray]]</code> or <code>List[List[PIL.Image.Image]]</code>):
The initial image will be used as the starting point for the image generation process. Can also accpet
image latents as <code>image</code>, if passing latents directly, it will not be encoded again.`,name:"image"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.control_image",description:`<strong>control_image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, <code>List[np.ndarray]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, <code>List[List[np.ndarray]]</code> or <code>List[List[PIL.Image.Image]]</code>):
The ControlNet input condition. ControlNet uses this input condition to generate guidance to Unet. If
the type is specified as <code>Torch.FloatTensor</code>, it is passed to ControlNet as is. <code>PIL.Image.Image</code> can
also be accepted as an image. The dimensions of the output image defaults to <code>image</code>&#x2019;s dimensions. If
height and/or width are passed, <code>image</code> is resized according to them. If multiple ControlNets are
specified in init, images must be passed as a list such that each element of the list can be correctly
batched for input to a single controlnet.`,name:"control_image"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.17.1/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.17.1/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet. If multiple ControlNets are specified in init, you can set the
corresponding scale as a list. Note that by default, we use a smaller conditioning scale for inpainting
than for <a href="/docs/diffusers/v0.17.1/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"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L772",returnDescription:`
<p><a
  href="/docs/diffusers/v0.17.1/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.17.1/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),io=new Me({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.example",$$slots:{default:[ax]},$$scope:{ctx:Z}}}),Gl=new $({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/pipeline_utils.py#L1492"}}),Dl=new $({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/pipeline_utils.py#L1508"}}),Bl=new $({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L207"}}),Pl=new $({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L217"}}),Fl=new $({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/pipeline_utils.py#L1434"}}),po=new Me({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[lx]},$$scope:{ctx:Z}}}),Vl=new $({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/pipeline_utils.py#L1466"}}),Al=new $({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.List[str], typing.Dict[str, torch.Tensor], typing.List[typing.Dict[str, torch.Tensor]]]"},{name:"token",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids should have an organization name, like
<code>&quot;sd-concepts-library/low-poly-hd-logos-icons&quot;</code>.</li>
<li>A path to a <em>directory</em> containing textual inversion weights, e.g.
<code>./my_text_inversion_directory/</code>.</li>
<li>A path to a <em>file</em> containing textual inversion weights, e.g. <code>./my_text_inversions.pt</code>.</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>
<p>Or a list of those elements.`,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 in two cases:</p>
<ul>
<li>The saved textual inversion file is in <code>diffusers</code> 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 &#x201C;Automatic1111&#x201D; form.</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 in which a downloaded pretrained model configuration should be cached if the
standard cache should not be 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 delete incompletely received files. Will attempt to resume the download if such a
file exists.`,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, e.g., <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(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{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>, will use the token generated
when running <code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>).`,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, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be 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;
In case the relevant files are located inside a subfolder of the model repo (either remote in
huggingface.co or downloaded locally), you can specify the folder name here.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to accelerate downloads in China. If you are from China and have an accessibility
problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.
Please refer to the mirror site for more information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/loaders.py#L482"}}),mo=new Ts({props:{warning:!0,$$slots:{default:[sx]},$$scope:{ctx:Z}}}),ho=new Ts({props:{$$slots:{default:[ix]},$$scope:{ctx:Z}}}),uo=new Me({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.example",$$slots:{default:[rx]},$$scope:{ctx:Z}}}),go=new Me({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.example-2",$$slots:{default:[cx]},$$scope:{ctx:Z}}}),Xl=new $({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L235"}}),Ql=new $({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L263"}}),Ll=new $({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L242"}}),zl=new $({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L225"}}),Hl=new L({}),ql=new $({props:{name:"class diffusers.StableDiffusionControlNetInpaintPipeline",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"controlnet",val:": typing.Union[diffusers.models.controlnet.ControlNetModel, typing.List[diffusers.models.controlnet.ControlNetModel], typing.Tuple[diffusers.models.controlnet.ControlNetModel], diffusers.pipelines.controlnet.multicontrolnet.MultiControlNetModel]"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPImageProcessor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.17.1/en/api/models#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.17.1/en/api/models#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/v0.17.1/en/api/models#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code>) &#x2014;
Provides additional conditioning to the unet during the denoising process. If you set multiple ControlNets
as a list, the outputs from each ControlNet are added together to create one combined additional
conditioning.`,name:"controlnet"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.17.1/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.17.1/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.17.1/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.17.1/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L226"}}),wo=new Ts({props:{$$slots:{default:[dx]},$$scope:{ctx:Z}}}),es=new $({props:{name:"__call__",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[torch.Tensor, PIL.Image.Image] = None"},{name:"mask_image",val:": typing.Union[torch.Tensor, PIL.Image.Image] = None"},{name:"control_image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, numpy.ndarray, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image], typing.List[numpy.ndarray]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"strength",val:": float = 1.0"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 0.5"},{name:"guess_mode",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, or <code>List[List[PIL.Image.Image]]</code>):
The ControlNet input condition. ControlNet uses this input condition to generate guidance to Unet. If
the type is specified as <code>Torch.FloatTensor</code>, it is passed to ControlNet as is. <code>PIL.Image.Image</code> can
also be accepted as an image. The dimensions of the output image defaults to <code>image</code>&#x2019;s dimensions. If
height and/or width are passed, <code>image</code> is resized according to them. If multiple ControlNets are
specified in init, images must be passed as a list such that each element of the list can be correctly
batched for input to a single controlnet.`,name:"image"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.strength",description:`<strong>strength</strong> (<code>float</code>, <em>optional</em>, defaults to 1.) &#x2014;
Conceptually, indicates how much to transform the masked portion of the reference <code>image</code>. Must be
between 0 and 1. <code>image</code> will be used as a starting point, adding more noise to it the larger the
<code>strength</code>. The number of denoising steps depends on the amount of noise initially added. When
<code>strength</code> is 1, added noise will be maximum and the denoising process will run for the full number of
iterations specified in <code>num_inference_steps</code>. A value of 1, therefore, essentially ignores the masked
portion of the reference <code>image</code>.`,name:"strength"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.17.1/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.17.1/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.5) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet. If multiple ControlNets are specified in init, you can set the
corresponding scale as a list. Note that by default, we use a smaller conditioning scale for inpainting
than for <a href="/docs/diffusers/v0.17.1/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"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L972",returnDescription:`
<p><a
  href="/docs/diffusers/v0.17.1/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.17.1/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Mo=new Me({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.example",$$slots:{default:[px]},$$scope:{ctx:Z}}}),ts=new $({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/pipeline_utils.py#L1492"}}),ns=new $({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/pipeline_utils.py#L1508"}}),as=new $({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L324"}}),ls=new $({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L334"}}),is=new $({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/pipeline_utils.py#L1434"}}),Eo=new Me({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[fx]},$$scope:{ctx:Z}}}),rs=new $({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/pipeline_utils.py#L1466"}}),cs=new $({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.List[str], typing.Dict[str, torch.Tensor], typing.List[typing.Dict[str, torch.Tensor]]]"},{name:"token",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids should have an organization name, like
<code>&quot;sd-concepts-library/low-poly-hd-logos-icons&quot;</code>.</li>
<li>A path to a <em>directory</em> containing textual inversion weights, e.g.
<code>./my_text_inversion_directory/</code>.</li>
<li>A path to a <em>file</em> containing textual inversion weights, e.g. <code>./my_text_inversions.pt</code>.</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>
<p>Or a list of those elements.`,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 in two cases:</p>
<ul>
<li>The saved textual inversion file is in <code>diffusers</code> 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 &#x201C;Automatic1111&#x201D; form.</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 in which a downloaded pretrained model configuration should be cached if the
standard cache should not be 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 delete incompletely received files. Will attempt to resume the download if such a
file exists.`,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, e.g., <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(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{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>, will use the token generated
when running <code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>).`,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, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be 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;
In case the relevant files are located inside a subfolder of the model repo (either remote in
huggingface.co or downloaded locally), you can specify the folder name here.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to accelerate downloads in China. If you are from China and have an accessibility
problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.
Please refer to the mirror site for more information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/loaders.py#L482"}}),Jo=new Ts({props:{warning:!0,$$slots:{default:[mx]},$$scope:{ctx:Z}}}),Co=new Ts({props:{$$slots:{default:[hx]},$$scope:{ctx:Z}}}),jo=new Me({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.example",$$slots:{default:[ux]},$$scope:{ctx:Z}}}),Zo=new Me({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.example-2",$$slots:{default:[gx]},$$scope:{ctx:Z}}}),ds=new $({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L352"}}),fs=new $({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L380"}}),ms=new $({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L359"}}),hs=new $({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L342"}}),us=new L({}),gs=new $({props:{name:"class diffusers.FlaxStableDiffusionControlNetPipeline",anchor:"diffusers.FlaxStableDiffusionControlNetPipeline",parameters:[{name:"vae",val:": FlaxAutoencoderKL"},{name:"text_encoder",val:": FlaxCLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": FlaxUNet2DConditionModel"},{name:"controlnet",val:": FlaxControlNetModel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim_flax.FlaxDDIMScheduler, diffusers.schedulers.scheduling_pndm_flax.FlaxPNDMScheduler, diffusers.schedulers.scheduling_lms_discrete_flax.FlaxLMSDiscreteScheduler, diffusers.schedulers.scheduling_dpmsolver_multistep_flax.FlaxDPMSolverMultistepScheduler]"},{name:"safety_checker",val:": FlaxStableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPFeatureExtractor"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"}],parametersDescription:[{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.17.1/en/api/models#diffusers.FlaxAutoencoderKL">FlaxAutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>FlaxCLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.FlaxCLIPTextModel" rel="nofollow">CLIP</a>,
specifically the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.17.1/en/api/models#diffusers.FlaxUNet2DConditionModel">FlaxUNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/v0.17.1/en/api/models#diffusers.FlaxControlNetModel">FlaxControlNetModel</a> &#x2014;
Provides additional conditioning to the unet during the denoising process.`,name:"controlnet"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.17.1/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<code>FlaxDDIMScheduler</code>, <code>FlaxLMSDiscreteScheduler</code>, <code>FlaxPNDMScheduler</code>, or
<code>FlaxDPMSolverMultistepScheduler</code>.`,name:"scheduler"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>FlaxStableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please, refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for details.`,name:"safety_checker"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPFeatureExtractor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py#L119"}}),bs=new $({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 <code>FlaxStableDiffusionPipelineOutput</code> instead of
a plain tuple.`,name:"return_dict"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.jit",description:`<strong>jit</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to run <code>pmap</code> versions of the generation and safety scoring functions. NOTE: This argument
exists because <code>__call__</code> is not yet end-to-end pmap-able. It will be removed in a future release.`,name:"jit"}],source:"https://github.com/huggingface/diffusers/blob/v0.17.1/src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py#L357",returnDescription:`
<p><code>FlaxStableDiffusionPipelineOutput</code> 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><code>FlaxStableDiffusionPipelineOutput</code> or <code>tuple</code></p>
`}}),Wo=new Me({props:{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.example",$$slots:{default:[_x]},$$scope:{ctx:Z}}}),{c(){h=o("meta"),I=c(),u=o("h1"),_=o("a"),J=o("span"),v(m.$$.fragment),b=c(),j=o("span"),g=s("Text-to-Image Generation with ControlNet Conditioning"),E=c(),k=o("h2"),V=o("a"),z=o("span"),v(xe.$$.fragment),Us=c(),zt=o("span"),I_=s("Overview"),Dh=c(),Qo=o("p"),Lo=o("a"),J_=s("Adding Conditional Control to Text-to-Image Diffusion Models"),C_=s(" by Lvmin Zhang and Maneesh Agrawala."),Sh=c(),Es=o("p"),j_=s("Using the pretrained models 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."),Bh=c(),Is=o("p"),Z_=s("The abstract of the paper is the following:"),Ph=c(),Js=o("p"),Mc=o("em"),N_=s("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."),Rh=c(),Ht=o("p"),$_=s("This model was contributed by the community contributor "),zo=o("a"),k_=s("takuma104"),x_=s(" \u2764\uFE0F ."),Fh=c(),Cs=o("p"),W_=s("Resources:"),Vh=c(),qt=o("ul"),Tc=o("li"),Ho=o("a"),G_=s("Paper"),D_=c(),Uc=o("li"),qo=o("a"),S_=s("Original Code"),Ah=c(),vt=o("h2"),Ot=o("a"),Ec=o("span"),v(Oo.$$.fragment),B_=c(),Ic=o("span"),P_=s("Available Pipelines:"),Xh=c(),Kt=o("table"),Jc=o("thead"),yt=o("tr"),Cc=o("th"),R_=s("Pipeline"),F_=c(),jc=o("th"),V_=s("Tasks"),A_=c(),js=o("th"),X_=s("Demo"),Y_=c(),wt=o("tbody"),Mt=o("tr"),Zc=o("td"),Ko=o("a"),Q_=s("StableDiffusionControlNetPipeline"),L_=c(),Nc=o("td"),$c=o("em"),z_=s("Text-to-Image Generation with ControlNet Conditioning"),H_=c(),Zs=o("td"),ea=o("a"),q_=s("Colab Example"),O_=c(),Tt=o("tr"),kc=o("td"),ta=o("a"),K_=s("StableDiffusionControlNetImg2ImgPipeline"),eb=c(),xc=o("td"),Wc=o("em"),tb=s("Image-to-Image Generation with ControlNet Conditioning"),nb=c(),Gc=o("td"),ob=c(),Ut=o("tr"),Dc=o("td"),na=o("a"),ab=s("StableDiffusionControlNetInpaintPipeline"),lb=c(),Sc=o("td"),Bc=o("em"),sb=s("Inpainting Generation with ControlNet Conditioning"),ib=c(),Pc=o("td"),Yh=c(),Et=o("h2"),en=o("a"),Rc=o("span"),v(oa.$$.fragment),rb=c(),Fc=o("span"),cb=s("Usage example"),Qh=c(),tn=o("p"),db=s("In the following we give a simple example of how to use a "),Vc=o("em"),pb=s("ControlNet"),fb=s(` checkpoint with Diffusers for inference.
The inference pipeline is the same for all pipelines:`),Lh=c(),nn=o("ul"),Ac=o("li"),Xc=o("ol"),Yc=o("li"),mb=s("Take an image and run it through a pre-conditioning processor."),hb=c(),Qc=o("li"),Ns=o("ol"),aa=o("li"),ub=s("Run the pre-processed image through the "),$s=o("a"),gb=s("StableDiffusionControlNetPipeline"),_b=s("."),zh=c(),on=o("p"),bb=s("Let\u2019s have a look at a simple example using the "),la=o("a"),vb=s("Canny Edge ControlNet"),yb=s("."),Hh=c(),v(sa.$$.fragment),qh=c(),ks=o("p"),xs=o("img"),Oh=c(),We=o("p"),wb=s("Next, we process the image to get the canny image. This is step "),Lc=o("em"),Mb=s("1."),Tb=s(" - running the pre-conditioning processor. The pre-conditioning processor is different for every ControlNet. Please see the model cards of the "),Ws=o("a"),Ub=s("official checkpoints"),Eb=s(" for more information about other models."),Kh=c(),Gs=o("p"),Ib=s("First, we need to install opencv:"),eu=c(),v(ia.$$.fragment),tu=c(),Ds=o("p"),Jb=s("Next, let\u2019s also install all required Hugging Face libraries:"),nu=c(),v(ra.$$.fragment),ou=c(),Ss=o("p"),Cb=s("Then we can retrieve the canny edges of the image."),au=c(),v(ca.$$.fragment),lu=c(),Bs=o("p"),jb=s("Let\u2019s take a look at the processed image."),su=c(),Ps=o("p"),Rs=o("img"),iu=c(),an=o("p"),Zb=s("Now, we load the official "),Fs=o("a"),Nb=s("Stable Diffusion 1.5 Model"),$b=s(" as well as the ControlNet for canny edges."),ru=c(),v(da.$$.fragment),cu=c(),ln=o("p"),kb=s("To speed-up things and reduce memory, let\u2019s enable model offloading and use the fast "),Vs=o("a"),xb=s("UniPCMultistepScheduler"),Wb=s("."),du=c(),v(pa.$$.fragment),pu=c(),As=o("p"),Gb=s("Finally, we can run the pipeline:"),fu=c(),v(fa.$$.fragment),mu=c(),Xs=o("p"),Db=s("This should take only around 3-4 seconds on GPU (depending on hardware). The output image then looks as follows:"),hu=c(),Ys=o("p"),Qs=o("img"),uu=c(),It=o("p"),zc=o("strong"),Sb=s("Note"),Bb=s(": To see how to run all other ControlNet checkpoints, please have a look at "),Ls=o("a"),Pb=s("ControlNet with Stable Diffusion 1.5"),Rb=s("."),gu=c(),Jt=o("h2"),sn=o("a"),Hc=o("span"),v(ma.$$.fragment),Fb=c(),qc=o("span"),Vb=s("Combining multiple conditionings"),_u=c(),rn=o("p"),Ab=s("Multiple ControlNet conditionings can be combined for a single image generation. Pass a list of ControlNets to the pipeline\u2019s constructor and a corresponding list of conditionings to "),Oc=o("code"),Xb=s("__call__"),Yb=s("."),bu=c(),zs=o("p"),Qb=s("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."),vu=c(),cn=o("p"),Lb=s("It can also be helpful to vary the "),Kc=o("code"),zb=s("controlnet_conditioning_scales"),Hb=s(" to emphasize one conditioning over the other."),yu=c(),Ct=o("h3"),dn=o("a"),ed=o("span"),v(ha.$$.fragment),qb=c(),td=o("span"),Ob=s("Canny conditioning"),wu=c(),Hs=o("p"),Kb=s("The original image:"),Mu=c(),qs=o("img"),Tu=c(),Os=o("p"),ev=s("Prepare the conditioning:"),Uu=c(),v(ua.$$.fragment),Eu=c(),Ks=o("img"),Iu=c(),jt=o("h3"),pn=o("a"),nd=o("span"),v(ga.$$.fragment),tv=c(),od=o("span"),nv=s("Openpose conditioning"),Ju=c(),ei=o("p"),ov=s("The original image:"),Cu=c(),_a=o("img"),ju=c(),ti=o("p"),av=s("Prepare the conditioning:"),Zu=c(),v(ba.$$.fragment),Nu=c(),va=o("img"),$u=c(),Zt=o("h3"),fn=o("a"),ad=o("span"),v(ya.$$.fragment),lv=c(),ld=o("span"),sv=s("Running ControlNet with multiple conditionings"),ku=c(),v(wa.$$.fragment),xu=c(),Ma=o("img"),Wu=c(),Nt=o("h3"),mn=o("a"),sd=o("span"),v(Ta.$$.fragment),iv=c(),id=o("span"),rv=s("Guess Mode"),Gu=c(),Ge=o("p"),cv=s("Guess Mode is "),Ua=o("a"),dv=s("a ControlNet feature that was implemented"),pv=s(" after the publication of "),Ea=o("a"),fv=s("the paper"),mv=s(". The description states:"),Du=c(),ni=o("blockquote"),rd=o("p"),hv=s("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."),Su=c(),$t=o("h4"),hn=o("a"),cd=o("span"),v(Ia.$$.fragment),uv=c(),dd=o("span"),gv=s("The core implementation:"),Bu=c(),De=o("p"),_v=s("It adjusts the scale of the output residuals from ControlNet by a fixed ratio depending on the block depth. The shallowest DownBlock corresponds to "),pd=o("code"),bv=s("0.1"),vv=s(". As the blocks get deeper, the scale increases exponentially, and the scale for the output of the MidBlock becomes "),fd=o("code"),yv=s("1.0"),wv=s("."),Pu=c(),un=o("p"),Mv=s("Since the core implementation is just this, "),md=o("strong"),Tv=s("it does not have any impact on prompt conditioning"),Uv=s(". While it is common to use it without specifying any prompts, it is also possible to provide prompts if desired."),Ru=c(),kt=o("h4"),gn=o("a"),hd=o("span"),v(Ja.$$.fragment),Ev=c(),ud=o("span"),Iv=s("Usage:"),Fu=c(),Ue=o("p"),Jv=s("Just specify "),gd=o("code"),Cv=s("guess_mode=True"),jv=s(" in the pipe() function. A "),_d=o("code"),Zv=s("guidance_scale"),Nv=s(" between 3.0 and 5.0 is "),Ca=o("a"),$v=s("recommended"),kv=s("."),Vu=c(),v(ja.$$.fragment),Au=c(),xt=o("h4"),_n=o("a"),bd=o("span"),v(Za.$$.fragment),xv=c(),vd=o("span"),Wv=s("Output image comparison:"),Xu=s(`

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

Canny Control Example
`),bn=a(n,"TABLE",{});var jg=l(bn);yd=a(jg,"THEAD",{});var T5=l(yd);Na=a(T5,"TR",{});var Zg=l(Na);wd=a(Zg,"TH",{});var U5=l(wd);Gv=i(U5,"no guess_mode with prompt"),U5.forEach(t),Dv=d(Zg),Md=a(Zg,"TH",{});var E5=l(Md);Sv=i(E5,"guess_mode without prompt"),E5.forEach(t),Zg.forEach(t),T5.forEach(t),Bv=d(jg),Td=a(jg,"TBODY",{});var I5=l(Td);$a=a(I5,"TR",{});var Ng=l($a);Ud=a(Ng,"TD",{});var J5=l(Ud);oi=a(J5,"A",{href:!0});var C5=l(oi);ai=a(C5,"IMG",{width:!0,src:!0}),C5.forEach(t),J5.forEach(t),Pv=d(Ng),Ed=a(Ng,"TD",{});var j5=l(Ed);li=a(j5,"A",{href:!0});var Z5=l(li);si=a(Z5,"IMG",{width:!0,src:!0}),Z5.forEach(t),j5.forEach(t),Ng.forEach(t),I5.forEach(t),jg.forEach(t),Yu=d(n),Wt=a(n,"H2",{class:!0});var $g=l(Wt);vn=a($g,"A",{id:!0,class:!0,href:!0});var N5=l(vn);Id=a(N5,"SPAN",{});var $5=l(Id);y(ka.$$.fragment,$5),$5.forEach(t),N5.forEach(t),Rv=d($g),Jd=a($g,"SPAN",{});var k5=l(Jd);Fv=i(k5,"Available checkpoints"),k5.forEach(t),$g.forEach(t),Qu=d(n),Se=a(n,"P",{});var nc=l(Se);Vv=i(nc,"ControlNet requires a "),Cd=a(nc,"EM",{});var x5=l(Cd);Av=i(x5,"control image"),x5.forEach(t),Xv=i(nc," in addition to the text-to-image "),jd=a(nc,"EM",{});var W5=l(jd);Yv=i(W5,"prompt"),W5.forEach(t),Qv=i(nc,`.
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.`),nc.forEach(t),Lu=d(n),yn=a(n,"P",{});var kg=l(yn);Lv=i(kg,"All checkpoints can be found under the authors\u2019 namespace "),xa=a(kg,"A",{href:!0,rel:!0});var G5=l(xa);zv=i(G5,"lllyasviel"),G5.forEach(t),Hv=i(kg,"."),kg.forEach(t),zu=d(n),Gt=a(n,"P",{});var jh=l(Gt);Zd=a(jh,"STRONG",{});var D5=l(Zd);qv=i(D5,"13.04.2024 Update"),D5.forEach(t),Ov=i(jh,": The author has released improved controlnet checkpoints v1.1 - see "),ii=a(jh,"A",{href:!0});var S5=l(ii);Kv=i(S5,"here"),S5.forEach(t),ey=i(jh,"."),jh.forEach(t),Hu=d(n),Dt=a(n,"H3",{class:!0});var xg=l(Dt);wn=a(xg,"A",{id:!0,class:!0,href:!0});var B5=l(wn);Nd=a(B5,"SPAN",{});var P5=l(Nd);y(Wa.$$.fragment,P5),P5.forEach(t),B5.forEach(t),ty=d(xg),$d=a(xg,"SPAN",{});var R5=l($d);ny=i(R5,"ControlNet v1.0"),R5.forEach(t),xg.forEach(t),qu=d(n),Mn=a(n,"TABLE",{});var Wg=l(Mn);kd=a(Wg,"THEAD",{});var F5=l(kd);Ee=a(F5,"TR",{});var Do=l(Ee);xd=a(Do,"TH",{});var V5=l(xd);oy=i(V5,"Model Name"),V5.forEach(t),ay=d(Do),Wd=a(Do,"TH",{});var A5=l(Wd);ly=i(A5,"Control Image Overview"),A5.forEach(t),sy=d(Do),Gd=a(Do,"TH",{});var X5=l(Gd);iy=i(X5,"Control Image Example"),X5.forEach(t),ry=d(Do),Dd=a(Do,"TH",{});var Y5=l(Dd);cy=i(Y5,"Generated Image Example"),Y5.forEach(t),Do.forEach(t),F5.forEach(t),dy=d(Wg),Q=a(Wg,"TBODY",{});var H=l(Q);Ie=a(H,"TR",{});var So=l(Ie);Tn=a(So,"TD",{});var Zh=l(Tn);Ga=a(Zh,"A",{href:!0,rel:!0});var Q5=l(Ga);py=i(Q5,"lllyasviel/sd-controlnet-canny"),Q5.forEach(t),fy=a(Zh,"BR",{}),my=d(Zh),Sd=a(Zh,"EM",{});var L5=l(Sd);hy=i(L5,"Trained with canny edge detection"),L5.forEach(t),Zh.forEach(t),uy=d(So),Bd=a(So,"TD",{});var z5=l(Bd);gy=i(z5,"A monochrome image with white edges on a black background."),z5.forEach(t),_y=d(So),Pd=a(So,"TD",{});var H5=l(Pd);ri=a(H5,"A",{href:!0});var q5=l(ri);Un=a(q5,"IMG",{width:!0,style:!0,src:!0}),q5.forEach(t),H5.forEach(t),by=d(So),Rd=a(So,"TD",{});var O5=l(Rd);ci=a(O5,"A",{href:!0});var K5=l(ci);di=a(K5,"IMG",{width:!0,src:!0}),K5.forEach(t),O5.forEach(t),So.forEach(t),vy=d(H),Je=a(H,"TR",{});var Bo=l(Je);En=a(Bo,"TD",{});var Nh=l(En);Da=a(Nh,"A",{href:!0,rel:!0});var ej=l(Da);yy=i(ej,"lllyasviel/sd-controlnet-depth"),ej.forEach(t),wy=a(Nh,"BR",{}),My=d(Nh),Fd=a(Nh,"EM",{});var tj=l(Fd);Ty=i(tj,"Trained with Midas depth estimation"),tj.forEach(t),Nh.forEach(t),Uy=d(Bo),Vd=a(Bo,"TD",{});var nj=l(Vd);Ey=i(nj,"A grayscale image with black representing deep areas and white representing shallow areas."),nj.forEach(t),Iy=d(Bo),Ad=a(Bo,"TD",{});var oj=l(Ad);pi=a(oj,"A",{href:!0});var aj=l(pi);fi=a(aj,"IMG",{width:!0,src:!0}),aj.forEach(t),oj.forEach(t),Jy=d(Bo),Xd=a(Bo,"TD",{});var lj=l(Xd);mi=a(lj,"A",{href:!0});var sj=l(mi);hi=a(sj,"IMG",{width:!0,src:!0}),sj.forEach(t),lj.forEach(t),Bo.forEach(t),Cy=d(H),Ce=a(H,"TR",{});var Po=l(Ce);In=a(Po,"TD",{});var $h=l(In);Sa=a($h,"A",{href:!0,rel:!0});var ij=l(Sa);jy=i(ij,"lllyasviel/sd-controlnet-hed"),ij.forEach(t),Zy=a($h,"BR",{}),Ny=d($h),Yd=a($h,"EM",{});var rj=l(Yd);$y=i(rj,"Trained with HED edge detection (soft edge)"),rj.forEach(t),$h.forEach(t),ky=d(Po),Qd=a(Po,"TD",{});var cj=l(Qd);xy=i(cj,"A monochrome image with white soft edges on a black background."),cj.forEach(t),Wy=d(Po),Ld=a(Po,"TD",{});var dj=l(Ld);ui=a(dj,"A",{href:!0});var pj=l(ui);gi=a(pj,"IMG",{width:!0,src:!0}),pj.forEach(t),dj.forEach(t),Gy=d(Po),zd=a(Po,"TD",{});var fj=l(zd);_i=a(fj,"A",{href:!0});var mj=l(_i);bi=a(mj,"IMG",{width:!0,src:!0}),mj.forEach(t),fj.forEach(t),Po.forEach(t),Dy=d(H),je=a(H,"TR",{});var Ro=l(je);Jn=a(Ro,"TD",{});var kh=l(Jn);Ba=a(kh,"A",{href:!0,rel:!0});var hj=l(Ba);Sy=i(hj,"lllyasviel/sd-controlnet-mlsd"),hj.forEach(t),By=a(kh,"BR",{}),Py=d(kh),Hd=a(kh,"EM",{});var uj=l(Hd);Ry=i(uj,"Trained with M-LSD line detection"),uj.forEach(t),kh.forEach(t),Fy=d(Ro),qd=a(Ro,"TD",{});var gj=l(qd);Vy=i(gj,"A monochrome image composed only of white straight lines on a black background."),gj.forEach(t),Ay=d(Ro),Od=a(Ro,"TD",{});var _j=l(Od);vi=a(_j,"A",{href:!0});var bj=l(vi);yi=a(bj,"IMG",{width:!0,src:!0}),bj.forEach(t),_j.forEach(t),Xy=d(Ro),Kd=a(Ro,"TD",{});var vj=l(Kd);wi=a(vj,"A",{href:!0});var yj=l(wi);Mi=a(yj,"IMG",{width:!0,src:!0}),yj.forEach(t),vj.forEach(t),Ro.forEach(t),Yy=d(H),Ze=a(H,"TR",{});var Fo=l(Ze);Cn=a(Fo,"TD",{});var xh=l(Cn);Pa=a(xh,"A",{href:!0,rel:!0});var wj=l(Pa);Qy=i(wj,"lllyasviel/sd-controlnet-normal"),wj.forEach(t),Ly=a(xh,"BR",{}),zy=d(xh),ep=a(xh,"EM",{});var Mj=l(ep);Hy=i(Mj,"Trained with normal map"),Mj.forEach(t),xh.forEach(t),qy=d(Fo),Ra=a(Fo,"TD",{});var Gg=l(Ra);Oy=i(Gg,"A "),Fa=a(Gg,"A",{href:!0,rel:!0});var Tj=l(Fa);Ky=i(Tj,"normal mapped"),Tj.forEach(t),e1=i(Gg," image."),Gg.forEach(t),t1=d(Fo),tp=a(Fo,"TD",{});var Uj=l(tp);Ti=a(Uj,"A",{href:!0});var Ej=l(Ti);Ui=a(Ej,"IMG",{width:!0,src:!0}),Ej.forEach(t),Uj.forEach(t),n1=d(Fo),np=a(Fo,"TD",{});var Ij=l(np);Ei=a(Ij,"A",{href:!0});var Jj=l(Ei);Ii=a(Jj,"IMG",{width:!0,src:!0}),Jj.forEach(t),Ij.forEach(t),Fo.forEach(t),o1=d(H),Ne=a(H,"TR",{});var Vo=l(Ne);jn=a(Vo,"TD",{});var Wh=l(jn);Va=a(Wh,"A",{href:!0,rel:!0});var Cj=l(Va);a1=i(Cj,"lllyasviel/sd-controlnet-openpose"),Cj.forEach(t),l1=a(Wh,"BR",{}),s1=d(Wh),op=a(Wh,"EM",{});var jj=l(op);i1=i(jj,"Trained with OpenPose bone image"),jj.forEach(t),Wh.forEach(t),r1=d(Vo),Aa=a(Vo,"TD",{});var Dg=l(Aa);c1=i(Dg,"A "),Xa=a(Dg,"A",{href:!0,rel:!0});var Zj=l(Xa);d1=i(Zj,"OpenPose bone"),Zj.forEach(t),p1=i(Dg," image."),Dg.forEach(t),f1=d(Vo),ap=a(Vo,"TD",{});var Nj=l(ap);Ji=a(Nj,"A",{href:!0});var $j=l(Ji);Ci=a($j,"IMG",{width:!0,src:!0}),$j.forEach(t),Nj.forEach(t),m1=d(Vo),lp=a(Vo,"TD",{});var kj=l(lp);ji=a(kj,"A",{href:!0});var xj=l(ji);Zi=a(xj,"IMG",{width:!0,src:!0}),xj.forEach(t),kj.forEach(t),Vo.forEach(t),h1=d(H),$e=a(H,"TR",{});var Ao=l($e);Zn=a(Ao,"TD",{});var Gh=l(Zn);Ya=a(Gh,"A",{href:!0,rel:!0});var Wj=l(Ya);u1=i(Wj,"lllyasviel/sd-controlnet-scribble"),Wj.forEach(t),g1=a(Gh,"BR",{}),_1=d(Gh),sp=a(Gh,"EM",{});var Gj=l(sp);b1=i(Gj,"Trained with human scribbles"),Gj.forEach(t),Gh.forEach(t),v1=d(Ao),ip=a(Ao,"TD",{});var Dj=l(ip);y1=i(Dj,"A hand-drawn monochrome image with white outlines on a black background."),Dj.forEach(t),w1=d(Ao),rp=a(Ao,"TD",{});var Sj=l(rp);Ni=a(Sj,"A",{href:!0});var Bj=l(Ni);$i=a(Bj,"IMG",{width:!0,src:!0}),Bj.forEach(t),Sj.forEach(t),M1=d(Ao),cp=a(Ao,"TD",{});var Pj=l(cp);ki=a(Pj,"A",{href:!0});var Rj=l(ki);xi=a(Rj,"IMG",{width:!0,src:!0}),Rj.forEach(t),Pj.forEach(t),Ao.forEach(t),T1=d(H),ke=a(H,"TR",{});var Xo=l(ke);Qa=a(Xo,"TD",{});var Sg=l(Qa);La=a(Sg,"A",{href:!0,rel:!0});var Fj=l(La);U1=i(Fj,"lllyasviel/sd-controlnet-seg"),Fj.forEach(t),E1=a(Sg,"BR",{}),dp=a(Sg,"EM",{});var Vj=l(dp);I1=i(Vj,"Trained with semantic segmentation"),Vj.forEach(t),Sg.forEach(t),J1=d(Xo),za=a(Xo,"TD",{});var Bg=l(za);C1=i(Bg,"An "),Ha=a(Bg,"A",{href:!0,rel:!0});var Aj=l(Ha);j1=i(Aj,"ADE20K"),Aj.forEach(t),Z1=i(Bg,"\u2019s segmentation protocol image."),Bg.forEach(t),N1=d(Xo),pp=a(Xo,"TD",{});var Xj=l(pp);Wi=a(Xj,"A",{href:!0});var Yj=l(Wi);Gi=a(Yj,"IMG",{width:!0,src:!0}),Yj.forEach(t),Xj.forEach(t),$1=d(Xo),fp=a(Xo,"TD",{});var Qj=l(fp);Di=a(Qj,"A",{href:!0});var Lj=l(Di);Si=a(Lj,"IMG",{width:!0,src:!0}),Lj.forEach(t),Qj.forEach(t),Xo.forEach(t),H.forEach(t),Wg.forEach(t),Ou=d(n),St=a(n,"H3",{class:!0});var Pg=l(St);Nn=a(Pg,"A",{id:!0,class:!0,href:!0});var zj=l(Nn);mp=a(zj,"SPAN",{});var Hj=l(mp);y(qa.$$.fragment,Hj),Hj.forEach(t),zj.forEach(t),k1=d(Pg),hp=a(Pg,"SPAN",{});var qj=l(hp);x1=i(qj,"ControlNet v1.1"),qj.forEach(t),Pg.forEach(t),Ku=d(n),$n=a(n,"TABLE",{});var Rg=l($n);up=a(Rg,"THEAD",{});var Oj=l(up);oe=a(Oj,"TR",{});var Oe=l(oe);gp=a(Oe,"TH",{});var Kj=l(gp);W1=i(Kj,"Model Name"),Kj.forEach(t),G1=d(Oe),_p=a(Oe,"TH",{});var eZ=l(_p);D1=i(eZ,"Control Image Overview"),eZ.forEach(t),S1=d(Oe),bp=a(Oe,"TH",{});var tZ=l(bp);B1=i(tZ,"Condition Image"),tZ.forEach(t),P1=d(Oe),vp=a(Oe,"TH",{});var nZ=l(vp);R1=i(nZ,"Control Image Example"),nZ.forEach(t),F1=d(Oe),yp=a(Oe,"TH",{});var oZ=l(yp);V1=i(oZ,"Generated Image Example"),oZ.forEach(t),Oe.forEach(t),Oj.forEach(t),A1=d(Rg),B=a(Rg,"TBODY",{});var R=l(B);ae=a(R,"TR",{});var Ke=l(ae);Bi=a(Ke,"TD",{});var JI=l(Bi);Oa=a(JI,"A",{href:!0,rel:!0});var aZ=l(Oa);X1=i(aZ,"lllyasviel/control_v11p_sd15_canny"),aZ.forEach(t),Y1=a(JI,"BR",{}),JI.forEach(t),Q1=d(Ke),wp=a(Ke,"TD",{});var lZ=l(wp);Mp=a(lZ,"EM",{});var sZ=l(Mp);L1=i(sZ,"Trained with canny edge detection"),sZ.forEach(t),lZ.forEach(t),z1=d(Ke),Tp=a(Ke,"TD",{});var iZ=l(Tp);H1=i(iZ,"A monochrome image with white edges on a black background."),iZ.forEach(t),q1=d(Ke),Up=a(Ke,"TD",{});var rZ=l(Up);Pi=a(rZ,"A",{href:!0});var cZ=l(Pi);kn=a(cZ,"IMG",{width:!0,style:!0,src:!0}),cZ.forEach(t),rZ.forEach(t),O1=d(Ke),Ep=a(Ke,"TD",{});var dZ=l(Ep);Ri=a(dZ,"A",{href:!0});var pZ=l(Ri);Fi=a(pZ,"IMG",{width:!0,src:!0}),pZ.forEach(t),dZ.forEach(t),Ke.forEach(t),K1=d(R),le=a(R,"TR",{});var et=l(le);Vi=a(et,"TD",{});var CI=l(Vi);Ka=a(CI,"A",{href:!0,rel:!0});var fZ=l(Ka);ew=i(fZ,"lllyasviel/control_v11e_sd15_ip2p"),fZ.forEach(t),tw=a(CI,"BR",{}),CI.forEach(t),nw=d(et),Ip=a(et,"TD",{});var mZ=l(Ip);Jp=a(mZ,"EM",{});var hZ=l(Jp);ow=i(hZ,"Trained with pixel to pixel instruction"),hZ.forEach(t),mZ.forEach(t),aw=d(et),Cp=a(et,"TD",{});var uZ=l(Cp);lw=i(uZ,"No condition ."),uZ.forEach(t),sw=d(et),jp=a(et,"TD",{});var gZ=l(jp);Ai=a(gZ,"A",{href:!0});var _Z=l(Ai);xn=a(_Z,"IMG",{width:!0,style:!0,src:!0}),_Z.forEach(t),gZ.forEach(t),iw=d(et),Zp=a(et,"TD",{});var bZ=l(Zp);Xi=a(bZ,"A",{href:!0});var vZ=l(Xi);Yi=a(vZ,"IMG",{width:!0,src:!0}),vZ.forEach(t),bZ.forEach(t),et.forEach(t),rw=d(R),se=a(R,"TR",{});var tt=l(se);Qi=a(tt,"TD",{});var jI=l(Qi);el=a(jI,"A",{href:!0,rel:!0});var yZ=l(el);cw=i(yZ,"lllyasviel/control_v11p_sd15_inpaint"),yZ.forEach(t),dw=a(jI,"BR",{}),jI.forEach(t),pw=d(tt),Np=a(tt,"TD",{});var wZ=l(Np);fw=i(wZ,"Trained with image inpainting"),wZ.forEach(t),mw=d(tt),$p=a(tt,"TD",{});var MZ=l($p);hw=i(MZ,"No condition."),MZ.forEach(t),uw=d(tt),kp=a(tt,"TD",{});var TZ=l(kp);Li=a(TZ,"A",{href:!0});var UZ=l(Li);Wn=a(UZ,"IMG",{width:!0,style:!0,src:!0}),UZ.forEach(t),TZ.forEach(t),gw=d(tt),xp=a(tt,"TD",{});var EZ=l(xp);zi=a(EZ,"A",{href:!0});var IZ=l(zi);Hi=a(IZ,"IMG",{width:!0,src:!0}),IZ.forEach(t),EZ.forEach(t),tt.forEach(t),_w=d(R),ie=a(R,"TR",{});var nt=l(ie);qi=a(nt,"TD",{});var ZI=l(qi);tl=a(ZI,"A",{href:!0,rel:!0});var JZ=l(tl);bw=i(JZ,"lllyasviel/control_v11p_sd15_mlsd"),JZ.forEach(t),vw=a(ZI,"BR",{}),ZI.forEach(t),yw=d(nt),Wp=a(nt,"TD",{});var CZ=l(Wp);ww=i(CZ,"Trained with multi-level line segment detection"),CZ.forEach(t),Mw=d(nt),Gp=a(nt,"TD",{});var jZ=l(Gp);Tw=i(jZ,"An image with annotated line segments."),jZ.forEach(t),Uw=d(nt),Dp=a(nt,"TD",{});var ZZ=l(Dp);Oi=a(ZZ,"A",{href:!0});var NZ=l(Oi);Gn=a(NZ,"IMG",{width:!0,style:!0,src:!0}),NZ.forEach(t),ZZ.forEach(t),Ew=d(nt),Sp=a(nt,"TD",{});var $Z=l(Sp);Ki=a($Z,"A",{href:!0});var kZ=l(Ki);er=a(kZ,"IMG",{width:!0,src:!0}),kZ.forEach(t),$Z.forEach(t),nt.forEach(t),Iw=d(R),re=a(R,"TR",{});var ot=l(re);tr=a(ot,"TD",{});var NI=l(tr);nl=a(NI,"A",{href:!0,rel:!0});var xZ=l(nl);Jw=i(xZ,"lllyasviel/control_v11f1p_sd15_depth"),xZ.forEach(t),Cw=a(NI,"BR",{}),NI.forEach(t),jw=d(ot),Bp=a(ot,"TD",{});var WZ=l(Bp);Zw=i(WZ,"Trained with depth estimation"),WZ.forEach(t),Nw=d(ot),Pp=a(ot,"TD",{});var GZ=l(Pp);$w=i(GZ,"An image with depth information, usually represented as a grayscale image."),GZ.forEach(t),kw=d(ot),Rp=a(ot,"TD",{});var DZ=l(Rp);nr=a(DZ,"A",{href:!0});var SZ=l(nr);Dn=a(SZ,"IMG",{width:!0,style:!0,src:!0}),SZ.forEach(t),DZ.forEach(t),xw=d(ot),Fp=a(ot,"TD",{});var BZ=l(Fp);or=a(BZ,"A",{href:!0});var PZ=l(or);ar=a(PZ,"IMG",{width:!0,src:!0}),PZ.forEach(t),BZ.forEach(t),ot.forEach(t),Ww=d(R),ce=a(R,"TR",{});var at=l(ce);lr=a(at,"TD",{});var $I=l(lr);ol=a($I,"A",{href:!0,rel:!0});var RZ=l(ol);Gw=i(RZ,"lllyasviel/control_v11p_sd15_normalbae"),RZ.forEach(t),Dw=a($I,"BR",{}),$I.forEach(t),Sw=d(at),Vp=a(at,"TD",{});var FZ=l(Vp);Bw=i(FZ,"Trained with surface normal estimation"),FZ.forEach(t),Pw=d(at),Ap=a(at,"TD",{});var VZ=l(Ap);Rw=i(VZ,"An image with surface normal information, usually represented as a color-coded image."),VZ.forEach(t),Fw=d(at),Xp=a(at,"TD",{});var AZ=l(Xp);sr=a(AZ,"A",{href:!0});var XZ=l(sr);Sn=a(XZ,"IMG",{width:!0,style:!0,src:!0}),XZ.forEach(t),AZ.forEach(t),Vw=d(at),Yp=a(at,"TD",{});var YZ=l(Yp);ir=a(YZ,"A",{href:!0});var QZ=l(ir);rr=a(QZ,"IMG",{width:!0,src:!0}),QZ.forEach(t),YZ.forEach(t),at.forEach(t),Aw=d(R),de=a(R,"TR",{});var lt=l(de);cr=a(lt,"TD",{});var kI=l(cr);al=a(kI,"A",{href:!0,rel:!0});var LZ=l(al);Xw=i(LZ,"lllyasviel/control_v11p_sd15_seg"),LZ.forEach(t),Yw=a(kI,"BR",{}),kI.forEach(t),Qw=d(lt),Qp=a(lt,"TD",{});var zZ=l(Qp);Lw=i(zZ,"Trained with image segmentation"),zZ.forEach(t),zw=d(lt),Lp=a(lt,"TD",{});var HZ=l(Lp);Hw=i(HZ,"An image with segmented regions, usually represented as a color-coded image."),HZ.forEach(t),qw=d(lt),zp=a(lt,"TD",{});var qZ=l(zp);dr=a(qZ,"A",{href:!0});var OZ=l(dr);Bn=a(OZ,"IMG",{width:!0,style:!0,src:!0}),OZ.forEach(t),qZ.forEach(t),Ow=d(lt),Hp=a(lt,"TD",{});var KZ=l(Hp);pr=a(KZ,"A",{href:!0});var eN=l(pr);fr=a(eN,"IMG",{width:!0,src:!0}),eN.forEach(t),KZ.forEach(t),lt.forEach(t),Kw=d(R),pe=a(R,"TR",{});var st=l(pe);mr=a(st,"TD",{});var xI=l(mr);ll=a(xI,"A",{href:!0,rel:!0});var tN=l(ll);e2=i(tN,"lllyasviel/control_v11p_sd15_lineart"),tN.forEach(t),t2=a(xI,"BR",{}),xI.forEach(t),n2=d(st),qp=a(st,"TD",{});var nN=l(qp);o2=i(nN,"Trained with line art generation"),nN.forEach(t),a2=d(st),Op=a(st,"TD",{});var oN=l(Op);l2=i(oN,"An image with line art, usually black lines on a white background."),oN.forEach(t),s2=d(st),Kp=a(st,"TD",{});var aN=l(Kp);hr=a(aN,"A",{href:!0});var lN=l(hr);Pn=a(lN,"IMG",{width:!0,style:!0,src:!0}),lN.forEach(t),aN.forEach(t),i2=d(st),ef=a(st,"TD",{});var sN=l(ef);ur=a(sN,"A",{href:!0});var iN=l(ur);gr=a(iN,"IMG",{width:!0,src:!0}),iN.forEach(t),sN.forEach(t),st.forEach(t),r2=d(R),fe=a(R,"TR",{});var it=l(fe);_r=a(it,"TD",{});var WI=l(_r);sl=a(WI,"A",{href:!0,rel:!0});var rN=l(sl);c2=i(rN,"lllyasviel/control_v11p_sd15s2_lineart_anime"),rN.forEach(t),d2=a(WI,"BR",{}),WI.forEach(t),p2=d(it),tf=a(it,"TD",{});var cN=l(tf);f2=i(cN,"Trained with anime line art generation"),cN.forEach(t),m2=d(it),nf=a(it,"TD",{});var dN=l(nf);h2=i(dN,"An image with anime-style line art."),dN.forEach(t),u2=d(it),of=a(it,"TD",{});var pN=l(of);br=a(pN,"A",{href:!0});var fN=l(br);Rn=a(fN,"IMG",{width:!0,style:!0,src:!0}),fN.forEach(t),pN.forEach(t),g2=d(it),af=a(it,"TD",{});var mN=l(af);vr=a(mN,"A",{href:!0});var hN=l(vr);yr=a(hN,"IMG",{width:!0,src:!0}),hN.forEach(t),mN.forEach(t),it.forEach(t),_2=d(R),me=a(R,"TR",{});var rt=l(me);wr=a(rt,"TD",{});var GI=l(wr);il=a(GI,"A",{href:!0,rel:!0});var uN=l(il);b2=i(uN,"lllyasviel/control_v11p_sd15_openpose"),uN.forEach(t),v2=a(GI,"BR",{}),GI.forEach(t),y2=d(rt),lf=a(rt,"TD",{});var gN=l(lf);w2=i(gN,"Trained with human pose estimation"),gN.forEach(t),M2=d(rt),sf=a(rt,"TD",{});var _N=l(sf);T2=i(_N,"An image with human poses, usually represented as a set of keypoints or skeletons."),_N.forEach(t),U2=d(rt),rf=a(rt,"TD",{});var bN=l(rf);Mr=a(bN,"A",{href:!0});var vN=l(Mr);Fn=a(vN,"IMG",{width:!0,style:!0,src:!0}),vN.forEach(t),bN.forEach(t),E2=d(rt),cf=a(rt,"TD",{});var yN=l(cf);Tr=a(yN,"A",{href:!0});var wN=l(Tr);Ur=a(wN,"IMG",{width:!0,src:!0}),wN.forEach(t),yN.forEach(t),rt.forEach(t),I2=d(R),he=a(R,"TR",{});var ct=l(he);Er=a(ct,"TD",{});var DI=l(Er);rl=a(DI,"A",{href:!0,rel:!0});var MN=l(rl);J2=i(MN,"lllyasviel/control_v11p_sd15_scribble"),MN.forEach(t),C2=a(DI,"BR",{}),DI.forEach(t),j2=d(ct),df=a(ct,"TD",{});var TN=l(df);Z2=i(TN,"Trained with scribble-based image generation"),TN.forEach(t),N2=d(ct),pf=a(ct,"TD",{});var UN=l(pf);$2=i(UN,"An image with scribbles, usually random or user-drawn strokes."),UN.forEach(t),k2=d(ct),ff=a(ct,"TD",{});var EN=l(ff);Ir=a(EN,"A",{href:!0});var IN=l(Ir);Vn=a(IN,"IMG",{width:!0,style:!0,src:!0}),IN.forEach(t),EN.forEach(t),x2=d(ct),mf=a(ct,"TD",{});var JN=l(mf);Jr=a(JN,"A",{href:!0});var CN=l(Jr);Cr=a(CN,"IMG",{width:!0,src:!0}),CN.forEach(t),JN.forEach(t),ct.forEach(t),W2=d(R),ue=a(R,"TR",{});var dt=l(ue);jr=a(dt,"TD",{});var SI=l(jr);cl=a(SI,"A",{href:!0,rel:!0});var jN=l(cl);G2=i(jN,"lllyasviel/control_v11p_sd15_softedge"),jN.forEach(t),D2=a(SI,"BR",{}),SI.forEach(t),S2=d(dt),hf=a(dt,"TD",{});var ZN=l(hf);B2=i(ZN,"Trained with soft edge image generation"),ZN.forEach(t),P2=d(dt),uf=a(dt,"TD",{});var NN=l(uf);R2=i(NN,"An image with soft edges, usually to create a more painterly or artistic effect."),NN.forEach(t),F2=d(dt),gf=a(dt,"TD",{});var $N=l(gf);Zr=a($N,"A",{href:!0});var kN=l(Zr);An=a(kN,"IMG",{width:!0,style:!0,src:!0}),kN.forEach(t),$N.forEach(t),V2=d(dt),_f=a(dt,"TD",{});var xN=l(_f);Nr=a(xN,"A",{href:!0});var WN=l(Nr);$r=a(WN,"IMG",{width:!0,src:!0}),WN.forEach(t),xN.forEach(t),dt.forEach(t),A2=d(R),ge=a(R,"TR",{});var pt=l(ge);kr=a(pt,"TD",{});var BI=l(kr);dl=a(BI,"A",{href:!0,rel:!0});var GN=l(dl);X2=i(GN,"lllyasviel/control_v11e_sd15_shuffle"),GN.forEach(t),Y2=a(BI,"BR",{}),BI.forEach(t),Q2=d(pt),bf=a(pt,"TD",{});var DN=l(bf);L2=i(DN,"Trained with image shuffling"),DN.forEach(t),z2=d(pt),vf=a(pt,"TD",{});var SN=l(vf);H2=i(SN,"An image with shuffled patches or regions."),SN.forEach(t),q2=d(pt),yf=a(pt,"TD",{});var BN=l(yf);xr=a(BN,"A",{href:!0});var PN=l(xr);Xn=a(PN,"IMG",{width:!0,style:!0,src:!0}),PN.forEach(t),BN.forEach(t),O2=d(pt),wf=a(pt,"TD",{});var RN=l(wf);Wr=a(RN,"A",{href:!0});var FN=l(Wr);Gr=a(FN,"IMG",{width:!0,src:!0}),FN.forEach(t),RN.forEach(t),pt.forEach(t),K2=d(R),_e=a(R,"TR",{});var ft=l(_e);Dr=a(ft,"TD",{});var PI=l(Dr);pl=a(PI,"A",{href:!0,rel:!0});var VN=l(pl);eM=i(VN,"lllyasviel/control_v11f1e_sd15_tile"),VN.forEach(t),tM=a(PI,"BR",{}),PI.forEach(t),nM=d(ft),Mf=a(ft,"TD",{});var AN=l(Mf);oM=i(AN,"Trained with image tiling"),AN.forEach(t),aM=d(ft),Tf=a(ft,"TD",{});var XN=l(Tf);lM=i(XN,"A blurry image or part of an image ."),XN.forEach(t),sM=d(ft),Uf=a(ft,"TD",{});var YN=l(Uf);Sr=a(YN,"A",{href:!0});var QN=l(Sr);Yn=a(QN,"IMG",{width:!0,style:!0,src:!0}),QN.forEach(t),YN.forEach(t),iM=d(ft),Ef=a(ft,"TD",{});var LN=l(Ef);Br=a(LN,"A",{href:!0});var zN=l(Br);Pr=a(zN,"IMG",{width:!0,src:!0}),zN.forEach(t),LN.forEach(t),ft.forEach(t),R.forEach(t),Rg.forEach(t),eg=d(n),Bt=a(n,"H2",{class:!0});var Fg=l(Bt);Qn=a(Fg,"A",{id:!0,class:!0,href:!0});var HN=l(Qn);If=a(HN,"SPAN",{});var qN=l(If);y(fl.$$.fragment,qN),qN.forEach(t),HN.forEach(t),rM=d(Fg),Jf=a(Fg,"SPAN",{});var ON=l(Jf);cM=i(ON,"StableDiffusionControlNetPipeline"),ON.forEach(t),Fg.forEach(t),tg=d(n),x=a(n,"DIV",{class:!0});var D=l(x);y(ml.$$.fragment,D),dM=d(D),Cf=a(D,"P",{});var KN=l(Cf);pM=i(KN,"Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),KN.forEach(t),fM=d(D),hl=a(D,"P",{});var Vg=l(hl);mM=i(Vg,"This model inherits from "),Rr=a(Vg,"A",{href:!0});var e$=l(Rr);hM=i(e$,"DiffusionPipeline"),e$.forEach(t),uM=i(Vg,`. 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.)`),Vg.forEach(t),gM=d(D),jf=a(D,"P",{});var t$=l(jf);_M=i(t$,"In addition the pipeline inherits the following loading methods:"),t$.forEach(t),bM=d(D),Zf=a(D,"UL",{});var n$=l(Zf);ul=a(n$,"LI",{});var Ag=l(ul);Nf=a(Ag,"EM",{});var o$=l(Nf);vM=i(o$,"Textual-Inversion"),o$.forEach(t),yM=i(Ag,": "),Fr=a(Ag,"A",{href:!0});var a$=l(Fr);wM=i(a$,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),a$.forEach(t),Ag.forEach(t),n$.forEach(t),MM=d(D),Be=a(D,"DIV",{class:!0});var oc=l(Be);y(gl.$$.fragment,oc),TM=d(oc),$f=a(oc,"P",{});var l$=l($f);UM=i(l$,"Function invoked when calling the pipeline for generation."),l$.forEach(t),EM=d(oc),y(Ln.$$.fragment,oc),oc.forEach(t),IM=d(D),Pe=a(D,"DIV",{class:!0});var ac=l(Pe);y(_l.$$.fragment,ac),JM=d(ac),kf=a(ac,"P",{});var s$=l(kf);CM=i(s$,"Enable sliced attention computation."),s$.forEach(t),jM=d(ac),xf=a(ac,"P",{});var i$=l(xf);ZM=i(i$,`When this option is enabled, the attention module will split the input tensor in slices, to compute attention
in several steps. This is useful to save some memory in exchange for a small speed decrease.`),i$.forEach(t),ac.forEach(t),NM=d(D),zn=a(D,"DIV",{class:!0});var Xg=l(zn);y(bl.$$.fragment,Xg),$M=d(Xg),vl=a(Xg,"P",{});var Yg=l(vl);kM=i(Yg,"Disable sliced attention computation. If "),Wf=a(Yg,"CODE",{});var r$=l(Wf);xM=i(r$,"enable_attention_slicing"),r$.forEach(t),WM=i(Yg,` was previously invoked, this method will go
back to computing attention in one step.`),Yg.forEach(t),Xg.forEach(t),GM=d(D),Re=a(D,"DIV",{class:!0});var lc=l(Re);y(yl.$$.fragment,lc),DM=d(lc),Gf=a(lc,"P",{});var c$=l(Gf);SM=i(c$,"Enable sliced VAE decoding."),c$.forEach(t),BM=d(lc),Df=a(lc,"P",{});var d$=l(Df);PM=i(d$,`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.`),d$.forEach(t),lc.forEach(t),RM=d(D),Hn=a(D,"DIV",{class:!0});var Qg=l(Hn);y(wl.$$.fragment,Qg),FM=d(Qg),Ml=a(Qg,"P",{});var Lg=l(Ml);VM=i(Lg,"Disable sliced VAE decoding. If "),Sf=a(Lg,"CODE",{});var p$=l(Sf);AM=i(p$,"enable_vae_slicing"),p$.forEach(t),XM=i(Lg,` was previously invoked, this method will go back to
computing decoding in one step.`),Lg.forEach(t),Qg.forEach(t),YM=d(D),ee=a(D,"DIV",{class:!0});var mt=l(ee);y(Tl.$$.fragment,mt),QM=d(mt),Bf=a(mt,"P",{});var f$=l(Bf);LM=i(f$,"Enable memory efficient attention as implemented in xformers."),f$.forEach(t),zM=d(mt),Pf=a(mt,"P",{});var m$=l(Pf);HM=i(m$,`When this option is enabled, you should observe lower GPU memory usage and a potential speed up at inference
time. Speed up at training time is not guaranteed.`),m$.forEach(t),qM=d(mt),Rf=a(mt,"P",{});var h$=l(Rf);OM=i(h$,`Warning: When Memory Efficient Attention and Sliced attention are both enabled, the Memory Efficient Attention
is used.`),h$.forEach(t),KM=d(mt),y(qn.$$.fragment,mt),mt.forEach(t),e0=d(D),On=a(D,"DIV",{class:!0});var zg=l(On);y(Ul.$$.fragment,zg),t0=d(zg),Ff=a(zg,"P",{});var u$=l(Ff);n0=i(u$,"Disable memory efficient attention as implemented in xformers."),u$.forEach(t),zg.forEach(t),o0=d(D),A=a(D,"DIV",{class:!0});var q=l(A);y(El.$$.fragment,q),a0=d(q),Pt=a(q,"P",{});var sc=l(Pt);l0=i(sc,"Load textual inversion embeddings into the text encoder of stable diffusion pipelines. Both "),Vf=a(sc,"CODE",{});var g$=l(Vf);s0=i(g$,"diffusers"),g$.forEach(t),i0=i(sc,` and
`),Af=a(sc,"CODE",{});var _$=l(Af);r0=i(_$,"Automatic1111"),_$.forEach(t),c0=i(sc," formats are supported (see example below)."),sc.forEach(t),d0=d(q),y(Kn.$$.fragment,q),p0=d(q),y(eo.$$.fragment,q),f0=d(q),Xf=a(q,"P",{});var b$=l(Xf);m0=i(b$,"Example:"),b$.forEach(t),h0=d(q),y(to.$$.fragment,q),u0=d(q),Yf=a(q,"P",{});var v$=l(Yf);g0=i(v$,"To load a textual inversion embedding vector in Automatic1111 format, make sure to first download the vector,"),v$.forEach(t),_0=d(q),y(no.$$.fragment,q),q.forEach(t),b0=d(D),oo=a(D,"DIV",{class:!0});var Hg=l(oo);y(Il.$$.fragment,Hg),v0=d(Hg),Jl=a(Hg,"P",{});var qg=l(Jl);y0=i(qg,"Disable tiled VAE decoding. If "),Qf=a(qg,"CODE",{});var y$=l(Qf);w0=i(y$,"enable_vae_tiling"),y$.forEach(t),M0=i(qg,` was previously invoked, this method will go back to
computing decoding in one step.`),qg.forEach(t),Hg.forEach(t),T0=d(D),ao=a(D,"DIV",{class:!0});var Og=l(ao);y(Cl.$$.fragment,Og),U0=d(Og),be=a(Og,"P",{});var ht=l(be);E0=i(ht,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Lf=a(ht,"CODE",{});var w$=l(Lf);I0=i(w$,"enable_sequential_cpu_offload"),w$.forEach(t),J0=i(ht,", this method moves one whole model at a time to the GPU when its "),zf=a(ht,"CODE",{});var M$=l(zf);C0=i(M$,"forward"),M$.forEach(t),j0=i(ht,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Hf=a(ht,"CODE",{});var T$=l(Hf);Z0=i(T$,"enable_sequential_cpu_offload"),T$.forEach(t),N0=i(ht,", but performance is much better due to the iterative execution of the "),qf=a(ht,"CODE",{});var U$=l(qf);$0=i(U$,"unet"),U$.forEach(t),k0=i(ht,"."),ht.forEach(t),Og.forEach(t),x0=d(D),lo=a(D,"DIV",{class:!0});var Kg=l(lo);y(jl.$$.fragment,Kg),W0=d(Kg),Rt=a(Kg,"P",{});var ic=l(Rt);G0=i(ic,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae, controlnet, and safety checker have their state dicts saved to CPU and then are moved to a
`),Of=a(ic,"CODE",{});var E$=l(Of);D0=i(E$,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),E$.forEach(t),S0=i(ic,"forward"),Kf=a(ic,"CODE",{});var I$=l(Kf);B0=i(I$,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),I$.forEach(t),P0=i(ic,"enable_model_cpu_offload`, but performance is lower."),ic.forEach(t),Kg.forEach(t),R0=d(D),Fe=a(D,"DIV",{class:!0});var rc=l(Fe);y(Zl.$$.fragment,rc),F0=d(rc),em=a(rc,"P",{});var J$=l(em);V0=i(J$,"Enable tiled VAE decoding."),J$.forEach(t),A0=d(rc),tm=a(rc,"P",{});var C$=l(tm);X0=i(C$,`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 to save a large amount of memory and to allow the processing of larger images.`),C$.forEach(t),rc.forEach(t),D.forEach(t),ng=d(n),Ft=a(n,"H2",{class:!0});var e_=l(Ft);so=a(e_,"A",{id:!0,class:!0,href:!0});var j$=l(so);nm=a(j$,"SPAN",{});var Z$=l(nm);y(Nl.$$.fragment,Z$),Z$.forEach(t),j$.forEach(t),Y0=d(e_),om=a(e_,"SPAN",{});var N$=l(om);Q0=i(N$,"StableDiffusionControlNetImg2ImgPipeline"),N$.forEach(t),e_.forEach(t),og=d(n),W=a(n,"DIV",{class:!0});var S=l(W);y($l.$$.fragment,S),L0=d(S),am=a(S,"P",{});var $$=l(am);z0=i($$,"Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),$$.forEach(t),H0=d(S),kl=a(S,"P",{});var t_=l(kl);q0=i(t_,"This model inherits from "),Vr=a(t_,"A",{href:!0});var k$=l(Vr);O0=i(k$,"DiffusionPipeline"),k$.forEach(t),K0=i(t_,`. 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.)`),t_.forEach(t),eT=d(S),lm=a(S,"P",{});var x$=l(lm);tT=i(x$,"In addition the pipeline inherits the following loading methods:"),x$.forEach(t),nT=d(S),sm=a(S,"UL",{});var W$=l(sm);xl=a(W$,"LI",{});var n_=l(xl);im=a(n_,"EM",{});var G$=l(im);oT=i(G$,"Textual-Inversion"),G$.forEach(t),aT=i(n_,": "),Ar=a(n_,"A",{href:!0});var D$=l(Ar);lT=i(D$,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),D$.forEach(t),n_.forEach(t),W$.forEach(t),sT=d(S),Ve=a(S,"DIV",{class:!0});var cc=l(Ve);y(Wl.$$.fragment,cc),iT=d(cc),rm=a(cc,"P",{});var S$=l(rm);rT=i(S$,"Function invoked when calling the pipeline for generation."),S$.forEach(t),cT=d(cc),y(io.$$.fragment,cc),cc.forEach(t),dT=d(S),Ae=a(S,"DIV",{class:!0});var dc=l(Ae);y(Gl.$$.fragment,dc),pT=d(dc),cm=a(dc,"P",{});var B$=l(cm);fT=i(B$,"Enable sliced attention computation."),B$.forEach(t),mT=d(dc),dm=a(dc,"P",{});var P$=l(dm);hT=i(P$,`When this option is enabled, the attention module will split the input tensor in slices, to compute attention
in several steps. This is useful to save some memory in exchange for a small speed decrease.`),P$.forEach(t),dc.forEach(t),uT=d(S),ro=a(S,"DIV",{class:!0});var o_=l(ro);y(Dl.$$.fragment,o_),gT=d(o_),Sl=a(o_,"P",{});var a_=l(Sl);_T=i(a_,"Disable sliced attention computation. If "),pm=a(a_,"CODE",{});var R$=l(pm);bT=i(R$,"enable_attention_slicing"),R$.forEach(t),vT=i(a_,` was previously invoked, this method will go
back to computing attention in one step.`),a_.forEach(t),o_.forEach(t),yT=d(S),Xe=a(S,"DIV",{class:!0});var pc=l(Xe);y(Bl.$$.fragment,pc),wT=d(pc),fm=a(pc,"P",{});var F$=l(fm);MT=i(F$,"Enable sliced VAE decoding."),F$.forEach(t),TT=d(pc),mm=a(pc,"P",{});var V$=l(mm);UT=i(V$,`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.`),V$.forEach(t),pc.forEach(t),ET=d(S),co=a(S,"DIV",{class:!0});var l_=l(co);y(Pl.$$.fragment,l_),IT=d(l_),Rl=a(l_,"P",{});var s_=l(Rl);JT=i(s_,"Disable sliced VAE decoding. If "),hm=a(s_,"CODE",{});var A$=l(hm);CT=i(A$,"enable_vae_slicing"),A$.forEach(t),jT=i(s_,` was previously invoked, this method will go back to
computing decoding in one step.`),s_.forEach(t),l_.forEach(t),ZT=d(S),te=a(S,"DIV",{class:!0});var ut=l(te);y(Fl.$$.fragment,ut),NT=d(ut),um=a(ut,"P",{});var X$=l(um);$T=i(X$,"Enable memory efficient attention as implemented in xformers."),X$.forEach(t),kT=d(ut),gm=a(ut,"P",{});var Y$=l(gm);xT=i(Y$,`When this option is enabled, you should observe lower GPU memory usage and a potential speed up at inference
time. Speed up at training time is not guaranteed.`),Y$.forEach(t),WT=d(ut),_m=a(ut,"P",{});var Q$=l(_m);GT=i(Q$,`Warning: When Memory Efficient Attention and Sliced attention are both enabled, the Memory Efficient Attention
is used.`),Q$.forEach(t),DT=d(ut),y(po.$$.fragment,ut),ut.forEach(t),ST=d(S),fo=a(S,"DIV",{class:!0});var i_=l(fo);y(Vl.$$.fragment,i_),BT=d(i_),bm=a(i_,"P",{});var L$=l(bm);PT=i(L$,"Disable memory efficient attention as implemented in xformers."),L$.forEach(t),i_.forEach(t),RT=d(S),X=a(S,"DIV",{class:!0});var O=l(X);y(Al.$$.fragment,O),FT=d(O),Vt=a(O,"P",{});var fc=l(Vt);VT=i(fc,"Load textual inversion embeddings into the text encoder of stable diffusion pipelines. Both "),vm=a(fc,"CODE",{});var z$=l(vm);AT=i(z$,"diffusers"),z$.forEach(t),XT=i(fc,` and
`),ym=a(fc,"CODE",{});var H$=l(ym);YT=i(H$,"Automatic1111"),H$.forEach(t),QT=i(fc," formats are supported (see example below)."),fc.forEach(t),LT=d(O),y(mo.$$.fragment,O),zT=d(O),y(ho.$$.fragment,O),HT=d(O),wm=a(O,"P",{});var q$=l(wm);qT=i(q$,"Example:"),q$.forEach(t),OT=d(O),y(uo.$$.fragment,O),KT=d(O),Mm=a(O,"P",{});var O$=l(Mm);eU=i(O$,"To load a textual inversion embedding vector in Automatic1111 format, make sure to first download the vector,"),O$.forEach(t),tU=d(O),y(go.$$.fragment,O),O.forEach(t),nU=d(S),_o=a(S,"DIV",{class:!0});var r_=l(_o);y(Xl.$$.fragment,r_),oU=d(r_),Yl=a(r_,"P",{});var c_=l(Yl);aU=i(c_,"Disable tiled VAE decoding. If "),Tm=a(c_,"CODE",{});var K$=l(Tm);lU=i(K$,"enable_vae_tiling"),K$.forEach(t),sU=i(c_,` was previously invoked, this method will go back to
computing decoding in one step.`),c_.forEach(t),r_.forEach(t),iU=d(S),bo=a(S,"DIV",{class:!0});var d_=l(bo);y(Ql.$$.fragment,d_),rU=d(d_),ve=a(d_,"P",{});var gt=l(ve);cU=i(gt,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Um=a(gt,"CODE",{});var ek=l(Um);dU=i(ek,"enable_sequential_cpu_offload"),ek.forEach(t),pU=i(gt,", this method moves one whole model at a time to the GPU when its "),Em=a(gt,"CODE",{});var tk=l(Em);fU=i(tk,"forward"),tk.forEach(t),mU=i(gt,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Im=a(gt,"CODE",{});var nk=l(Im);hU=i(nk,"enable_sequential_cpu_offload"),nk.forEach(t),uU=i(gt,", but performance is much better due to the iterative execution of the "),Jm=a(gt,"CODE",{});var ok=l(Jm);gU=i(ok,"unet"),ok.forEach(t),_U=i(gt,"."),gt.forEach(t),d_.forEach(t),bU=d(S),vo=a(S,"DIV",{class:!0});var p_=l(vo);y(Ll.$$.fragment,p_),vU=d(p_),At=a(p_,"P",{});var mc=l(At);yU=i(mc,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae, controlnet, and safety checker have their state dicts saved to CPU and then are moved to a
`),Cm=a(mc,"CODE",{});var ak=l(Cm);wU=i(ak,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),ak.forEach(t),MU=i(mc,"forward"),jm=a(mc,"CODE",{});var lk=l(jm);TU=i(lk,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),lk.forEach(t),UU=i(mc,"enable_model_cpu_offload`, but performance is lower."),mc.forEach(t),p_.forEach(t),EU=d(S),Ye=a(S,"DIV",{class:!0});var hc=l(Ye);y(zl.$$.fragment,hc),IU=d(hc),Zm=a(hc,"P",{});var sk=l(Zm);JU=i(sk,"Enable tiled VAE decoding."),sk.forEach(t),CU=d(hc),Nm=a(hc,"P",{});var ik=l(Nm);jU=i(ik,`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 to save a large amount of memory and to allow the processing of larger images.`),ik.forEach(t),hc.forEach(t),S.forEach(t),ag=d(n),Xt=a(n,"H2",{class:!0});var f_=l(Xt);yo=a(f_,"A",{id:!0,class:!0,href:!0});var rk=l(yo);$m=a(rk,"SPAN",{});var ck=l($m);y(Hl.$$.fragment,ck),ck.forEach(t),rk.forEach(t),ZU=d(f_),km=a(f_,"SPAN",{});var dk=l(km);NU=i(dk,"StableDiffusionControlNetInpaintPipeline"),dk.forEach(t),f_.forEach(t),lg=d(n),N=a(n,"DIV",{class:!0});var G=l(N);y(ql.$$.fragment,G),$U=d(G),xm=a(G,"P",{});var pk=l(xm);kU=i(pk,"Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),pk.forEach(t),xU=d(G),Ol=a(G,"P",{});var m_=l(Ol);WU=i(m_,"This model inherits from "),Xr=a(m_,"A",{href:!0});var fk=l(Xr);GU=i(fk,"DiffusionPipeline"),fk.forEach(t),DU=i(m_,`. 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.)`),m_.forEach(t),SU=d(G),Wm=a(G,"P",{});var mk=l(Wm);BU=i(mk,"In addition the pipeline inherits the following loading methods:"),mk.forEach(t),PU=d(G),Gm=a(G,"UL",{});var hk=l(Gm);Kl=a(hk,"LI",{});var h_=l(Kl);Dm=a(h_,"EM",{});var uk=l(Dm);RU=i(uk,"Textual-Inversion"),uk.forEach(t),FU=i(h_,": "),Yr=a(h_,"A",{href:!0});var gk=l(Yr);VU=i(gk,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),gk.forEach(t),h_.forEach(t),hk.forEach(t),AU=d(G),y(wo.$$.fragment,G),XU=d(G),Qe=a(G,"DIV",{class:!0});var uc=l(Qe);y(es.$$.fragment,uc),YU=d(uc),Sm=a(uc,"P",{});var _k=l(Sm);QU=i(_k,"Function invoked when calling the pipeline for generation."),_k.forEach(t),LU=d(uc),y(Mo.$$.fragment,uc),uc.forEach(t),zU=d(G),Le=a(G,"DIV",{class:!0});var gc=l(Le);y(ts.$$.fragment,gc),HU=d(gc),Bm=a(gc,"P",{});var bk=l(Bm);qU=i(bk,"Enable sliced attention computation."),bk.forEach(t),OU=d(gc),Pm=a(gc,"P",{});var vk=l(Pm);KU=i(vk,`When this option is enabled, the attention module will split the input tensor in slices, to compute attention
in several steps. This is useful to save some memory in exchange for a small speed decrease.`),vk.forEach(t),gc.forEach(t),eE=d(G),To=a(G,"DIV",{class:!0});var u_=l(To);y(ns.$$.fragment,u_),tE=d(u_),os=a(u_,"P",{});var g_=l(os);nE=i(g_,"Disable sliced attention computation. If "),Rm=a(g_,"CODE",{});var yk=l(Rm);oE=i(yk,"enable_attention_slicing"),yk.forEach(t),aE=i(g_,` was previously invoked, this method will go
back to computing attention in one step.`),g_.forEach(t),u_.forEach(t),lE=d(G),ze=a(G,"DIV",{class:!0});var _c=l(ze);y(as.$$.fragment,_c),sE=d(_c),Fm=a(_c,"P",{});var wk=l(Fm);iE=i(wk,"Enable sliced VAE decoding."),wk.forEach(t),rE=d(_c),Vm=a(_c,"P",{});var Mk=l(Vm);cE=i(Mk,`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.`),Mk.forEach(t),_c.forEach(t),dE=d(G),Uo=a(G,"DIV",{class:!0});var __=l(Uo);y(ls.$$.fragment,__),pE=d(__),ss=a(__,"P",{});var b_=l(ss);fE=i(b_,"Disable sliced VAE decoding. If "),Am=a(b_,"CODE",{});var Tk=l(Am);mE=i(Tk,"enable_vae_slicing"),Tk.forEach(t),hE=i(b_,` was previously invoked, this method will go back to
computing decoding in one step.`),b_.forEach(t),__.forEach(t),uE=d(G),ne=a(G,"DIV",{class:!0});var _t=l(ne);y(is.$$.fragment,_t),gE=d(_t),Xm=a(_t,"P",{});var Uk=l(Xm);_E=i(Uk,"Enable memory efficient attention as implemented in xformers."),Uk.forEach(t),bE=d(_t),Ym=a(_t,"P",{});var Ek=l(Ym);vE=i(Ek,`When this option is enabled, you should observe lower GPU memory usage and a potential speed up at inference
time. Speed up at training time is not guaranteed.`),Ek.forEach(t),yE=d(_t),Qm=a(_t,"P",{});var Ik=l(Qm);wE=i(Ik,`Warning: When Memory Efficient Attention and Sliced attention are both enabled, the Memory Efficient Attention
is used.`),Ik.forEach(t),ME=d(_t),y(Eo.$$.fragment,_t),_t.forEach(t),TE=d(G),Io=a(G,"DIV",{class:!0});var v_=l(Io);y(rs.$$.fragment,v_),UE=d(v_),Lm=a(v_,"P",{});var Jk=l(Lm);EE=i(Jk,"Disable memory efficient attention as implemented in xformers."),Jk.forEach(t),v_.forEach(t),IE=d(G),Y=a(G,"DIV",{class:!0});var K=l(Y);y(cs.$$.fragment,K),JE=d(K),Yt=a(K,"P",{});var bc=l(Yt);CE=i(bc,"Load textual inversion embeddings into the text encoder of stable diffusion pipelines. Both "),zm=a(bc,"CODE",{});var Ck=l(zm);jE=i(Ck,"diffusers"),Ck.forEach(t),ZE=i(bc,` and
`),Hm=a(bc,"CODE",{});var jk=l(Hm);NE=i(jk,"Automatic1111"),jk.forEach(t),$E=i(bc," formats are supported (see example below)."),bc.forEach(t),kE=d(K),y(Jo.$$.fragment,K),xE=d(K),y(Co.$$.fragment,K),WE=d(K),qm=a(K,"P",{});var Zk=l(qm);GE=i(Zk,"Example:"),Zk.forEach(t),DE=d(K),y(jo.$$.fragment,K),SE=d(K),Om=a(K,"P",{});var Nk=l(Om);BE=i(Nk,"To load a textual inversion embedding vector in Automatic1111 format, make sure to first download the vector,"),Nk.forEach(t),PE=d(K),y(Zo.$$.fragment,K),K.forEach(t),RE=d(G),No=a(G,"DIV",{class:!0});var y_=l(No);y(ds.$$.fragment,y_),FE=d(y_),ps=a(y_,"P",{});var w_=l(ps);VE=i(w_,"Disable tiled VAE decoding. If "),Km=a(w_,"CODE",{});var $k=l(Km);AE=i($k,"enable_vae_tiling"),$k.forEach(t),XE=i(w_,` was previously invoked, this method will go back to
computing decoding in one step.`),w_.forEach(t),y_.forEach(t),YE=d(G),$o=a(G,"DIV",{class:!0});var M_=l($o);y(fs.$$.fragment,M_),QE=d(M_),ye=a(M_,"P",{});var bt=l(ye);LE=i(bt,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),eh=a(bt,"CODE",{});var kk=l(eh);zE=i(kk,"enable_sequential_cpu_offload"),kk.forEach(t),HE=i(bt,", this method moves one whole model at a time to the GPU when its "),th=a(bt,"CODE",{});var xk=l(th);qE=i(xk,"forward"),xk.forEach(t),OE=i(bt,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),nh=a(bt,"CODE",{});var Wk=l(nh);KE=i(Wk,"enable_sequential_cpu_offload"),Wk.forEach(t),eI=i(bt,", but performance is much better due to the iterative execution of the "),oh=a(bt,"CODE",{});var Gk=l(oh);tI=i(Gk,"unet"),Gk.forEach(t),nI=i(bt,"."),bt.forEach(t),M_.forEach(t),oI=d(G),ko=a(G,"DIV",{class:!0});var T_=l(ko);y(ms.$$.fragment,T_),aI=d(T_),Qt=a(T_,"P",{});var vc=l(Qt);lI=i(vc,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae, controlnet, and safety checker have their state dicts saved to CPU and then are moved to a
`),ah=a(vc,"CODE",{});var Dk=l(ah);sI=i(Dk,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),Dk.forEach(t),iI=i(vc,"forward"),lh=a(vc,"CODE",{});var Sk=l(lh);rI=i(Sk,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),Sk.forEach(t),cI=i(vc,"enable_model_cpu_offload`, but performance is lower."),vc.forEach(t),T_.forEach(t),dI=d(G),He=a(G,"DIV",{class:!0});var yc=l(He);y(hs.$$.fragment,yc),pI=d(yc),sh=a(yc,"P",{});var Bk=l(sh);fI=i(Bk,"Enable tiled VAE decoding."),Bk.forEach(t),mI=d(yc),ih=a(yc,"P",{});var Pk=l(ih);hI=i(Pk,`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 to save a large amount of memory and to allow the processing of larger images.`),Pk.forEach(t),yc.forEach(t),G.forEach(t),sg=d(n),Lt=a(n,"H2",{class:!0});var U_=l(Lt);xo=a(U_,"A",{id:!0,class:!0,href:!0});var Rk=l(xo);rh=a(Rk,"SPAN",{});var Fk=l(rh);y(us.$$.fragment,Fk),Fk.forEach(t),Rk.forEach(t),uI=d(U_),ch=a(U_,"SPAN",{});var Vk=l(ch);gI=i(Vk,"FlaxStableDiffusionControlNetPipeline"),Vk.forEach(t),U_.forEach(t),ig=d(n),we=a(n,"DIV",{class:!0});var Yo=l(we);y(gs.$$.fragment,Yo),_I=d(Yo),dh=a(Yo,"P",{});var Ak=l(dh);bI=i(Ak,"Pipeline for text-to-image generation using Stable Diffusion with ControlNet Guidance."),Ak.forEach(t),vI=d(Yo),_s=a(Yo,"P",{});var E_=l(_s);yI=i(E_,"This model inherits from "),ph=a(E_,"CODE",{});var Xk=l(ph);wI=i(Xk,"FlaxDiffusionPipeline"),Xk.forEach(t),MI=i(E_,`. 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.)`),E_.forEach(t),TI=d(Yo),qe=a(Yo,"DIV",{class:!0});var wc=l(qe);y(bs.$$.fragment,wc),UI=d(wc),fh=a(wc,"P",{});var Yk=l(fh);EI=i(Yk,"Function invoked when calling the pipeline for generation."),Yk.forEach(t),II=d(wc),y(Wo.$$.fragment,wc),wc.forEach(t),Yo.forEach(t),this.h()},h(){r(h,"name","hf:doc:metadata"),r(h,"content",JSON.stringify(vx)),r(_,"id","texttoimage-generation-with-controlnet-conditioning"),r(_,"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"),r(_,"href","#texttoimage-generation-with-controlnet-conditioning"),r(u,"class","relative group"),r(V,"id","overview"),r(V,"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"),r(V,"href","#overview"),r(k,"class","relative group"),r(Lo,"href","https://arxiv.org/abs/2302.05543"),r(Lo,"rel","nofollow"),r(zo,"href","https://huggingface.co/takuma104"),r(zo,"rel","nofollow"),r(Ho,"href","https://arxiv.org/abs/2302.05543"),r(Ho,"rel","nofollow"),r(qo,"href","https://github.com/lllyasviel/ControlNet"),r(qo,"rel","nofollow"),r(Ot,"id","available-pipelines"),r(Ot,"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"),r(Ot,"href","#available-pipelines"),r(vt,"class","relative group"),r(js,"align","center"),r(Ko,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet.py"),r(Ko,"rel","nofollow"),r(ea,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/controlnet.ipynb"),r(ea,"rel","nofollow"),r(Zs,"align","center"),r(ta,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py"),r(ta,"rel","nofollow"),r(Gc,"align","center"),r(na,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_controlnet_inpaint.py"),r(na,"rel","nofollow"),r(Pc,"align","center"),r(en,"id","usage-example"),r(en,"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"),r(en,"href","#usage-example"),r(Et,"class","relative group"),r($s,"href","/docs/diffusers/v0.17.1/en/api/pipelines/controlnet#diffusers.StableDiffusionControlNetPipeline"),r(Ns,"start","2"),r(la,"href","https://huggingface.co/lllyasviel/sd-controlnet-canny"),r(la,"rel","nofollow"),C(xs.src,RI="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/input_image_vermeer.png")||r(xs,"src",RI),r(xs,"alt","img"),r(Ws,"href","#controlnet-with-stable-diffusion-1.5"),C(Rs.src,FI="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/vermeer_canny_edged.png")||r(Rs,"src",FI),r(Rs,"alt","img"),r(Fs,"href","runwayml/stable-diffusion-v1-5"),r(Vs,"href","/docs/diffusers/v0.17.1/en/api/schedulers/unipc#diffusers.UniPCMultistepScheduler"),C(Qs.src,VI="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/vermeer_disco_dancing.png")||r(Qs,"src",VI),r(Qs,"alt","img"),r(Ls,"href","#controlnet-with-stable-diffusion-1.5"),r(sn,"id","combining-multiple-conditionings"),r(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"),r(sn,"href","#combining-multiple-conditionings"),r(Jt,"class","relative group"),r(dn,"id","canny-conditioning"),r(dn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(dn,"href","#canny-conditioning"),r(Ct,"class","relative group"),C(qs.src,AI="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/landscape.png")||r(qs,"src",AI),C(Ks.src,XI="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/controlnet/landscape_canny_masked.png")||r(Ks,"src",XI),r(pn,"id","openpose-conditioning"),r(pn,"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"),r(pn,"href","#openpose-conditioning"),r(jt,"class","relative group"),C(_a.src,YI="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/person.png")||r(_a,"src",YI),r(_a,"width","600"),C(va.src,QI="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/controlnet/person_pose.png")||r(va,"src",QI),r(va,"width","600"),r(fn,"id","running-controlnet-with-multiple-conditionings"),r(fn,"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"),r(fn,"href","#running-controlnet-with-multiple-conditionings"),r(Zt,"class","relative group"),C(Ma.src,LI="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/controlnet/multi_controlnet_output.png")||r(Ma,"src",LI),r(Ma,"width","600"),r(mn,"id","guess-mode"),r(mn,"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"),r(mn,"href","#guess-mode"),r(Nt,"class","relative group"),r(Ua,"href","https://github.com/lllyasviel/ControlNet#guess-mode--non-prompt-mode"),r(Ua,"rel","nofollow"),r(Ea,"href","https://arxiv.org/abs/2302.05543"),r(Ea,"rel","nofollow"),r(hn,"id","the-core-implementation"),r(hn,"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"),r(hn,"href","#the-core-implementation"),r($t,"class","relative group"),r(gn,"id","usage"),r(gn,"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"),r(gn,"href","#usage"),r(kt,"class","relative group"),r(Ca,"href","https://github.com/lllyasviel/ControlNet#guess-mode--non-prompt-mode"),r(Ca,"rel","nofollow"),r(_n,"id","output-image-comparison"),r(_n,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(_n,"href","#output-image-comparison"),r(xt,"class","relative group"),r(ai,"width","128"),C(ai.src,zI="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_guess_mode/output_images/diffusers/output_bird_canny_0.png")||r(ai,"src",zI),r(oi,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_guess_mode/output_images/diffusers/output_bird_canny_0.png"),r(si,"width","128"),C(si.src,HI="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_guess_mode/output_images/diffusers/output_bird_canny_0_gm.png")||r(si,"src",HI),r(li,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_guess_mode/output_images/diffusers/output_bird_canny_0_gm.png"),r(vn,"id","available-checkpoints"),r(vn,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(vn,"href","#available-checkpoints"),r(Wt,"class","relative group"),r(xa,"href","https://huggingface.co/lllyasviel"),r(xa,"rel","nofollow"),r(ii,"href","#controlnet-v1.1"),r(wn,"id","controlnet-v10"),r(wn,"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"),r(wn,"href","#controlnet-v10"),r(Dt,"class","relative group"),r(Ga,"href","https://huggingface.co/lllyasviel/sd-controlnet-canny"),r(Ga,"rel","nofollow"),r(Un,"width","64"),P(Un,"margin","0"),P(Un,"padding","0"),C(Un.src,qI="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_bird_canny.png")||r(Un,"src",qI),r(ri,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_bird_canny.png"),r(di,"width","64"),C(di.src,OI="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_bird_canny_1.png")||r(di,"src",OI),r(ci,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_bird_canny_1.png"),r(Da,"href","https://huggingface.co/lllyasviel/sd-controlnet-depth"),r(Da,"rel","nofollow"),r(fi,"width","64"),C(fi.src,KI="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_vermeer_depth.png")||r(fi,"src",KI),r(pi,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_vermeer_depth.png"),r(hi,"width","64"),C(hi.src,eJ="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_vermeer_depth_2.png")||r(hi,"src",eJ),r(mi,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_vermeer_depth_2.png"),r(Sa,"href","https://huggingface.co/lllyasviel/sd-controlnet-hed"),r(Sa,"rel","nofollow"),r(gi,"width","64"),C(gi.src,tJ="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_bird_hed.png")||r(gi,"src",tJ),r(ui,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_bird_hed.png"),r(bi,"width","64"),C(bi.src,nJ="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_bird_hed_1.png")||r(bi,"src",nJ),r(_i,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_bird_hed_1.png"),r(Ba,"href","https://huggingface.co/lllyasviel/sd-controlnet-mlsd"),r(Ba,"rel","nofollow"),r(yi,"width","64"),C(yi.src,oJ="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_room_mlsd.png")||r(yi,"src",oJ),r(vi,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_room_mlsd.png"),r(Mi,"width","64"),C(Mi.src,aJ="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_room_mlsd_0.png")||r(Mi,"src",aJ),r(wi,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_room_mlsd_0.png"),r(Pa,"href","https://huggingface.co/lllyasviel/sd-controlnet-normal"),r(Pa,"rel","nofollow"),r(Fa,"href","https://en.wikipedia.org/wiki/Normal_mapping"),r(Fa,"rel","nofollow"),r(Ui,"width","64"),C(Ui.src,lJ="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_human_normal.png")||r(Ui,"src",lJ),r(Ti,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_human_normal.png"),r(Ii,"width","64"),C(Ii.src,sJ="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_human_normal_1.png")||r(Ii,"src",sJ),r(Ei,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_human_normal_1.png"),r(Va,"href","https://huggingface.co/lllyasviel/sd-controlnet_openpose"),r(Va,"rel","nofollow"),r(Xa,"href","https://github.com/CMU-Perceptual-Computing-Lab/openpose"),r(Xa,"rel","nofollow"),r(Ci,"width","64"),C(Ci.src,iJ="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_human_openpose.png")||r(Ci,"src",iJ),r(Ji,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_human_openpose.png"),r(Zi,"width","64"),C(Zi.src,rJ="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_human_openpose_0.png")||r(Zi,"src",rJ),r(ji,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_human_openpose_0.png"),r(Ya,"href","https://huggingface.co/lllyasviel/sd-controlnet_scribble"),r(Ya,"rel","nofollow"),r($i,"width","64"),C($i.src,cJ="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_vermeer_scribble.png")||r($i,"src",cJ),r(Ni,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_vermeer_scribble.png"),r(xi,"width","64"),C(xi.src,dJ="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_vermeer_scribble_0.png")||r(xi,"src",dJ),r(ki,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_vermeer_scribble_0.png"),r(La,"href","https://huggingface.co/lllyasviel/sd-controlnet_seg"),r(La,"rel","nofollow"),r(Ha,"href","https://groups.csail.mit.edu/vision/datasets/ADE20K/"),r(Ha,"rel","nofollow"),r(Gi,"width","64"),C(Gi.src,pJ="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_room_seg.png")||r(Gi,"src",pJ),r(Wi,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_room_seg.png"),r(Si,"width","64"),C(Si.src,fJ="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_room_seg_1.png")||r(Si,"src",fJ),r(Di,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_room_seg_1.png"),r(Nn,"id","controlnet-v11"),r(Nn,"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"),r(Nn,"href","#controlnet-v11"),r(St,"class","relative group"),r(Oa,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_canny"),r(Oa,"rel","nofollow"),r(kn,"width","64"),P(kn,"margin","0"),P(kn,"padding","0"),C(kn.src,mJ="https://huggingface.co/lllyasviel/control_v11p_sd15_canny/resolve/main/images/control.png")||r(kn,"src",mJ),r(Pi,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_canny/resolve/main/images/control.png"),r(Fi,"width","64"),C(Fi.src,hJ="https://huggingface.co/lllyasviel/control_v11p_sd15_canny/resolve/main/images/image_out.png")||r(Fi,"src",hJ),r(Ri,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_canny/resolve/main/images/image_out.png"),r(Ka,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p"),r(Ka,"rel","nofollow"),r(xn,"width","64"),P(xn,"margin","0"),P(xn,"padding","0"),C(xn.src,uJ="https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p/resolve/main/images/control.png")||r(xn,"src",uJ),r(Ai,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p/resolve/main/images/control.png"),r(Yi,"width","64"),C(Yi.src,gJ="https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p/resolve/main/images/image_out.png")||r(Yi,"src",gJ),r(Xi,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p/resolve/main/images/image_out.png"),r(el,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint"),r(el,"rel","nofollow"),r(Wn,"width","64"),P(Wn,"margin","0"),P(Wn,"padding","0"),C(Wn.src,_J="https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint/resolve/main/images/control.png")||r(Wn,"src",_J),r(Li,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint/resolve/main/images/control.png"),r(Hi,"width","64"),C(Hi.src,bJ="https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint/resolve/main/images/output.png")||r(Hi,"src",bJ),r(zi,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint/resolve/main/images/output.png"),r(tl,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd"),r(tl,"rel","nofollow"),r(Gn,"width","64"),P(Gn,"margin","0"),P(Gn,"padding","0"),C(Gn.src,vJ="https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd/resolve/main/images/control.png")||r(Gn,"src",vJ),r(Oi,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd/resolve/main/images/control.png"),r(er,"width","64"),C(er.src,yJ="https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd/resolve/main/images/image_out.png")||r(er,"src",yJ),r(Ki,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd/resolve/main/images/image_out.png"),r(nl,"href","https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth"),r(nl,"rel","nofollow"),r(Dn,"width","64"),P(Dn,"margin","0"),P(Dn,"padding","0"),C(Dn.src,wJ="https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth/resolve/main/images/control.png")||r(Dn,"src",wJ),r(nr,"href","https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth/resolve/main/images/control.png"),r(ar,"width","64"),C(ar.src,MJ="https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth/resolve/main/images/image_out.png")||r(ar,"src",MJ),r(or,"href","https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth/resolve/main/images/image_out.png"),r(ol,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae"),r(ol,"rel","nofollow"),r(Sn,"width","64"),P(Sn,"margin","0"),P(Sn,"padding","0"),C(Sn.src,TJ="https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae/resolve/main/images/control.png")||r(Sn,"src",TJ),r(sr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae/resolve/main/images/control.png"),r(rr,"width","64"),C(rr.src,UJ="https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae/resolve/main/images/image_out.png")||r(rr,"src",UJ),r(ir,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae/resolve/main/images/image_out.png"),r(al,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_seg"),r(al,"rel","nofollow"),r(Bn,"width","64"),P(Bn,"margin","0"),P(Bn,"padding","0"),C(Bn.src,EJ="https://huggingface.co/lllyasviel/control_v11p_sd15_seg/resolve/main/images/control.png")||r(Bn,"src",EJ),r(dr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_seg/resolve/main/images/control.png"),r(fr,"width","64"),C(fr.src,IJ="https://huggingface.co/lllyasviel/control_v11p_sd15_seg/resolve/main/images/image_out.png")||r(fr,"src",IJ),r(pr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_seg/resolve/main/images/image_out.png"),r(ll,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_lineart"),r(ll,"rel","nofollow"),r(Pn,"width","64"),P(Pn,"margin","0"),P(Pn,"padding","0"),C(Pn.src,JJ="https://huggingface.co/lllyasviel/control_v11p_sd15_lineart/resolve/main/images/control.png")||r(Pn,"src",JJ),r(hr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_lineart/resolve/main/images/control.png"),r(gr,"width","64"),C(gr.src,CJ="https://huggingface.co/lllyasviel/control_v11p_sd15_lineart/resolve/main/images/image_out.png")||r(gr,"src",CJ),r(ur,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_lineart/resolve/main/images/image_out.png"),r(sl,"href","https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime"),r(sl,"rel","nofollow"),r(Rn,"width","64"),P(Rn,"margin","0"),P(Rn,"padding","0"),C(Rn.src,jJ="https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime/resolve/main/images/control.png")||r(Rn,"src",jJ),r(br,"href","https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime/resolve/main/images/control.png"),r(yr,"width","64"),C(yr.src,ZJ="https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime/resolve/main/images/image_out.png")||r(yr,"src",ZJ),r(vr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime/resolve/main/images/image_out.png"),r(il,"href","https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime"),r(il,"rel","nofollow"),r(Fn,"width","64"),P(Fn,"margin","0"),P(Fn,"padding","0"),C(Fn.src,NJ="https://huggingface.co/lllyasviel/control_v11p_sd15_openpose/resolve/main/images/control.png")||r(Fn,"src",NJ),r(Mr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_openpose/resolve/main/images/control.png"),r(Ur,"width","64"),C(Ur.src,$J="https://huggingface.co/lllyasviel/control_v11p_sd15_openpose/resolve/main/images/image_out.png")||r(Ur,"src",$J),r(Tr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_openpose/resolve/main/images/image_out.png"),r(rl,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_scribble"),r(rl,"rel","nofollow"),r(Vn,"width","64"),P(Vn,"margin","0"),P(Vn,"padding","0"),C(Vn.src,kJ="https://huggingface.co/lllyasviel/control_v11p_sd15_scribble/resolve/main/images/control.png")||r(Vn,"src",kJ),r(Ir,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_scribble/resolve/main/images/control.png"),r(Cr,"width","64"),C(Cr.src,xJ="https://huggingface.co/lllyasviel/control_v11p_sd15_scribble/resolve/main/images/image_out.png")||r(Cr,"src",xJ),r(Jr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_scribble/resolve/main/images/image_out.png"),r(cl,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_softedge"),r(cl,"rel","nofollow"),r(An,"width","64"),P(An,"margin","0"),P(An,"padding","0"),C(An.src,WJ="https://huggingface.co/lllyasviel/control_v11p_sd15_softedge/resolve/main/images/control.png")||r(An,"src",WJ),r(Zr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_softedge/resolve/main/images/control.png"),r($r,"width","64"),C($r.src,GJ="https://huggingface.co/lllyasviel/control_v11p_sd15_softedge/resolve/main/images/image_out.png")||r($r,"src",GJ),r(Nr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_softedge/resolve/main/images/image_out.png"),r(dl,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle"),r(dl,"rel","nofollow"),r(Xn,"width","64"),P(Xn,"margin","0"),P(Xn,"padding","0"),C(Xn.src,DJ="https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle/resolve/main/images/control.png")||r(Xn,"src",DJ),r(xr,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle/resolve/main/images/control.png"),r(Gr,"width","64"),C(Gr.src,SJ="https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle/resolve/main/images/image_out.png")||r(Gr,"src",SJ),r(Wr,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle/resolve/main/images/image_out.png"),r(pl,"href","https://huggingface.co/lllyasviel/control_v11f1e_sd15_tile"),r(pl,"rel","nofollow"),r(Yn,"width","64"),P(Yn,"margin","0"),P(Yn,"padding","0"),C(Yn.src,BJ="https://huggingface.co/lllyasviel/control_v11f1e_sd15_tile/resolve/main/images/original.png")||r(Yn,"src",BJ),r(Sr,"href","https://huggingface.co/lllyasviel/control_v11f1e_sd15_tile/resolve/main/images/original.png"),r(Pr,"width","64"),C(Pr.src,PJ="https://huggingface.co/lllyasviel/control_v11f1e_sd15_tile/resolve/main/images/output.png")||r(Pr,"src",PJ),r(Br,"href","https://huggingface.co/lllyasviel/control_v11f1e_sd15_tile/resolve/main/images/output.png"),r(Qn,"id","diffusers.StableDiffusionControlNetPipeline"),r(Qn,"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"),r(Qn,"href","#diffusers.StableDiffusionControlNetPipeline"),r(Bt,"class","relative group"),r(Rr,"href","/docs/diffusers/v0.17.1/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),r(Fr,"href","/docs/diffusers/v0.17.1/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline.load_textual_inversion"),r(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(zn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(Hn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(On,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(oo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(ao,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(lo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(so,"id","diffusers.StableDiffusionControlNetImg2ImgPipeline"),r(so,"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"),r(so,"href","#diffusers.StableDiffusionControlNetImg2ImgPipeline"),r(Ft,"class","relative group"),r(Vr,"href","/docs/diffusers/v0.17.1/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),r(Ar,"href","/docs/diffusers/v0.17.1/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline.load_textual_inversion"),r(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(ro,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(Xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(co,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(fo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(_o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(bo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(vo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(yo,"id","diffusers.StableDiffusionControlNetInpaintPipeline"),r(yo,"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"),r(yo,"href","#diffusers.StableDiffusionControlNetInpaintPipeline"),r(Xt,"class","relative group"),r(Xr,"href","/docs/diffusers/v0.17.1/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),r(Yr,"href","/docs/diffusers/v0.17.1/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline.load_textual_inversion"),r(Qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(To,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(Uo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(Io,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(No,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r($o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(ko,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(He,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(xo,"id","diffusers.FlaxStableDiffusionControlNetPipeline"),r(xo,"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"),r(xo,"href","#diffusers.FlaxStableDiffusionControlNetPipeline"),r(Lt,"class","relative group"),r(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(we,"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,p){e(document.head,h),f(n,I,p),f(n,u,p),e(u,_),e(_,J),w(m,J,null),e(u,b),e(u,j),e(j,g),f(n,E,p),f(n,k,p),e(k,V),e(V,z),w(xe,z,null),e(k,Us),e(k,zt),e(zt,I_),f(n,Dh,p),f(n,Qo,p),e(Qo,Lo),e(Lo,J_),e(Qo,C_),f(n,Sh,p),f(n,Es,p),e(Es,j_),f(n,Bh,p),f(n,Is,p),e(Is,Z_),f(n,Ph,p),f(n,Js,p),e(Js,Mc),e(Mc,N_),f(n,Rh,p),f(n,Ht,p),e(Ht,$_),e(Ht,zo),e(zo,k_),e(Ht,x_),f(n,Fh,p),f(n,Cs,p),e(Cs,W_),f(n,Vh,p),f(n,qt,p),e(qt,Tc),e(Tc,Ho),e(Ho,G_),e(qt,D_),e(qt,Uc),e(Uc,qo),e(qo,S_),f(n,Ah,p),f(n,vt,p),e(vt,Ot),e(Ot,Ec),w(Oo,Ec,null),e(vt,B_),e(vt,Ic),e(Ic,P_),f(n,Xh,p),f(n,Kt,p),e(Kt,Jc),e(Jc,yt),e(yt,Cc),e(Cc,R_),e(yt,F_),e(yt,jc),e(jc,V_),e(yt,A_),e(yt,js),e(js,X_),e(Kt,Y_),e(Kt,wt),e(wt,Mt),e(Mt,Zc),e(Zc,Ko),e(Ko,Q_),e(Mt,L_),e(Mt,Nc),e(Nc,$c),e($c,z_),e(Mt,H_),e(Mt,Zs),e(Zs,ea),e(ea,q_),e(wt,O_),e(wt,Tt),e(Tt,kc),e(kc,ta),e(ta,K_),e(Tt,eb),e(Tt,xc),e(xc,Wc),e(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fe,of),e(of,br),e(br,Rn),e(fe,g2),e(fe,af),e(af,vr),e(vr,yr),e(B,_2),e(B,me),e(me,wr),e(wr,il),e(il,b2),e(wr,v2),e(me,y2),e(me,lf),e(lf,w2),e(me,M2),e(me,sf),e(sf,T2),e(me,U2),e(me,rf),e(rf,Mr),e(Mr,Fn),e(me,E2),e(me,cf),e(cf,Tr),e(Tr,Ur),e(B,I2),e(B,he),e(he,Er),e(Er,rl),e(rl,J2),e(Er,C2),e(he,j2),e(he,df),e(df,Z2),e(he,N2),e(he,pf),e(pf,$2),e(he,k2),e(he,ff),e(ff,Ir),e(Ir,Vn),e(he,x2),e(he,mf),e(mf,Jr),e(Jr,Cr),e(B,W2),e(B,ue),e(ue,jr),e(jr,cl),e(cl,G2),e(jr,D2),e(ue,S2),e(ue,hf),e(hf,B2),e(ue,P2),e(ue,uf),e(uf,R2),e(ue,F2),e(ue,gf),e(gf,Zr),e(Zr,An),e(ue,V2),e(ue,_f),e(_f,Nr),e(Nr,$r),e(B,A2),e(B,ge),e(ge,kr),e(kr,dl),e(dl,X2),e(kr,Y2),e(ge,Q2),e(ge,bf),e(bf,L2),e(ge,z2),e(ge,vf),e(vf,H2),e(ge,q2),e(ge,yf),e(yf,xr),e(xr,Xn),e(ge,O2),e(ge,wf),e(wf,Wr),e(Wr,Gr),e(B,K2),e(B,_e),e(_e,Dr),e(Dr,pl),e(pl,eM),e(Dr,tM),e(_e,nM),e(_e,Mf),e(Mf,oM),e(_e,aM),e(_e,Tf),e(Tf,lM),e(_e,sM),e(_e,Uf),e(Uf,Sr),e(Sr,Yn),e(_e,iM),e(_e,Ef),e(Ef,Br),e(Br,Pr),f(n,eg,p),f(n,Bt,p),e(Bt,Qn),e(Qn,If),w(fl,If,null),e(Bt,rM),e(Bt,Jf),e(Jf,cM),f(n,tg,p),f(n,x,p),w(ml,x,null),e(x,dM),e(x,Cf),e(Cf,pM),e(x,fM),e(x,hl),e(hl,mM),e(hl,Rr),e(Rr,hM),e(hl,uM),e(x,gM),e(x,jf),e(jf,_M),e(x,bM),e(x,Zf),e(Zf,ul),e(ul,Nf),e(Nf,vM),e(ul,yM),e(ul,Fr),e(Fr,wM),e(x,MM),e(x,Be),w(gl,Be,null),e(Be,TM),e(Be,$f),e($f,UM),e(Be,EM),w(Ln,Be,null),e(x,IM),e(x,Pe),w(_l,Pe,null),e(Pe,JM),e(Pe,kf),e(kf,CM),e(Pe,jM),e(Pe,xf),e(xf,ZM),e(x,NM),e(x,zn),w(bl,zn,null),e(zn,$M),e(zn,vl),e(vl,kM),e(vl,Wf),e(Wf,xM),e(vl,WM),e(x,GM),e(x,Re),w(yl,Re,null),e(Re,DM),e(Re,Gf),e(Gf,SM),e(Re,BM),e(Re,Df),e(Df,PM),e(x,RM),e(x,Hn),w(wl,Hn,null),e(Hn,FM),e(Hn,Ml),e(Ml,VM),e(Ml,Sf),e(Sf,AM),e(Ml,XM),e(x,YM),e(x,ee),w(Tl,ee,null),e(ee,QM),e(ee,Bf),e(Bf,LM),e(ee,zM),e(ee,Pf),e(Pf,HM),e(ee,qM),e(ee,Rf),e(Rf,OM),e(ee,KM),w(qn,ee,null),e(x,e0),e(x,On),w(Ul,On,null),e(On,t0),e(On,Ff),e(Ff,n0),e(x,o0),e(x,A),w(El,A,null),e(A,a0),e(A,Pt),e(Pt,l0),e(Pt,Vf),e(Vf,s0),e(Pt,i0),e(Pt,Af),e(Af,r0),e(Pt,c0),e(A,d0),w(Kn,A,null),e(A,p0),w(eo,A,null),e(A,f0),e(A,Xf),e(Xf,m0),e(A,h0),w(to,A,null),e(A,u0),e(A,Yf),e(Yf,g0),e(A,_0),w(no,A,null),e(x,b0),e(x,oo),w(Il,oo,null),e(oo,v0),e(oo,Jl),e(Jl,y0),e(Jl,Qf),e(Qf,w0),e(Jl,M0),e(x,T0),e(x,ao),w(Cl,ao,null),e(ao,U0),e(ao,be),e(be,E0),e(be,Lf),e(Lf,I0),e(be,J0),e(be,zf),e(zf,C0),e(be,j0),e(be,Hf),e(Hf,Z0),e(be,N0),e(be,qf),e(qf,$0),e(be,k0),e(x,x0),e(x,lo),w(jl,lo,null),e(lo,W0),e(lo,Rt),e(Rt,G0),e(Rt,Of),e(Of,D0),e(Rt,S0),e(Rt,Kf),e(Kf,B0),e(Rt,P0),e(x,R0),e(x,Fe),w(Zl,Fe,null),e(Fe,F0),e(Fe,em),e(em,V0),e(Fe,A0),e(Fe,tm),e(tm,X0),f(n,ng,p),f(n,Ft,p),e(Ft,so),e(so,nm),w(Nl,nm,null),e(Ft,Y0),e(Ft,om),e(om,Q0),f(n,og,p),f(n,W,p),w($l,W,null),e(W,L0),e(W,am),e(am,z0),e(W,H0),e(W,kl),e(kl,q0),e(kl,Vr),e(Vr,O0),e(kl,K0),e(W,eT),e(W,lm),e(lm,tT),e(W,nT),e(W,sm),e(sm,xl),e(xl,im),e(im,oT),e(xl,aT),e(xl,Ar),e(Ar,lT),e(W,sT),e(W,Ve),w(Wl,Ve,null),e(Ve,iT),e(Ve,rm),e(rm,rT),e(Ve,cT),w(io,Ve,null),e(W,dT),e(W,Ae),w(Gl,Ae,null),e(Ae,pT),e(Ae,cm),e(cm,fT),e(Ae,mT),e(Ae,dm),e(dm,hT),e(W,uT),e(W,ro),w(Dl,ro,null),e(ro,gT),e(ro,Sl),e(Sl,_T),e(Sl,pm),e(pm,bT),e(Sl,vT),e(W,yT),e(W,Xe),w(Bl,Xe,null),e(Xe,wT),e(Xe,fm),e(fm,MT),e(Xe,TT),e(Xe,mm),e(mm,UT),e(W,ET),e(W,co),w(Pl,co,null),e(co,IT),e(co,Rl),e(Rl,JT),e(Rl,hm),e(hm,CT),e(Rl,jT),e(W,ZT),e(W,te),w(Fl,te,null),e(te,NT),e(te,um),e(um,$T),e(te,kT),e(te,gm),e(gm,xT),e(te,WT),e(te,_m),e(_m,GT),e(te,DT),w(po,te,null),e(W,ST),e(W,fo),w(Vl,fo,null),e(fo,BT),e(fo,bm),e(bm,PT),e(W,RT),e(W,X),w(Al,X,null),e(X,FT),e(X,Vt),e(Vt,VT),e(Vt,vm),e(vm,AT),e(Vt,XT),e(Vt,ym),e(ym,YT),e(Vt,QT),e(X,LT),w(mo,X,null),e(X,zT),w(ho,X,null),e(X,HT),e(X,wm),e(wm,qT),e(X,OT),w(uo,X,null),e(X,KT),e(X,Mm),e(Mm,eU),e(X,tU),w(go,X,null),e(W,nU),e(W,_o),w(Xl,_o,null),e(_o,oU),e(_o,Yl),e(Yl,aU),e(Yl,Tm),e(Tm,lU),e(Yl,sU),e(W,iU),e(W,bo),w(Ql,bo,null),e(bo,rU),e(bo,ve),e(ve,cU),e(ve,Um),e(Um,dU),e(ve,pU),e(ve,Em),e(Em,fU),e(ve,mU),e(ve,Im),e(Im,hU),e(ve,uU),e(ve,Jm),e(Jm,gU),e(ve,_U),e(W,bU),e(W,vo),w(Ll,vo,null),e(vo,vU),e(vo,At),e(At,yU),e(At,Cm),e(Cm,wU),e(At,MU),e(At,jm),e(jm,TU),e(At,UU),e(W,EU),e(W,Ye),w(zl,Ye,null),e(Ye,IU),e(Ye,Zm),e(Zm,JU),e(Ye,CU),e(Ye,Nm),e(Nm,jU),f(n,ag,p),f(n,Xt,p),e(Xt,yo),e(yo,$m),w(Hl,$m,null),e(Xt,ZU),e(Xt,km),e(km,NU),f(n,lg,p),f(n,N,p),w(ql,N,null),e(N,$U),e(N,xm),e(xm,kU),e(N,xU),e(N,Ol),e(Ol,WU),e(Ol,Xr),e(Xr,GU),e(Ol,DU),e(N,SU),e(N,Wm),e(Wm,BU),e(N,PU),e(N,Gm),e(Gm,Kl),e(Kl,Dm),e(Dm,RU),e(Kl,FU),e(Kl,Yr),e(Yr,VU),e(N,AU),w(wo,N,null),e(N,XU),e(N,Qe),w(es,Qe,null),e(Qe,YU),e(Qe,Sm),e(Sm,QU),e(Qe,LU),w(Mo,Qe,null),e(N,zU),e(N,Le),w(ts,Le,null),e(Le,HU),e(Le,Bm),e(Bm,qU),e(Le,OU),e(Le,Pm),e(Pm,KU),e(N,eE),e(N,To),w(ns,To,null),e(To,tE),e(To,os),e(os,nE),e(os,Rm),e(Rm,oE),e(os,aE),e(N,lE),e(N,ze),w(as,ze,null),e(ze,sE),e(ze,Fm),e(Fm,iE),e(ze,rE),e(ze,Vm),e(Vm,cE),e(N,dE),e(N,Uo),w(ls,Uo,null),e(Uo,pE),e(Uo,ss),e(ss,fE),e(ss,Am),e(Am,mE),e(ss,hE),e(N,uE),e(N,ne),w(is,ne,null),e(ne,gE),e(ne,Xm),e(Xm,_E),e(ne,bE),e(ne,Ym),e(Ym,vE),e(ne,yE),e(ne,Qm),e(Qm,wE),e(ne,ME),w(Eo,ne,null),e(N,TE),e(N,Io),w(rs,Io,null),e(Io,UE),e(Io,Lm),e(Lm,EE),e(N,IE),e(N,Y),w(cs,Y,null),e(Y,JE),e(Y,Yt),e(Yt,CE),e(Yt,zm),e(zm,jE),e(Yt,ZE),e(Yt,Hm),e(Hm,NE),e(Yt,$E),e(Y,kE),w(Jo,Y,null),e(Y,xE),w(Co,Y,null),e(Y,WE),e(Y,qm),e(qm,GE),e(Y,DE),w(jo,Y,null),e(Y,SE),e(Y,Om),e(Om,BE),e(Y,PE),w(Zo,Y,null),e(N,RE),e(N,No),w(ds,No,null),e(No,FE),e(No,ps),e(ps,VE),e(ps,Km),e(Km,AE),e(ps,XE),e(N,YE),e(N,$o),w(fs,$o,null),e($o,QE),e($o,ye),e(ye,LE),e(ye,eh),e(eh,zE),e(ye,HE),e(ye,th),e(th,qE),e(ye,OE),e(ye,nh),e(nh,KE),e(ye,eI),e(ye,oh),e(oh,tI),e(ye,nI),e(N,oI),e(N,ko),w(ms,ko,null),e(ko,aI),e(ko,Qt),e(Qt,lI),e(Qt,ah),e(ah,sI),e(Qt,iI),e(Qt,lh),e(lh,rI),e(Qt,cI),e(N,dI),e(N,He),w(hs,He,null),e(He,pI),e(He,sh),e(sh,fI),e(He,mI),e(He,ih),e(ih,hI),f(n,sg,p),f(n,Lt,p),e(Lt,xo),e(xo,rh),w(us,rh,null),e(Lt,uI),e(Lt,ch),e(ch,gI),f(n,ig,p),f(n,we,p),w(gs,we,null),e(we,_I),e(we,dh),e(dh,bI),e(we,vI),e(we,_s),e(_s,yI),e(_s,ph),e(ph,wI),e(_s,MI),e(we,TI),e(we,qe),w(bs,qe,null),e(qe,UI),e(qe,fh),e(fh,EI),e(qe,II),w(Wo,qe,null),rg=!0},p(n,[p]){const vs={};p&2&&(vs.$$scope={dirty:p,ctx:n}),Ln.$set(vs);const mh={};p&2&&(mh.$$scope={dirty:p,ctx:n}),qn.$set(mh);const hh={};p&2&&(hh.$$scope={dirty:p,ctx:n}),Kn.$set(hh);const uh={};p&2&&(uh.$$scope={dirty:p,ctx:n}),eo.$set(uh);const ys={};p&2&&(ys.$$scope={dirty:p,ctx:n}),to.$set(ys);const gh={};p&2&&(gh.$$scope={dirty:p,ctx:n}),no.$set(gh);const _h={};p&2&&(_h.$$scope={dirty:p,ctx:n}),io.$set(_h);const bh={};p&2&&(bh.$$scope={dirty:p,ctx:n}),po.$set(bh);const Qr={};p&2&&(Qr.$$scope={dirty:p,ctx:n}),mo.$set(Qr);const vh={};p&2&&(vh.$$scope={dirty:p,ctx:n}),ho.$set(vh);const yh={};p&2&&(yh.$$scope={dirty:p,ctx:n}),uo.$set(yh);const wh={};p&2&&(wh.$$scope={dirty:p,ctx:n}),go.$set(wh);const Mh={};p&2&&(Mh.$$scope={dirty:p,ctx:n}),wo.$set(Mh);const Th={};p&2&&(Th.$$scope={dirty:p,ctx:n}),Mo.$set(Th);const ws={};p&2&&(ws.$$scope={dirty:p,ctx:n}),Eo.$set(ws);const Uh={};p&2&&(Uh.$$scope={dirty:p,ctx:n}),Jo.$set(Uh);const Eh={};p&2&&(Eh.$$scope={dirty:p,ctx:n}),Co.$set(Eh);const Ms={};p&2&&(Ms.$$scope={dirty:p,ctx:n}),jo.$set(Ms);const Ih={};p&2&&(Ih.$$scope={dirty:p,ctx:n}),Zo.$set(Ih);const Jh={};p&2&&(Jh.$$scope={dirty:p,ctx:n}),Wo.$set(Jh)},i(n){rg||(M(m.$$.fragment,n),M(xe.$$.fragment,n),M(Oo.$$.fragment,n),M(oa.$$.fragment,n),M(sa.$$.fragment,n),M(ia.$$.fragment,n),M(ra.$$.fragment,n),M(ca.$$.fragment,n),M(da.$$.fragment,n),M(pa.$$.fragment,n),M(fa.$$.fragment,n),M(ma.$$.fragment,n),M(ha.$$.fragment,n),M(ua.$$.fragment,n),M(ga.$$.fragment,n),M(ba.$$.fragment,n),M(ya.$$.fragment,n),M(wa.$$.fragment,n),M(Ta.$$.fragment,n),M(Ia.$$.fragment,n),M(Ja.$$.fragment,n),M(ja.$$.fragment,n),M(Za.$$.fragment,n),M(ka.$$.fragment,n),M(Wa.$$.fragment,n),M(qa.$$.fragment,n),M(fl.$$.fragment,n),M(ml.$$.fragment,n),M(gl.$$.fragment,n),M(Ln.$$.fragment,n),M(_l.$$.fragment,n),M(bl.$$.fragment,n),M(yl.$$.fragment,n),M(wl.$$.fragment,n),M(Tl.$$.fragment,n),M(qn.$$.fragment,n),M(Ul.$$.fragment,n),M(El.$$.fragment,n),M(Kn.$$.fragment,n),M(eo.$$.fragment,n),M(to.$$.fragment,n),M(no.$$.fragment,n),M(Il.$$.fragment,n),M(Cl.$$.fragment,n),M(jl.$$.fragment,n),M(Zl.$$.fragment,n),M(Nl.$$.fragment,n),M($l.$$.fragment,n),M(Wl.$$.fragment,n),M(io.$$.fragment,n),M(Gl.$$.fragment,n),M(Dl.$$.fragment,n),M(Bl.$$.fragment,n),M(Pl.$$.fragment,n),M(Fl.$$.fragment,n),M(po.$$.fragment,n),M(Vl.$$.fragment,n),M(Al.$$.fragment,n),M(mo.$$.fragment,n),M(ho.$$.fragment,n),M(uo.$$.fragment,n),M(go.$$.fragment,n),M(Xl.$$.fragment,n),M(Ql.$$.fragment,n),M(Ll.$$.fragment,n),M(zl.$$.fragment,n),M(Hl.$$.fragment,n),M(ql.$$.fragment,n),M(wo.$$.fragment,n),M(es.$$.fragment,n),M(Mo.$$.fragment,n),M(ts.$$.fragment,n),M(ns.$$.fragment,n),M(as.$$.fragment,n),M(ls.$$.fragment,n),M(is.$$.fragment,n),M(Eo.$$.fragment,n),M(rs.$$.fragment,n),M(cs.$$.fragment,n),M(Jo.$$.fragment,n),M(Co.$$.fragment,n),M(jo.$$.fragment,n),M(Zo.$$.fragment,n),M(ds.$$.fragment,n),M(fs.$$.fragment,n),M(ms.$$.fragment,n),M(hs.$$.fragment,n),M(us.$$.fragment,n),M(gs.$$.fragment,n),M(bs.$$.fragment,n),M(Wo.$$.fragment,n),rg=!0)},o(n){T(m.$$.fragment,n),T(xe.$$.fragment,n),T(Oo.$$.fragment,n),T(oa.$$.fragment,n),T(sa.$$.fragment,n),T(ia.$$.fragment,n),T(ra.$$.fragment,n),T(ca.$$.fragment,n),T(da.$$.fragment,n),T(pa.$$.fragment,n),T(fa.$$.fragment,n),T(ma.$$.fragment,n),T(ha.$$.fragment,n),T(ua.$$.fragment,n),T(ga.$$.fragment,n),T(ba.$$.fragment,n),T(ya.$$.fragment,n),T(wa.$$.fragment,n),T(Ta.$$.fragment,n),T(Ia.$$.fragment,n),T(Ja.$$.fragment,n),T(ja.$$.fragment,n),T(Za.$$.fragment,n),T(ka.$$.fragment,n),T(Wa.$$.fragment,n),T(qa.$$.fragment,n),T(fl.$$.fragment,n),T(ml.$$.fragment,n),T(gl.$$.fragment,n),T(Ln.$$.fragment,n),T(_l.$$.fragment,n),T(bl.$$.fragment,n),T(yl.$$.fragment,n),T(wl.$$.fragment,n),T(Tl.$$.fragment,n),T(qn.$$.fragment,n),T(Ul.$$.fragment,n),T(El.$$.fragment,n),T(Kn.$$.fragment,n),T(eo.$$.fragment,n),T(to.$$.fragment,n),T(no.$$.fragment,n),T(Il.$$.fragment,n),T(Cl.$$.fragment,n),T(jl.$$.fragment,n),T(Zl.$$.fragment,n),T(Nl.$$.fragment,n),T($l.$$.fragment,n),T(Wl.$$.fragment,n),T(io.$$.fragment,n),T(Gl.$$.fragment,n),T(Dl.$$.fragment,n),T(Bl.$$.fragment,n),T(Pl.$$.fragment,n),T(Fl.$$.fragment,n),T(po.$$.fragment,n),T(Vl.$$.fragment,n),T(Al.$$.fragment,n),T(mo.$$.fragment,n),T(ho.$$.fragment,n),T(uo.$$.fragment,n),T(go.$$.fragment,n),T(Xl.$$.fragment,n),T(Ql.$$.fragment,n),T(Ll.$$.fragment,n),T(zl.$$.fragment,n),T(Hl.$$.fragment,n),T(ql.$$.fragment,n),T(wo.$$.fragment,n),T(es.$$.fragment,n),T(Mo.$$.fragment,n),T(ts.$$.fragment,n),T(ns.$$.fragment,n),T(as.$$.fragment,n),T(ls.$$.fragment,n),T(is.$$.fragment,n),T(Eo.$$.fragment,n),T(rs.$$.fragment,n),T(cs.$$.fragment,n),T(Jo.$$.fragment,n),T(Co.$$.fragment,n),T(jo.$$.fragment,n),T(Zo.$$.fragment,n),T(ds.$$.fragment,n),T(fs.$$.fragment,n),T(ms.$$.fragment,n),T(hs.$$.fragment,n),T(us.$$.fragment,n),T(gs.$$.fragment,n),T(bs.$$.fragment,n),T(Wo.$$.fragment,n),rg=!1},d(n){t(h),n&&t(I),n&&t(u),U(m),n&&t(E),n&&t(k),U(xe),n&&t(Dh),n&&t(Qo),n&&t(Sh),n&&t(Es),n&&t(Bh),n&&t(Is),n&&t(Ph),n&&t(Js),n&&t(Rh),n&&t(Ht),n&&t(Fh),n&&t(Cs),n&&t(Vh),n&&t(qt),n&&t(Ah),n&&t(vt),U(Oo),n&&t(Xh),n&&t(Kt),n&&t(Yh),n&&t(Et),U(oa),n&&t(Qh),n&&t(tn),n&&t(Lh),n&&t(nn),n&&t(zh),n&&t(on),n&&t(Hh),U(sa,n),n&&t(qh),n&&t(ks),n&&t(Oh),n&&t(We),n&&t(Kh),n&&t(Gs),n&&t(eu),U(ia,n),n&&t(tu),n&&t(Ds),n&&t(nu),U(ra,n),n&&t(ou),n&&t(Ss),n&&t(au),U(ca,n),n&&t(lu),n&&t(Bs),n&&t(su),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),U(Gl),U(Dl),U(Bl),U(Pl),U(Fl),U(po),U(Vl),U(Al),U(mo),U(ho),U(uo),U(go),U(Xl),U(Ql),U(Ll),U(zl),n&&t(ag),n&&t(Xt),U(Hl),n&&t(lg),n&&t(N),U(ql),U(wo),U(es),U(Mo),U(ts),U(ns),U(as),U(ls),U(is),U(Eo),U(rs),U(cs),U(Jo),U(Co),U(jo),U(Zo),U(ds),U(fs),U(ms),U(hs),n&&t(sg),n&&t(Lt),U(us),n&&t(ig),n&&t(we),U(gs),U(bs),U(Wo)}}}const vx={local:"texttoimage-generation-with-controlnet-conditioning",sections:[{local:"overview",title:"Overview"},{local:"available-pipelines",title:"Available Pipelines:"},{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:"Text-to-Image Generation with ControlNet Conditioning"};function yx(Z){return qk(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Jx extends Qk{constructor(h){super();Lk(this,h,yx,bx,zk,{})}}export{Jx as default,vx as metadata};
