import{S as cm,i as dm,s as pm,e as s,k as p,w as y,t as c,M as mm,c as a,d as o,m,a as i,x as v,h as d,b as g,G as e,g as x,y as w,q as M,o as I,B as T,v as fm,L as V}from"../../../chunks/vendor-hf-doc-builder.js";import{T as Mt}from"../../../chunks/Tip-hf-doc-builder.js";import{D as $}from"../../../chunks/Docstring-hf-doc-builder.js";import{C as X}from"../../../chunks/CodeBlock-hf-doc-builder.js";import{I as io}from"../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as B}from"../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function um(J){let l,_,u,r,h,t,f,S;return{c(){l=s("p"),_=c("Make sure to check out the Schedulers "),u=s("a"),r=c("guide"),h=c(" to learn how to explore the tradeoff between scheduler speed and quality, and see the "),t=s("a"),f=c("reuse components across pipelines"),S=c(" section to learn how to efficiently load the same components into multiple pipelines."),this.h()},l(W){l=a(W,"P",{});var P=i(l);_=d(P,"Make sure to check out the Schedulers "),u=a(P,"A",{href:!0});var R=i(u);r=d(R,"guide"),R.forEach(o),h=d(P," to learn how to explore the tradeoff between scheduler speed and quality, and see the "),t=a(P,"A",{href:!0});var Y=i(t);f=d(Y,"reuse components across pipelines"),Y.forEach(o),S=d(P," section to learn how to efficiently load the same components into multiple pipelines."),P.forEach(o),this.h()},h(){g(u,"href","/using-diffusers/schedulers"),g(t,"href","/using-diffusers/loading#reuse-components-across-pipelines")},m(W,P){x(W,l,P),e(l,_),e(l,u),e(u,r),e(l,h),e(l,t),e(t,f),e(l,S)},d(W){W&&o(l)}}}function gm(J){let l,_,u,r,h;return r=new X({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjBvcGVuY3YtcHl0aG9uJTIwdHJhbnNmb3JtZXJzJTIwYWNjZWxlcmF0ZSUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBTdGFibGVEaWZmdXNpb25Db250cm9sTmV0UGlwZWxpbmUlMkMlMjBDb250cm9sTmV0TW9kZWwlMkMlMjBVbmlQQ011bHRpc3RlcFNjaGVkdWxlciUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBaW1wb3J0JTIwdG9yY2glMEElMEFpbXBvcnQlMjBjdjIlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEElMjMlMjBkb3dubG9hZCUyMGFuJTIwaW1hZ2UlMEFpbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTBBJTIwJTIwJTIwJTIwJTIyaHR0cHMlM0ElMkYlMkZoZi5jbyUyRmRhdGFzZXRzJTJGaHVnZ2luZ2ZhY2UlMkZkb2N1bWVudGF0aW9uLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGZGlmZnVzZXJzJTJGaW5wdXRfaW1hZ2VfdmVybWVlci5wbmclMjIlMEEpJTBBaW1hZ2UlMjAlM0QlMjBucC5hcnJheShpbWFnZSklMEElMEElMjMlMjBnZXQlMjBjYW5ueSUyMGltYWdlJTBBaW1hZ2UlMjAlM0QlMjBjdjIuQ2FubnkoaW1hZ2UlMkMlMjAxMDAlMkMlMjAyMDApJTBBaW1hZ2UlMjAlM0QlMjBpbWFnZSU1QiUzQSUyQyUyMCUzQSUyQyUyME5vbmUlNUQlMEFpbWFnZSUyMCUzRCUyMG5wLmNvbmNhdGVuYXRlKCU1QmltYWdlJTJDJTIwaW1hZ2UlMkMlMjBpbWFnZSU1RCUyQyUyMGF4aXMlM0QyKSUwQWNhbm55X2ltYWdlJTIwJTNEJTIwSW1hZ2UuZnJvbWFycmF5KGltYWdlKSUwQSUwQSUyMyUyMGxvYWQlMjBjb250cm9sJTIwbmV0JTIwYW5kJTIwc3RhYmxlJTIwZGlmZnVzaW9uJTIwdjEtNSUwQWNvbnRyb2xuZXQlMjAlM0QlMjBDb250cm9sTmV0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMmxsbHlhc3ZpZWwlMkZzZC1jb250cm9sbmV0LWNhbm55JTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25Db250cm9sTmV0UGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTIwY29udHJvbG5ldCUzRGNvbnRyb2xuZXQlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEpJTBBJTBBJTIzJTIwc3BlZWQlMjB1cCUyMGRpZmZ1c2lvbiUyMHByb2Nlc3MlMjB3aXRoJTIwZmFzdGVyJTIwc2NoZWR1bGVyJTIwYW5kJTIwbWVtb3J5JTIwb3B0aW1pemF0aW9uJTBBcGlwZS5zY2hlZHVsZXIlMjAlM0QlMjBVbmlQQ011bHRpc3RlcFNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlLnNjaGVkdWxlci5jb25maWcpJTBBJTIzJTIwcmVtb3ZlJTIwZm9sbG93aW5nJTIwbGluZSUyMGlmJTIweGZvcm1lcnMlMjBpcyUyMG5vdCUyMGluc3RhbGxlZCUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKCklMEElMEFwaXBlLmVuYWJsZV9tb2RlbF9jcHVfb2ZmbG9hZCgpJTBBJTBBJTIzJTIwZ2VuZXJhdGUlMjBpbWFnZSUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLm1hbnVhbF9zZWVkKDApJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMCUyMmZ1dHVyaXN0aWMtbG9va2luZyUyMHdvbWFuJTIyJTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTIwaW1hZ2UlM0RjYW5ueV9pbWFnZSUwQSkuaW1hZ2VzJTVCMCU1RA==",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(){l=s("p"),_=c("Examples:"),u=p(),y(r.$$.fragment)},l(t){l=a(t,"P",{});var f=i(l);_=d(f,"Examples:"),f.forEach(o),u=m(t),v(r.$$.fragment,t)},m(t,f){x(t,l,f),e(l,_),x(t,u,f),w(r,t,f),h=!0},p:V,i(t){h||(M(r.$$.fragment,t),h=!0)},o(t){I(r.$$.fragment,t),h=!1},d(t){t&&o(l),t&&o(u),T(r,t)}}}function hm(J){let l,_,u,r,h;return{c(){l=s("p"),_=c("\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),u=s("code"),r=c("scaled_dot_product_attention"),h=c(` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`)},l(t){l=a(t,"P",{});var f=i(l);_=d(f,"\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),u=a(f,"CODE",{});var S=i(u);r=d(S,"scaled_dot_product_attention"),S.forEach(o),h=d(f,` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`),f.forEach(o)},m(t,f){x(t,l,f),e(l,_),e(l,u),e(u,r),e(l,h)},d(t){t&&o(l)}}}function _m(J){let l,_,u,r,h;return r=new X({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUyQyUwQSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIwb24lMjBtYXJzJTIyJTBBcGlwZS5lbmFibGVfYXR0ZW50aW9uX3NsaWNpbmcoKSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_attention_slicing()
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`}}),{c(){l=s("p"),_=c("Examples:"),u=p(),y(r.$$.fragment)},l(t){l=a(t,"P",{});var f=i(l);_=d(f,"Examples:"),f.forEach(o),u=m(t),v(r.$$.fragment,t)},m(t,f){x(t,l,f),e(l,_),x(t,u,f),w(r,t,f),h=!0},p:V,i(t){h||(M(r.$$.fragment,t),h=!0)},o(t){I(r.$$.fragment,t),h=!1},d(t){t&&o(l),t&&o(u),T(r,t)}}}function xm(J){let l,_;return{c(){l=s("p"),_=c(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(u){l=a(u,"P",{});var r=i(l);_=d(r,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),r.forEach(o)},m(u,r){x(u,l,r),e(l,_)},d(u){u&&o(l)}}}function Jm(J){let l,_,u,r,h;return r=new X({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(){l=s("p"),_=c("Examples:"),u=p(),y(r.$$.fragment)},l(t){l=a(t,"P",{});var f=i(l);_=d(f,"Examples:"),f.forEach(o),u=m(t),v(r.$$.fragment,t)},m(t,f){x(t,l,f),e(l,_),x(t,u,f),w(r,t,f),h=!0},p:V,i(t){h||(M(r.$$.fragment,t),h=!0)},o(t){I(r.$$.fragment,t),h=!1},d(t){t&&o(l),t&&o(u),T(r,t)}}}function $m(J){let l,_,u,r,h;return r=new X({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(){l=s("p"),_=c("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),u=p(),y(r.$$.fragment)},l(t){l=a(t,"P",{});var f=i(l);_=d(f,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),f.forEach(o),u=m(t),v(r.$$.fragment,t)},m(t,f){x(t,l,f),e(l,_),x(t,u,f),w(r,t,f),h=!0},p:V,i(t){h||(M(r.$$.fragment,t),h=!0)},o(t){I(r.$$.fragment,t),h=!1},d(t){t&&o(l),t&&o(u),T(r,t)}}}function Nm(J){let l,_,u,r,h;return r=new X({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(){l=s("p"),_=c("locally:"),u=p(),y(r.$$.fragment)},l(t){l=a(t,"P",{});var f=i(l);_=d(f,"locally:"),f.forEach(o),u=m(t),v(r.$$.fragment,t)},m(t,f){x(t,l,f),e(l,_),x(t,u,f),w(r,t,f),h=!0},p:V,i(t){h||(M(r.$$.fragment,t),h=!0)},o(t){I(r.$$.fragment,t),h=!1},d(t){t&&o(l),t&&o(u),T(r,t)}}}function Cm(J){let l,_,u,r,h,t,f,S,W,P,R;return{c(){l=s("p"),_=c(`This pipeline can be used with checkpoints that have been specifically fine-tuned for inpainting
(`),u=s("a"),r=c("runwayml/stable-diffusion-inpainting"),h=c(`) as well as
default text-to-image Stable Diffusion checkpoints
(`),t=s("a"),f=c("runwayml/stable-diffusion-v1-5"),S=c(`). Default text-to-image
Stable Diffusion checkpoints might be preferable for ControlNets that have been fine-tuned on those, such as
`),W=s("a"),P=c("lllyasviel/control_v11p_sd15_inpaint"),R=c("."),this.h()},l(Y){l=a(Y,"P",{});var D=i(l);_=d(D,`This pipeline can be used with checkpoints that have been specifically fine-tuned for inpainting
(`),u=a(D,"A",{href:!0,rel:!0});var lo=i(u);r=d(lo,"runwayml/stable-diffusion-inpainting"),lo.forEach(o),h=d(D,`) as well as
default text-to-image Stable Diffusion checkpoints
(`),t=a(D,"A",{href:!0,rel:!0});var ro=i(t);f=d(ro,"runwayml/stable-diffusion-v1-5"),ro.forEach(o),S=d(D,`). Default text-to-image
Stable Diffusion checkpoints might be preferable for ControlNets that have been fine-tuned on those, such as
`),W=a(D,"A",{href:!0,rel:!0});var It=i(W);P=d(It,"lllyasviel/control_v11p_sd15_inpaint"),It.forEach(o),R=d(D,"."),D.forEach(o),this.h()},h(){g(u,"href","https://huggingface.co/runwayml/stable-diffusion-inpainting"),g(u,"rel","nofollow"),g(t,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5"),g(t,"rel","nofollow"),g(W,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint"),g(W,"rel","nofollow")},m(Y,D){x(Y,l,D),e(l,_),e(l,u),e(u,r),e(l,h),e(l,t),e(t,f),e(l,S),e(l,W),e(W,P),e(l,R)},d(Y){Y&&o(l)}}}function jm(J){let l,_,u,r,h;return r=new X({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjB0cmFuc2Zvcm1lcnMlMjBhY2NlbGVyYXRlJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkNvbnRyb2xOZXRJbnBhaW50UGlwZWxpbmUlMkMlMjBDb250cm9sTmV0TW9kZWwlMkMlMjBERElNU2NoZWR1bGVyJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQWluaXRfaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmRpZmZ1c2VycyUyRnRlc3QtYXJyYXlzJTJGcmVzb2x2ZSUyRm1haW4lMkZzdGFibGVfZGlmZnVzaW9uX2lucGFpbnQlMkZib3kucG5nJTIyJTBBKSUwQWluaXRfaW1hZ2UlMjAlM0QlMjBpbml0X2ltYWdlLnJlc2l6ZSgoNTEyJTJDJTIwNTEyKSklMEElMEFnZW5lcmF0b3IlMjAlM0QlMjB0b3JjaC5HZW5lcmF0b3IoZGV2aWNlJTNEJTIyY3B1JTIyKS5tYW51YWxfc2VlZCgxKSUwQSUwQW1hc2tfaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmRpZmZ1c2VycyUyRnRlc3QtYXJyYXlzJTJGcmVzb2x2ZSUyRm1haW4lMkZzdGFibGVfZGlmZnVzaW9uX2lucGFpbnQlMkZib3lfbWFzay5wbmclMjIlMEEpJTBBbWFza19pbWFnZSUyMCUzRCUyMG1hc2tfaW1hZ2UucmVzaXplKCg1MTIlMkMlMjA1MTIpKSUwQSUwQSUwQWRlZiUyMG1ha2VfaW5wYWludF9jb25kaXRpb24oaW1hZ2UlMkMlMjBpbWFnZV9tYXNrKSUzQSUwQSUyMCUyMCUyMCUyMGltYWdlJTIwJTNEJTIwbnAuYXJyYXkoaW1hZ2UuY29udmVydCglMjJSR0IlMjIpKS5hc3R5cGUobnAuZmxvYXQzMiklMjAlMkYlMjAyNTUuMCUwQSUyMCUyMCUyMCUyMGltYWdlX21hc2slMjAlM0QlMjBucC5hcnJheShpbWFnZV9tYXNrLmNvbnZlcnQoJTIyTCUyMikpLmFzdHlwZShucC5mbG9hdDMyKSUyMCUyRiUyMDI1NS4wJTBBJTBBJTIwJTIwJTIwJTIwYXNzZXJ0JTIwaW1hZ2Uuc2hhcGUlNUIwJTNBMSU1RCUyMCUzRCUzRCUyMGltYWdlX21hc2suc2hhcGUlNUIwJTNBMSU1RCUyQyUyMCUyMmltYWdlJTIwYW5kJTIwaW1hZ2VfbWFzayUyMG11c3QlMjBoYXZlJTIwdGhlJTIwc2FtZSUyMGltYWdlJTIwc2l6ZSUyMiUwQSUyMCUyMCUyMCUyMGltYWdlJTVCaW1hZ2VfbWFzayUyMCUzRSUyMDAuNSU1RCUyMCUzRCUyMC0xLjAlMjAlMjAlMjMlMjBzZXQlMjBhcyUyMG1hc2tlZCUyMHBpeGVsJTBBJTIwJTIwJTIwJTIwaW1hZ2UlMjAlM0QlMjBucC5leHBhbmRfZGltcyhpbWFnZSUyQyUyMDApLnRyYW5zcG9zZSgwJTJDJTIwMyUyQyUyMDElMkMlMjAyKSUwQSUyMCUyMCUyMCUyMGltYWdlJTIwJTNEJTIwdG9yY2guZnJvbV9udW1weShpbWFnZSklMEElMjAlMjAlMjAlMjByZXR1cm4lMjBpbWFnZSUwQSUwQSUwQWNvbnRyb2xfaW1hZ2UlMjAlM0QlMjBtYWtlX2lucGFpbnRfY29uZGl0aW9uKGluaXRfaW1hZ2UlMkMlMjBtYXNrX2ltYWdlKSUwQSUwQWNvbnRyb2xuZXQlMjAlM0QlMjBDb250cm9sTmV0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmxsbHlhc3ZpZWwlMkZjb250cm9sX3YxMXBfc2QxNV9pbnBhaW50JTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25Db250cm9sTmV0SW5wYWludFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUyQyUyMGNvbnRyb2xuZXQlM0Rjb250cm9sbmV0JTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKSUwQSUwQXBpcGUuc2NoZWR1bGVyJTIwJTNEJTIwRERJTVNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlLnNjaGVkdWxlci5jb25maWcpJTBBcGlwZS5lbmFibGVfbW9kZWxfY3B1X29mZmxvYWQoKSUwQSUwQSUyMyUyMGdlbmVyYXRlJTIwaW1hZ2UlMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwJTIyYSUyMGhhbmRzb21lJTIwbWFuJTIwd2l0aCUyMHJheS1iYW4lMjBzdW5nbGFzc2VzJTIyJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDIwJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTBBJTIwJTIwJTIwJTIwZXRhJTNEMS4wJTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0Rpbml0X2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwbWFza19pbWFnZSUzRG1hc2tfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBjb250cm9sX2ltYWdlJTNEY29udHJvbF9pbWFnZSUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",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(){l=s("p"),_=c("Examples:"),u=p(),y(r.$$.fragment)},l(t){l=a(t,"P",{});var f=i(l);_=d(f,"Examples:"),f.forEach(o),u=m(t),v(r.$$.fragment,t)},m(t,f){x(t,l,f),e(l,_),x(t,u,f),w(r,t,f),h=!0},p:V,i(t){h||(M(r.$$.fragment,t),h=!0)},o(t){I(r.$$.fragment,t),h=!1},d(t){t&&o(l),t&&o(u),T(r,t)}}}function Um(J){let l,_,u,r,h;return{c(){l=s("p"),_=c("\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),u=s("code"),r=c("scaled_dot_product_attention"),h=c(` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`)},l(t){l=a(t,"P",{});var f=i(l);_=d(f,"\u26A0\uFE0F Don\u2019t enable attention slicing if you\u2019re already using "),u=a(f,"CODE",{});var S=i(u);r=d(S,"scaled_dot_product_attention"),S.forEach(o),h=d(f,` (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won\u2019t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`),f.forEach(o)},m(t,f){x(t,l,f),e(l,_),e(l,u),e(u,r),e(l,h)},d(t){t&&o(l)}}}function Zm(J){let l,_,u,r,h;return r=new X({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUyQyUwQSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIwb24lMjBtYXJzJTIyJTBBcGlwZS5lbmFibGVfYXR0ZW50aW9uX3NsaWNpbmcoKSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_attention_slicing()
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`}}),{c(){l=s("p"),_=c("Examples:"),u=p(),y(r.$$.fragment)},l(t){l=a(t,"P",{});var f=i(l);_=d(f,"Examples:"),f.forEach(o),u=m(t),v(r.$$.fragment,t)},m(t,f){x(t,l,f),e(l,_),x(t,u,f),w(r,t,f),h=!0},p:V,i(t){h||(M(r.$$.fragment,t),h=!0)},o(t){I(r.$$.fragment,t),h=!1},d(t){t&&o(l),t&&o(u),T(r,t)}}}function km(J){let l,_;return{c(){l=s("p"),_=c(`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`)},l(u){l=a(u,"P",{});var r=i(l);_=d(r,`\u26A0\uFE0F When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`),r.forEach(o)},m(u,r){x(u,l,r),e(l,_)},d(u){u&&o(l)}}}function Sm(J){let l,_,u,r,h;return r=new X({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(){l=s("p"),_=c("Examples:"),u=p(),y(r.$$.fragment)},l(t){l=a(t,"P",{});var f=i(l);_=d(f,"Examples:"),f.forEach(o),u=m(t),v(r.$$.fragment,t)},m(t,f){x(t,l,f),e(l,_),x(t,u,f),w(r,t,f),h=!0},p:V,i(t){h||(M(r.$$.fragment,t),h=!0)},o(t){I(r.$$.fragment,t),h=!1},d(t){t&&o(l),t&&o(u),T(r,t)}}}function Dm(J){let l,_,u,r,h;return r=new X({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(){l=s("p"),_=c("To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),u=p(),y(r.$$.fragment)},l(t){l=a(t,"P",{});var f=i(l);_=d(f,"To load a textual inversion embedding vector in \u{1F917} Diffusers format:"),f.forEach(o),u=m(t),v(r.$$.fragment,t)},m(t,f){x(t,l,f),e(l,_),x(t,u,f),w(r,t,f),h=!0},p:V,i(t){h||(M(r.$$.fragment,t),h=!0)},o(t){I(r.$$.fragment,t),h=!1},d(t){t&&o(l),t&&o(u),T(r,t)}}}function Wm(J){let l,_,u,r,h;return r=new X({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(){l=s("p"),_=c("locally:"),u=p(),y(r.$$.fragment)},l(t){l=a(t,"P",{});var f=i(l);_=d(f,"locally:"),f.forEach(o),u=m(t),v(r.$$.fragment,t)},m(t,f){x(t,l,f),e(l,_),x(t,u,f),w(r,t,f),h=!0},p:V,i(t){h||(M(r.$$.fragment,t),h=!0)},o(t){I(r.$$.fragment,t),h=!1},d(t){t&&o(l),t&&o(u),T(r,t)}}}function Pm(J){let l,_,u,r,h;return r=new X({props:{code:"aW1wb3J0JTIwamF4JTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBaW1wb3J0JTIwamF4Lm51bXB5JTIwYXMlMjBqbnAlMEFmcm9tJTIwZmxheC5qYXhfdXRpbHMlMjBpbXBvcnQlMjByZXBsaWNhdGUlMEFmcm9tJTIwZmxheC50cmFpbmluZy5jb21tb25fdXRpbHMlMjBpbXBvcnQlMjBzaGFyZCUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTJDJTIwbWFrZV9pbWFnZV9ncmlkJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEZsYXhTdGFibGVEaWZmdXNpb25Db250cm9sTmV0UGlwZWxpbmUlMkMlMjBGbGF4Q29udHJvbE5ldE1vZGVsJTBBJTBBJTBBZGVmJTIwY3JlYXRlX2tleShzZWVkJTNEMCklM0ElMEElMjAlMjAlMjAlMjByZXR1cm4lMjBqYXgucmFuZG9tLlBSTkdLZXkoc2VlZCklMEElMEElMEFybmclMjAlM0QlMjBjcmVhdGVfa2V5KDApJTBBJTBBJTIzJTIwZ2V0JTIwY2FubnklMjBpbWFnZSUwQWNhbm55X2ltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZZaVlpWHUlMkZ0ZXN0LWRvYy1hc3NldHMlMkZyZXNvbHZlJTJGbWFpbiUyRmJsb2dfcG9zdF9jZWxsXzEwX291dHB1dF8wLmpwZWclMjIlMEEpJTBBJTBBcHJvbXB0cyUyMCUzRCUyMCUyMmJlc3QlMjBxdWFsaXR5JTJDJTIwZXh0cmVtZWx5JTIwZGV0YWlsZWQlMjIlMEFuZWdhdGl2ZV9wcm9tcHRzJTIwJTNEJTIwJTIybW9ub2Nocm9tZSUyQyUyMGxvd3JlcyUyQyUyMGJhZCUyMGFuYXRvbXklMkMlMjB3b3JzdCUyMHF1YWxpdHklMkMlMjBsb3clMjBxdWFsaXR5JTIyJTBBJTBBJTIzJTIwbG9hZCUyMGNvbnRyb2wlMjBuZXQlMjBhbmQlMjBzdGFibGUlMjBkaWZmdXNpb24lMjB2MS01JTBBY29udHJvbG5ldCUyQyUyMGNvbnRyb2xuZXRfcGFyYW1zJTIwJTNEJTIwRmxheENvbnRyb2xOZXRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIybGxseWFzdmllbCUyRnNkLWNvbnRyb2xuZXQtY2FubnklMjIlMkMlMjBmcm9tX3B0JTNEVHJ1ZSUyQyUyMGR0eXBlJTNEam5wLmZsb2F0MzIlMEEpJTBBcGlwZSUyQyUyMHBhcmFtcyUyMCUzRCUyMEZsYXhTdGFibGVEaWZmdXNpb25Db250cm9sTmV0UGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTIwY29udHJvbG5ldCUzRGNvbnRyb2xuZXQlMkMlMjByZXZpc2lvbiUzRCUyMmZsYXglMjIlMkMlMjBkdHlwZSUzRGpucC5mbG9hdDMyJTBBKSUwQXBhcmFtcyU1QiUyMmNvbnRyb2xuZXQlMjIlNUQlMjAlM0QlMjBjb250cm9sbmV0X3BhcmFtcyUwQSUwQW51bV9zYW1wbGVzJTIwJTNEJTIwamF4LmRldmljZV9jb3VudCgpJTBBcm5nJTIwJTNEJTIwamF4LnJhbmRvbS5zcGxpdChybmclMkMlMjBqYXguZGV2aWNlX2NvdW50KCkpJTBBJTBBcHJvbXB0X2lkcyUyMCUzRCUyMHBpcGUucHJlcGFyZV90ZXh0X2lucHV0cyglNUJwcm9tcHRzJTVEJTIwKiUyMG51bV9zYW1wbGVzKSUwQW5lZ2F0aXZlX3Byb21wdF9pZHMlMjAlM0QlMjBwaXBlLnByZXBhcmVfdGV4dF9pbnB1dHMoJTVCbmVnYXRpdmVfcHJvbXB0cyU1RCUyMColMjBudW1fc2FtcGxlcyklMEFwcm9jZXNzZWRfaW1hZ2UlMjAlM0QlMjBwaXBlLnByZXBhcmVfaW1hZ2VfaW5wdXRzKCU1QmNhbm55X2ltYWdlJTVEJTIwKiUyMG51bV9zYW1wbGVzKSUwQSUwQXBfcGFyYW1zJTIwJTNEJTIwcmVwbGljYXRlKHBhcmFtcyklMEFwcm9tcHRfaWRzJTIwJTNEJTIwc2hhcmQocHJvbXB0X2lkcyklMEFuZWdhdGl2ZV9wcm9tcHRfaWRzJTIwJTNEJTIwc2hhcmQobmVnYXRpdmVfcHJvbXB0X2lkcyklMEFwcm9jZXNzZWRfaW1hZ2UlMjAlM0QlMjBzaGFyZChwcm9jZXNzZWRfaW1hZ2UpJTBBJTBBb3V0cHV0JTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHRfaWRzJTNEcHJvbXB0X2lkcyUyQyUwQSUyMCUyMCUyMCUyMGltYWdlJTNEcHJvY2Vzc2VkX2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwcGFyYW1zJTNEcF9wYXJhbXMlMkMlMEElMjAlMjAlMjAlMjBwcm5nX3NlZWQlM0RybmclMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENTAlMkMlMEElMjAlMjAlMjAlMjBuZWdfcHJvbXB0X2lkcyUzRG5lZ2F0aXZlX3Byb21wdF9pZHMlMkMlMEElMjAlMjAlMjAlMjBqaXQlM0RUcnVlJTJDJTBBKS5pbWFnZXMlMEElMEFvdXRwdXRfaW1hZ2VzJTIwJTNEJTIwcGlwZS5udW1weV90b19waWwobnAuYXNhcnJheShvdXRwdXQucmVzaGFwZSgobnVtX3NhbXBsZXMlMkMpJTIwJTJCJTIwb3V0cHV0LnNoYXBlJTVCLTMlM0ElNUQpKSklMEFvdXRwdXRfaW1hZ2VzJTIwJTNEJTIwbWFrZV9pbWFnZV9ncmlkKG91dHB1dF9pbWFnZXMlMkMlMjBudW1fc2FtcGxlcyUyMCUyRiUyRiUyMDQlMkMlMjA0KSUwQW91dHB1dF9pbWFnZXMuc2F2ZSglMjJnZW5lcmF0ZWRfaW1hZ2UucG5nJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax.jax_utils <span class="hljs-keyword">import</span> replicate
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax.training.common_utils <span class="hljs-keyword">import</span> shard
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image, make_image_grid
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlaxStableDiffusionControlNetPipeline, FlaxControlNetModel


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


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

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>output_images = pipe.numpy_to_pil(np.asarray(output.reshape((num_samples,) + output.shape[-<span class="hljs-number">3</span>:])))
<span class="hljs-meta">&gt;&gt;&gt; </span>output_images = make_image_grid(output_images, num_samples // <span class="hljs-number">4</span>, <span class="hljs-number">4</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>output_images.save(<span class="hljs-string">&quot;generated_image.png&quot;</span>)`}}),{c(){l=s("p"),_=c("Examples:"),u=p(),y(r.$$.fragment)},l(t){l=a(t,"P",{});var f=i(l);_=d(f,"Examples:"),f.forEach(o),u=m(t),v(r.$$.fragment,t)},m(t,f){x(t,l,f),e(l,_),x(t,u,f),w(r,t,f),h=!0},p:V,i(t){h||(M(r.$$.fragment,t),h=!0)},o(t){I(r.$$.fragment,t),h=!1},d(t){t&&o(l),t&&o(u),T(r,t)}}}function Em(J){let l,_,u,r,h,t,f,S,W,P,R,Y,D,lo,ro,It,co,di,zs,po,pi,Qs,mo,Uo,mi,Hs,he,fi,Tt,ui,gi,qs,oe,hi,xt,_i,bi,Jt,yi,vi,Os,_e,Ks,re,be,Zo,$t,wi,ko,Mi,ea,C,Nt,Ii,So,Ti,xi,Ct,Ji,fo,$i,Ni,Ci,Do,ji,Ui,Wo,uo,go,Zi,ki,Si,se,jt,Di,Po,Wi,Pi,ye,Ei,A,Ut,Gi,Eo,Fi,Bi,ve,Vi,we,Xi,Me,Zt,Ri,kt,Li,Go,Yi,Ai,zi,Ie,St,Qi,Fo,Hi,qi,Te,Dt,Oi,Wt,Ki,Bo,el,tl,nl,z,Pt,ol,Et,sl,Gt,al,il,ll,xe,rl,Je,cl,$e,Ft,dl,Bt,pl,Vt,ml,fl,ul,E,Xt,gl,Rt,hl,ho,_l,bl,yl,Vo,vl,wl,Ne,Ml,Lt,Il,Yt,Tl,xl,Jl,Ce,$l,je,At,Nl,zt,Cl,Xo,jl,Ul,Zl,Ue,Qt,kl,Ro,Sl,Dl,Ze,Ht,Wl,Lo,Pl,ta,ce,ke,Yo,qt,El,Ao,Gl,na,j,Ot,Fl,zo,Bl,Vl,Kt,Xl,_o,Rl,Ll,Yl,Qo,Al,zl,Ho,bo,yo,Ql,Hl,ql,ae,en,Ol,qo,Kl,er,Se,tr,Q,tn,nr,Oo,or,sr,De,ar,We,ir,Pe,nn,lr,on,rr,Ko,cr,dr,pr,Ee,sn,mr,es,fr,ur,Ge,an,gr,ln,hr,ts,_r,br,yr,H,rn,vr,cn,wr,dn,Mr,Ir,Tr,Fe,xr,Be,Jr,Ve,pn,$r,mn,Nr,fn,Cr,jr,Ur,G,un,Zr,gn,kr,vo,Sr,Dr,Wr,ns,Pr,Er,Xe,Gr,hn,Fr,_n,Br,Vr,Xr,Re,Rr,Le,bn,Lr,yn,Yr,os,Ar,zr,Qr,Ye,vn,Hr,ss,qr,Or,Ae,wn,Kr,as,ec,oa,de,ze,is,Mn,tc,ls,nc,sa,N,In,oc,rs,sc,ac,Tn,ic,wo,lc,rc,cc,cs,dc,pc,ds,Mo,Io,mc,fc,uc,Qe,gc,ie,xn,hc,ps,_c,bc,He,yc,q,Jn,vc,ms,wc,Mc,qe,Ic,Oe,Tc,Ke,$n,xc,Nn,Jc,fs,$c,Nc,Cc,et,Cn,jc,us,Uc,Zc,tt,jn,kc,Un,Sc,gs,Dc,Wc,Pc,O,Zn,Ec,kn,Gc,Sn,Fc,Bc,Vc,nt,Xc,ot,Rc,st,Dn,Lc,Wn,Yc,Pn,Ac,zc,Qc,F,En,Hc,Gn,qc,To,Oc,Kc,ed,hs,td,nd,at,od,Fn,sd,Bn,ad,id,ld,it,rd,lt,Vn,cd,Xn,dd,_s,pd,md,fd,rt,Rn,ud,bs,gd,hd,ct,Ln,_d,ys,bd,aa,pe,dt,vs,Yn,yd,ws,vd,ia,me,An,wd,Ms,Md,la,fe,pt,Is,zn,Id,Ts,Td,ra,L,Qn,xd,xs,Jd,$d,Hn,Nd,xo,Cd,jd,Ud,le,qn,Zd,Js,kd,Sd,mt,ca,ue,ft,$s,On,Dd,Ns,Wd,da,ne,Kn,Pd,Cs,Ed,Gd,ut,eo,Fd,js,Bd,pa;return t=new io({}),_e=new Mt({props:{$$slots:{default:[um]},$$scope:{ctx:J}}}),$t=new io({}),Nt=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.21.0/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionControlNetPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <code>UNet2DConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.StableDiffusionControlNetPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code>) &#x2014;
Provides additional conditioning to the <code>unet</code> 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.21.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.21.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.21.0/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionControlNetPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for more details
about a model&#x2019;s potential harms.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionControlNetPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
A <code>CLIPImageProcessor</code> to extract features from generated images; used as inputs to the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L91"}}),jt=new $({props:{name:"__call__",anchor:"diffusers.StableDiffusionControlNetPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 1.0"},{name:"guess_mode",val:": bool = False"},{name:"control_guidance_start",val:": typing.Union[float, typing.List[float]] = 0.0"},{name:"control_guidance_end",val:": typing.Union[float, typing.List[float]] = 1.0"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide image generation. If not defined, you need to pass <code>prompt_embeds</code>.`,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 to provide guidance to the <code>unet</code> for generation. 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 accordingly. If multiple ControlNets are specified in
<code>init</code>, 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 <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#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 <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#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;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,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 to guide what to not include in image generation. If not defined, you need to
pass <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (<code>guidance_scale &lt; 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;) from the <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">DDIM</a> paper. Only applies
to the <a href="/docs/diffusers/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,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;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></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 is 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 (prompt weighting). If not
provided, text embeddings are generated from the <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 (prompt weighting). If
not provided, <code>negative_prompt_embeds</code> are generated from the <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 generated image. Choose between <code>PIL.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.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is 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 is called. If not specified, the callback is 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 in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow"><code>self.processor</code></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 <code>unet</code>. If multiple ControlNets are specified in <code>init</code>, 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;
The ControlNet encoder tries to recognize the content of the input image even if you remove all
prompts. A <code>guidance_scale</code> value between 3.0 and 5.0 is recommended.`,name:"guess_mode"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.control_guidance_start",description:`<strong>control_guidance_start</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The percentage of total steps at which the ControlNet starts applying.`,name:"control_guidance_start"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.control_guidance_end",description:`<strong>control_guidance_end</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The percentage of total steps at which the ControlNet stops applying.`,name:"control_guidance_end"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L674",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> is returned,
otherwise a <code>tuple</code> is returned where the first element is a list with the generated images and the
second element is a list of <code>bool</code>s indicating whether the corresponding generated image contains
\u201Cnot-safe-for-work\u201D (nsfw) content.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),ye=new B({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.example",$$slots:{default:[gm]},$$scope:{ctx:J}}}),Ut=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.21.0/src/diffusers/pipelines/pipeline_utils.py#L1780"}}),ve=new Mt({props:{warning:!0,$$slots:{default:[hm]},$$scope:{ctx:J}}}),we=new B({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_attention_slicing.example",$$slots:{default:[_m]},$$scope:{ctx:J}}}),Zt=new $({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L1820"}}),St=new $({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L181"}}),Dt=new $({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L189"}}),Pt=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.21.0/src/diffusers/pipelines/pipeline_utils.py#L1719"}}),xe=new Mt({props:{warning:!0,$$slots:{default:[bm]},$$scope:{ctx:J}}}),Je=new B({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[ym]},$$scope:{ctx:J}}}),Ft=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.21.0/src/diffusers/pipelines/pipeline_utils.py#L1754"}}),Xt=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:"tokenizer",val:": typing.Optional[transformers.tokenization_utils.PreTrainedTokenizer] = None"},{name:"text_encoder",val:": typing.Optional[transformers.modeling_utils.PreTrainedModel] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>, <em>optional</em>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).
If not specified, function will take self.tokenizer.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>, <em>optional</em>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text. If not specified, function will take self.tokenizer.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/loaders.py#L687"}}),Ne=new B({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.example",$$slots:{default:[vm]},$$scope:{ctx:J}}}),Ce=new B({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.example-2",$$slots:{default:[wm]},$$scope:{ctx:J}}}),At=new $({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L206"}}),Qt=new $({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L197"}}),Ht=new $({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionControlNetPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"device",val:""},{name:"num_images_per_prompt",val:""},{name:"do_classifier_free_guidance",val:""},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableDiffusionControlNetPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet.py#L245"}}),qt=new io({}),Ot=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.21.0/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <code>UNet2DConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code>) &#x2014;
Provides additional conditioning to the <code>unet</code> 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.21.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.21.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.21.0/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for more details
about a model&#x2019;s potential harms.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
A <code>CLIPImageProcessor</code> to extract features from generated images; used as inputs to the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L115"}}),en=new $({props:{name:"__call__",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"control_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"strength",val:": float = 0.8"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 0.8"},{name:"guess_mode",val:": bool = False"},{name:"control_guidance_start",val:": typing.Union[float, typing.List[float]] = 0.0"},{name:"control_guidance_end",val:": typing.Union[float, typing.List[float]] = 1.0"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide image generation. If not defined, you need to pass <code>prompt_embeds</code>.`,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 to be used as the starting point for the image generation process. Can also accept
image latents as <code>image</code>, and if passing latents directly they are not 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 to provide guidance to the <code>unet</code> for generation. 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 accordingly. If multiple ControlNets are specified in
<code>init</code>, 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 <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#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 <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#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;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,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 to guide what to not include in image generation. If not defined, you need to
pass <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (<code>guidance_scale &lt; 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;) from the <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">DDIM</a> paper. Only applies
to the <a href="/docs/diffusers/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,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;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></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 is 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 (prompt weighting). If not
provided, text embeddings are generated from the <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 (prompt weighting). If
not provided, <code>negative_prompt_embeds</code> are generated from the <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 generated image. Choose between <code>PIL.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.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is 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 is called. If not specified, the callback is 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 in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow"><code>self.processor</code></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 <code>unet</code>. If multiple ControlNets are specified in <code>init</code>, you can set
the corresponding scale as a list.`,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;
The ControlNet encoder tries to recognize the content of the input image even if you remove all
prompts. A <code>guidance_scale</code> value between 3.0 and 5.0 is recommended.`,name:"guess_mode"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.control_guidance_start",description:`<strong>control_guidance_start</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The percentage of total steps at which the ControlNet starts applying.`,name:"control_guidance_start"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.control_guidance_end",description:`<strong>control_guidance_end</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The percentage of total steps at which the ControlNet stops applying.`,name:"control_guidance_end"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L744",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> is returned,
otherwise a <code>tuple</code> is returned where the first element is a list with the generated images and the
second element is a list of <code>bool</code>s indicating whether the corresponding generated image contains
\u201Cnot-safe-for-work\u201D (nsfw) content.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Se=new B({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.__call__.example",$$slots:{default:[Mm]},$$scope:{ctx:J}}}),tn=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.21.0/src/diffusers/pipelines/pipeline_utils.py#L1780"}}),De=new Mt({props:{warning:!0,$$slots:{default:[Im]},$$scope:{ctx:J}}}),We=new B({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_attention_slicing.example",$$slots:{default:[Tm]},$$scope:{ctx:J}}}),nn=new $({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L1820"}}),sn=new $({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L205"}}),an=new $({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L213"}}),rn=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.21.0/src/diffusers/pipelines/pipeline_utils.py#L1719"}}),Fe=new Mt({props:{warning:!0,$$slots:{default:[xm]},$$scope:{ctx:J}}}),Be=new B({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[Jm]},$$scope:{ctx:J}}}),pn=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.21.0/src/diffusers/pipelines/pipeline_utils.py#L1754"}}),un=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:"tokenizer",val:": typing.Optional[transformers.tokenization_utils.PreTrainedTokenizer] = None"},{name:"text_encoder",val:": typing.Optional[transformers.modeling_utils.PreTrainedModel] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>, <em>optional</em>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).
If not specified, function will take self.tokenizer.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>, <em>optional</em>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text. If not specified, function will take self.tokenizer.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/loaders.py#L687"}}),Xe=new B({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.example",$$slots:{default:[$m]},$$scope:{ctx:J}}}),Re=new B({props:{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.load_textual_inversion.example-2",$$slots:{default:[Nm]},$$scope:{ctx:J}}}),bn=new $({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L230"}}),vn=new $({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L221"}}),wn=new $({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"device",val:""},{name:"num_images_per_prompt",val:""},{name:"do_classifier_free_guidance",val:""},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetImg2ImgPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet_img2img.py#L269"}}),Mn=new io({}),In=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.21.0/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014;
A <code>UNet2DConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code>) &#x2014;
Provides additional conditioning to the <code>unet</code> 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.21.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.21.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.21.0/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>StableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for more details
about a model&#x2019;s potential harms.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
A <code>CLIPImageProcessor</code> to extract features from generated images; used as inputs to the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L228"}}),Qe=new Mt({props:{$$slots:{default:[Cm]},$$scope:{ctx:J}}}),xn=new $({props:{name:"__call__",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"mask_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"control_image",val:": typing.Union[PIL.Image.Image, numpy.ndarray, torch.FloatTensor, typing.List[PIL.Image.Image], typing.List[numpy.ndarray], typing.List[torch.FloatTensor]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"strength",val:": float = 1.0"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 0.5"},{name:"guess_mode",val:": bool = False"},{name:"control_guidance_start",val:": typing.Union[float, typing.List[float]] = 0.0"},{name:"control_guidance_end",val:": typing.Union[float, typing.List[float]] = 1.0"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide image generation. If not defined, you need to pass <code>prompt_embeds</code>.`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, &#x2014;
<code>List[PIL.Image.Image]</code>, or <code>List[np.ndarray]</code>):
<code>Image</code>, NumPy array or tensor representing an image batch to be used as the starting point. For both
NumPy array and PyTorch tensor, the expected value range is between <code>[0, 1]</code>. If it&#x2019;s a tensor or a
list or tensors, the expected shape should be <code>(B, C, H, W)</code> or <code>(C, H, W)</code>. If it is a NumPy array or
a list of arrays, the expected shape should be <code>(B, H, W, C)</code> or <code>(H, W, C)</code>. It can also accept image
latents as <code>image</code>, but if passing latents directly it is not encoded again.`,name:"image"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.mask_image",description:`<strong>mask_image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>np.ndarray</code>, <code>List[torch.FloatTensor]</code>, &#x2014;
<code>List[PIL.Image.Image]</code>, or <code>List[np.ndarray]</code>):
<code>Image</code>, NumPy array or tensor representing an image batch to mask <code>image</code>. White pixels in the mask
are repainted while black pixels are preserved. If <code>mask_image</code> is a PIL image, it is converted to a
single channel (luminance) before use. If it&#x2019;s a NumPy array or PyTorch tensor, it should contain one
color channel (L) instead of 3, so the expected shape for PyTorch tensor would be <code>(B, 1, H, W)</code>, <code>(B, H, W)</code>, <code>(1, H, W)</code>, <code>(H, W)</code>. And for NumPy array, it would be for <code>(B, H, W, 1)</code>, <code>(B, H, W)</code>, <code>(H, W, 1)</code>, or <code>(H, W)</code>.`,name:"mask_image"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.control_image",description:`<strong>control_image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, or <code>List[List[PIL.Image.Image]]</code>):
The ControlNet input condition to provide guidance to the <code>unet</code> for generation. 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 accordingly. If multiple ControlNets are specified in
<code>init</code>, images must be passed as a list such that each element of the list can be correctly batched for
input to a single ControlNet.`,name:"control_image"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#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 <code>self.unet.config.sample_size * self.vae_scale_factor</code>) &#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.0) &#x2014;
Indicates extent to transform the reference <code>image</code>. Must be between 0 and 1. <code>image</code> is used as a
starting point and more noise is added the higher 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 is maximum and the denoising
process runs for the full number of iterations specified in <code>num_inference_steps</code>. A value of 1
essentially ignores <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;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,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 to guide what to not include in image generation. If not defined, you need to
pass <code>negative_prompt_embeds</code> instead. Ignored when not using guidance (<code>guidance_scale &lt; 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;) from the <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">DDIM</a> paper. Only applies
to the <a href="/docs/diffusers/v0.21.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, and is ignored in other schedulers.`,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;
A <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow"><code>torch.Generator</code></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 is 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 (prompt weighting). If not
provided, text embeddings are generated from the <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 (prompt weighting). If
not provided, <code>negative_prompt_embeds</code> are generated from the <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 generated image. Choose between <code>PIL.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.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that calls every <code>callback_steps</code> steps during inference. The function is 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 is called. If not specified, the callback is 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 in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow"><code>self.processor</code></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 <code>unet</code>. If multiple ControlNets are specified in <code>init</code>, you can set
the corresponding scale as a list.`,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;
The ControlNet encoder tries to recognize the content of the input image even if you remove all
prompts. A <code>guidance_scale</code> value between 3.0 and 5.0 is recommended.`,name:"guess_mode"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.control_guidance_start",description:`<strong>control_guidance_start</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 0.0) &#x2014;
The percentage of total steps at which the ControlNet starts applying.`,name:"control_guidance_start"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.control_guidance_end",description:`<strong>control_guidance_end</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The percentage of total steps at which the ControlNet stops applying.`,name:"control_guidance_end"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L937",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> is returned,
otherwise a <code>tuple</code> is returned where the first element is a list with the generated images and the
second element is a list of <code>bool</code>s indicating whether the corresponding generated image contains
\u201Cnot-safe-for-work\u201D (nsfw) content.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),He=new B({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.__call__.example",$$slots:{default:[jm]},$$scope:{ctx:J}}}),Jn=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.21.0/src/diffusers/pipelines/pipeline_utils.py#L1780"}}),qe=new Mt({props:{warning:!0,$$slots:{default:[Um]},$$scope:{ctx:J}}}),Oe=new B({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_attention_slicing.example",$$slots:{default:[Zm]},$$scope:{ctx:J}}}),$n=new $({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/pipeline_utils.py#L1820"}}),Cn=new $({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L332"}}),jn=new $({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L340"}}),Zn=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.21.0/src/diffusers/pipelines/pipeline_utils.py#L1719"}}),nt=new Mt({props:{warning:!0,$$slots:{default:[km]},$$scope:{ctx:J}}}),ot=new B({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[Sm]},$$scope:{ctx:J}}}),Dn=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.21.0/src/diffusers/pipelines/pipeline_utils.py#L1754"}}),En=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:"tokenizer",val:": typing.Optional[transformers.tokenization_utils.PreTrainedTokenizer] = None"},{name:"text_encoder",val:": typing.Optional[transformers.modeling_utils.PreTrainedModel] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code> or <code>List[str or os.PathLike]</code> or <code>Dict</code> or <code>List[Dict]</code>) &#x2014;
Can be either one of the following or a list of them:</p>
<ul>
<li>A string, the <em>model id</em> (for example <code>sd-concepts-library/low-poly-hd-logos-icons</code>) of a
pretrained model hosted on the Hub.</li>
<li>A path to a <em>directory</em> (for example <code>./my_text_inversion_directory/</code>) containing the textual
inversion weights.</li>
<li>A path to a <em>file</em> (for example <code>./my_text_inversions.pt</code>) containing textual inversion weights.</li>
<li>A <a href="https://pytorch.org/tutorials/beginner/saving_loading_models.html#what-is-a-state-dict" rel="nofollow">torch state
dict</a>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.token",description:`<strong>token</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
Override the token to use for the textual inversion weights. If <code>pretrained_model_name_or_path</code> is a
list, then <code>token</code> must also be a list of equal length.`,name:"token"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>, <em>optional</em>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).
If not specified, function will take self.tokenizer.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>, <em>optional</em>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text. If not specified, function will take self.tokenizer.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used when:</p>
<ul>
<li>The saved textual inversion file is in &#x1F917; Diffusers format, but was saved under a specific weight
name such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the Automatic1111 format.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory where a downloaded pretrained model configuration is cached if the standard cache
is not used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to resume downloading the model weights and configuration files. If set to <code>False</code>, any
incompletely downloaded files are deleted.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, for example, <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.local_files_only",description:`<strong>local_files_only</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to only load local model weights and configuration files or not. If set to <code>True</code>, the model
won&#x2019;t be downloaded from the Hub.`,name:"local_files_only"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, the token generated from
<code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>) is used.`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, a commit id, or any identifier
allowed by Git.`,name:"revision"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
The subfolder location of a model file within a larger model repository on the Hub or locally.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to resolve accessibility issues if you&#x2019;re downloading a model in China. We do not
guarantee the timeliness or safety of the source, and you should refer to the mirror site for more
information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/loaders.py#L687"}}),at=new B({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.example",$$slots:{default:[Dm]},$$scope:{ctx:J}}}),it=new B({props:{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.load_textual_inversion.example-2",$$slots:{default:[Wm]},$$scope:{ctx:J}}}),Vn=new $({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L357"}}),Rn=new $({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L348"}}),Ln=new $({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"device",val:""},{name:"num_images_per_prompt",val:""},{name:"do_classifier_free_guidance",val:""},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"lora_scale",val:": typing.Optional[float] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetInpaintPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint.py#L396"}}),Yn=new io({}),An=new $({props:{name:"class diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",parameters:[{name:"images",val:": typing.Union[typing.List[PIL.Image.Image], numpy.ndarray]"},{name:"nsfw_content_detected",val:": typing.Optional[typing.List[bool]]"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.images",description:`<strong>images</strong> (<code>List[PIL.Image.Image]</code> or <code>np.ndarray</code>) &#x2014;
List of denoised PIL images of length <code>batch_size</code> or NumPy array of shape <code>(batch_size, height, width, num_channels)</code>.`,name:"images"},{anchor:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) &#x2014;
List indicating whether the corresponding generated image contains &#x201C;not-safe-for-work&#x201D; (nsfw) content or
<code>None</code> if safety checking could not be performed.`,name:"nsfw_content_detected"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_output.py#L15"}}),zn=new io({}),Qn=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.21.0/en/api/models/autoencoderkl#diffusers.FlaxAutoencoderKL">FlaxAutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>FlaxCLIPTextModel</code>) &#x2014;
Frozen text-encoder (<a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a>).`,name:"text_encoder"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
A <code>CLIPTokenizer</code> to tokenize text.`,name:"tokenizer"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.unet",description:`<strong>unet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/unet2d-cond#diffusers.FlaxUNet2DConditionModel">FlaxUNet2DConditionModel</a>) &#x2014;
A <code>FlaxUNet2DConditionModel</code> to denoise the encoded image latents.`,name:"unet"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/v0.21.0/en/api/models/controlnet#diffusers.FlaxControlNetModel">FlaxControlNetModel</a> &#x2014;
Provides additional conditioning to the <code>unet</code> during the denoising process.`,name:"controlnet"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.21.0/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<code>FlaxDDIMScheduler</code>, <code>FlaxLMSDiscreteScheduler</code>, <code>FlaxPNDMScheduler</code>, or
<code>FlaxDPMSolverMultistepScheduler</code>.`,name:"scheduler"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.safety_checker",description:`<strong>safety_checker</strong> (<code>FlaxStableDiffusionSafetyChecker</code>) &#x2014;
Classification module that estimates whether generated images could be considered offensive or harmful.
Please refer to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow">model card</a> for more details
about a model&#x2019;s potential harms.`,name:"safety_checker"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
A <code>CLIPImageProcessor</code> to extract features from generated images; used as inputs to the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py#L111"}}),qn=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 to provide guidance to the <code>unet</code> for generation.`,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;
A higher guidance scale value encourages the model to generate images closely linked to the text
<code>prompt</code> at the expense of lower image quality. Guidance scale is enabled when <code>guidance_scale &gt; 1</code>.`,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
array is 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 <code>unet</code>.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput">FlaxStableDiffusionPipelineOutput</a> instead of
a plain tuple.`,name:"return_dict"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.jit",description:`<strong>jit</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to run <code>pmap</code> versions of the generation and safety scoring functions.</p>
<div class="course-tip course-tip-orange bg-gradient-to-br dark:bg-gradient-to-r before:border-orange-500 dark:before:border-orange-800 from-orange-50 dark:from-gray-900 to-white dark:to-gray-950 border border-orange-50 text-orange-700 dark:text-gray-400">
						
<p>This argument exists because <code>__call__</code> is not yet end-to-end pmap-able. It will be removed in a
future release.</p>

					</div>`,name:"jit"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/controlnet/pipeline_flax_controlnet.py#L348",returnDescription:`
<p>If <code>return_dict</code> is <code>True</code>, <a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"
>FlaxStableDiffusionPipelineOutput</a> is
returned, otherwise a <code>tuple</code> is returned where the first element is a list with the generated images
and the second element is a list of <code>bool</code>s indicating whether the corresponding generated image
contains \u201Cnot-safe-for-work\u201D (nsfw) content.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"
>FlaxStableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),mt=new B({props:{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.example",$$slots:{default:[Pm]},$$scope:{ctx:J}}}),On=new io({}),Kn=new $({props:{name:"class diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput",anchor:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput",parameters:[{name:"images",val:": ndarray"},{name:"nsfw_content_detected",val:": typing.List[bool]"}],parametersDescription:[{anchor:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput.images",description:`<strong>images</strong> (<code>np.ndarray</code>) &#x2014;
Denoised images of array shape of <code>(batch_size, height, width, num_channels)</code>.`,name:"images"},{anchor:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput.nsfw_content_detected",description:`<strong>nsfw_content_detected</strong> (<code>List[bool]</code>) &#x2014;
List indicating whether the corresponding generated image contains &#x201C;not-safe-for-work&#x201D; (nsfw) content
or <code>None</code> if safety checking could not be performed.`,name:"nsfw_content_detected"}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/diffusers/pipelines/stable_diffusion/pipeline_output.py#L36"}}),eo=new $({props:{name:"replace",anchor:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput.replace",parameters:[{name:"**updates",val:""}],source:"https://github.com/huggingface/diffusers/blob/v0.21.0/src/flax/struct.py#L111"}}),{c(){l=s("meta"),_=p(),u=s("h1"),r=s("a"),h=s("span"),y(t.$$.fragment),f=p(),S=s("span"),W=c("ControlNet"),P=p(),R=s("p"),Y=c("ControlNet was introduced in "),D=s("a"),lo=c("Adding Conditional Control to Text-to-Image Diffusion Models"),ro=c(" by Lvmin Zhang and Maneesh Agrawala."),It=p(),co=s("p"),di=c("With a ControlNet model, you can provide an additional control image to condition and control Stable Diffusion generation. For example, if you provide a depth map, the ControlNet model generates an image that\u2019ll preserve the spatial information from the depth map. It is a more flexible and accurate way to control the image generation process."),zs=p(),po=s("p"),pi=c("The abstract from the paper is:"),Qs=p(),mo=s("p"),Uo=s("em"),mi=c("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."),Hs=p(),he=s("p"),fi=c("This model was contributed by "),Tt=s("a"),ui=c("takuma104"),gi=c(". \u2764\uFE0F"),qs=p(),oe=s("p"),hi=c("The original codebase can be found at "),xt=s("a"),_i=c("lllyasviel/ControlNet"),bi=c(", and you can find official ControlNet checkpoints on "),Jt=s("a"),yi=c("lllyasviel\u2019s"),vi=c(" Hub profile."),Os=p(),y(_e.$$.fragment),Ks=p(),re=s("h2"),be=s("a"),Zo=s("span"),y($t.$$.fragment),wi=p(),ko=s("span"),Mi=c("StableDiffusionControlNetPipeline"),ea=p(),C=s("div"),y(Nt.$$.fragment),Ii=p(),So=s("p"),Ti=c("Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),xi=p(),Ct=s("p"),Ji=c("This model inherits from "),fo=s("a"),$i=c("DiffusionPipeline"),Ni=c(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Ci=p(),Do=s("p"),ji=c("The pipeline also inherits the following loading methods:"),Ui=p(),Wo=s("ul"),uo=s("li"),go=s("a"),Zi=c("load_textual_inversion()"),ki=c(" for loading textual inversion embeddings"),Si=p(),se=s("div"),y(jt.$$.fragment),Di=p(),Po=s("p"),Wi=c("The call function to the pipeline for generation."),Pi=p(),y(ye.$$.fragment),Ei=p(),A=s("div"),y(Ut.$$.fragment),Gi=p(),Eo=s("p"),Fi=c(`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`),Bi=p(),y(ve.$$.fragment),Vi=p(),y(we.$$.fragment),Xi=p(),Me=s("div"),y(Zt.$$.fragment),Ri=p(),kt=s("p"),Li=c("Disable sliced attention computation. If "),Go=s("code"),Yi=c("enable_attention_slicing"),Ai=c(` was previously called, attention is
computed in one step.`),zi=p(),Ie=s("div"),y(St.$$.fragment),Qi=p(),Fo=s("p"),Hi=c(`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),qi=p(),Te=s("div"),y(Dt.$$.fragment),Oi=p(),Wt=s("p"),Ki=c("Disable sliced VAE decoding. If "),Bo=s("code"),el=c("enable_vae_slicing"),tl=c(` was previously enabled, this method will go back to
computing decoding in one step.`),nl=p(),z=s("div"),y(Pt.$$.fragment),ol=p(),Et=s("p"),sl=c("Enable memory efficient attention from "),Gt=s("a"),al=c("xFormers"),il=c(`. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`),ll=p(),y(xe.$$.fragment),rl=p(),y(Je.$$.fragment),cl=p(),$e=s("div"),y(Ft.$$.fragment),dl=p(),Bt=s("p"),pl=c("Disable memory efficient attention from "),Vt=s("a"),ml=c("xFormers"),fl=c("."),ul=p(),E=s("div"),y(Xt.$$.fragment),gl=p(),Rt=s("p"),hl=c("Load textual inversion embeddings into the text encoder of "),ho=s("a"),_l=c("StableDiffusionPipeline"),bl=c(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),yl=p(),Vo=s("p"),vl=c("Example:"),wl=p(),y(Ne.$$.fragment),Ml=p(),Lt=s("p"),Il=c(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Yt=s("a"),Tl=c("civitAI"),xl=c(") and then load the vector"),Jl=p(),y(Ce.$$.fragment),$l=p(),je=s("div"),y(At.$$.fragment),Nl=p(),zt=s("p"),Cl=c("Disable tiled VAE decoding. If "),Xo=s("code"),jl=c("enable_vae_tiling"),Ul=c(` was previously enabled, this method will go back to
computing decoding in one step.`),Zl=p(),Ue=s("div"),y(Qt.$$.fragment),kl=p(),Ro=s("p"),Sl=c(`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),Dl=p(),Ze=s("div"),y(Ht.$$.fragment),Wl=p(),Lo=s("p"),Pl=c("Encodes the prompt into text encoder hidden states."),ta=p(),ce=s("h2"),ke=s("a"),Yo=s("span"),y(qt.$$.fragment),El=p(),Ao=s("span"),Gl=c("StableDiffusionControlNetImg2ImgPipeline"),na=p(),j=s("div"),y(Ot.$$.fragment),Fl=p(),zo=s("p"),Bl=c("Pipeline for image-to-image generation using Stable Diffusion with ControlNet guidance."),Vl=p(),Kt=s("p"),Xl=c("This model inherits from "),_o=s("a"),Rl=c("DiffusionPipeline"),Ll=c(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Yl=p(),Qo=s("p"),Al=c("The pipeline also inherits the following loading methods:"),zl=p(),Ho=s("ul"),bo=s("li"),yo=s("a"),Ql=c("load_textual_inversion()"),Hl=c(" for loading textual inversion embeddings"),ql=p(),ae=s("div"),y(en.$$.fragment),Ol=p(),qo=s("p"),Kl=c("The call function to the pipeline for generation."),er=p(),y(Se.$$.fragment),tr=p(),Q=s("div"),y(tn.$$.fragment),nr=p(),Oo=s("p"),or=c(`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`),sr=p(),y(De.$$.fragment),ar=p(),y(We.$$.fragment),ir=p(),Pe=s("div"),y(nn.$$.fragment),lr=p(),on=s("p"),rr=c("Disable sliced attention computation. If "),Ko=s("code"),cr=c("enable_attention_slicing"),dr=c(` was previously called, attention is
computed in one step.`),pr=p(),Ee=s("div"),y(sn.$$.fragment),mr=p(),es=s("p"),fr=c(`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),ur=p(),Ge=s("div"),y(an.$$.fragment),gr=p(),ln=s("p"),hr=c("Disable sliced VAE decoding. If "),ts=s("code"),_r=c("enable_vae_slicing"),br=c(` was previously enabled, this method will go back to
computing decoding in one step.`),yr=p(),H=s("div"),y(rn.$$.fragment),vr=p(),cn=s("p"),wr=c("Enable memory efficient attention from "),dn=s("a"),Mr=c("xFormers"),Ir=c(`. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`),Tr=p(),y(Fe.$$.fragment),xr=p(),y(Be.$$.fragment),Jr=p(),Ve=s("div"),y(pn.$$.fragment),$r=p(),mn=s("p"),Nr=c("Disable memory efficient attention from "),fn=s("a"),Cr=c("xFormers"),jr=c("."),Ur=p(),G=s("div"),y(un.$$.fragment),Zr=p(),gn=s("p"),kr=c("Load textual inversion embeddings into the text encoder of "),vo=s("a"),Sr=c("StableDiffusionPipeline"),Dr=c(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),Wr=p(),ns=s("p"),Pr=c("Example:"),Er=p(),y(Xe.$$.fragment),Gr=p(),hn=s("p"),Fr=c(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),_n=s("a"),Br=c("civitAI"),Vr=c(") and then load the vector"),Xr=p(),y(Re.$$.fragment),Rr=p(),Le=s("div"),y(bn.$$.fragment),Lr=p(),yn=s("p"),Yr=c("Disable tiled VAE decoding. If "),os=s("code"),Ar=c("enable_vae_tiling"),zr=c(` was previously enabled, this method will go back to
computing decoding in one step.`),Qr=p(),Ye=s("div"),y(vn.$$.fragment),Hr=p(),ss=s("p"),qr=c(`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),Or=p(),Ae=s("div"),y(wn.$$.fragment),Kr=p(),as=s("p"),ec=c("Encodes the prompt into text encoder hidden states."),oa=p(),de=s("h2"),ze=s("a"),is=s("span"),y(Mn.$$.fragment),tc=p(),ls=s("span"),nc=c("StableDiffusionControlNetInpaintPipeline"),sa=p(),N=s("div"),y(In.$$.fragment),oc=p(),rs=s("p"),sc=c("Pipeline for image inpainting using Stable Diffusion with ControlNet guidance."),ac=p(),Tn=s("p"),ic=c("This model inherits from "),wo=s("a"),lc=c("DiffusionPipeline"),rc=c(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),cc=p(),cs=s("p"),dc=c("The pipeline also inherits the following loading methods:"),pc=p(),ds=s("ul"),Mo=s("li"),Io=s("a"),mc=c("load_textual_inversion()"),fc=c(" for loading textual inversion embeddings"),uc=p(),y(Qe.$$.fragment),gc=p(),ie=s("div"),y(xn.$$.fragment),hc=p(),ps=s("p"),_c=c("The call function to the pipeline for generation."),bc=p(),y(He.$$.fragment),yc=p(),q=s("div"),y(Jn.$$.fragment),vc=p(),ms=s("p"),wc=c(`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`),Mc=p(),y(qe.$$.fragment),Ic=p(),y(Oe.$$.fragment),Tc=p(),Ke=s("div"),y($n.$$.fragment),xc=p(),Nn=s("p"),Jc=c("Disable sliced attention computation. If "),fs=s("code"),$c=c("enable_attention_slicing"),Nc=c(` was previously called, attention is
computed in one step.`),Cc=p(),et=s("div"),y(Cn.$$.fragment),jc=p(),us=s("p"),Uc=c(`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),Zc=p(),tt=s("div"),y(jn.$$.fragment),kc=p(),Un=s("p"),Sc=c("Disable sliced VAE decoding. If "),gs=s("code"),Dc=c("enable_vae_slicing"),Wc=c(` was previously enabled, this method will go back to
computing decoding in one step.`),Pc=p(),O=s("div"),y(Zn.$$.fragment),Ec=p(),kn=s("p"),Gc=c("Enable memory efficient attention from "),Sn=s("a"),Fc=c("xFormers"),Bc=c(`. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`),Vc=p(),y(nt.$$.fragment),Xc=p(),y(ot.$$.fragment),Rc=p(),st=s("div"),y(Dn.$$.fragment),Lc=p(),Wn=s("p"),Yc=c("Disable memory efficient attention from "),Pn=s("a"),Ac=c("xFormers"),zc=c("."),Qc=p(),F=s("div"),y(En.$$.fragment),Hc=p(),Gn=s("p"),qc=c("Load textual inversion embeddings into the text encoder of "),To=s("a"),Oc=c("StableDiffusionPipeline"),Kc=c(` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),ed=p(),hs=s("p"),td=c("Example:"),nd=p(),y(at.$$.fragment),od=p(),Fn=s("p"),sd=c(`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Bn=s("a"),ad=c("civitAI"),id=c(") and then load the vector"),ld=p(),y(it.$$.fragment),rd=p(),lt=s("div"),y(Vn.$$.fragment),cd=p(),Xn=s("p"),dd=c("Disable tiled VAE decoding. If "),_s=s("code"),pd=c("enable_vae_tiling"),md=c(` was previously enabled, this method will go back to
computing decoding in one step.`),fd=p(),rt=s("div"),y(Rn.$$.fragment),ud=p(),bs=s("p"),gd=c(`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),hd=p(),ct=s("div"),y(Ln.$$.fragment),_d=p(),ys=s("p"),bd=c("Encodes the prompt into text encoder hidden states."),aa=p(),pe=s("h2"),dt=s("a"),vs=s("span"),y(Yn.$$.fragment),yd=p(),ws=s("span"),vd=c("StableDiffusionPipelineOutput"),ia=p(),me=s("div"),y(An.$$.fragment),wd=p(),Ms=s("p"),Md=c("Output class for Stable Diffusion pipelines."),la=p(),fe=s("h2"),pt=s("a"),Is=s("span"),y(zn.$$.fragment),Id=p(),Ts=s("span"),Td=c("FlaxStableDiffusionControlNetPipeline"),ra=p(),L=s("div"),y(Qn.$$.fragment),xd=p(),xs=s("p"),Jd=c("Flax-based pipeline for text-to-image generation using Stable Diffusion with ControlNet Guidance."),$d=p(),Hn=s("p"),Nd=c("This model inherits from "),xo=s("a"),Cd=c("FlaxDiffusionPipeline"),jd=c(`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Ud=p(),le=s("div"),y(qn.$$.fragment),Zd=p(),Js=s("p"),kd=c("The call function to the pipeline for generation."),Sd=p(),y(mt.$$.fragment),ca=p(),ue=s("h2"),ft=s("a"),$s=s("span"),y(On.$$.fragment),Dd=p(),Ns=s("span"),Wd=c("FlaxStableDiffusionControlNetPipelineOutput"),da=p(),ne=s("div"),y(Kn.$$.fragment),Pd=p(),Cs=s("p"),Ed=c("Output class for Flax-based Stable Diffusion pipelines."),Gd=p(),ut=s("div"),y(eo.$$.fragment),Fd=p(),js=s("p"),Bd=c("\u201CReturns a new object replacing the specified fields with new values."),this.h()},l(n){const b=mm('[data-svelte="svelte-1phssyn"]',document.head);l=a(b,"META",{name:!0,content:!0}),b.forEach(o),_=m(n),u=a(n,"H1",{class:!0});var to=i(u);r=a(to,"A",{id:!0,class:!0,href:!0});var Us=i(r);h=a(Us,"SPAN",{});var Zs=i(h);v(t.$$.fragment,Zs),Zs.forEach(o),Us.forEach(o),f=m(to),S=a(to,"SPAN",{});var ks=i(S);W=d(ks,"ControlNet"),ks.forEach(o),to.forEach(o),P=m(n),R=a(n,"P",{});var no=i(R);Y=d(no,"ControlNet was introduced in "),D=a(no,"A",{href:!0,rel:!0});var Ss=i(D);lo=d(Ss,"Adding Conditional Control to Text-to-Image Diffusion Models"),Ss.forEach(o),ro=d(no," by Lvmin Zhang and Maneesh Agrawala."),no.forEach(o),It=m(n),co=a(n,"P",{});var Ds=i(co);di=d(Ds,"With a ControlNet model, you can provide an additional control image to condition and control Stable Diffusion generation. For example, if you provide a depth map, the ControlNet model generates an image that\u2019ll preserve the spatial information from the depth map. It is a more flexible and accurate way to control the image generation process."),Ds.forEach(o),zs=m(n),po=a(n,"P",{});var Ws=i(po);pi=d(Ws,"The abstract from the paper is:"),Ws.forEach(o),Qs=m(n),mo=a(n,"P",{});var Ps=i(mo);Uo=a(Ps,"EM",{});var Es=i(Uo);mi=d(Es,"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."),Es.forEach(o),Ps.forEach(o),Hs=m(n),he=a(n,"P",{});var oo=i(he);fi=d(oo,"This model was contributed by "),Tt=a(oo,"A",{href:!0,rel:!0});var Gs=i(Tt);ui=d(Gs,"takuma104"),Gs.forEach(o),gi=d(oo,". \u2764\uFE0F"),oo.forEach(o),qs=m(n),oe=a(n,"P",{});var ge=i(oe);hi=d(ge,"The original codebase can be found at "),xt=a(ge,"A",{href:!0,rel:!0});var Fs=i(xt);_i=d(Fs,"lllyasviel/ControlNet"),Fs.forEach(o),bi=d(ge,", and you can find official ControlNet checkpoints on "),Jt=a(ge,"A",{href:!0,rel:!0});var Bs=i(Jt);yi=d(Bs,"lllyasviel\u2019s"),Bs.forEach(o),vi=d(ge," Hub profile."),ge.forEach(o),Os=m(n),v(_e.$$.fragment,n),Ks=m(n),re=a(n,"H2",{class:!0});var so=i(re);be=a(so,"A",{id:!0,class:!0,href:!0});var Vs=i(be);Zo=a(Vs,"SPAN",{});var Xs=i(Zo);v($t.$$.fragment,Xs),Xs.forEach(o),Vs.forEach(o),wi=m(so),ko=a(so,"SPAN",{});var Rs=i(ko);Mi=d(Rs,"StableDiffusionControlNetPipeline"),Rs.forEach(o),so.forEach(o),ea=m(n),C=a(n,"DIV",{class:!0});var U=i(C);v(Nt.$$.fragment,U),Ii=m(U),So=a(U,"P",{});var Ls=i(So);Ti=d(Ls,"Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),Ls.forEach(o),xi=m(U),Ct=a(U,"P",{});var ao=i(Ct);Ji=d(ao,"This model inherits from "),fo=a(ao,"A",{href:!0});var Ys=i(fo);$i=d(Ys,"DiffusionPipeline"),Ys.forEach(o),Ni=d(ao,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),ao.forEach(o),Ci=m(U),Do=a(U,"P",{});var As=i(Do);ji=d(As,"The pipeline also inherits the following loading methods:"),As.forEach(o),Ui=m(U),Wo=a(U,"UL",{});var Ld=i(Wo);uo=a(Ld,"LI",{});var Vd=i(uo);go=a(Vd,"A",{href:!0});var Yd=i(go);Zi=d(Yd,"load_textual_inversion()"),Yd.forEach(o),ki=d(Vd," for loading textual inversion embeddings"),Vd.forEach(o),Ld.forEach(o),Si=m(U),se=a(U,"DIV",{class:!0});var Jo=i(se);v(jt.$$.fragment,Jo),Di=m(Jo),Po=a(Jo,"P",{});var Ad=i(Po);Wi=d(Ad,"The call function to the pipeline for generation."),Ad.forEach(o),Pi=m(Jo),v(ye.$$.fragment,Jo),Jo.forEach(o),Ei=m(U),A=a(U,"DIV",{class:!0});var gt=i(A);v(Ut.$$.fragment,gt),Gi=m(gt),Eo=a(gt,"P",{});var zd=i(Eo);Fi=d(zd,`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`),zd.forEach(o),Bi=m(gt),v(ve.$$.fragment,gt),Vi=m(gt),v(we.$$.fragment,gt),gt.forEach(o),Xi=m(U),Me=a(U,"DIV",{class:!0});var ma=i(Me);v(Zt.$$.fragment,ma),Ri=m(ma),kt=a(ma,"P",{});var fa=i(kt);Li=d(fa,"Disable sliced attention computation. If "),Go=a(fa,"CODE",{});var Qd=i(Go);Yi=d(Qd,"enable_attention_slicing"),Qd.forEach(o),Ai=d(fa,` was previously called, attention is
computed in one step.`),fa.forEach(o),ma.forEach(o),zi=m(U),Ie=a(U,"DIV",{class:!0});var ua=i(Ie);v(St.$$.fragment,ua),Qi=m(ua),Fo=a(ua,"P",{});var Hd=i(Fo);Hi=d(Hd,`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),Hd.forEach(o),ua.forEach(o),qi=m(U),Te=a(U,"DIV",{class:!0});var ga=i(Te);v(Dt.$$.fragment,ga),Oi=m(ga),Wt=a(ga,"P",{});var ha=i(Wt);Ki=d(ha,"Disable sliced VAE decoding. If "),Bo=a(ha,"CODE",{});var qd=i(Bo);el=d(qd,"enable_vae_slicing"),qd.forEach(o),tl=d(ha,` was previously enabled, this method will go back to
computing decoding in one step.`),ha.forEach(o),ga.forEach(o),nl=m(U),z=a(U,"DIV",{class:!0});var ht=i(z);v(Pt.$$.fragment,ht),ol=m(ht),Et=a(ht,"P",{});var _a=i(Et);sl=d(_a,"Enable memory efficient attention from "),Gt=a(_a,"A",{href:!0,rel:!0});var Od=i(Gt);al=d(Od,"xFormers"),Od.forEach(o),il=d(_a,`. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`),_a.forEach(o),ll=m(ht),v(xe.$$.fragment,ht),rl=m(ht),v(Je.$$.fragment,ht),ht.forEach(o),cl=m(U),$e=a(U,"DIV",{class:!0});var ba=i($e);v(Ft.$$.fragment,ba),dl=m(ba),Bt=a(ba,"P",{});var ya=i(Bt);pl=d(ya,"Disable memory efficient attention from "),Vt=a(ya,"A",{href:!0,rel:!0});var Kd=i(Vt);ml=d(Kd,"xFormers"),Kd.forEach(o),fl=d(ya,"."),ya.forEach(o),ba.forEach(o),ul=m(U),E=a(U,"DIV",{class:!0});var K=i(E);v(Xt.$$.fragment,K),gl=m(K),Rt=a(K,"P",{});var va=i(Rt);hl=d(va,"Load textual inversion embeddings into the text encoder of "),ho=a(va,"A",{href:!0});var ep=i(ho);_l=d(ep,"StableDiffusionPipeline"),ep.forEach(o),bl=d(va,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),va.forEach(o),yl=m(K),Vo=a(K,"P",{});var tp=i(Vo);vl=d(tp,"Example:"),tp.forEach(o),wl=m(K),v(Ne.$$.fragment,K),Ml=m(K),Lt=a(K,"P",{});var wa=i(Lt);Il=d(wa,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Yt=a(wa,"A",{href:!0,rel:!0});var np=i(Yt);Tl=d(np,"civitAI"),np.forEach(o),xl=d(wa,") and then load the vector"),wa.forEach(o),Jl=m(K),v(Ce.$$.fragment,K),K.forEach(o),$l=m(U),je=a(U,"DIV",{class:!0});var Ma=i(je);v(At.$$.fragment,Ma),Nl=m(Ma),zt=a(Ma,"P",{});var Ia=i(zt);Cl=d(Ia,"Disable tiled VAE decoding. If "),Xo=a(Ia,"CODE",{});var op=i(Xo);jl=d(op,"enable_vae_tiling"),op.forEach(o),Ul=d(Ia,` was previously enabled, this method will go back to
computing decoding in one step.`),Ia.forEach(o),Ma.forEach(o),Zl=m(U),Ue=a(U,"DIV",{class:!0});var Ta=i(Ue);v(Qt.$$.fragment,Ta),kl=m(Ta),Ro=a(Ta,"P",{});var sp=i(Ro);Sl=d(sp,`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),sp.forEach(o),Ta.forEach(o),Dl=m(U),Ze=a(U,"DIV",{class:!0});var xa=i(Ze);v(Ht.$$.fragment,xa),Wl=m(xa),Lo=a(xa,"P",{});var ap=i(Lo);Pl=d(ap,"Encodes the prompt into text encoder hidden states."),ap.forEach(o),xa.forEach(o),U.forEach(o),ta=m(n),ce=a(n,"H2",{class:!0});var Ja=i(ce);ke=a(Ja,"A",{id:!0,class:!0,href:!0});var ip=i(ke);Yo=a(ip,"SPAN",{});var lp=i(Yo);v(qt.$$.fragment,lp),lp.forEach(o),ip.forEach(o),El=m(Ja),Ao=a(Ja,"SPAN",{});var rp=i(Ao);Gl=d(rp,"StableDiffusionControlNetImg2ImgPipeline"),rp.forEach(o),Ja.forEach(o),na=m(n),j=a(n,"DIV",{class:!0});var k=i(j);v(Ot.$$.fragment,k),Fl=m(k),zo=a(k,"P",{});var cp=i(zo);Bl=d(cp,"Pipeline for image-to-image generation using Stable Diffusion with ControlNet guidance."),cp.forEach(o),Vl=m(k),Kt=a(k,"P",{});var $a=i(Kt);Xl=d($a,"This model inherits from "),_o=a($a,"A",{href:!0});var dp=i(_o);Rl=d(dp,"DiffusionPipeline"),dp.forEach(o),Ll=d($a,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),$a.forEach(o),Yl=m(k),Qo=a(k,"P",{});var pp=i(Qo);Al=d(pp,"The pipeline also inherits the following loading methods:"),pp.forEach(o),zl=m(k),Ho=a(k,"UL",{});var mp=i(Ho);bo=a(mp,"LI",{});var Xd=i(bo);yo=a(Xd,"A",{href:!0});var fp=i(yo);Ql=d(fp,"load_textual_inversion()"),fp.forEach(o),Hl=d(Xd," for loading textual inversion embeddings"),Xd.forEach(o),mp.forEach(o),ql=m(k),ae=a(k,"DIV",{class:!0});var $o=i(ae);v(en.$$.fragment,$o),Ol=m($o),qo=a($o,"P",{});var up=i(qo);Kl=d(up,"The call function to the pipeline for generation."),up.forEach(o),er=m($o),v(Se.$$.fragment,$o),$o.forEach(o),tr=m(k),Q=a(k,"DIV",{class:!0});var _t=i(Q);v(tn.$$.fragment,_t),nr=m(_t),Oo=a(_t,"P",{});var gp=i(Oo);or=d(gp,`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`),gp.forEach(o),sr=m(_t),v(De.$$.fragment,_t),ar=m(_t),v(We.$$.fragment,_t),_t.forEach(o),ir=m(k),Pe=a(k,"DIV",{class:!0});var Na=i(Pe);v(nn.$$.fragment,Na),lr=m(Na),on=a(Na,"P",{});var Ca=i(on);rr=d(Ca,"Disable sliced attention computation. If "),Ko=a(Ca,"CODE",{});var hp=i(Ko);cr=d(hp,"enable_attention_slicing"),hp.forEach(o),dr=d(Ca,` was previously called, attention is
computed in one step.`),Ca.forEach(o),Na.forEach(o),pr=m(k),Ee=a(k,"DIV",{class:!0});var ja=i(Ee);v(sn.$$.fragment,ja),mr=m(ja),es=a(ja,"P",{});var _p=i(es);fr=d(_p,`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),_p.forEach(o),ja.forEach(o),ur=m(k),Ge=a(k,"DIV",{class:!0});var Ua=i(Ge);v(an.$$.fragment,Ua),gr=m(Ua),ln=a(Ua,"P",{});var Za=i(ln);hr=d(Za,"Disable sliced VAE decoding. If "),ts=a(Za,"CODE",{});var bp=i(ts);_r=d(bp,"enable_vae_slicing"),bp.forEach(o),br=d(Za,` was previously enabled, this method will go back to
computing decoding in one step.`),Za.forEach(o),Ua.forEach(o),yr=m(k),H=a(k,"DIV",{class:!0});var bt=i(H);v(rn.$$.fragment,bt),vr=m(bt),cn=a(bt,"P",{});var ka=i(cn);wr=d(ka,"Enable memory efficient attention from "),dn=a(ka,"A",{href:!0,rel:!0});var yp=i(dn);Mr=d(yp,"xFormers"),yp.forEach(o),Ir=d(ka,`. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`),ka.forEach(o),Tr=m(bt),v(Fe.$$.fragment,bt),xr=m(bt),v(Be.$$.fragment,bt),bt.forEach(o),Jr=m(k),Ve=a(k,"DIV",{class:!0});var Sa=i(Ve);v(pn.$$.fragment,Sa),$r=m(Sa),mn=a(Sa,"P",{});var Da=i(mn);Nr=d(Da,"Disable memory efficient attention from "),fn=a(Da,"A",{href:!0,rel:!0});var vp=i(fn);Cr=d(vp,"xFormers"),vp.forEach(o),jr=d(Da,"."),Da.forEach(o),Sa.forEach(o),Ur=m(k),G=a(k,"DIV",{class:!0});var ee=i(G);v(un.$$.fragment,ee),Zr=m(ee),gn=a(ee,"P",{});var Wa=i(gn);kr=d(Wa,"Load textual inversion embeddings into the text encoder of "),vo=a(Wa,"A",{href:!0});var wp=i(vo);Sr=d(wp,"StableDiffusionPipeline"),wp.forEach(o),Dr=d(Wa,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),Wa.forEach(o),Wr=m(ee),ns=a(ee,"P",{});var Mp=i(ns);Pr=d(Mp,"Example:"),Mp.forEach(o),Er=m(ee),v(Xe.$$.fragment,ee),Gr=m(ee),hn=a(ee,"P",{});var Pa=i(hn);Fr=d(Pa,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),_n=a(Pa,"A",{href:!0,rel:!0});var Ip=i(_n);Br=d(Ip,"civitAI"),Ip.forEach(o),Vr=d(Pa,") and then load the vector"),Pa.forEach(o),Xr=m(ee),v(Re.$$.fragment,ee),ee.forEach(o),Rr=m(k),Le=a(k,"DIV",{class:!0});var Ea=i(Le);v(bn.$$.fragment,Ea),Lr=m(Ea),yn=a(Ea,"P",{});var Ga=i(yn);Yr=d(Ga,"Disable tiled VAE decoding. If "),os=a(Ga,"CODE",{});var Tp=i(os);Ar=d(Tp,"enable_vae_tiling"),Tp.forEach(o),zr=d(Ga,` was previously enabled, this method will go back to
computing decoding in one step.`),Ga.forEach(o),Ea.forEach(o),Qr=m(k),Ye=a(k,"DIV",{class:!0});var Fa=i(Ye);v(vn.$$.fragment,Fa),Hr=m(Fa),ss=a(Fa,"P",{});var xp=i(ss);qr=d(xp,`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),xp.forEach(o),Fa.forEach(o),Or=m(k),Ae=a(k,"DIV",{class:!0});var Ba=i(Ae);v(wn.$$.fragment,Ba),Kr=m(Ba),as=a(Ba,"P",{});var Jp=i(as);ec=d(Jp,"Encodes the prompt into text encoder hidden states."),Jp.forEach(o),Ba.forEach(o),k.forEach(o),oa=m(n),de=a(n,"H2",{class:!0});var Va=i(de);ze=a(Va,"A",{id:!0,class:!0,href:!0});var $p=i(ze);is=a($p,"SPAN",{});var Np=i(is);v(Mn.$$.fragment,Np),Np.forEach(o),$p.forEach(o),tc=m(Va),ls=a(Va,"SPAN",{});var Cp=i(ls);nc=d(Cp,"StableDiffusionControlNetInpaintPipeline"),Cp.forEach(o),Va.forEach(o),sa=m(n),N=a(n,"DIV",{class:!0});var Z=i(N);v(In.$$.fragment,Z),oc=m(Z),rs=a(Z,"P",{});var jp=i(rs);sc=d(jp,"Pipeline for image inpainting using Stable Diffusion with ControlNet guidance."),jp.forEach(o),ac=m(Z),Tn=a(Z,"P",{});var Xa=i(Tn);ic=d(Xa,"This model inherits from "),wo=a(Xa,"A",{href:!0});var Up=i(wo);lc=d(Up,"DiffusionPipeline"),Up.forEach(o),rc=d(Xa,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),Xa.forEach(o),cc=m(Z),cs=a(Z,"P",{});var Zp=i(cs);dc=d(Zp,"The pipeline also inherits the following loading methods:"),Zp.forEach(o),pc=m(Z),ds=a(Z,"UL",{});var kp=i(ds);Mo=a(kp,"LI",{});var Rd=i(Mo);Io=a(Rd,"A",{href:!0});var Sp=i(Io);mc=d(Sp,"load_textual_inversion()"),Sp.forEach(o),fc=d(Rd," for loading textual inversion embeddings"),Rd.forEach(o),kp.forEach(o),uc=m(Z),v(Qe.$$.fragment,Z),gc=m(Z),ie=a(Z,"DIV",{class:!0});var No=i(ie);v(xn.$$.fragment,No),hc=m(No),ps=a(No,"P",{});var Dp=i(ps);_c=d(Dp,"The call function to the pipeline for generation."),Dp.forEach(o),bc=m(No),v(He.$$.fragment,No),No.forEach(o),yc=m(Z),q=a(Z,"DIV",{class:!0});var yt=i(q);v(Jn.$$.fragment,yt),vc=m(yt),ms=a(yt,"P",{});var Wp=i(ms);wc=d(Wp,`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`),Wp.forEach(o),Mc=m(yt),v(qe.$$.fragment,yt),Ic=m(yt),v(Oe.$$.fragment,yt),yt.forEach(o),Tc=m(Z),Ke=a(Z,"DIV",{class:!0});var Ra=i(Ke);v($n.$$.fragment,Ra),xc=m(Ra),Nn=a(Ra,"P",{});var La=i(Nn);Jc=d(La,"Disable sliced attention computation. If "),fs=a(La,"CODE",{});var Pp=i(fs);$c=d(Pp,"enable_attention_slicing"),Pp.forEach(o),Nc=d(La,` was previously called, attention is
computed in one step.`),La.forEach(o),Ra.forEach(o),Cc=m(Z),et=a(Z,"DIV",{class:!0});var Ya=i(et);v(Cn.$$.fragment,Ya),jc=m(Ya),us=a(Ya,"P",{});var Ep=i(us);Uc=d(Ep,`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`),Ep.forEach(o),Ya.forEach(o),Zc=m(Z),tt=a(Z,"DIV",{class:!0});var Aa=i(tt);v(jn.$$.fragment,Aa),kc=m(Aa),Un=a(Aa,"P",{});var za=i(Un);Sc=d(za,"Disable sliced VAE decoding. If "),gs=a(za,"CODE",{});var Gp=i(gs);Dc=d(Gp,"enable_vae_slicing"),Gp.forEach(o),Wc=d(za,` was previously enabled, this method will go back to
computing decoding in one step.`),za.forEach(o),Aa.forEach(o),Pc=m(Z),O=a(Z,"DIV",{class:!0});var vt=i(O);v(Zn.$$.fragment,vt),Ec=m(vt),kn=a(vt,"P",{});var Qa=i(kn);Gc=d(Qa,"Enable memory efficient attention from "),Sn=a(Qa,"A",{href:!0,rel:!0});var Fp=i(Sn);Fc=d(Fp,"xFormers"),Fp.forEach(o),Bc=d(Qa,`. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`),Qa.forEach(o),Vc=m(vt),v(nt.$$.fragment,vt),Xc=m(vt),v(ot.$$.fragment,vt),vt.forEach(o),Rc=m(Z),st=a(Z,"DIV",{class:!0});var Ha=i(st);v(Dn.$$.fragment,Ha),Lc=m(Ha),Wn=a(Ha,"P",{});var qa=i(Wn);Yc=d(qa,"Disable memory efficient attention from "),Pn=a(qa,"A",{href:!0,rel:!0});var Bp=i(Pn);Ac=d(Bp,"xFormers"),Bp.forEach(o),zc=d(qa,"."),qa.forEach(o),Ha.forEach(o),Qc=m(Z),F=a(Z,"DIV",{class:!0});var te=i(F);v(En.$$.fragment,te),Hc=m(te),Gn=a(te,"P",{});var Oa=i(Gn);qc=d(Oa,"Load textual inversion embeddings into the text encoder of "),To=a(Oa,"A",{href:!0});var Vp=i(To);Oc=d(Vp,"StableDiffusionPipeline"),Vp.forEach(o),Kc=d(Oa,` (both \u{1F917} Diffusers and
Automatic1111 formats are supported).`),Oa.forEach(o),ed=m(te),hs=a(te,"P",{});var Xp=i(hs);td=d(Xp,"Example:"),Xp.forEach(o),nd=m(te),v(at.$$.fragment,te),od=m(te),Fn=a(te,"P",{});var Ka=i(Fn);sd=d(Ka,`To load a textual inversion embedding vector in Automatic1111 format, make sure to download the vector first
(for example from `),Bn=a(Ka,"A",{href:!0,rel:!0});var Rp=i(Bn);ad=d(Rp,"civitAI"),Rp.forEach(o),id=d(Ka,") and then load the vector"),Ka.forEach(o),ld=m(te),v(it.$$.fragment,te),te.forEach(o),rd=m(Z),lt=a(Z,"DIV",{class:!0});var ei=i(lt);v(Vn.$$.fragment,ei),cd=m(ei),Xn=a(ei,"P",{});var ti=i(Xn);dd=d(ti,"Disable tiled VAE decoding. If "),_s=a(ti,"CODE",{});var Lp=i(_s);pd=d(Lp,"enable_vae_tiling"),Lp.forEach(o),md=d(ti,` was previously enabled, this method will go back to
computing decoding in one step.`),ti.forEach(o),ei.forEach(o),fd=m(Z),rt=a(Z,"DIV",{class:!0});var ni=i(rt);v(Rn.$$.fragment,ni),ud=m(ni),bs=a(ni,"P",{});var Yp=i(bs);gd=d(Yp,`Enable tiled VAE decoding. When this option is enabled, the VAE will split the input tensor into tiles to
compute decoding and encoding in several steps. This is useful for saving a large amount of memory and to allow
processing larger images.`),Yp.forEach(o),ni.forEach(o),hd=m(Z),ct=a(Z,"DIV",{class:!0});var oi=i(ct);v(Ln.$$.fragment,oi),_d=m(oi),ys=a(oi,"P",{});var Ap=i(ys);bd=d(Ap,"Encodes the prompt into text encoder hidden states."),Ap.forEach(o),oi.forEach(o),Z.forEach(o),aa=m(n),pe=a(n,"H2",{class:!0});var si=i(pe);dt=a(si,"A",{id:!0,class:!0,href:!0});var zp=i(dt);vs=a(zp,"SPAN",{});var Qp=i(vs);v(Yn.$$.fragment,Qp),Qp.forEach(o),zp.forEach(o),yd=m(si),ws=a(si,"SPAN",{});var Hp=i(ws);vd=d(Hp,"StableDiffusionPipelineOutput"),Hp.forEach(o),si.forEach(o),ia=m(n),me=a(n,"DIV",{class:!0});var ai=i(me);v(An.$$.fragment,ai),wd=m(ai),Ms=a(ai,"P",{});var qp=i(Ms);Md=d(qp,"Output class for Stable Diffusion pipelines."),qp.forEach(o),ai.forEach(o),la=m(n),fe=a(n,"H2",{class:!0});var ii=i(fe);pt=a(ii,"A",{id:!0,class:!0,href:!0});var Op=i(pt);Is=a(Op,"SPAN",{});var Kp=i(Is);v(zn.$$.fragment,Kp),Kp.forEach(o),Op.forEach(o),Id=m(ii),Ts=a(ii,"SPAN",{});var em=i(Ts);Td=d(em,"FlaxStableDiffusionControlNetPipeline"),em.forEach(o),ii.forEach(o),ra=m(n),L=a(n,"DIV",{class:!0});var wt=i(L);v(Qn.$$.fragment,wt),xd=m(wt),xs=a(wt,"P",{});var tm=i(xs);Jd=d(tm,"Flax-based pipeline for text-to-image generation using Stable Diffusion with ControlNet Guidance."),tm.forEach(o),$d=m(wt),Hn=a(wt,"P",{});var li=i(Hn);Nd=d(li,"This model inherits from "),xo=a(li,"A",{href:!0});var nm=i(xo);Cd=d(nm,"FlaxDiffusionPipeline"),nm.forEach(o),jd=d(li,`. Check the superclass documentation for the generic methods
implemented for all pipelines (downloading, saving, running on a particular device, etc.).`),li.forEach(o),Ud=m(wt),le=a(wt,"DIV",{class:!0});var Co=i(le);v(qn.$$.fragment,Co),Zd=m(Co),Js=a(Co,"P",{});var om=i(Js);kd=d(om,"The call function to the pipeline for generation."),om.forEach(o),Sd=m(Co),v(mt.$$.fragment,Co),Co.forEach(o),wt.forEach(o),ca=m(n),ue=a(n,"H2",{class:!0});var ri=i(ue);ft=a(ri,"A",{id:!0,class:!0,href:!0});var sm=i(ft);$s=a(sm,"SPAN",{});var am=i($s);v(On.$$.fragment,am),am.forEach(o),sm.forEach(o),Dd=m(ri),Ns=a(ri,"SPAN",{});var im=i(Ns);Wd=d(im,"FlaxStableDiffusionControlNetPipelineOutput"),im.forEach(o),ri.forEach(o),da=m(n),ne=a(n,"DIV",{class:!0});var jo=i(ne);v(Kn.$$.fragment,jo),Pd=m(jo),Cs=a(jo,"P",{});var lm=i(Cs);Ed=d(lm,"Output class for Flax-based Stable Diffusion pipelines."),lm.forEach(o),Gd=m(jo),ut=a(jo,"DIV",{class:!0});var ci=i(ut);v(eo.$$.fragment,ci),Fd=m(ci),js=a(ci,"P",{});var rm=i(js);Bd=d(rm,"\u201CReturns a new object replacing the specified fields with new values."),rm.forEach(o),ci.forEach(o),jo.forEach(o),this.h()},h(){g(l,"name","hf:doc:metadata"),g(l,"content",JSON.stringify(Gm)),g(r,"id","controlnet"),g(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"),g(r,"href","#controlnet"),g(u,"class","relative group"),g(D,"href","https://huggingface.co/papers/2302.05543"),g(D,"rel","nofollow"),g(Tt,"href","https://huggingface.co/takuma104"),g(Tt,"rel","nofollow"),g(xt,"href","https://github.com/lllyasviel/ControlNet"),g(xt,"rel","nofollow"),g(Jt,"href","https://huggingface.co/lllyasviel"),g(Jt,"rel","nofollow"),g(be,"id","diffusers.StableDiffusionControlNetPipeline"),g(be,"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"),g(be,"href","#diffusers.StableDiffusionControlNetPipeline"),g(re,"class","relative group"),g(fo,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(go,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion"),g(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Gt,"href","https://facebookresearch.github.io/xformers/"),g(Gt,"rel","nofollow"),g(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Vt,"href","https://facebookresearch.github.io/xformers/"),g(Vt,"rel","nofollow"),g($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ho,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),g(Yt,"href","https://civitai.com/models/3036?modelVersionId=9857"),g(Yt,"rel","nofollow"),g(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ke,"id","diffusers.StableDiffusionControlNetImg2ImgPipeline"),g(ke,"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"),g(ke,"href","#diffusers.StableDiffusionControlNetImg2ImgPipeline"),g(ce,"class","relative group"),g(_o,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(yo,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion"),g(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(dn,"href","https://facebookresearch.github.io/xformers/"),g(dn,"rel","nofollow"),g(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(fn,"href","https://facebookresearch.github.io/xformers/"),g(fn,"rel","nofollow"),g(Ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(vo,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),g(_n,"href","https://civitai.com/models/3036?modelVersionId=9857"),g(_n,"rel","nofollow"),g(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ze,"id","diffusers.StableDiffusionControlNetInpaintPipeline"),g(ze,"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"),g(ze,"href","#diffusers.StableDiffusionControlNetInpaintPipeline"),g(de,"class","relative group"),g(wo,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.DiffusionPipeline"),g(Io,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.load_textual_inversion"),g(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Sn,"href","https://facebookresearch.github.io/xformers/"),g(Sn,"rel","nofollow"),g(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(Pn,"href","https://facebookresearch.github.io/xformers/"),g(Pn,"rel","nofollow"),g(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(To,"href","/docs/diffusers/v0.21.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),g(Bn,"href","https://civitai.com/models/3036?modelVersionId=9857"),g(Bn,"rel","nofollow"),g(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(dt,"id","diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),g(dt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(dt,"href","#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"),g(pe,"class","relative group"),g(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(pt,"id","diffusers.FlaxStableDiffusionControlNetPipeline"),g(pt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(pt,"href","#diffusers.FlaxStableDiffusionControlNetPipeline"),g(fe,"class","relative group"),g(xo,"href","/docs/diffusers/v0.21.0/en/api/pipelines/overview#diffusers.FlaxDiffusionPipeline"),g(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ft,"id","diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"),g(ft,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),g(ft,"href","#diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput"),g(ue,"class","relative group"),g(ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),g(ne,"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,b){e(document.head,l),x(n,_,b),x(n,u,b),e(u,r),e(r,h),w(t,h,null),e(u,f),e(u,S),e(S,W),x(n,P,b),x(n,R,b),e(R,Y),e(R,D),e(D,lo),e(R,ro),x(n,It,b),x(n,co,b),e(co,di),x(n,zs,b),x(n,po,b),e(po,pi),x(n,Qs,b),x(n,mo,b),e(mo,Uo),e(Uo,mi),x(n,Hs,b),x(n,he,b),e(he,fi),e(he,Tt),e(Tt,ui),e(he,gi),x(n,qs,b),x(n,oe,b),e(oe,hi),e(oe,xt),e(xt,_i),e(oe,bi),e(oe,Jt),e(Jt,yi),e(oe,vi),x(n,Os,b),w(_e,n,b),x(n,Ks,b),x(n,re,b),e(re,be),e(be,Zo),w($t,Zo,null),e(re,wi),e(re,ko),e(ko,Mi),x(n,ea,b),x(n,C,b),w(Nt,C,null),e(C,Ii),e(C,So),e(So,Ti),e(C,xi),e(C,Ct),e(Ct,Ji),e(Ct,fo),e(fo,$i),e(Ct,Ni),e(C,Ci),e(C,Do),e(Do,ji),e(C,Ui),e(C,Wo),e(Wo,uo),e(uo,go),e(go,Zi),e(uo,ki),e(C,Si),e(C,se),w(jt,se,null),e(se,Di),e(se,Po),e(Po,Wi),e(se,Pi),w(ye,se,null),e(C,Ei),e(C,A),w(Ut,A,null),e(A,Gi),e(A,Eo),e(Eo,Fi),e(A,Bi),w(ve,A,null),e(A,Vi),w(we,A,null),e(C,Xi),e(C,Me),w(Zt,Me,null),e(Me,Ri),e(Me,kt),e(kt,Li),e(kt,Go),e(Go,Yi),e(kt,Ai),e(C,zi),e(C,Ie),w(St,Ie,null),e(Ie,Qi),e(Ie,Fo),e(Fo,Hi),e(C,qi),e(C,Te),w(Dt,Te,null),e(Te,Oi),e(Te,Wt),e(Wt,Ki),e(Wt,Bo),e(Bo,el),e(Wt,tl),e(C,nl),e(C,z),w(Pt,z,null),e(z,ol),e(z,Et),e(Et,sl),e(Et,Gt),e(Gt,al),e(Et,il),e(z,ll),w(xe,z,null),e(z,rl),w(Je,z,null),e(C,cl),e(C,$e),w(Ft,$e,null),e($e,dl),e($e,Bt),e(Bt,pl),e(Bt,Vt),e(Vt,ml),e(Bt,fl),e(C,ul),e(C,E),w(Xt,E,null),e(E,gl),e(E,Rt),e(Rt,hl),e(Rt,ho),e(ho,_l),e(Rt,bl),e(E,yl),e(E,Vo),e(Vo,vl),e(E,wl),w(Ne,E,null),e(E,Ml),e(E,Lt),e(Lt,Il),e(Lt,Yt),e(Yt,Tl),e(Lt,xl),e(E,Jl),w(Ce,E,null),e(C,$l),e(C,je),w(At,je,null),e(je,Nl),e(je,zt),e(zt,Cl),e(zt,Xo),e(Xo,jl),e(zt,Ul),e(C,Zl),e(C,Ue),w(Qt,Ue,null),e(Ue,kl),e(Ue,Ro),e(Ro,Sl),e(C,Dl),e(C,Ze),w(Ht,Ze,null),e(Ze,Wl),e(Ze,Lo),e(Lo,Pl),x(n,ta,b),x(n,ce,b),e(ce,ke),e(ke,Yo),w(qt,Yo,null),e(ce,El),e(ce,Ao),e(Ao,Gl),x(n,na,b),x(n,j,b),w(Ot,j,null),e(j,Fl),e(j,zo),e(zo,Bl),e(j,Vl),e(j,Kt),e(Kt,Xl),e(Kt,_o),e(_o,Rl),e(Kt,Ll),e(j,Yl),e(j,Qo),e(Qo,Al),e(j,zl),e(j,Ho),e(Ho,bo),e(bo,yo),e(yo,Ql),e(bo,Hl),e(j,ql),e(j,ae),w(en,ae,null),e(ae,Ol),e(ae,qo),e(qo,Kl),e(ae,er),w(Se,ae,null),e(j,tr),e(j,Q),w(tn,Q,null),e(Q,nr),e(Q,Oo),e(Oo,or),e(Q,sr),w(De,Q,null),e(Q,ar),w(We,Q,null),e(j,ir),e(j,Pe),w(nn,Pe,null),e(Pe,lr),e(Pe,on),e(on,rr),e(on,Ko),e(Ko,cr),e(on,dr),e(j,pr),e(j,Ee),w(sn,Ee,null),e(Ee,mr),e(Ee,es),e(es,fr),e(j,ur),e(j,Ge),w(an,Ge,null),e(Ge,gr),e(Ge,ln),e(ln,hr),e(ln,ts),e(ts,_r),e(ln,br),e(j,yr),e(j,H),w(rn,H,null),e(H,vr),e(H,cn),e(cn,wr),e(cn,dn),e(dn,Mr),e(cn,Ir),e(H,Tr),w(Fe,H,null),e(H,xr),w(Be,H,null),e(j,Jr),e(j,Ve),w(pn,Ve,null),e(Ve,$r),e(Ve,mn),e(mn,Nr),e(mn,fn),e(fn,Cr),e(mn,jr),e(j,Ur),e(j,G),w(un,G,null),e(G,Zr),e(G,gn),e(gn,kr),e(gn,vo),e(vo,Sr),e(gn,Dr),e(G,Wr),e(G,ns),e(ns,Pr),e(G,Er),w(Xe,G,null),e(G,Gr),e(G,hn),e(hn,Fr),e(hn,_n),e(_n,Br),e(hn,Vr),e(G,Xr),w(Re,G,null),e(j,Rr),e(j,Le),w(bn,Le,null),e(Le,Lr),e(Le,yn),e(yn,Yr),e(yn,os),e(os,Ar),e(yn,zr),e(j,Qr),e(j,Ye),w(vn,Ye,null),e(Ye,Hr),e(Ye,ss),e(ss,qr),e(j,Or),e(j,Ae),w(wn,Ae,null),e(Ae,Kr),e(Ae,as),e(as,ec),x(n,oa,b),x(n,de,b),e(de,ze),e(ze,is),w(Mn,is,null),e(de,tc),e(de,ls),e(ls,nc),x(n,sa,b),x(n,N,b),w(In,N,null),e(N,oc),e(N,rs),e(rs,sc),e(N,ac),e(N,Tn),e(Tn,ic),e(Tn,wo),e(wo,lc),e(Tn,rc),e(N,cc),e(N,cs),e(cs,dc),e(N,pc),e(N,ds),e(ds,Mo),e(Mo,Io),e(Io,mc),e(Mo,fc),e(N,uc),w(Qe,N,null),e(N,gc),e(N,ie),w(xn,ie,null),e(ie,hc),e(ie,ps),e(ps,_c),e(ie,bc),w(He,ie,null),e(N,yc),e(N,q),w(Jn,q,null),e(q,vc),e(q,ms),e(ms,wc),e(q,Mc),w(qe,q,null),e(q,Ic),w(Oe,q,null),e(N,Tc),e(N,Ke),w($n,Ke,null),e(Ke,xc),e(Ke,Nn),e(Nn,Jc),e(Nn,fs),e(fs,$c),e(Nn,Nc),e(N,Cc),e(N,et),w(Cn,et,null),e(et,jc),e(et,us),e(us,Uc),e(N,Zc),e(N,tt),w(jn,tt,null),e(tt,kc),e(tt,Un),e(Un,Sc),e(Un,gs),e(gs,Dc),e(Un,Wc),e(N,Pc),e(N,O),w(Zn,O,null),e(O,Ec),e(O,kn),e(kn,Gc),e(kn,Sn),e(Sn,Fc),e(kn,Bc),e(O,Vc),w(nt,O,null),e(O,Xc),w(ot,O,null),e(N,Rc),e(N,st),w(Dn,st,null),e(st,Lc),e(st,Wn),e(Wn,Yc),e(Wn,Pn),e(Pn,Ac),e(Wn,zc),e(N,Qc),e(N,F),w(En,F,null),e(F,Hc),e(F,Gn),e(Gn,qc),e(Gn,To),e(To,Oc),e(Gn,Kc),e(F,ed),e(F,hs),e(hs,td),e(F,nd),w(at,F,null),e(F,od),e(F,Fn),e(Fn,sd),e(Fn,Bn),e(Bn,ad),e(Fn,id),e(F,ld),w(it,F,null),e(N,rd),e(N,lt),w(Vn,lt,null),e(lt,cd),e(lt,Xn),e(Xn,dd),e(Xn,_s),e(_s,pd),e(Xn,md),e(N,fd),e(N,rt),w(Rn,rt,null),e(rt,ud),e(rt,bs),e(bs,gd),e(N,hd),e(N,ct),w(Ln,ct,null),e(ct,_d),e(ct,ys),e(ys,bd),x(n,aa,b),x(n,pe,b),e(pe,dt),e(dt,vs),w(Yn,vs,null),e(pe,yd),e(pe,ws),e(ws,vd),x(n,ia,b),x(n,me,b),w(An,me,null),e(me,wd),e(me,Ms),e(Ms,Md),x(n,la,b),x(n,fe,b),e(fe,pt),e(pt,Is),w(zn,Is,null),e(fe,Id),e(fe,Ts),e(Ts,Td),x(n,ra,b),x(n,L,b),w(Qn,L,null),e(L,xd),e(L,xs),e(xs,Jd),e(L,$d),e(L,Hn),e(Hn,Nd),e(Hn,xo),e(xo,Cd),e(Hn,jd),e(L,Ud),e(L,le),w(qn,le,null),e(le,Zd),e(le,Js),e(Js,kd),e(le,Sd),w(mt,le,null),x(n,ca,b),x(n,ue,b),e(ue,ft),e(ft,$s),w(On,$s,null),e(ue,Dd),e(ue,Ns),e(Ns,Wd),x(n,da,b),x(n,ne,b),w(Kn,ne,null),e(ne,Pd),e(ne,Cs),e(Cs,Ed),e(ne,Gd),e(ne,ut),w(eo,ut,null),e(ut,Fd),e(ut,js),e(js,Bd),pa=!0},p(n,[b]){const to={};b&2&&(to.$$scope={dirty:b,ctx:n}),_e.$set(to);const Us={};b&2&&(Us.$$scope={dirty:b,ctx:n}),ye.$set(Us);const Zs={};b&2&&(Zs.$$scope={dirty:b,ctx:n}),ve.$set(Zs);const ks={};b&2&&(ks.$$scope={dirty:b,ctx:n}),we.$set(ks);const no={};b&2&&(no.$$scope={dirty:b,ctx:n}),xe.$set(no);const Ss={};b&2&&(Ss.$$scope={dirty:b,ctx:n}),Je.$set(Ss);const Ds={};b&2&&(Ds.$$scope={dirty:b,ctx:n}),Ne.$set(Ds);const Ws={};b&2&&(Ws.$$scope={dirty:b,ctx:n}),Ce.$set(Ws);const Ps={};b&2&&(Ps.$$scope={dirty:b,ctx:n}),Se.$set(Ps);const Es={};b&2&&(Es.$$scope={dirty:b,ctx:n}),De.$set(Es);const oo={};b&2&&(oo.$$scope={dirty:b,ctx:n}),We.$set(oo);const Gs={};b&2&&(Gs.$$scope={dirty:b,ctx:n}),Fe.$set(Gs);const ge={};b&2&&(ge.$$scope={dirty:b,ctx:n}),Be.$set(ge);const Fs={};b&2&&(Fs.$$scope={dirty:b,ctx:n}),Xe.$set(Fs);const Bs={};b&2&&(Bs.$$scope={dirty:b,ctx:n}),Re.$set(Bs);const so={};b&2&&(so.$$scope={dirty:b,ctx:n}),Qe.$set(so);const Vs={};b&2&&(Vs.$$scope={dirty:b,ctx:n}),He.$set(Vs);const Xs={};b&2&&(Xs.$$scope={dirty:b,ctx:n}),qe.$set(Xs);const Rs={};b&2&&(Rs.$$scope={dirty:b,ctx:n}),Oe.$set(Rs);const U={};b&2&&(U.$$scope={dirty:b,ctx:n}),nt.$set(U);const Ls={};b&2&&(Ls.$$scope={dirty:b,ctx:n}),ot.$set(Ls);const ao={};b&2&&(ao.$$scope={dirty:b,ctx:n}),at.$set(ao);const Ys={};b&2&&(Ys.$$scope={dirty:b,ctx:n}),it.$set(Ys);const As={};b&2&&(As.$$scope={dirty:b,ctx:n}),mt.$set(As)},i(n){pa||(M(t.$$.fragment,n),M(_e.$$.fragment,n),M($t.$$.fragment,n),M(Nt.$$.fragment,n),M(jt.$$.fragment,n),M(ye.$$.fragment,n),M(Ut.$$.fragment,n),M(ve.$$.fragment,n),M(we.$$.fragment,n),M(Zt.$$.fragment,n),M(St.$$.fragment,n),M(Dt.$$.fragment,n),M(Pt.$$.fragment,n),M(xe.$$.fragment,n),M(Je.$$.fragment,n),M(Ft.$$.fragment,n),M(Xt.$$.fragment,n),M(Ne.$$.fragment,n),M(Ce.$$.fragment,n),M(At.$$.fragment,n),M(Qt.$$.fragment,n),M(Ht.$$.fragment,n),M(qt.$$.fragment,n),M(Ot.$$.fragment,n),M(en.$$.fragment,n),M(Se.$$.fragment,n),M(tn.$$.fragment,n),M(De.$$.fragment,n),M(We.$$.fragment,n),M(nn.$$.fragment,n),M(sn.$$.fragment,n),M(an.$$.fragment,n),M(rn.$$.fragment,n),M(Fe.$$.fragment,n),M(Be.$$.fragment,n),M(pn.$$.fragment,n),M(un.$$.fragment,n),M(Xe.$$.fragment,n),M(Re.$$.fragment,n),M(bn.$$.fragment,n),M(vn.$$.fragment,n),M(wn.$$.fragment,n),M(Mn.$$.fragment,n),M(In.$$.fragment,n),M(Qe.$$.fragment,n),M(xn.$$.fragment,n),M(He.$$.fragment,n),M(Jn.$$.fragment,n),M(qe.$$.fragment,n),M(Oe.$$.fragment,n),M($n.$$.fragment,n),M(Cn.$$.fragment,n),M(jn.$$.fragment,n),M(Zn.$$.fragment,n),M(nt.$$.fragment,n),M(ot.$$.fragment,n),M(Dn.$$.fragment,n),M(En.$$.fragment,n),M(at.$$.fragment,n),M(it.$$.fragment,n),M(Vn.$$.fragment,n),M(Rn.$$.fragment,n),M(Ln.$$.fragment,n),M(Yn.$$.fragment,n),M(An.$$.fragment,n),M(zn.$$.fragment,n),M(Qn.$$.fragment,n),M(qn.$$.fragment,n),M(mt.$$.fragment,n),M(On.$$.fragment,n),M(Kn.$$.fragment,n),M(eo.$$.fragment,n),pa=!0)},o(n){I(t.$$.fragment,n),I(_e.$$.fragment,n),I($t.$$.fragment,n),I(Nt.$$.fragment,n),I(jt.$$.fragment,n),I(ye.$$.fragment,n),I(Ut.$$.fragment,n),I(ve.$$.fragment,n),I(we.$$.fragment,n),I(Zt.$$.fragment,n),I(St.$$.fragment,n),I(Dt.$$.fragment,n),I(Pt.$$.fragment,n),I(xe.$$.fragment,n),I(Je.$$.fragment,n),I(Ft.$$.fragment,n),I(Xt.$$.fragment,n),I(Ne.$$.fragment,n),I(Ce.$$.fragment,n),I(At.$$.fragment,n),I(Qt.$$.fragment,n),I(Ht.$$.fragment,n),I(qt.$$.fragment,n),I(Ot.$$.fragment,n),I(en.$$.fragment,n),I(Se.$$.fragment,n),I(tn.$$.fragment,n),I(De.$$.fragment,n),I(We.$$.fragment,n),I(nn.$$.fragment,n),I(sn.$$.fragment,n),I(an.$$.fragment,n),I(rn.$$.fragment,n),I(Fe.$$.fragment,n),I(Be.$$.fragment,n),I(pn.$$.fragment,n),I(un.$$.fragment,n),I(Xe.$$.fragment,n),I(Re.$$.fragment,n),I(bn.$$.fragment,n),I(vn.$$.fragment,n),I(wn.$$.fragment,n),I(Mn.$$.fragment,n),I(In.$$.fragment,n),I(Qe.$$.fragment,n),I(xn.$$.fragment,n),I(He.$$.fragment,n),I(Jn.$$.fragment,n),I(qe.$$.fragment,n),I(Oe.$$.fragment,n),I($n.$$.fragment,n),I(Cn.$$.fragment,n),I(jn.$$.fragment,n),I(Zn.$$.fragment,n),I(nt.$$.fragment,n),I(ot.$$.fragment,n),I(Dn.$$.fragment,n),I(En.$$.fragment,n),I(at.$$.fragment,n),I(it.$$.fragment,n),I(Vn.$$.fragment,n),I(Rn.$$.fragment,n),I(Ln.$$.fragment,n),I(Yn.$$.fragment,n),I(An.$$.fragment,n),I(zn.$$.fragment,n),I(Qn.$$.fragment,n),I(qn.$$.fragment,n),I(mt.$$.fragment,n),I(On.$$.fragment,n),I(Kn.$$.fragment,n),I(eo.$$.fragment,n),pa=!1},d(n){o(l),n&&o(_),n&&o(u),T(t),n&&o(P),n&&o(R),n&&o(It),n&&o(co),n&&o(zs),n&&o(po),n&&o(Qs),n&&o(mo),n&&o(Hs),n&&o(he),n&&o(qs),n&&o(oe),n&&o(Os),T(_e,n),n&&o(Ks),n&&o(re),T($t),n&&o(ea),n&&o(C),T(Nt),T(jt),T(ye),T(Ut),T(ve),T(we),T(Zt),T(St),T(Dt),T(Pt),T(xe),T(Je),T(Ft),T(Xt),T(Ne),T(Ce),T(At),T(Qt),T(Ht),n&&o(ta),n&&o(ce),T(qt),n&&o(na),n&&o(j),T(Ot),T(en),T(Se),T(tn),T(De),T(We),T(nn),T(sn),T(an),T(rn),T(Fe),T(Be),T(pn),T(un),T(Xe),T(Re),T(bn),T(vn),T(wn),n&&o(oa),n&&o(de),T(Mn),n&&o(sa),n&&o(N),T(In),T(Qe),T(xn),T(He),T(Jn),T(qe),T(Oe),T($n),T(Cn),T(jn),T(Zn),T(nt),T(ot),T(Dn),T(En),T(at),T(it),T(Vn),T(Rn),T(Ln),n&&o(aa),n&&o(pe),T(Yn),n&&o(ia),n&&o(me),T(An),n&&o(la),n&&o(fe),T(zn),n&&o(ra),n&&o(L),T(Qn),T(qn),T(mt),n&&o(ca),n&&o(ue),T(On),n&&o(da),n&&o(ne),T(Kn),T(eo)}}}const Gm={local:"controlnet",sections:[{local:"diffusers.StableDiffusionControlNetPipeline",title:"StableDiffusionControlNetPipeline"},{local:"diffusers.StableDiffusionControlNetImg2ImgPipeline",title:"StableDiffusionControlNetImg2ImgPipeline"},{local:"diffusers.StableDiffusionControlNetInpaintPipeline",title:"StableDiffusionControlNetInpaintPipeline"},{local:"diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput",title:"StableDiffusionPipelineOutput"},{local:"diffusers.FlaxStableDiffusionControlNetPipeline",title:"FlaxStableDiffusionControlNetPipeline"},{local:"diffusers.pipelines.stable_diffusion.FlaxStableDiffusionPipelineOutput",title:"FlaxStableDiffusionControlNetPipelineOutput"}],title:"ControlNet"};function Fm(J){return fm(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Am extends cm{constructor(l){super();dm(this,l,Fm,Em,pm,{})}}export{Am as default,Gm as metadata};
