import{S as S$,i as I$,s as M$,e as a,k as c,w as u,t as l,M as q$,c as n,d as t,m as p,a as s,x as g,h as i,b as r,N as w,f as A,G as e,g as f,y as _,q as v,o as b,B as y,v as L$,L as Dp}from"../../../../chunks/vendor-hf-doc-builder.js";import{T as A$}from"../../../../chunks/Tip-hf-doc-builder.js";import{D as z}from"../../../../chunks/Docstring-hf-doc-builder.js";import{C as R}from"../../../../chunks/CodeBlock-hf-doc-builder.js";import{I as F}from"../../../../chunks/IconCopyLink-hf-doc-builder.js";import{E as kp}from"../../../../chunks/ExampleCodeBlock-hf-doc-builder.js";function F$(G){let h,C,E,$,T;return $=new R({props:{code:`# !pip install opencv-python transformers accelerate
from diffusers import StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler
from diffusers.utils import load_image
import numpy as np
import torch

import cv2
from PIL import Image

# download an image
image = load_image(
    "https://hf.co/datasets/huggingface/documentation-images/resolve/main/diffusers/input_image_vermeer.png"
)
image = np.array(image)

# get canny image
image = cv2.Canny(image, 100, 200)
image = image[:, :, None]
image = np.concatenate([image, image, image], axis=2)
canny_image = Image.fromarray(image)

# load control net and stable diffusion v1-5
controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-canny", torch_dtype=torch.float16)
pipe = StableDiffusionControlNetPipeline.from_pretrained(
    "runwayml/stable-diffusion-v1-5", controlnet=controlnet, torch_dtype=torch.float16
)

# speed up diffusion process with faster scheduler and memory optimization
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
# remove following line if xformers is not installed
pipe.enable_xformers_memory_efficient_attention()

pipe.enable_model_cpu_offload()

# generate image
generator = torch.manual_seed(0)
image = pipe(
    "futuristic-looking woman", num_inference_steps=20, generator=generator, image=canny_image
).images[0]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># !pip install opencv-python transformers accelerate</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># generate image</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>generator = torch.manual_seed(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;futuristic-looking woman&quot;</span>, num_inference_steps=<span class="hljs-number">20</span>, generator=generator, image=canny_image
<span class="hljs-meta">... </span>).images[<span class="hljs-number">0</span>]`}}),{c(){h=a("p"),C=l("Examples:"),E=c(),u($.$$.fragment)},l(m){h=n(m,"P",{});var x=s(h);C=i(x,"Examples:"),x.forEach(t),E=p(m),g($.$$.fragment,m)},m(m,x){f(m,h,x),e(h,C),f(m,E,x),_($,m,x),T=!0},p:Dp,i(m){T||(v($.$$.fragment,m),T=!0)},o(m){b($.$$.fragment,m),T=!1},d(m){m&&t(h),m&&t(E),y($,m)}}}function G$(G){let h,C,E,$,T;return $=new R({props:{code:`import torch
from diffusers import DiffusionPipeline
from xformers.ops import MemoryEfficientAttentionFlashAttentionOp

pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-1", torch_dtype=torch.float16)
pipe = pipe.to("cuda")
pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
# Workaround for not accepting attention shape using VAE for Flash Attention
pipe.vae.enable_xformers_memory_efficient_attention(attention_op=None)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Workaround for not accepting attention shape using VAE for Flash Attention</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_xformers_memory_efficient_attention(attention_op=<span class="hljs-literal">None</span>)`}}),{c(){h=a("p"),C=l("Examples:"),E=c(),u($.$$.fragment)},l(m){h=n(m,"P",{});var x=s(h);C=i(x,"Examples:"),x.forEach(t),E=p(m),g($.$$.fragment,m)},m(m,x){f(m,h,x),e(h,C),f(m,E,x),_($,m,x),T=!0},p:Dp,i(m){T||(v($.$$.fragment,m),T=!0)},o(m){b($.$$.fragment,m),T=!1},d(m){m&&t(h),m&&t(E),y($,m)}}}function O$(G){let h,C;return{c(){h=a("p"),C=l("This function is experimental and might change in the future.")},l(E){h=n(E,"P",{});var $=s(h);C=i($,"This function is experimental and might change in the future."),$.forEach(t)},m(E,$){f(E,h,$),e(h,C)},d(E){E&&t(h)}}}function U$(G){let h,C,E,$,T,m,x,M;return{c(){h=a("p"),C=l("It is required to be logged in ("),E=a("code"),$=l("huggingface-cli login"),T=l(") when you want to use private or "),m=a("a"),x=l(`gated
models`),M=l("."),this.h()},l(k){h=n(k,"P",{});var N=s(h);C=i(N,"It is required to be logged in ("),E=n(N,"CODE",{});var L=s(E);$=i(L,"huggingface-cli login"),L.forEach(t),T=i(N,") when you want to use private or "),m=n(N,"A",{href:!0,rel:!0});var K=s(m);x=i(K,`gated
models`),K.forEach(t),M=i(N,"."),N.forEach(t),this.h()},h(){r(m,"href","https://huggingface.co/docs/hub/models-gated#gated-models"),r(m,"rel","nofollow")},m(k,N){f(k,h,N),e(h,C),e(h,E),e(E,$),e(h,T),e(h,m),e(m,x),e(h,M)},d(k){k&&t(h)}}}function R$(G){let h,C,E,$,T,m,x,M;return x=new R({props:{code:`from diffusers import StableDiffusionPipeline
import torch

model_id = "runwayml/stable-diffusion-v1-5"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to("cuda")

pipe.load_textual_inversion("sd-concepts-library/cat-toy")

prompt = "A <cat-toy> backpack"

image = pipe(prompt, num_inference_steps=50).images[0]
image.save("cat-backpack.png")`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

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

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

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

image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;cat-backpack.png&quot;</span>)`}}),{c(){h=a("p"),C=l("To load a textual inversion embedding vector in "),E=a("code"),$=l("diffusers"),T=l(" format:"),m=c(),u(x.$$.fragment)},l(k){h=n(k,"P",{});var N=s(h);C=i(N,"To load a textual inversion embedding vector in "),E=n(N,"CODE",{});var L=s(E);$=i(L,"diffusers"),L.forEach(t),T=i(N," format:"),N.forEach(t),m=p(k),g(x.$$.fragment,k)},m(k,N){f(k,h,N),e(h,C),e(h,E),e(E,$),e(h,T),f(k,m,N),_(x,k,N),M=!0},p:Dp,i(k){M||(v(x.$$.fragment,k),M=!0)},o(k){b(x.$$.fragment,k),M=!1},d(k){k&&t(h),k&&t(m),y(x,k)}}}function z$(G){let h,C,E,$,T,m,x,M;return x=new R({props:{code:`from diffusers import StableDiffusionPipeline
import torch

model_id = "runwayml/stable-diffusion-v1-5"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to("cuda")

pipe.load_textual_inversion("./charturnerv2.pt", token="charturnerv2")

prompt = "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."

image = pipe(prompt, num_inference_steps=50).images[0]
image.save("character.png")`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

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

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

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

image = pipe(prompt, num_inference_steps=<span class="hljs-number">50</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;character.png&quot;</span>)`}}),{c(){h=a("p"),C=l("e.g. from "),E=a("a"),$=l("civitAI"),T=l(" and then load the vector locally:"),m=c(),u(x.$$.fragment),this.h()},l(k){h=n(k,"P",{});var N=s(h);C=i(N,"e.g. from "),E=n(N,"A",{href:!0,rel:!0});var L=s(E);$=i(L,"civitAI"),L.forEach(t),T=i(N," and then load the vector locally:"),N.forEach(t),m=p(k),g(x.$$.fragment,k),this.h()},h(){r(E,"href","https://civitai.com/models/3036?modelVersionId=9857"),r(E,"rel","nofollow")},m(k,N){f(k,h,N),e(h,C),e(h,E),e(E,$),e(h,T),f(k,m,N),_(x,k,N),M=!0},p:Dp,i(k){M||(v(x.$$.fragment,k),M=!0)},o(k){b(x.$$.fragment,k),M=!1},d(k){k&&t(h),k&&t(m),y(x,k)}}}function B$(G){let h,C,E,$,T;return $=new R({props:{code:`import jax
import numpy as np
import jax.numpy as jnp
from flax.jax_utils import replicate
from flax.training.common_utils import shard
from diffusers.utils import load_image
from PIL import Image
from diffusers import FlaxStableDiffusionControlNetPipeline, FlaxControlNetModel


def image_grid(imgs, rows, cols):
    w, h = imgs[0].size
    grid = Image.new("RGB", size=(cols * w, rows * h))
    for i, img in enumerate(imgs):
        grid.paste(img, box=(i % cols * w, i // cols * h))
    return grid


def create_key(seed=0):
    return jax.random.PRNGKey(seed)


rng = create_key(0)

# get canny image
canny_image = load_image(
    "https://huggingface.co/datasets/YiYiXu/test-doc-assets/resolve/main/blog_post_cell_10_output_0.jpeg"
)

prompts = "best quality, extremely detailed"
negative_prompts = "monochrome, lowres, bad anatomy, worst quality, low quality"

# load control net and stable diffusion v1-5
controlnet, controlnet_params = FlaxControlNetModel.from_pretrained(
    "lllyasviel/sd-controlnet-canny", from_pt=True, dtype=jnp.float32
)
pipe, params = FlaxStableDiffusionControlNetPipeline.from_pretrained(
    "runwayml/stable-diffusion-v1-5", controlnet=controlnet, revision="flax", dtype=jnp.float32
)
params["controlnet"] = controlnet_params

num_samples = jax.device_count()
rng = jax.random.split(rng, jax.device_count())

prompt_ids = pipe.prepare_text_inputs([prompts] * num_samples)
negative_prompt_ids = pipe.prepare_text_inputs([negative_prompts] * num_samples)
processed_image = pipe.prepare_image_inputs([canny_image] * num_samples)

p_params = replicate(params)
prompt_ids = shard(prompt_ids)
negative_prompt_ids = shard(negative_prompt_ids)
processed_image = shard(processed_image)

output = pipe(
    prompt_ids=prompt_ids,
    image=processed_image,
    params=p_params,
    prng_seed=rng,
    num_inference_steps=50,
    neg_prompt_ids=negative_prompt_ids,
    jit=True,
).images

output_images = pipe.numpy_to_pil(np.asarray(output.reshape((num_samples,) + output.shape[-3:])))
output_images = image_grid(output_images, num_samples // 4, 4)
output_images.save("generated_image.png")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax.numpy <span class="hljs-keyword">as</span> jnp
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax.jax_utils <span class="hljs-keyword">import</span> replicate
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> flax.training.common_utils <span class="hljs-keyword">import</span> shard
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlaxStableDiffusionControlNetPipeline, FlaxControlNetModel


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


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


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

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>output_images = pipe.numpy_to_pil(np.asarray(output.reshape((num_samples,) + output.shape[-<span class="hljs-number">3</span>:])))
<span class="hljs-meta">&gt;&gt;&gt; </span>output_images = image_grid(output_images, num_samples // <span class="hljs-number">4</span>, <span class="hljs-number">4</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>output_images.save(<span class="hljs-string">&quot;generated_image.png&quot;</span>)`}}),{c(){h=a("p"),C=l("Examples:"),E=c(),u($.$$.fragment)},l(m){h=n(m,"P",{});var x=s(h);C=i(x,"Examples:"),x.forEach(t),E=p(m),g($.$$.fragment,m)},m(m,x){f(m,h,x),e(h,C),f(m,E,x),_($,m,x),T=!0},p:Dp,i(m){T||(v($.$$.fragment,m),T=!0)},o(m){b($.$$.fragment,m),T=!1},d(m){m&&t(h),m&&t(E),y($,m)}}}function H$(G){let h,C,E,$,T,m,x,M,k,N,L,K,Kr,Io,om,Yr,am,Pp,Mo,qo,nm,sm,Cp,In,rm,Tp,Mn,lm,Np,qn,Jr,im,jp,Je,cm,Lo,pm,dm,Ap,Ln,fm,Sp,Xe,Xr,Fo,mm,hm,Zr,Go,um,Ip,Te,Ze,Qr,Oo,gm,el,_m,Mp,Qe,tl,Ne,ol,vm,bm,al,ym,wm,Fn,Em,$m,nl,je,sl,Uo,xm,km,rl,ll,Dm,Pm,Gn,Ro,Cm,qp,Ae,et,il,zo,Tm,cl,Nm,Lp,tt,jm,pl,Am,Sm,Fp,ot,dl,fl,ml,Im,Mm,hl,On,Bo,qm,Un,Lm,Fm,Gp,at,Gm,Ho,Om,Um,Op,Vo,Up,Rn,zn,ny,Rp,ve,Rm,ul,zm,Bm,Bn,Hm,Vm,zp,Hn,Wm,Bp,Wo,Hp,Vn,Km,Vp,Ko,Wp,Wn,Ym,Kp,Yo,Yp,Kn,Jm,Jp,Yn,Jn,sy,Xp,nt,Xm,Xn,Zm,Qm,Zp,Jo,Qp,st,eh,Zn,th,oh,ed,Xo,td,Qn,ah,od,Zo,ad,es,nh,nd,ts,os,ry,sd,Se,gl,sh,rh,as,lh,ih,rd,Ie,rt,_l,Qo,ch,vl,ph,ld,lt,dh,bl,fh,mh,id,ns,hh,cd,it,uh,yl,gh,_h,pd,Me,ct,wl,ea,vh,El,bh,dd,ss,yh,fd,rs,ly,md,ls,wh,hd,ta,ud,is,iy,gd,qe,pt,$l,oa,Eh,xl,$h,_d,cs,xh,vd,aa,cy,bd,ps,kh,yd,na,wd,sa,py,Ed,Le,dt,kl,ra,Dh,Dl,Ph,$d,la,xd,ia,dy,kd,Fe,ft,Pl,ca,Ch,Cl,Th,Dd,be,Nh,pa,jh,Ah,da,Sh,Ih,Pd,ds,Tl,Mh,Cd,Ge,mt,Nl,fa,qh,jl,Lh,Td,ye,Fh,Al,Gh,Oh,Sl,Uh,Rh,Nd,ht,zh,Il,Bh,Hh,jd,Oe,ut,Ml,ma,Vh,ql,Wh,Ad,W,Kh,Ll,Yh,Jh,Fl,Xh,Zh,ha,Qh,eu,Sd,ua,Id,Ue,gt,Gl,ga,tu,Ol,ou,Md,_t,Ul,_a,Rl,au,nu,zl,su,ru,Bl,va,Hl,fs,ms,fy,lu,Vl,hs,us,my,qd,Re,vt,Wl,ba,iu,Kl,cu,Ld,we,pu,Yl,du,fu,Jl,mu,hu,Fd,bt,uu,ya,gu,_u,Gd,ze,Xl,vu,bu,gs,yu,wu,Od,Be,yt,Zl,wa,Eu,Ql,$u,Ud,wt,ei,Y,ti,xu,ku,oi,Du,Pu,ai,Cu,Tu,ni,Nu,ju,q,J,Et,Ea,Au,Su,Iu,si,Mu,qu,ri,Lu,Fu,li,_s,$t,hy,Gu,ii,vs,bs,uy,Ou,X,xt,$a,Uu,Ru,zu,ci,Bu,Hu,pi,Vu,Wu,di,ys,ws,gy,Ku,fi,Es,$s,_y,Yu,Z,kt,xa,Ju,Xu,Zu,mi,Qu,eg,hi,tg,og,ui,xs,ks,vy,ag,gi,Ds,Ps,by,ng,Q,Dt,ka,sg,rg,lg,_i,ig,cg,vi,pg,dg,bi,Cs,Ts,yy,fg,yi,Ns,js,wy,mg,ee,Pt,Da,hg,ug,gg,wi,_g,vg,Pa,bg,Ca,yg,wg,Eg,Ei,As,Ss,Ey,$g,$i,Is,Ms,$y,xg,te,Ct,Ta,kg,Dg,Pg,xi,Cg,Tg,Na,Ng,ja,jg,Ag,Sg,ki,qs,Ls,xy,Ig,Di,Fs,Gs,ky,Mg,oe,Tt,Aa,qg,Lg,Fg,Pi,Gg,Og,Ci,Ug,Rg,Ti,Os,Us,Dy,zg,Ni,Rs,zs,Py,Bg,ae,Sa,Ia,Hg,Vg,ji,Wg,Kg,Ma,Yg,qa,Jg,Xg,Zg,Ai,Bs,Hs,Cy,Qg,Si,Vs,Ws,Ty,Rd,He,Nt,Ii,La,e_,Mi,t_,zd,jt,qi,ne,Li,o_,a_,Fi,n_,s_,Gi,r_,l_,Oi,i_,c_,j,se,At,Fa,p_,d_,f_,Ui,m_,h_,Ri,u_,g_,zi,Ks,St,Ny,__,Bi,Ys,Js,jy,v_,re,It,Ga,b_,y_,w_,Hi,E_,$_,Vi,x_,k_,Wi,Xs,Mt,Ay,D_,Ki,Zs,Qs,Sy,P_,le,Oa,Ua,C_,T_,N_,j_,Yi,A_,S_,Ji,er,qt,Iy,I_,Xi,tr,or,My,M_,ie,Ra,za,q_,L_,F_,G_,Zi,O_,U_,Qi,ar,Lt,qy,R_,ec,nr,sr,Ly,z_,ce,Ba,Ha,B_,H_,V_,W_,tc,K_,Y_,oc,rr,Ft,Fy,J_,ac,lr,ir,Gy,X_,pe,Va,Wa,Z_,Q_,ev,tv,nc,ov,av,sc,cr,Gt,Oy,nv,rc,pr,dr,Uy,sv,de,Ka,Ya,rv,lv,iv,cv,lc,pv,dv,ic,fr,Ot,Ry,fv,cc,mr,hr,zy,mv,fe,Ja,Xa,hv,uv,gv,_v,pc,vv,bv,dc,ur,Ut,By,yv,fc,gr,_r,Hy,wv,me,Za,Qa,Ev,$v,xv,kv,mc,Dv,Pv,hc,vr,Rt,Vy,Cv,uc,br,yr,Wy,Tv,he,en,tn,Nv,jv,Av,Sv,gc,Iv,Mv,_c,wr,zt,Ky,qv,vc,Er,$r,Yy,Lv,ue,on,an,Fv,Gv,Ov,Uv,bc,Rv,zv,yc,xr,Bt,Jy,Bv,wc,kr,Dr,Xy,Hv,ge,nn,sn,Vv,Wv,Kv,Yv,Ec,Jv,Xv,$c,Pr,Ht,Zy,Zv,xc,Cr,Tr,Qy,Qv,_e,rn,ln,e1,t1,o1,a1,kc,n1,s1,Dc,Nr,Vt,ew,r1,Pc,jr,Ar,tw,Bd,Ve,Wt,Cc,cn,l1,Tc,i1,Hd,D,pn,c1,Nc,p1,d1,dn,f1,Sr,m1,h1,u1,jc,g1,_1,Ac,fn,Sc,v1,b1,Ir,y1,w1,Ee,mn,E1,Ic,$1,x1,Kt,k1,$e,hn,D1,Mc,P1,C1,qc,T1,N1,Yt,un,j1,gn,A1,Lc,S1,I1,M1,xe,_n,q1,Fc,L1,F1,Gc,G1,O1,Jt,vn,U1,bn,R1,Oc,z1,B1,H1,B,yn,V1,Uc,W1,K1,Rc,Y1,J1,zc,X1,Z1,Xt,Q1,Zt,wn,eb,Bc,tb,ob,I,En,ab,We,nb,Hc,sb,rb,Vc,lb,ib,cb,Qt,pb,eo,db,Wc,fb,mb,to,hb,Kc,ub,gb,oo,_b,ao,$n,vb,xn,bb,Yc,yb,wb,Eb,no,kn,$b,H,xb,Jc,kb,Db,Xc,Pb,Cb,Zc,Tb,Nb,Qc,jb,Ab,Sb,so,Dn,Ib,Ke,Mb,ep,qb,Lb,tp,Fb,Gb,Ob,ke,Pn,Ub,op,Rb,zb,ap,Bb,Vd,Ye,ro,np,Cn,Hb,sp,Vb,Wd,V,Tn,Wb,rp,Kb,Yb,Nn,Jb,lp,Xb,Zb,Qb,De,jn,ey,ip,ty,oy,lo,Kd;return m=new F({}),Io=new F({}),Oo=new F({}),zo=new F({}),Vo=new R({props:{code:`from diffusers import StableDiffusionControlNetPipeline
from diffusers.utils import load_image

# Let's load the popular vermeer image
image = load_image(
    "https://hf.co/datasets/huggingface/documentation-images/resolve/main/diffusers/input_image_vermeer.png"
)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

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

image = np.array(image)

low_threshold = 100
high_threshold = 200

image = cv2.Canny(image, low_threshold, high_threshold)
image = image[:, :, None]
image = np.concatenate([image, image, image], axis=2)
canny_image = Image.fromarray(image)`,highlighted:`<span class="hljs-keyword">import</span> cv2
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

image = np.array(image)

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

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

controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-canny", torch_dtype=torch.float16)
pipe = StableDiffusionControlNetPipeline.from_pretrained(
    "runwayml/stable-diffusion-v1-5", controlnet=controlnet, torch_dtype=torch.float16
)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline, ControlNetModel
<span class="hljs-keyword">import</span> torch

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

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

# this command loads the individual model components on GPU on-demand.
pipe.enable_model_cpu_offload()`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UniPCMultistepScheduler

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

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

out_image = pipe(
    "disco dancer with colorful lights", num_inference_steps=20, generator=generator, image=canny_image
).images[0]`,highlighted:`generator = torch.manual_seed(<span class="hljs-number">0</span>)

out_image = pipe(
    <span class="hljs-string">&quot;disco dancer with colorful lights&quot;</span>, num_inference_steps=<span class="hljs-number">20</span>, generator=generator, image=canny_image
).images[<span class="hljs-number">0</span>]`}}),Qo=new F({}),ea=new F({}),ta=new R({props:{code:`from diffusers.utils import load_image
from PIL import Image
import cv2
import numpy as np
from diffusers.utils import load_image

canny_image = load_image(
    "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/landscape.png"
)
canny_image = np.array(canny_image)

low_threshold = 100
high_threshold = 200

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

# zero out middle columns of image where pose will be overlayed
zero_start = canny_image.shape[1] // 4
zero_end = zero_start + canny_image.shape[1] // 2
canny_image[:, zero_start:zero_end] = 0

canny_image = canny_image[:, :, None]
canny_image = np.concatenate([canny_image, canny_image, canny_image], axis=2)
canny_image = Image.fromarray(canny_image)`,highlighted:`<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-keyword">import</span> cv2
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

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

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

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

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

canny_image = canny_image[:, :, <span class="hljs-literal">None</span>]
canny_image = np.concatenate([canny_image, canny_image, canny_image], axis=<span class="hljs-number">2</span>)
canny_image = Image.fromarray(canny_image)`}}),oa=new F({}),na=new R({props:{code:`from controlnet_aux import OpenposeDetector
from diffusers.utils import load_image

openpose = OpenposeDetector.from_pretrained("lllyasviel/ControlNet")

openpose_image = load_image(
    "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/person.png"
)
openpose_image = openpose(openpose_image)`,highlighted:`<span class="hljs-keyword">from</span> controlnet_aux <span class="hljs-keyword">import</span> OpenposeDetector
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

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

openpose_image = load_image(
    <span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/person.png&quot;</span>
)
openpose_image = openpose(openpose_image)`}}),ra=new F({}),la=new R({props:{code:`from diffusers import StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler
import torch

controlnet = [
    ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-openpose", torch_dtype=torch.float16),
    ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-canny", torch_dtype=torch.float16),
]

pipe = StableDiffusionControlNetPipeline.from_pretrained(
    "runwayml/stable-diffusion-v1-5", controlnet=controlnet, torch_dtype=torch.float16
)
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)

pipe.enable_xformers_memory_efficient_attention()
pipe.enable_model_cpu_offload()

prompt = "a giant standing in a fantasy landscape, best quality"
negative_prompt = "monochrome, lowres, bad anatomy, worst quality, low quality"

generator = torch.Generator(device="cpu").manual_seed(1)

images = [openpose_image, canny_image]

image = pipe(
    prompt,
    images,
    num_inference_steps=20,
    generator=generator,
    negative_prompt=negative_prompt,
    controlnet_conditioning_scale=[1.0, 0.8],
).images[0]

image.save("./multi_controlnet_output.png")`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler
<span class="hljs-keyword">import</span> torch

controlnet = [
    ControlNetModel.from_pretrained(<span class="hljs-string">&quot;lllyasviel/sd-controlnet-openpose&quot;</span>, torch_dtype=torch.float16),
    ControlNetModel.from_pretrained(<span class="hljs-string">&quot;lllyasviel/sd-controlnet-canny&quot;</span>, torch_dtype=torch.float16),
]

pipe = StableDiffusionControlNetPipeline.from_pretrained(
    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, controlnet=controlnet, torch_dtype=torch.float16
)
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)

pipe.enable_xformers_memory_efficient_attention()
pipe.enable_model_cpu_offload()

prompt = <span class="hljs-string">&quot;a giant standing in a fantasy landscape, best quality&quot;</span>
negative_prompt = <span class="hljs-string">&quot;monochrome, lowres, bad anatomy, worst quality, low quality&quot;</span>

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

images = [openpose_image, canny_image]

image = pipe(
    prompt,
    images,
    num_inference_steps=<span class="hljs-number">20</span>,
    generator=generator,
    negative_prompt=negative_prompt,
    controlnet_conditioning_scale=[<span class="hljs-number">1.0</span>, <span class="hljs-number">0.8</span>],
).images[<span class="hljs-number">0</span>]

image.save(<span class="hljs-string">&quot;./multi_controlnet_output.png&quot;</span>)`}}),ca=new F({}),fa=new F({}),ma=new F({}),ua=new R({props:{code:`from diffusers import StableDiffusionControlNetPipeline, ControlNetModel
import torch

controlnet = ControlNetModel.from_pretrained("lllyasviel/sd-controlnet-canny")
pipe = StableDiffusionControlNetPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", controlnet=controlnet).to(
    "cuda"
)
image = pipe("", image=canny_image, guess_mode=True, guidance_scale=3.0).images[0]
image.save("guess_mode_generated.png")`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline, ControlNetModel
<span class="hljs-keyword">import</span> torch

controlnet = ControlNetModel.from_pretrained(<span class="hljs-string">&quot;lllyasviel/sd-controlnet-canny&quot;</span>)
pipe = StableDiffusionControlNetPipeline.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, controlnet=controlnet).to(
    <span class="hljs-string">&quot;cuda&quot;</span>
)
image = pipe(<span class="hljs-string">&quot;&quot;</span>, image=canny_image, guess_mode=<span class="hljs-literal">True</span>, guidance_scale=<span class="hljs-number">3.0</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;guess_mode_generated.png&quot;</span>)`}}),ga=new F({}),ba=new F({}),wa=new F({}),La=new F({}),cn=new F({}),pn=new z({props:{name:"class diffusers.StableDiffusionControlNetPipeline",anchor:"diffusers.StableDiffusionControlNetPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"controlnet",val:": typing.Union[diffusers.models.controlnet.ControlNetModel, typing.List[diffusers.models.controlnet.ControlNetModel], typing.Tuple[diffusers.models.controlnet.ControlNetModel], diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_controlnet.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.16.0/en/api/models#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionControlNetPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>CLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIP</a>, specifically
the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.StableDiffusionControlNetPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.StableDiffusionControlNetPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.16.0/en/api/models#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionControlNetPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/v0.16.0/en/api/models#diffusers.ControlNetModel">ControlNetModel</a> or <code>List[ControlNetModel]</code>) &#x2014;
Provides additional conditioning to the unet during the denoising process. If you set multiple ControlNets
as a list, the outputs from each ControlNet are added together to create one combined additional
conditioning.`,name:"controlnet"},{anchor:"diffusers.StableDiffusionControlNetPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.16.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.16.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/v0.16.0/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/v0.16.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 details.`,name:"safety_checker"},{anchor:"diffusers.StableDiffusionControlNetPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPImageProcessor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_controlnet.py#L152"}}),mn=new z({props:{name:"__call__",anchor:"diffusers.StableDiffusionControlNetPipeline.__call__",parameters:[{name:"prompt",val:": typing.Union[str, typing.List[str]] = None"},{name:"image",val:": typing.Union[torch.FloatTensor, PIL.Image.Image, typing.List[torch.FloatTensor], typing.List[PIL.Image.Image]] = None"},{name:"height",val:": typing.Optional[int] = None"},{name:"width",val:": typing.Optional[int] = None"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"num_images_per_prompt",val:": typing.Optional[int] = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": typing.Union[torch._C.Generator, typing.List[torch._C.Generator], NoneType] = None"},{name:"latents",val:": typing.Optional[torch.FloatTensor] = None"},{name:"prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"negative_prompt_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"output_type",val:": typing.Optional[str] = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": typing.Union[typing.Callable[[int, int, torch.FloatTensor], NoneType], NoneType] = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, typing.List[float]] = 1.0"},{name:"guess_mode",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to guide the image generation. If not defined, one has to pass <code>prompt_embeds</code>.
instead.`,name:"prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>List[torch.FloatTensor]</code>, <code>List[PIL.Image.Image]</code>, &#x2014;
<code>List[List[torch.FloatTensor]]</code>, or <code>List[List[PIL.Image.Image]]</code>):
The ControlNet input condition. ControlNet uses this input condition to generate guidance to Unet. If
the type is specified as <code>Torch.FloatTensor</code>, it is passed to ControlNet as is. <code>PIL.Image.Image</code> can
also be accepted as an image. The dimensions of the output image defaults to <code>image</code>&#x2019;s dimensions. If
height and/or width are passed, <code>image</code> is resized according to them. If multiple ControlNets are
specified in init, images must be passed as a list such that each element of the list can be correctly
batched for input to a single controlnet.`,name:"image"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.height",description:`<strong>height</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The height in pixels of the generated image.`,name:"height"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.width",description:`<strong>width</strong> (<code>int</code>, <em>optional</em>, defaults to self.unet.config.sample_size * self.vae_scale_factor) &#x2014;
The width in pixels of the generated image.`,name:"width"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of images to generate per prompt.`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/v0.16.0/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.generator",description:`<strong>generator</strong> (<code>torch.Generator</code> or <code>List[torch.Generator]</code>, <em>optional</em>) &#x2014;
One or a list of <a href="https://pytorch.org/docs/stable/generated/torch.Generator.html" rel="nofollow">torch generator(s)</a>
to make generation deterministic.`,name:"generator"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.latents",description:`<strong>latents</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.output_type",description:`<strong>output_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pil&quot;</code>) &#x2014;
The output format of the generate image. Choose between
<a href="https://pillow.readthedocs.io/en/stable/" rel="nofollow">PIL</a>: <code>PIL.Image.Image</code> or <code>np.array</code>.`,name:"output_type"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <a href="/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput">StableDiffusionPipelineOutput</a> instead of a
plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.callback",description:`<strong>callback</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
A function that will be called every <code>callback_steps</code> steps during inference. The function will be
called with the following arguments: <code>callback(step: int, timestep: int, latents: torch.FloatTensor)</code>.`,name:"callback"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.callback_steps",description:`<strong>callback_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The frequency at which the <code>callback</code> function will be called. If not specified, the callback will be
called at every step.`,name:"callback_steps"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/cross_attention.py" rel="nofollow">diffusers.cross_attention</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet. If multiple ControlNets are specified in init, you can set the
corresponding scale as a list.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.guess_mode",description:`<strong>guess_mode</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
In this mode, the ControlNet encoder will try best to recognize the content of the input image even if
you remove all prompts. The <code>guidance_scale</code> between 3.0 and 5.0 is recommended.`,name:"guess_mode"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_controlnet.py#L759",returnDescription:`
<p><a
  href="/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> if <code>return_dict</code> is True, otherwise a <code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><a
  href="/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/overview#diffusers.pipelines.stable_diffusion.StableDiffusionPipelineOutput"
>StableDiffusionPipelineOutput</a> or <code>tuple</code></p>
`}}),Kt=new kp({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.__call__.example",$$slots:{default:[F$]},$$scope:{ctx:G}}}),hn=new z({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": typing.Union[str, int, NoneType] = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/pipeline_utils.py#L1476"}}),un=new z({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/pipeline_utils.py#L1492"}}),_n=new z({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_controlnet.py#L235"}}),vn=new z({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_controlnet.py#L245"}}),yn=new z({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": typing.Optional[typing.Callable] = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/pipeline_utils.py#L1418"}}),Xt=new kp({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[G$]},$$scope:{ctx:G}}}),wn=new z({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/pipeline_utils.py#L1450"}}),En=new z({props:{name:"load_textual_inversion",anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion",parameters:[{name:"pretrained_model_name_or_path",val:": typing.Union[str, typing.Dict[str, torch.Tensor]]"},{name:"token",val:": typing.Optional[str] = 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>) &#x2014;
Can be either:</p>
<ul>
<li>A string, the <em>model id</em> of a pretrained model hosted inside a model repo on huggingface.co.
Valid model ids should have an organization name, like
<code>&quot;sd-concepts-library/low-poly-hd-logos-icons&quot;</code>.</li>
<li>A path to a <em>directory</em> containing textual inversion weights, e.g.
<code>./my_text_inversion_directory/</code>.</li>
</ul>`,name:"pretrained_model_name_or_path"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.weight_name",description:`<strong>weight_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of a custom weight file. This should be used in two cases:</p>
<ul>
<li>The saved textual inversion file is in <code>diffusers</code> format, but was saved under a specific weight
name, such as <code>text_inv.bin</code>.</li>
<li>The saved textual inversion file is in the &#x201C;Automatic1111&#x201D; form.</li>
</ul>`,name:"weight_name"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.cache_dir",description:`<strong>cache_dir</strong> (<code>Union[str, os.PathLike]</code>, <em>optional</em>) &#x2014;
Path to a directory in which a downloaded pretrained model configuration should be cached if the
standard cache should not be used.`,name:"cache_dir"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.force_download",description:`<strong>force_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to force the (re-)download of the model weights and configuration files, overriding the
cached versions if they exist.`,name:"force_download"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.resume_download",description:`<strong>resume_download</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to delete incompletely received files. Will attempt to resume the download if such a
file exists.`,name:"resume_download"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.proxies",description:`<strong>proxies</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
A dictionary of proxy servers to use by protocol or endpoint, e.g., <code>{&apos;http&apos;: &apos;foo.bar:3128&apos;, &apos;http://hostname&apos;: &apos;foo.bar:4012&apos;}</code>. The proxies are used on each request.`,name:"proxies"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.local_files_only(bool,",description:`<strong>local_files_only(<code>bool</code>,</strong> <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to only look at local files (i.e., do not try to download the model).`,name:"local_files_only(bool,"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.use_auth_token",description:`<strong>use_auth_token</strong> (<code>str</code> or <em>bool</em>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated
when running <code>diffusers-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"use_auth_token"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;main&quot;</code>) &#x2014;
The specific model version to use. It can be a branch name, a tag name, or a commit id, since we use a
git-based system for storing models and other artifacts on huggingface.co, so <code>revision</code> can be any
identifier allowed by git.`,name:"revision"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.subfolder",description:`<strong>subfolder</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&quot;</code>) &#x2014;
In case the relevant files are located inside a subfolder of the model repo (either remote in
huggingface.co or downloaded locally), you can specify the folder name here.`,name:"subfolder"},{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.mirror",description:`<strong>mirror</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Mirror source to accelerate downloads in China. If you are from China and have an accessibility
problem, you can set this option to resolve it. Note that we do not guarantee the timeliness or safety.
Please refer to the mirror site for more information.`,name:"mirror"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/loaders.py#L420"}}),Qt=new A$({props:{warning:!0,$$slots:{default:[O$]},$$scope:{ctx:G}}}),eo=new A$({props:{$$slots:{default:[U$]},$$scope:{ctx:G}}}),to=new kp({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.example",$$slots:{default:[R$]},$$scope:{ctx:G}}}),oo=new kp({props:{anchor:"diffusers.StableDiffusionControlNetPipeline.load_textual_inversion.example-2",$$slots:{default:[z$]},$$scope:{ctx:G}}}),$n=new z({props:{name:"disable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetPipeline.disable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_controlnet.py#L263"}}),kn=new z({props:{name:"enable_model_cpu_offload",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_model_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_controlnet.py#L291"}}),Dn=new z({props:{name:"enable_sequential_cpu_offload",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_sequential_cpu_offload",parameters:[{name:"gpu_id",val:" = 0"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_controlnet.py#L270"}}),Pn=new z({props:{name:"enable_vae_tiling",anchor:"diffusers.StableDiffusionControlNetPipeline.enable_vae_tiling",parameters:[],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_controlnet.py#L253"}}),Cn=new F({}),Tn=new z({props:{name:"class diffusers.FlaxStableDiffusionControlNetPipeline",anchor:"diffusers.FlaxStableDiffusionControlNetPipeline",parameters:[{name:"vae",val:": FlaxAutoencoderKL"},{name:"text_encoder",val:": FlaxCLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": FlaxUNet2DConditionModel"},{name:"controlnet",val:": FlaxControlNetModel"},{name:"scheduler",val:": typing.Union[diffusers.schedulers.scheduling_ddim_flax.FlaxDDIMScheduler, diffusers.schedulers.scheduling_pndm_flax.FlaxPNDMScheduler, diffusers.schedulers.scheduling_lms_discrete_flax.FlaxLMSDiscreteScheduler, diffusers.schedulers.scheduling_dpmsolver_multistep_flax.FlaxDPMSolverMultistepScheduler]"},{name:"safety_checker",val:": FlaxStableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPFeatureExtractor"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"}],parametersDescription:[{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/v0.16.0/en/api/models#diffusers.FlaxAutoencoderKL">FlaxAutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.text_encoder",description:`<strong>text_encoder</strong> (<code>FlaxCLIPTextModel</code>) &#x2014;
Frozen text-encoder. Stable Diffusion uses the text portion of
<a href="https://huggingface.co/docs/transformers/model_doc/clip#transformers.FlaxCLIPTextModel" rel="nofollow">CLIP</a>,
specifically the <a href="https://huggingface.co/openai/clip-vit-large-patch14" rel="nofollow">clip-vit-large-patch14</a> variant.`,name:"text_encoder"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.tokenizer",description:`<strong>tokenizer</strong> (<code>CLIPTokenizer</code>) &#x2014;
Tokenizer of class
<a href="https://huggingface.co/docs/transformers/v4.21.0/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a>.`,name:"tokenizer"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/v0.16.0/en/api/models#diffusers.FlaxUNet2DConditionModel">FlaxUNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.controlnet",description:`<strong>controlnet</strong> (<a href="/docs/diffusers/v0.16.0/en/api/models#diffusers.FlaxControlNetModel">FlaxControlNetModel</a> &#x2014;
Provides additional conditioning to the unet during the denoising process.`,name:"controlnet"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/v0.16.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 details.`,name:"safety_checker"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPFeatureExtractor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_controlnet.py#L119"}}),jn=new z({props:{name:"__call__",anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__",parameters:[{name:"prompt_ids",val:": array"},{name:"image",val:": array"},{name:"params",val:": typing.Union[typing.Dict, flax.core.frozen_dict.FrozenDict]"},{name:"prng_seed",val:": PRNGKeyArray"},{name:"num_inference_steps",val:": int = 50"},{name:"guidance_scale",val:": typing.Union[float, array] = 7.5"},{name:"latents",val:": array = None"},{name:"neg_prompt_ids",val:": array = None"},{name:"controlnet_conditioning_scale",val:": typing.Union[float, array] = 1.0"},{name:"return_dict",val:": bool = True"},{name:"jit",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.prompt_ids",description:`<strong>prompt_ids</strong> (<code>jnp.array</code>) &#x2014;
The prompt or prompts to guide the image generation.`,name:"prompt_ids"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.image",description:`<strong>image</strong> (<code>jnp.array</code>) &#x2014;
Array representing the ControlNet input condition. ControlNet use this input condition to generate
guidance to Unet.`,name:"image"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.params",description:"<strong>params</strong> (<code>Dict</code> or <code>FrozenDict</code>) &#x2014; Dictionary containing the model parameters/weights",name:"params"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.prng_seed",description:"<strong>prng_seed</strong> (<code>jax.random.KeyArray</code> or <code>jax.Array</code>) &#x2014; Array containing random number generator key",name:"prng_seed"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.num_inference_steps",description:`<strong>num_inference_steps</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The number of denoising steps. More denoising steps usually lead to a higher quality image at the
expense of slower inference.`,name:"num_inference_steps"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 7.5) &#x2014;
Guidance scale as defined in <a href="https://arxiv.org/abs/2207.12598" rel="nofollow">Classifier-Free Diffusion Guidance</a>.
<code>guidance_scale</code> is defined as <code>w</code> of equation 2. of <a href="https://arxiv.org/pdf/2205.11487.pdf" rel="nofollow">Imagen
Paper</a>. Guidance scale is enabled by setting <code>guidance_scale &gt; 1</code>. Higher guidance scale encourages to generate images that are closely linked to the text <code>prompt</code>,
usually at the expense of lower image quality.`,name:"guidance_scale"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.latents",description:`<strong>latents</strong> (<code>jnp.array</code>, <em>optional</em>) &#x2014;
Pre-generated noisy latents, sampled from a Gaussian distribution, to be used as inputs for image
generation. Can be used to tweak the same generation with different prompts. If not provided, a latents
tensor will ge generated by sampling using the supplied random <code>generator</code>.`,name:"latents"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.controlnet_conditioning_scale",description:`<strong>controlnet_conditioning_scale</strong> (<code>float</code> or <code>jnp.array</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the controlnet are multiplied by <code>controlnet_conditioning_scale</code> before they are added
to the residual in the original unet.`,name:"controlnet_conditioning_scale"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <code>FlaxStableDiffusionPipelineOutput</code> instead of
a plain tuple.`,name:"return_dict"},{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.jit",description:`<strong>jit</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to run <code>pmap</code> versions of the generation and safety scoring functions. NOTE: This argument
exists because <code>__call__</code> is not yet end-to-end pmap-able. It will be removed in a future release.`,name:"jit"}],source:"https://github.com/huggingface/diffusers/blob/v0.16.0/src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion_controlnet.py#L357",returnDescription:`
<p><code>FlaxStableDiffusionPipelineOutput</code> if <code>return_dict</code> is True, otherwise a
<code>tuple. When returning a tuple, the first element is a list with the generated images, and the second element is a list of </code>bool<code>s denoting whether the corresponding generated image likely represents "not-safe-for-work" (nsfw) content, according to the </code>safety_checker\`.</p>
`,returnType:`
<p><code>FlaxStableDiffusionPipelineOutput</code> or <code>tuple</code></p>
`}}),lo=new kp({props:{anchor:"diffusers.FlaxStableDiffusionControlNetPipeline.__call__.example",$$slots:{default:[B$]},$$scope:{ctx:G}}}),{c(){h=a("meta"),C=c(),E=a("h1"),$=a("a"),T=a("span"),u(m.$$.fragment),x=c(),M=a("span"),k=l("Text-to-Image Generation with ControlNet Conditioning"),N=c(),L=a("h2"),K=a("a"),Kr=a("span"),u(Io.$$.fragment),om=c(),Yr=a("span"),am=l("Overview"),Pp=c(),Mo=a("p"),qo=a("a"),nm=l("Adding Conditional Control to Text-to-Image Diffusion Models"),sm=l(" by Lvmin Zhang and Maneesh Agrawala."),Cp=c(),In=a("p"),rm=l("Using the pretrained models we can provide control images (for example, a depth map) to control Stable Diffusion text-to-image generation so that it follows the structure of the depth image and fills in the details."),Tp=c(),Mn=a("p"),lm=l("The abstract of the paper is the following:"),Np=c(),qn=a("p"),Jr=a("em"),im=l("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."),jp=c(),Je=a("p"),cm=l("This model was contributed by the amazing community contributor "),Lo=a("a"),pm=l("takuma104"),dm=l(" \u2764\uFE0F ."),Ap=c(),Ln=a("p"),fm=l("Resources:"),Sp=c(),Xe=a("ul"),Xr=a("li"),Fo=a("a"),mm=l("Paper"),hm=c(),Zr=a("li"),Go=a("a"),um=l("Original Code"),Ip=c(),Te=a("h2"),Ze=a("a"),Qr=a("span"),u(Oo.$$.fragment),gm=c(),el=a("span"),_m=l("Available Pipelines:"),Mp=c(),Qe=a("table"),tl=a("thead"),Ne=a("tr"),ol=a("th"),vm=l("Pipeline"),bm=c(),al=a("th"),ym=l("Tasks"),wm=c(),Fn=a("th"),Em=l("Demo"),$m=c(),nl=a("tbody"),je=a("tr"),sl=a("td"),Uo=a("a"),xm=l("StableDiffusionControlNetPipeline"),km=c(),rl=a("td"),ll=a("em"),Dm=l("Text-to-Image Generation with ControlNet Conditioning"),Pm=c(),Gn=a("td"),Ro=a("a"),Cm=l("Colab Example"),qp=c(),Ae=a("h2"),et=a("a"),il=a("span"),u(zo.$$.fragment),Tm=c(),cl=a("span"),Nm=l("Usage example"),Lp=c(),tt=a("p"),jm=l("In the following we give a simple example of how to use a "),pl=a("em"),Am=l("ControlNet"),Sm=l(` checkpoint with Diffusers for inference.
The inference pipeline is the same for all pipelines:`),Fp=c(),ot=a("ul"),dl=a("li"),fl=a("ol"),ml=a("li"),Im=l("Take an image and run it through a pre-conditioning processor."),Mm=c(),hl=a("li"),On=a("ol"),Bo=a("li"),qm=l("Run the pre-processed image through the "),Un=a("a"),Lm=l("StableDiffusionControlNetPipeline"),Fm=l("."),Gp=c(),at=a("p"),Gm=l("Let\u2019s have a look at a simple example using the "),Ho=a("a"),Om=l("Canny Edge ControlNet"),Um=l("."),Op=c(),u(Vo.$$.fragment),Up=c(),Rn=a("p"),zn=a("img"),Rp=c(),ve=a("p"),Rm=l("Next, we process the image to get the canny image. This is step "),ul=a("em"),zm=l("1."),Bm=l(" - running the pre-conditioning processor. The pre-conditioning processor is different for every ControlNet. Please see the model cards of the "),Bn=a("a"),Hm=l("official checkpoints"),Vm=l(" for more information about other models."),zp=c(),Hn=a("p"),Wm=l("First, we need to install opencv:"),Bp=c(),u(Wo.$$.fragment),Hp=c(),Vn=a("p"),Km=l("Next, let\u2019s also install all required Hugging Face libraries:"),Vp=c(),u(Ko.$$.fragment),Wp=c(),Wn=a("p"),Ym=l("Then we can retrieve the canny edges of the image."),Kp=c(),u(Yo.$$.fragment),Yp=c(),Kn=a("p"),Jm=l("Let\u2019s take a look at the processed image."),Jp=c(),Yn=a("p"),Jn=a("img"),Xp=c(),nt=a("p"),Xm=l("Now, we load the official "),Xn=a("a"),Zm=l("Stable Diffusion 1.5 Model"),Qm=l(" as well as the ControlNet for canny edges."),Zp=c(),u(Jo.$$.fragment),Qp=c(),st=a("p"),eh=l("To speed-up things and reduce memory, let\u2019s enable model offloading and use the fast "),Zn=a("a"),th=l("UniPCMultistepScheduler"),oh=l("."),ed=c(),u(Xo.$$.fragment),td=c(),Qn=a("p"),ah=l("Finally, we can run the pipeline:"),od=c(),u(Zo.$$.fragment),ad=c(),es=a("p"),nh=l("This should take only around 3-4 seconds on GPU (depending on hardware). The output image then looks as follows:"),nd=c(),ts=a("p"),os=a("img"),sd=c(),Se=a("p"),gl=a("strong"),sh=l("Note"),rh=l(": To see how to run all other ControlNet checkpoints, please have a look at "),as=a("a"),lh=l("ControlNet with Stable Diffusion 1.5"),ih=l("."),rd=c(),Ie=a("h2"),rt=a("a"),_l=a("span"),u(Qo.$$.fragment),ch=c(),vl=a("span"),ph=l("Combining multiple conditionings"),ld=c(),lt=a("p"),dh=l("Multiple ControlNet conditionings can be combined for a single image generation. Pass a list of ControlNets to the pipeline\u2019s constructor and a corresponding list of conditionings to "),bl=a("code"),fh=l("__call__"),mh=l("."),id=c(),ns=a("p"),hh=l("When combining conditionings, it is helpful to mask conditionings such that they do not overlap. In the example, we mask the middle of the canny map where the pose conditioning is located."),cd=c(),it=a("p"),uh=l("It can also be helpful to vary the "),yl=a("code"),gh=l("controlnet_conditioning_scales"),_h=l(" to emphasize one conditioning over the other."),pd=c(),Me=a("h3"),ct=a("a"),wl=a("span"),u(ea.$$.fragment),vh=c(),El=a("span"),bh=l("Canny conditioning"),dd=c(),ss=a("p"),yh=l("The original image:"),fd=c(),rs=a("img"),md=c(),ls=a("p"),wh=l("Prepare the conditioning:"),hd=c(),u(ta.$$.fragment),ud=c(),is=a("img"),gd=c(),qe=a("h3"),pt=a("a"),$l=a("span"),u(oa.$$.fragment),Eh=c(),xl=a("span"),$h=l("Openpose conditioning"),_d=c(),cs=a("p"),xh=l("The original image:"),vd=c(),aa=a("img"),bd=c(),ps=a("p"),kh=l("Prepare the conditioning:"),yd=c(),u(na.$$.fragment),wd=c(),sa=a("img"),Ed=c(),Le=a("h3"),dt=a("a"),kl=a("span"),u(ra.$$.fragment),Dh=c(),Dl=a("span"),Ph=l("Running ControlNet with multiple conditionings"),$d=c(),u(la.$$.fragment),xd=c(),ia=a("img"),kd=c(),Fe=a("h3"),ft=a("a"),Pl=a("span"),u(ca.$$.fragment),Ch=c(),Cl=a("span"),Th=l("Guess Mode"),Dd=c(),be=a("p"),Nh=l("Guess Mode is "),pa=a("a"),jh=l("a ControlNet feature that was implemented"),Ah=l(" after the publication of "),da=a("a"),Sh=l("the paper"),Ih=l(". The description states:"),Pd=c(),ds=a("blockquote"),Tl=a("p"),Mh=l("In this mode, the ControlNet encoder will try best to recognize the content of the input control map, like depth map, edge map, scribbles, etc, even if you remove all prompts."),Cd=c(),Ge=a("h4"),mt=a("a"),Nl=a("span"),u(fa.$$.fragment),qh=c(),jl=a("span"),Lh=l("The core implementation:"),Td=c(),ye=a("p"),Fh=l("It adjusts the scale of the output residuals from ControlNet by a fixed ratio depending on the block depth. The shallowest DownBlock corresponds to "),Al=a("code"),Gh=l("0.1"),Oh=l(". As the blocks get deeper, the scale increases exponentially, and the scale for the output of the MidBlock becomes "),Sl=a("code"),Uh=l("1.0"),Rh=l("."),Nd=c(),ht=a("p"),zh=l("Since the core implementation is just this, "),Il=a("strong"),Bh=l("it does not have any impact on prompt conditioning"),Hh=l(". While it is common to use it without specifying any prompts, it is also possible to provide prompts if desired."),jd=c(),Oe=a("h4"),ut=a("a"),Ml=a("span"),u(ma.$$.fragment),Vh=c(),ql=a("span"),Wh=l("Usage:"),Ad=c(),W=a("p"),Kh=l("Just specify "),Ll=a("code"),Yh=l("guess_mode=True"),Jh=l(" in the pipe() function. A "),Fl=a("code"),Xh=l("guidance_scale"),Zh=l(" between 3.0 and 5.0 is "),ha=a("a"),Qh=l("recommended"),eu=l("."),Sd=c(),u(ua.$$.fragment),Id=c(),Ue=a("h4"),gt=a("a"),Gl=a("span"),u(ga.$$.fragment),tu=c(),Ol=a("span"),ou=l("Output image comparison:"),Md=l(`

Canny Control Example
`),_t=a("table"),Ul=a("thead"),_a=a("tr"),Rl=a("th"),au=l("no guess_mode with prompt"),nu=c(),zl=a("th"),su=l("guess_mode without prompt"),ru=c(),Bl=a("tbody"),va=a("tr"),Hl=a("td"),fs=a("a"),ms=a("img"),lu=c(),Vl=a("td"),hs=a("a"),us=a("img"),qd=c(),Re=a("h2"),vt=a("a"),Wl=a("span"),u(ba.$$.fragment),iu=c(),Kl=a("span"),cu=l("Available checkpoints"),Ld=c(),we=a("p"),pu=l("ControlNet requires a "),Yl=a("em"),du=l("control image"),fu=l(" in addition to the text-to-image "),Jl=a("em"),mu=l("prompt"),hu=l(`.
Each pretrained model is trained using a different conditioning method that requires different images for conditioning the generated outputs. For example, Canny edge conditioning requires the control image to be the output of a Canny filter, while depth conditioning requires the control image to be a depth map. See the overview and image examples below to know more.`),Fd=c(),bt=a("p"),uu=l("All checkpoints can be found under the authors\u2019 namespace "),ya=a("a"),gu=l("lllyasviel"),_u=l("."),Gd=c(),ze=a("p"),Xl=a("strong"),vu=l("13.04.2024 Update"),bu=l(": The author has released improved controlnet checkpoints v1.1 - see "),gs=a("a"),yu=l("here"),wu=l("."),Od=c(),Be=a("h3"),yt=a("a"),Zl=a("span"),u(wa.$$.fragment),Eu=c(),Ql=a("span"),$u=l("ControlNet v1.0"),Ud=c(),wt=a("table"),ei=a("thead"),Y=a("tr"),ti=a("th"),xu=l("Model Name"),ku=c(),oi=a("th"),Du=l("Control Image Overview"),Pu=c(),ai=a("th"),Cu=l("Control Image Example"),Tu=c(),ni=a("th"),Nu=l("Generated Image Example"),ju=c(),q=a("tbody"),J=a("tr"),Et=a("td"),Ea=a("a"),Au=l("lllyasviel/sd-controlnet-canny"),Su=a("br"),Iu=c(),si=a("em"),Mu=l("Trained with canny edge detection"),qu=c(),ri=a("td"),Lu=l("A monochrome image with white edges on a black background."),Fu=c(),li=a("td"),_s=a("a"),$t=a("img"),Gu=c(),ii=a("td"),vs=a("a"),bs=a("img"),Ou=c(),X=a("tr"),xt=a("td"),$a=a("a"),Uu=l("lllyasviel/sd-controlnet-depth"),Ru=a("br"),zu=c(),ci=a("em"),Bu=l("Trained with Midas depth estimation"),Hu=c(),pi=a("td"),Vu=l("A grayscale image with black representing deep areas and white representing shallow areas."),Wu=c(),di=a("td"),ys=a("a"),ws=a("img"),Ku=c(),fi=a("td"),Es=a("a"),$s=a("img"),Yu=c(),Z=a("tr"),kt=a("td"),xa=a("a"),Ju=l("lllyasviel/sd-controlnet-hed"),Xu=a("br"),Zu=c(),mi=a("em"),Qu=l("Trained with HED edge detection (soft edge)"),eg=c(),hi=a("td"),tg=l("A monochrome image with white soft edges on a black background."),og=c(),ui=a("td"),xs=a("a"),ks=a("img"),ag=c(),gi=a("td"),Ds=a("a"),Ps=a("img"),ng=c(),Q=a("tr"),Dt=a("td"),ka=a("a"),sg=l("lllyasviel/sd-controlnet-mlsd"),rg=a("br"),lg=c(),_i=a("em"),ig=l("Trained with M-LSD line detection"),cg=c(),vi=a("td"),pg=l("A monochrome image composed only of white straight lines on a black background."),dg=c(),bi=a("td"),Cs=a("a"),Ts=a("img"),fg=c(),yi=a("td"),Ns=a("a"),js=a("img"),mg=c(),ee=a("tr"),Pt=a("td"),Da=a("a"),hg=l("lllyasviel/sd-controlnet-normal"),ug=a("br"),gg=c(),wi=a("em"),_g=l("Trained with normal map"),vg=c(),Pa=a("td"),bg=l("A "),Ca=a("a"),yg=l("normal mapped"),wg=l(" image."),Eg=c(),Ei=a("td"),As=a("a"),Ss=a("img"),$g=c(),$i=a("td"),Is=a("a"),Ms=a("img"),xg=c(),te=a("tr"),Ct=a("td"),Ta=a("a"),kg=l("lllyasviel/sd-controlnet-openpose"),Dg=a("br"),Pg=c(),xi=a("em"),Cg=l("Trained with OpenPose bone image"),Tg=c(),Na=a("td"),Ng=l("A "),ja=a("a"),jg=l("OpenPose bone"),Ag=l(" image."),Sg=c(),ki=a("td"),qs=a("a"),Ls=a("img"),Ig=c(),Di=a("td"),Fs=a("a"),Gs=a("img"),Mg=c(),oe=a("tr"),Tt=a("td"),Aa=a("a"),qg=l("lllyasviel/sd-controlnet-scribble"),Lg=a("br"),Fg=c(),Pi=a("em"),Gg=l("Trained with human scribbles"),Og=c(),Ci=a("td"),Ug=l("A hand-drawn monochrome image with white outlines on a black background."),Rg=c(),Ti=a("td"),Os=a("a"),Us=a("img"),zg=c(),Ni=a("td"),Rs=a("a"),zs=a("img"),Bg=c(),ae=a("tr"),Sa=a("td"),Ia=a("a"),Hg=l("lllyasviel/sd-controlnet-seg"),Vg=a("br"),ji=a("em"),Wg=l("Trained with semantic segmentation"),Kg=c(),Ma=a("td"),Yg=l("An "),qa=a("a"),Jg=l("ADE20K"),Xg=l("\u2019s segmentation protocol image."),Zg=c(),Ai=a("td"),Bs=a("a"),Hs=a("img"),Qg=c(),Si=a("td"),Vs=a("a"),Ws=a("img"),Rd=c(),He=a("h3"),Nt=a("a"),Ii=a("span"),u(La.$$.fragment),e_=c(),Mi=a("span"),t_=l("ControlNet v1.1"),zd=c(),jt=a("table"),qi=a("thead"),ne=a("tr"),Li=a("th"),o_=l("Model Name"),a_=c(),Fi=a("th"),n_=l("Control Image Overview"),s_=c(),Gi=a("th"),r_=l("Control Image Example"),l_=c(),Oi=a("th"),i_=l("Generated Image Example"),c_=c(),j=a("tbody"),se=a("tr"),At=a("td"),Fa=a("a"),p_=l("lllyasviel/control_v11p_sd15_canny"),d_=a("br"),f_=c(),Ui=a("em"),m_=l("Trained with canny edge detection"),h_=c(),Ri=a("td"),u_=l("A monochrome image with white edges on a black background."),g_=c(),zi=a("td"),Ks=a("a"),St=a("img"),__=c(),Bi=a("td"),Ys=a("a"),Js=a("img"),v_=c(),re=a("tr"),It=a("td"),Ga=a("a"),b_=l("lllyasviel/control_v11e_sd15_ip2p"),y_=a("br"),w_=c(),Hi=a("em"),E_=l("Trained with pixel to pixel instruction"),$_=c(),Vi=a("td"),x_=l("No condition ."),k_=c(),Wi=a("td"),Xs=a("a"),Mt=a("img"),D_=c(),Ki=a("td"),Zs=a("a"),Qs=a("img"),P_=c(),le=a("tr"),Oa=a("td"),Ua=a("a"),C_=l("lllyasviel/control_v11p_sd15_inpaint"),T_=a("br"),N_=l(" Trained with image inpainting"),j_=c(),Yi=a("td"),A_=l("No condition."),S_=c(),Ji=a("td"),er=a("a"),qt=a("img"),I_=c(),Xi=a("td"),tr=a("a"),or=a("img"),M_=c(),ie=a("tr"),Ra=a("td"),za=a("a"),q_=l("lllyasviel/control_v11p_sd15_mlsd"),L_=a("br"),F_=l(" Trained with multi-level line segment detection"),G_=c(),Zi=a("td"),O_=l("An image with annotated line segments."),U_=c(),Qi=a("td"),ar=a("a"),Lt=a("img"),R_=c(),ec=a("td"),nr=a("a"),sr=a("img"),z_=c(),ce=a("tr"),Ba=a("td"),Ha=a("a"),B_=l("lllyasviel/control_v11f1p_sd15_depth"),H_=a("br"),V_=l(" Trained with depth estimation"),W_=c(),tc=a("td"),K_=l("An image with depth information, usually represented as a grayscale image."),Y_=c(),oc=a("td"),rr=a("a"),Ft=a("img"),J_=c(),ac=a("td"),lr=a("a"),ir=a("img"),X_=c(),pe=a("tr"),Va=a("td"),Wa=a("a"),Z_=l("lllyasviel/control_v11p_sd15_normalbae"),Q_=a("br"),ev=l(" Trained with surface normal estimation"),tv=c(),nc=a("td"),ov=l("An image with surface normal information, usually represented as a color-coded image."),av=c(),sc=a("td"),cr=a("a"),Gt=a("img"),nv=c(),rc=a("td"),pr=a("a"),dr=a("img"),sv=c(),de=a("tr"),Ka=a("td"),Ya=a("a"),rv=l("lllyasviel/control_v11p_sd15_seg"),lv=a("br"),iv=l(" Trained with image segmentation"),cv=c(),lc=a("td"),pv=l("An image with segmented regions, usually represented as a color-coded image."),dv=c(),ic=a("td"),fr=a("a"),Ot=a("img"),fv=c(),cc=a("td"),mr=a("a"),hr=a("img"),mv=c(),fe=a("tr"),Ja=a("td"),Xa=a("a"),hv=l("lllyasviel/control_v11p_sd15_lineart"),uv=a("br"),gv=l(" Trained with line art generation"),_v=c(),pc=a("td"),vv=l("An image with line art, usually black lines on a white background."),bv=c(),dc=a("td"),ur=a("a"),Ut=a("img"),yv=c(),fc=a("td"),gr=a("a"),_r=a("img"),wv=c(),me=a("tr"),Za=a("td"),Qa=a("a"),Ev=l("lllyasviel/control_v11p_sd15s2_lineart_anime"),$v=a("br"),xv=l(" Trained with anime line art generation"),kv=c(),mc=a("td"),Dv=l("An image with anime-style line art."),Pv=c(),hc=a("td"),vr=a("a"),Rt=a("img"),Cv=c(),uc=a("td"),br=a("a"),yr=a("img"),Tv=c(),he=a("tr"),en=a("td"),tn=a("a"),Nv=l("lllyasviel/control_v11p_sd15_openpose"),jv=a("br"),Av=l(" Trained with human pose estimation"),Sv=c(),gc=a("td"),Iv=l("An image with human poses, usually represented as a set of keypoints or skeletons."),Mv=c(),_c=a("td"),wr=a("a"),zt=a("img"),qv=c(),vc=a("td"),Er=a("a"),$r=a("img"),Lv=c(),ue=a("tr"),on=a("td"),an=a("a"),Fv=l("lllyasviel/control_v11p_sd15_scribble"),Gv=a("br"),Ov=l(" Trained with scribble-based image generation"),Uv=c(),bc=a("td"),Rv=l("An image with scribbles, usually random or user-drawn strokes."),zv=c(),yc=a("td"),xr=a("a"),Bt=a("img"),Bv=c(),wc=a("td"),kr=a("a"),Dr=a("img"),Hv=c(),ge=a("tr"),nn=a("td"),sn=a("a"),Vv=l("lllyasviel/control_v11p_sd15_softedge"),Wv=a("br"),Kv=l(" Trained with soft edge image generation"),Yv=c(),Ec=a("td"),Jv=l("An image with soft edges, usually to create a more painterly or artistic effect."),Xv=c(),$c=a("td"),Pr=a("a"),Ht=a("img"),Zv=c(),xc=a("td"),Cr=a("a"),Tr=a("img"),Qv=c(),_e=a("tr"),rn=a("td"),ln=a("a"),e1=l("lllyasviel/control_v11e_sd15_shuffle"),t1=a("br"),o1=l(" Trained with image shuffling"),a1=c(),kc=a("td"),n1=l("An image with shuffled patches or regions."),s1=c(),Dc=a("td"),Nr=a("a"),Vt=a("img"),r1=c(),Pc=a("td"),jr=a("a"),Ar=a("img"),Bd=c(),Ve=a("h2"),Wt=a("a"),Cc=a("span"),u(cn.$$.fragment),l1=c(),Tc=a("span"),i1=l("StableDiffusionControlNetPipeline"),Hd=c(),D=a("div"),u(pn.$$.fragment),c1=c(),Nc=a("p"),p1=l("Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),d1=c(),dn=a("p"),f1=l("This model inherits from "),Sr=a("a"),m1=l("DiffusionPipeline"),h1=l(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),u1=c(),jc=a("p"),g1=l("In addition the pipeline inherits the following loading methods:"),_1=c(),Ac=a("ul"),fn=a("li"),Sc=a("em"),v1=l("Textual-Inversion"),b1=l(": "),Ir=a("a"),y1=l("loaders.TextualInversionLoaderMixin.load_textual_inversion()"),w1=c(),Ee=a("div"),u(mn.$$.fragment),E1=c(),Ic=a("p"),$1=l("Function invoked when calling the pipeline for generation."),x1=c(),u(Kt.$$.fragment),k1=c(),$e=a("div"),u(hn.$$.fragment),D1=c(),Mc=a("p"),P1=l("Enable sliced attention computation."),C1=c(),qc=a("p"),T1=l(`When this option is enabled, the attention module will split the input tensor in slices, to compute attention
in several steps. This is useful to save some memory in exchange for a small speed decrease.`),N1=c(),Yt=a("div"),u(un.$$.fragment),j1=c(),gn=a("p"),A1=l("Disable sliced attention computation. If "),Lc=a("code"),S1=l("enable_attention_slicing"),I1=l(` was previously invoked, this method will go
back to computing attention in one step.`),M1=c(),xe=a("div"),u(_n.$$.fragment),q1=c(),Fc=a("p"),L1=l("Enable sliced VAE decoding."),F1=c(),Gc=a("p"),G1=l(`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.`),O1=c(),Jt=a("div"),u(vn.$$.fragment),U1=c(),bn=a("p"),R1=l("Disable sliced VAE decoding. If "),Oc=a("code"),z1=l("enable_vae_slicing"),B1=l(` was previously invoked, this method will go back to
computing decoding in one step.`),H1=c(),B=a("div"),u(yn.$$.fragment),V1=c(),Uc=a("p"),W1=l("Enable memory efficient attention as implemented in xformers."),K1=c(),Rc=a("p"),Y1=l(`When this option is enabled, you should observe lower GPU memory usage and a potential speed up at inference
time. Speed up at training time is not guaranteed.`),J1=c(),zc=a("p"),X1=l(`Warning: When Memory Efficient Attention and Sliced attention are both enabled, the Memory Efficient Attention
is used.`),Z1=c(),u(Xt.$$.fragment),Q1=c(),Zt=a("div"),u(wn.$$.fragment),eb=c(),Bc=a("p"),tb=l("Disable memory efficient attention as implemented in xformers."),ob=c(),I=a("div"),u(En.$$.fragment),ab=c(),We=a("p"),nb=l("Load textual inversion embeddings into the text encoder of stable diffusion pipelines. Both "),Hc=a("code"),sb=l("diffusers"),rb=l(` and
`),Vc=a("code"),lb=l("Automatic1111"),ib=l(" formats are supported (see example below)."),cb=c(),u(Qt.$$.fragment),pb=c(),u(eo.$$.fragment),db=c(),Wc=a("p"),fb=l("Example:"),mb=c(),u(to.$$.fragment),hb=c(),Kc=a("p"),ub=l("To load a textual inversion embedding vector in Automatic1111 format, make sure to first download the vector,"),gb=c(),u(oo.$$.fragment),_b=c(),ao=a("div"),u($n.$$.fragment),vb=c(),xn=a("p"),bb=l("Disable tiled VAE decoding. If "),Yc=a("code"),yb=l("enable_vae_tiling"),wb=l(` was previously invoked, this method will go back to
computing decoding in one step.`),Eb=c(),no=a("div"),u(kn.$$.fragment),$b=c(),H=a("p"),xb=l(`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Jc=a("code"),kb=l("enable_sequential_cpu_offload"),Db=l(", this method moves one whole model at a time to the GPU when its "),Xc=a("code"),Pb=l("forward"),Cb=l(`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Zc=a("code"),Tb=l("enable_sequential_cpu_offload"),Nb=l(", but performance is much better due to the iterative execution of the "),Qc=a("code"),jb=l("unet"),Ab=l("."),Sb=c(),so=a("div"),u(Dn.$$.fragment),Ib=c(),Ke=a("p"),Mb=l(`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae, controlnet, and safety checker have their state dicts saved to CPU and then are moved to a
`),ep=a("code"),qb=l("torch.device('meta') and loaded to GPU only when their specific submodule has its "),Lb=l("forward"),tp=a("code"),Fb=l("method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),Gb=l("enable_model_cpu_offload`, but performance is lower."),Ob=c(),ke=a("div"),u(Pn.$$.fragment),Ub=c(),op=a("p"),Rb=l("Enable tiled VAE decoding."),zb=c(),ap=a("p"),Bb=l(`When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and encoding in
several steps. This is useful to save a large amount of memory and to allow the processing of larger images.`),Vd=c(),Ye=a("h2"),ro=a("a"),np=a("span"),u(Cn.$$.fragment),Hb=c(),sp=a("span"),Vb=l("FlaxStableDiffusionControlNetPipeline"),Wd=c(),V=a("div"),u(Tn.$$.fragment),Wb=c(),rp=a("p"),Kb=l("Pipeline for text-to-image generation using Stable Diffusion with ControlNet Guidance."),Yb=c(),Nn=a("p"),Jb=l("This model inherits from "),lp=a("code"),Xb=l("FlaxDiffusionPipeline"),Zb=l(`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),Qb=c(),De=a("div"),u(jn.$$.fragment),ey=c(),ip=a("p"),ty=l("Function invoked when calling the pipeline for generation."),oy=c(),u(lo.$$.fragment),this.h()},l(o){const d=q$('[data-svelte="svelte-1phssyn"]',document.head);h=n(d,"META",{name:!0,content:!0}),d.forEach(t),C=p(o),E=n(o,"H1",{class:!0});var An=s(E);$=n(An,"A",{id:!0,class:!0,href:!0});var cp=s($);T=n(cp,"SPAN",{});var pp=s(T);g(m.$$.fragment,pp),pp.forEach(t),cp.forEach(t),x=p(An),M=n(An,"SPAN",{});var dp=s(M);k=i(dp,"Text-to-Image Generation with ControlNet Conditioning"),dp.forEach(t),An.forEach(t),N=p(o),L=n(o,"H2",{class:!0});var Sn=s(L);K=n(Sn,"A",{id:!0,class:!0,href:!0});var fp=s(K);Kr=n(fp,"SPAN",{});var mp=s(Kr);g(Io.$$.fragment,mp),mp.forEach(t),fp.forEach(t),om=p(Sn),Yr=n(Sn,"SPAN",{});var ow=s(Yr);am=i(ow,"Overview"),ow.forEach(t),Sn.forEach(t),Pp=p(o),Mo=n(o,"P",{});var ay=s(Mo);qo=n(ay,"A",{href:!0,rel:!0});var aw=s(qo);nm=i(aw,"Adding Conditional Control to Text-to-Image Diffusion Models"),aw.forEach(t),sm=i(ay," by Lvmin Zhang and Maneesh Agrawala."),ay.forEach(t),Cp=p(o),In=n(o,"P",{});var nw=s(In);rm=i(nw,"Using the pretrained models we can provide control images (for example, a depth map) to control Stable Diffusion text-to-image generation so that it follows the structure of the depth image and fills in the details."),nw.forEach(t),Tp=p(o),Mn=n(o,"P",{});var sw=s(Mn);lm=i(sw,"The abstract of the paper is the following:"),sw.forEach(t),Np=p(o),qn=n(o,"P",{});var rw=s(qn);Jr=n(rw,"EM",{});var lw=s(Jr);im=i(lw,"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."),lw.forEach(t),rw.forEach(t),jp=p(o),Je=n(o,"P",{});var Yd=s(Je);cm=i(Yd,"This model was contributed by the amazing community contributor "),Lo=n(Yd,"A",{href:!0,rel:!0});var iw=s(Lo);pm=i(iw,"takuma104"),iw.forEach(t),dm=i(Yd," \u2764\uFE0F ."),Yd.forEach(t),Ap=p(o),Ln=n(o,"P",{});var cw=s(Ln);fm=i(cw,"Resources:"),cw.forEach(t),Sp=p(o),Xe=n(o,"UL",{});var Jd=s(Xe);Xr=n(Jd,"LI",{});var pw=s(Xr);Fo=n(pw,"A",{href:!0,rel:!0});var dw=s(Fo);mm=i(dw,"Paper"),dw.forEach(t),pw.forEach(t),hm=p(Jd),Zr=n(Jd,"LI",{});var fw=s(Zr);Go=n(fw,"A",{href:!0,rel:!0});var mw=s(Go);um=i(mw,"Original Code"),mw.forEach(t),fw.forEach(t),Jd.forEach(t),Ip=p(o),Te=n(o,"H2",{class:!0});var Xd=s(Te);Ze=n(Xd,"A",{id:!0,class:!0,href:!0});var hw=s(Ze);Qr=n(hw,"SPAN",{});var uw=s(Qr);g(Oo.$$.fragment,uw),uw.forEach(t),hw.forEach(t),gm=p(Xd),el=n(Xd,"SPAN",{});var gw=s(el);_m=i(gw,"Available Pipelines:"),gw.forEach(t),Xd.forEach(t),Mp=p(o),Qe=n(o,"TABLE",{});var Zd=s(Qe);tl=n(Zd,"THEAD",{});var _w=s(tl);Ne=n(_w,"TR",{});var Mr=s(Ne);ol=n(Mr,"TH",{});var vw=s(ol);vm=i(vw,"Pipeline"),vw.forEach(t),bm=p(Mr),al=n(Mr,"TH",{});var bw=s(al);ym=i(bw,"Tasks"),bw.forEach(t),wm=p(Mr),Fn=n(Mr,"TH",{align:!0});var yw=s(Fn);Em=i(yw,"Demo"),yw.forEach(t),Mr.forEach(t),_w.forEach(t),$m=p(Zd),nl=n(Zd,"TBODY",{});var ww=s(nl);je=n(ww,"TR",{});var qr=s(je);sl=n(qr,"TD",{});var Ew=s(sl);Uo=n(Ew,"A",{href:!0,rel:!0});var $w=s(Uo);xm=i($w,"StableDiffusionControlNetPipeline"),$w.forEach(t),Ew.forEach(t),km=p(qr),rl=n(qr,"TD",{});var xw=s(rl);ll=n(xw,"EM",{});var kw=s(ll);Dm=i(kw,"Text-to-Image Generation with ControlNet Conditioning"),kw.forEach(t),xw.forEach(t),Pm=p(qr),Gn=n(qr,"TD",{align:!0});var Dw=s(Gn);Ro=n(Dw,"A",{href:!0,rel:!0});var Pw=s(Ro);Cm=i(Pw,"Colab Example"),Pw.forEach(t),Dw.forEach(t),qr.forEach(t),ww.forEach(t),Zd.forEach(t),qp=p(o),Ae=n(o,"H2",{class:!0});var Qd=s(Ae);et=n(Qd,"A",{id:!0,class:!0,href:!0});var Cw=s(et);il=n(Cw,"SPAN",{});var Tw=s(il);g(zo.$$.fragment,Tw),Tw.forEach(t),Cw.forEach(t),Tm=p(Qd),cl=n(Qd,"SPAN",{});var Nw=s(cl);Nm=i(Nw,"Usage example"),Nw.forEach(t),Qd.forEach(t),Lp=p(o),tt=n(o,"P",{});var ef=s(tt);jm=i(ef,"In the following we give a simple example of how to use a "),pl=n(ef,"EM",{});var jw=s(pl);Am=i(jw,"ControlNet"),jw.forEach(t),Sm=i(ef,` checkpoint with Diffusers for inference.
The inference pipeline is the same for all pipelines:`),ef.forEach(t),Fp=p(o),ot=n(o,"UL",{});var tf=s(ot);dl=n(tf,"LI",{});var Aw=s(dl);fl=n(Aw,"OL",{});var Sw=s(fl);ml=n(Sw,"LI",{});var Iw=s(ml);Im=i(Iw,"Take an image and run it through a pre-conditioning processor."),Iw.forEach(t),Sw.forEach(t),Aw.forEach(t),Mm=p(tf),hl=n(tf,"LI",{});var Mw=s(hl);On=n(Mw,"OL",{start:!0});var qw=s(On);Bo=n(qw,"LI",{});var of=s(Bo);qm=i(of,"Run the pre-processed image through the "),Un=n(of,"A",{href:!0});var Lw=s(Un);Lm=i(Lw,"StableDiffusionControlNetPipeline"),Lw.forEach(t),Fm=i(of,"."),of.forEach(t),qw.forEach(t),Mw.forEach(t),tf.forEach(t),Gp=p(o),at=n(o,"P",{});var af=s(at);Gm=i(af,"Let\u2019s have a look at a simple example using the "),Ho=n(af,"A",{href:!0,rel:!0});var Fw=s(Ho);Om=i(Fw,"Canny Edge ControlNet"),Fw.forEach(t),Um=i(af,"."),af.forEach(t),Op=p(o),g(Vo.$$.fragment,o),Up=p(o),Rn=n(o,"P",{});var Gw=s(Rn);zn=n(Gw,"IMG",{src:!0,alt:!0}),Gw.forEach(t),Rp=p(o),ve=n(o,"P",{});var Lr=s(ve);Rm=i(Lr,"Next, we process the image to get the canny image. This is step "),ul=n(Lr,"EM",{});var Ow=s(ul);zm=i(Ow,"1."),Ow.forEach(t),Bm=i(Lr," - running the pre-conditioning processor. The pre-conditioning processor is different for every ControlNet. Please see the model cards of the "),Bn=n(Lr,"A",{href:!0});var Uw=s(Bn);Hm=i(Uw,"official checkpoints"),Uw.forEach(t),Vm=i(Lr," for more information about other models."),Lr.forEach(t),zp=p(o),Hn=n(o,"P",{});var Rw=s(Hn);Wm=i(Rw,"First, we need to install opencv:"),Rw.forEach(t),Bp=p(o),g(Wo.$$.fragment,o),Hp=p(o),Vn=n(o,"P",{});var zw=s(Vn);Km=i(zw,"Next, let\u2019s also install all required Hugging Face libraries:"),zw.forEach(t),Vp=p(o),g(Ko.$$.fragment,o),Wp=p(o),Wn=n(o,"P",{});var Bw=s(Wn);Ym=i(Bw,"Then we can retrieve the canny edges of the image."),Bw.forEach(t),Kp=p(o),g(Yo.$$.fragment,o),Yp=p(o),Kn=n(o,"P",{});var Hw=s(Kn);Jm=i(Hw,"Let\u2019s take a look at the processed image."),Hw.forEach(t),Jp=p(o),Yn=n(o,"P",{});var Vw=s(Yn);Jn=n(Vw,"IMG",{src:!0,alt:!0}),Vw.forEach(t),Xp=p(o),nt=n(o,"P",{});var nf=s(nt);Xm=i(nf,"Now, we load the official "),Xn=n(nf,"A",{href:!0});var Ww=s(Xn);Zm=i(Ww,"Stable Diffusion 1.5 Model"),Ww.forEach(t),Qm=i(nf," as well as the ControlNet for canny edges."),nf.forEach(t),Zp=p(o),g(Jo.$$.fragment,o),Qp=p(o),st=n(o,"P",{});var sf=s(st);eh=i(sf,"To speed-up things and reduce memory, let\u2019s enable model offloading and use the fast "),Zn=n(sf,"A",{href:!0});var Kw=s(Zn);th=i(Kw,"UniPCMultistepScheduler"),Kw.forEach(t),oh=i(sf,"."),sf.forEach(t),ed=p(o),g(Xo.$$.fragment,o),td=p(o),Qn=n(o,"P",{});var Yw=s(Qn);ah=i(Yw,"Finally, we can run the pipeline:"),Yw.forEach(t),od=p(o),g(Zo.$$.fragment,o),ad=p(o),es=n(o,"P",{});var Jw=s(es);nh=i(Jw,"This should take only around 3-4 seconds on GPU (depending on hardware). The output image then looks as follows:"),Jw.forEach(t),nd=p(o),ts=n(o,"P",{});var Xw=s(ts);os=n(Xw,"IMG",{src:!0,alt:!0}),Xw.forEach(t),sd=p(o),Se=n(o,"P",{});var hp=s(Se);gl=n(hp,"STRONG",{});var Zw=s(gl);sh=i(Zw,"Note"),Zw.forEach(t),rh=i(hp,": To see how to run all other ControlNet checkpoints, please have a look at "),as=n(hp,"A",{href:!0});var Qw=s(as);lh=i(Qw,"ControlNet with Stable Diffusion 1.5"),Qw.forEach(t),ih=i(hp,"."),hp.forEach(t),rd=p(o),Ie=n(o,"H2",{class:!0});var rf=s(Ie);rt=n(rf,"A",{id:!0,class:!0,href:!0});var e2=s(rt);_l=n(e2,"SPAN",{});var t2=s(_l);g(Qo.$$.fragment,t2),t2.forEach(t),e2.forEach(t),ch=p(rf),vl=n(rf,"SPAN",{});var o2=s(vl);ph=i(o2,"Combining multiple conditionings"),o2.forEach(t),rf.forEach(t),ld=p(o),lt=n(o,"P",{});var lf=s(lt);dh=i(lf,"Multiple ControlNet conditionings can be combined for a single image generation. Pass a list of ControlNets to the pipeline\u2019s constructor and a corresponding list of conditionings to "),bl=n(lf,"CODE",{});var a2=s(bl);fh=i(a2,"__call__"),a2.forEach(t),mh=i(lf,"."),lf.forEach(t),id=p(o),ns=n(o,"P",{});var n2=s(ns);hh=i(n2,"When combining conditionings, it is helpful to mask conditionings such that they do not overlap. In the example, we mask the middle of the canny map where the pose conditioning is located."),n2.forEach(t),cd=p(o),it=n(o,"P",{});var cf=s(it);uh=i(cf,"It can also be helpful to vary the "),yl=n(cf,"CODE",{});var s2=s(yl);gh=i(s2,"controlnet_conditioning_scales"),s2.forEach(t),_h=i(cf," to emphasize one conditioning over the other."),cf.forEach(t),pd=p(o),Me=n(o,"H3",{class:!0});var pf=s(Me);ct=n(pf,"A",{id:!0,class:!0,href:!0});var r2=s(ct);wl=n(r2,"SPAN",{});var l2=s(wl);g(ea.$$.fragment,l2),l2.forEach(t),r2.forEach(t),vh=p(pf),El=n(pf,"SPAN",{});var i2=s(El);bh=i(i2,"Canny conditioning"),i2.forEach(t),pf.forEach(t),dd=p(o),ss=n(o,"P",{});var c2=s(ss);yh=i(c2,"The original image:"),c2.forEach(t),fd=p(o),rs=n(o,"IMG",{src:!0}),md=p(o),ls=n(o,"P",{});var p2=s(ls);wh=i(p2,"Prepare the conditioning:"),p2.forEach(t),hd=p(o),g(ta.$$.fragment,o),ud=p(o),is=n(o,"IMG",{src:!0}),gd=p(o),qe=n(o,"H3",{class:!0});var df=s(qe);pt=n(df,"A",{id:!0,class:!0,href:!0});var d2=s(pt);$l=n(d2,"SPAN",{});var f2=s($l);g(oa.$$.fragment,f2),f2.forEach(t),d2.forEach(t),Eh=p(df),xl=n(df,"SPAN",{});var m2=s(xl);$h=i(m2,"Openpose conditioning"),m2.forEach(t),df.forEach(t),_d=p(o),cs=n(o,"P",{});var h2=s(cs);xh=i(h2,"The original image:"),h2.forEach(t),vd=p(o),aa=n(o,"IMG",{src:!0,width:!0}),bd=p(o),ps=n(o,"P",{});var u2=s(ps);kh=i(u2,"Prepare the conditioning:"),u2.forEach(t),yd=p(o),g(na.$$.fragment,o),wd=p(o),sa=n(o,"IMG",{src:!0,width:!0}),Ed=p(o),Le=n(o,"H3",{class:!0});var ff=s(Le);dt=n(ff,"A",{id:!0,class:!0,href:!0});var g2=s(dt);kl=n(g2,"SPAN",{});var _2=s(kl);g(ra.$$.fragment,_2),_2.forEach(t),g2.forEach(t),Dh=p(ff),Dl=n(ff,"SPAN",{});var v2=s(Dl);Ph=i(v2,"Running ControlNet with multiple conditionings"),v2.forEach(t),ff.forEach(t),$d=p(o),g(la.$$.fragment,o),xd=p(o),ia=n(o,"IMG",{src:!0,width:!0}),kd=p(o),Fe=n(o,"H3",{class:!0});var mf=s(Fe);ft=n(mf,"A",{id:!0,class:!0,href:!0});var b2=s(ft);Pl=n(b2,"SPAN",{});var y2=s(Pl);g(ca.$$.fragment,y2),y2.forEach(t),b2.forEach(t),Ch=p(mf),Cl=n(mf,"SPAN",{});var w2=s(Cl);Th=i(w2,"Guess Mode"),w2.forEach(t),mf.forEach(t),Dd=p(o),be=n(o,"P",{});var Fr=s(be);Nh=i(Fr,"Guess Mode is "),pa=n(Fr,"A",{href:!0,rel:!0});var E2=s(pa);jh=i(E2,"a ControlNet feature that was implemented"),E2.forEach(t),Ah=i(Fr," after the publication of "),da=n(Fr,"A",{href:!0,rel:!0});var $2=s(da);Sh=i($2,"the paper"),$2.forEach(t),Ih=i(Fr,". The description states:"),Fr.forEach(t),Pd=p(o),ds=n(o,"BLOCKQUOTE",{});var x2=s(ds);Tl=n(x2,"P",{});var k2=s(Tl);Mh=i(k2,"In this mode, the ControlNet encoder will try best to recognize the content of the input control map, like depth map, edge map, scribbles, etc, even if you remove all prompts."),k2.forEach(t),x2.forEach(t),Cd=p(o),Ge=n(o,"H4",{class:!0});var hf=s(Ge);mt=n(hf,"A",{id:!0,class:!0,href:!0});var D2=s(mt);Nl=n(D2,"SPAN",{});var P2=s(Nl);g(fa.$$.fragment,P2),P2.forEach(t),D2.forEach(t),qh=p(hf),jl=n(hf,"SPAN",{});var C2=s(jl);Lh=i(C2,"The core implementation:"),C2.forEach(t),hf.forEach(t),Td=p(o),ye=n(o,"P",{});var Gr=s(ye);Fh=i(Gr,"It adjusts the scale of the output residuals from ControlNet by a fixed ratio depending on the block depth. The shallowest DownBlock corresponds to "),Al=n(Gr,"CODE",{});var T2=s(Al);Gh=i(T2,"0.1"),T2.forEach(t),Oh=i(Gr,". As the blocks get deeper, the scale increases exponentially, and the scale for the output of the MidBlock becomes "),Sl=n(Gr,"CODE",{});var N2=s(Sl);Uh=i(N2,"1.0"),N2.forEach(t),Rh=i(Gr,"."),Gr.forEach(t),Nd=p(o),ht=n(o,"P",{});var uf=s(ht);zh=i(uf,"Since the core implementation is just this, "),Il=n(uf,"STRONG",{});var j2=s(Il);Bh=i(j2,"it does not have any impact on prompt conditioning"),j2.forEach(t),Hh=i(uf,". While it is common to use it without specifying any prompts, it is also possible to provide prompts if desired."),uf.forEach(t),jd=p(o),Oe=n(o,"H4",{class:!0});var gf=s(Oe);ut=n(gf,"A",{id:!0,class:!0,href:!0});var A2=s(ut);Ml=n(A2,"SPAN",{});var S2=s(Ml);g(ma.$$.fragment,S2),S2.forEach(t),A2.forEach(t),Vh=p(gf),ql=n(gf,"SPAN",{});var I2=s(ql);Wh=i(I2,"Usage:"),I2.forEach(t),gf.forEach(t),Ad=p(o),W=n(o,"P",{});var io=s(W);Kh=i(io,"Just specify "),Ll=n(io,"CODE",{});var M2=s(Ll);Yh=i(M2,"guess_mode=True"),M2.forEach(t),Jh=i(io," in the pipe() function. A "),Fl=n(io,"CODE",{});var q2=s(Fl);Xh=i(q2,"guidance_scale"),q2.forEach(t),Zh=i(io," between 3.0 and 5.0 is "),ha=n(io,"A",{href:!0,rel:!0});var L2=s(ha);Qh=i(L2,"recommended"),L2.forEach(t),eu=i(io,"."),io.forEach(t),Sd=p(o),g(ua.$$.fragment,o),Id=p(o),Ue=n(o,"H4",{class:!0});var _f=s(Ue);gt=n(_f,"A",{id:!0,class:!0,href:!0});var F2=s(gt);Gl=n(F2,"SPAN",{});var G2=s(Gl);g(ga.$$.fragment,G2),G2.forEach(t),F2.forEach(t),tu=p(_f),Ol=n(_f,"SPAN",{});var O2=s(Ol);ou=i(O2,"Output image comparison:"),O2.forEach(t),_f.forEach(t),Md=i(o,`

Canny Control Example
`),_t=n(o,"TABLE",{});var vf=s(_t);Ul=n(vf,"THEAD",{});var U2=s(Ul);_a=n(U2,"TR",{});var bf=s(_a);Rl=n(bf,"TH",{});var R2=s(Rl);au=i(R2,"no guess_mode with prompt"),R2.forEach(t),nu=p(bf),zl=n(bf,"TH",{});var z2=s(zl);su=i(z2,"guess_mode without prompt"),z2.forEach(t),bf.forEach(t),U2.forEach(t),ru=p(vf),Bl=n(vf,"TBODY",{});var B2=s(Bl);va=n(B2,"TR",{});var yf=s(va);Hl=n(yf,"TD",{});var H2=s(Hl);fs=n(H2,"A",{href:!0});var V2=s(fs);ms=n(V2,"IMG",{width:!0,src:!0}),V2.forEach(t),H2.forEach(t),lu=p(yf),Vl=n(yf,"TD",{});var W2=s(Vl);hs=n(W2,"A",{href:!0});var K2=s(hs);us=n(K2,"IMG",{width:!0,src:!0}),K2.forEach(t),W2.forEach(t),yf.forEach(t),B2.forEach(t),vf.forEach(t),qd=p(o),Re=n(o,"H2",{class:!0});var wf=s(Re);vt=n(wf,"A",{id:!0,class:!0,href:!0});var Y2=s(vt);Wl=n(Y2,"SPAN",{});var J2=s(Wl);g(ba.$$.fragment,J2),J2.forEach(t),Y2.forEach(t),iu=p(wf),Kl=n(wf,"SPAN",{});var X2=s(Kl);cu=i(X2,"Available checkpoints"),X2.forEach(t),wf.forEach(t),Ld=p(o),we=n(o,"P",{});var Or=s(we);pu=i(Or,"ControlNet requires a "),Yl=n(Or,"EM",{});var Z2=s(Yl);du=i(Z2,"control image"),Z2.forEach(t),fu=i(Or," in addition to the text-to-image "),Jl=n(Or,"EM",{});var Q2=s(Jl);mu=i(Q2,"prompt"),Q2.forEach(t),hu=i(Or,`.
Each pretrained model is trained using a different conditioning method that requires different images for conditioning the generated outputs. For example, Canny edge conditioning requires the control image to be the output of a Canny filter, while depth conditioning requires the control image to be a depth map. See the overview and image examples below to know more.`),Or.forEach(t),Fd=p(o),bt=n(o,"P",{});var Ef=s(bt);uu=i(Ef,"All checkpoints can be found under the authors\u2019 namespace "),ya=n(Ef,"A",{href:!0,rel:!0});var e0=s(ya);gu=i(e0,"lllyasviel"),e0.forEach(t),_u=i(Ef,"."),Ef.forEach(t),Gd=p(o),ze=n(o,"P",{});var up=s(ze);Xl=n(up,"STRONG",{});var t0=s(Xl);vu=i(t0,"13.04.2024 Update"),t0.forEach(t),bu=i(up,": The author has released improved controlnet checkpoints v1.1 - see "),gs=n(up,"A",{href:!0});var o0=s(gs);yu=i(o0,"here"),o0.forEach(t),wu=i(up,"."),up.forEach(t),Od=p(o),Be=n(o,"H3",{class:!0});var $f=s(Be);yt=n($f,"A",{id:!0,class:!0,href:!0});var a0=s(yt);Zl=n(a0,"SPAN",{});var n0=s(Zl);g(wa.$$.fragment,n0),n0.forEach(t),a0.forEach(t),Eu=p($f),Ql=n($f,"SPAN",{});var s0=s(Ql);$u=i(s0,"ControlNet v1.0"),s0.forEach(t),$f.forEach(t),Ud=p(o),wt=n(o,"TABLE",{});var xf=s(wt);ei=n(xf,"THEAD",{});var r0=s(ei);Y=n(r0,"TR",{});var co=s(Y);ti=n(co,"TH",{});var l0=s(ti);xu=i(l0,"Model Name"),l0.forEach(t),ku=p(co),oi=n(co,"TH",{});var i0=s(oi);Du=i(i0,"Control Image Overview"),i0.forEach(t),Pu=p(co),ai=n(co,"TH",{});var c0=s(ai);Cu=i(c0,"Control Image Example"),c0.forEach(t),Tu=p(co),ni=n(co,"TH",{});var p0=s(ni);Nu=i(p0,"Generated Image Example"),p0.forEach(t),co.forEach(t),r0.forEach(t),ju=p(xf),q=n(xf,"TBODY",{});var O=s(q);J=n(O,"TR",{});var po=s(J);Et=n(po,"TD",{});var gp=s(Et);Ea=n(gp,"A",{href:!0,rel:!0});var d0=s(Ea);Au=i(d0,"lllyasviel/sd-controlnet-canny"),d0.forEach(t),Su=n(gp,"BR",{}),Iu=p(gp),si=n(gp,"EM",{});var f0=s(si);Mu=i(f0,"Trained with canny edge detection"),f0.forEach(t),gp.forEach(t),qu=p(po),ri=n(po,"TD",{});var m0=s(ri);Lu=i(m0,"A monochrome image with white edges on a black background."),m0.forEach(t),Fu=p(po),li=n(po,"TD",{});var h0=s(li);_s=n(h0,"A",{href:!0});var u0=s(_s);$t=n(u0,"IMG",{width:!0,style:!0,src:!0}),u0.forEach(t),h0.forEach(t),Gu=p(po),ii=n(po,"TD",{});var g0=s(ii);vs=n(g0,"A",{href:!0});var _0=s(vs);bs=n(_0,"IMG",{width:!0,src:!0}),_0.forEach(t),g0.forEach(t),po.forEach(t),Ou=p(O),X=n(O,"TR",{});var fo=s(X);xt=n(fo,"TD",{});var _p=s(xt);$a=n(_p,"A",{href:!0,rel:!0});var v0=s($a);Uu=i(v0,"lllyasviel/sd-controlnet-depth"),v0.forEach(t),Ru=n(_p,"BR",{}),zu=p(_p),ci=n(_p,"EM",{});var b0=s(ci);Bu=i(b0,"Trained with Midas depth estimation"),b0.forEach(t),_p.forEach(t),Hu=p(fo),pi=n(fo,"TD",{});var y0=s(pi);Vu=i(y0,"A grayscale image with black representing deep areas and white representing shallow areas."),y0.forEach(t),Wu=p(fo),di=n(fo,"TD",{});var w0=s(di);ys=n(w0,"A",{href:!0});var E0=s(ys);ws=n(E0,"IMG",{width:!0,src:!0}),E0.forEach(t),w0.forEach(t),Ku=p(fo),fi=n(fo,"TD",{});var $0=s(fi);Es=n($0,"A",{href:!0});var x0=s(Es);$s=n(x0,"IMG",{width:!0,src:!0}),x0.forEach(t),$0.forEach(t),fo.forEach(t),Yu=p(O),Z=n(O,"TR",{});var mo=s(Z);kt=n(mo,"TD",{});var vp=s(kt);xa=n(vp,"A",{href:!0,rel:!0});var k0=s(xa);Ju=i(k0,"lllyasviel/sd-controlnet-hed"),k0.forEach(t),Xu=n(vp,"BR",{}),Zu=p(vp),mi=n(vp,"EM",{});var D0=s(mi);Qu=i(D0,"Trained with HED edge detection (soft edge)"),D0.forEach(t),vp.forEach(t),eg=p(mo),hi=n(mo,"TD",{});var P0=s(hi);tg=i(P0,"A monochrome image with white soft edges on a black background."),P0.forEach(t),og=p(mo),ui=n(mo,"TD",{});var C0=s(ui);xs=n(C0,"A",{href:!0});var T0=s(xs);ks=n(T0,"IMG",{width:!0,src:!0}),T0.forEach(t),C0.forEach(t),ag=p(mo),gi=n(mo,"TD",{});var N0=s(gi);Ds=n(N0,"A",{href:!0});var j0=s(Ds);Ps=n(j0,"IMG",{width:!0,src:!0}),j0.forEach(t),N0.forEach(t),mo.forEach(t),ng=p(O),Q=n(O,"TR",{});var ho=s(Q);Dt=n(ho,"TD",{});var bp=s(Dt);ka=n(bp,"A",{href:!0,rel:!0});var A0=s(ka);sg=i(A0,"lllyasviel/sd-controlnet-mlsd"),A0.forEach(t),rg=n(bp,"BR",{}),lg=p(bp),_i=n(bp,"EM",{});var S0=s(_i);ig=i(S0,"Trained with M-LSD line detection"),S0.forEach(t),bp.forEach(t),cg=p(ho),vi=n(ho,"TD",{});var I0=s(vi);pg=i(I0,"A monochrome image composed only of white straight lines on a black background."),I0.forEach(t),dg=p(ho),bi=n(ho,"TD",{});var M0=s(bi);Cs=n(M0,"A",{href:!0});var q0=s(Cs);Ts=n(q0,"IMG",{width:!0,src:!0}),q0.forEach(t),M0.forEach(t),fg=p(ho),yi=n(ho,"TD",{});var L0=s(yi);Ns=n(L0,"A",{href:!0});var F0=s(Ns);js=n(F0,"IMG",{width:!0,src:!0}),F0.forEach(t),L0.forEach(t),ho.forEach(t),mg=p(O),ee=n(O,"TR",{});var uo=s(ee);Pt=n(uo,"TD",{});var yp=s(Pt);Da=n(yp,"A",{href:!0,rel:!0});var G0=s(Da);hg=i(G0,"lllyasviel/sd-controlnet-normal"),G0.forEach(t),ug=n(yp,"BR",{}),gg=p(yp),wi=n(yp,"EM",{});var O0=s(wi);_g=i(O0,"Trained with normal map"),O0.forEach(t),yp.forEach(t),vg=p(uo),Pa=n(uo,"TD",{});var kf=s(Pa);bg=i(kf,"A "),Ca=n(kf,"A",{href:!0,rel:!0});var U0=s(Ca);yg=i(U0,"normal mapped"),U0.forEach(t),wg=i(kf," image."),kf.forEach(t),Eg=p(uo),Ei=n(uo,"TD",{});var R0=s(Ei);As=n(R0,"A",{href:!0});var z0=s(As);Ss=n(z0,"IMG",{width:!0,src:!0}),z0.forEach(t),R0.forEach(t),$g=p(uo),$i=n(uo,"TD",{});var B0=s($i);Is=n(B0,"A",{href:!0});var H0=s(Is);Ms=n(H0,"IMG",{width:!0,src:!0}),H0.forEach(t),B0.forEach(t),uo.forEach(t),xg=p(O),te=n(O,"TR",{});var go=s(te);Ct=n(go,"TD",{});var wp=s(Ct);Ta=n(wp,"A",{href:!0,rel:!0});var V0=s(Ta);kg=i(V0,"lllyasviel/sd-controlnet-openpose"),V0.forEach(t),Dg=n(wp,"BR",{}),Pg=p(wp),xi=n(wp,"EM",{});var W0=s(xi);Cg=i(W0,"Trained with OpenPose bone image"),W0.forEach(t),wp.forEach(t),Tg=p(go),Na=n(go,"TD",{});var Df=s(Na);Ng=i(Df,"A "),ja=n(Df,"A",{href:!0,rel:!0});var K0=s(ja);jg=i(K0,"OpenPose bone"),K0.forEach(t),Ag=i(Df," image."),Df.forEach(t),Sg=p(go),ki=n(go,"TD",{});var Y0=s(ki);qs=n(Y0,"A",{href:!0});var J0=s(qs);Ls=n(J0,"IMG",{width:!0,src:!0}),J0.forEach(t),Y0.forEach(t),Ig=p(go),Di=n(go,"TD",{});var X0=s(Di);Fs=n(X0,"A",{href:!0});var Z0=s(Fs);Gs=n(Z0,"IMG",{width:!0,src:!0}),Z0.forEach(t),X0.forEach(t),go.forEach(t),Mg=p(O),oe=n(O,"TR",{});var _o=s(oe);Tt=n(_o,"TD",{});var Ep=s(Tt);Aa=n(Ep,"A",{href:!0,rel:!0});var Q0=s(Aa);qg=i(Q0,"lllyasviel/sd-controlnet-scribble"),Q0.forEach(t),Lg=n(Ep,"BR",{}),Fg=p(Ep),Pi=n(Ep,"EM",{});var e4=s(Pi);Gg=i(e4,"Trained with human scribbles"),e4.forEach(t),Ep.forEach(t),Og=p(_o),Ci=n(_o,"TD",{});var t4=s(Ci);Ug=i(t4,"A hand-drawn monochrome image with white outlines on a black background."),t4.forEach(t),Rg=p(_o),Ti=n(_o,"TD",{});var o4=s(Ti);Os=n(o4,"A",{href:!0});var a4=s(Os);Us=n(a4,"IMG",{width:!0,src:!0}),a4.forEach(t),o4.forEach(t),zg=p(_o),Ni=n(_o,"TD",{});var n4=s(Ni);Rs=n(n4,"A",{href:!0});var s4=s(Rs);zs=n(s4,"IMG",{width:!0,src:!0}),s4.forEach(t),n4.forEach(t),_o.forEach(t),Bg=p(O),ae=n(O,"TR",{});var vo=s(ae);Sa=n(vo,"TD",{});var Pf=s(Sa);Ia=n(Pf,"A",{href:!0,rel:!0});var r4=s(Ia);Hg=i(r4,"lllyasviel/sd-controlnet-seg"),r4.forEach(t),Vg=n(Pf,"BR",{}),ji=n(Pf,"EM",{});var l4=s(ji);Wg=i(l4,"Trained with semantic segmentation"),l4.forEach(t),Pf.forEach(t),Kg=p(vo),Ma=n(vo,"TD",{});var Cf=s(Ma);Yg=i(Cf,"An "),qa=n(Cf,"A",{href:!0,rel:!0});var i4=s(qa);Jg=i(i4,"ADE20K"),i4.forEach(t),Xg=i(Cf,"\u2019s segmentation protocol image."),Cf.forEach(t),Zg=p(vo),Ai=n(vo,"TD",{});var c4=s(Ai);Bs=n(c4,"A",{href:!0});var p4=s(Bs);Hs=n(p4,"IMG",{width:!0,src:!0}),p4.forEach(t),c4.forEach(t),Qg=p(vo),Si=n(vo,"TD",{});var d4=s(Si);Vs=n(d4,"A",{href:!0});var f4=s(Vs);Ws=n(f4,"IMG",{width:!0,src:!0}),f4.forEach(t),d4.forEach(t),vo.forEach(t),O.forEach(t),xf.forEach(t),Rd=p(o),He=n(o,"H3",{class:!0});var Tf=s(He);Nt=n(Tf,"A",{id:!0,class:!0,href:!0});var m4=s(Nt);Ii=n(m4,"SPAN",{});var h4=s(Ii);g(La.$$.fragment,h4),h4.forEach(t),m4.forEach(t),e_=p(Tf),Mi=n(Tf,"SPAN",{});var u4=s(Mi);t_=i(u4,"ControlNet v1.1"),u4.forEach(t),Tf.forEach(t),zd=p(o),jt=n(o,"TABLE",{});var Nf=s(jt);qi=n(Nf,"THEAD",{});var g4=s(qi);ne=n(g4,"TR",{});var bo=s(ne);Li=n(bo,"TH",{});var _4=s(Li);o_=i(_4,"Model Name"),_4.forEach(t),a_=p(bo),Fi=n(bo,"TH",{});var v4=s(Fi);n_=i(v4,"Control Image Overview"),v4.forEach(t),s_=p(bo),Gi=n(bo,"TH",{});var b4=s(Gi);r_=i(b4,"Control Image Example"),b4.forEach(t),l_=p(bo),Oi=n(bo,"TH",{});var y4=s(Oi);i_=i(y4,"Generated Image Example"),y4.forEach(t),bo.forEach(t),g4.forEach(t),c_=p(Nf),j=n(Nf,"TBODY",{});var S=s(j);se=n(S,"TR",{});var yo=s(se);At=n(yo,"TD",{});var $p=s(At);Fa=n($p,"A",{href:!0,rel:!0});var w4=s(Fa);p_=i(w4,"lllyasviel/control_v11p_sd15_canny"),w4.forEach(t),d_=n($p,"BR",{}),f_=p($p),Ui=n($p,"EM",{});var E4=s(Ui);m_=i(E4,"Trained with canny edge detection"),E4.forEach(t),$p.forEach(t),h_=p(yo),Ri=n(yo,"TD",{});var $4=s(Ri);u_=i($4,"A monochrome image with white edges on a black background."),$4.forEach(t),g_=p(yo),zi=n(yo,"TD",{});var x4=s(zi);Ks=n(x4,"A",{href:!0});var k4=s(Ks);St=n(k4,"IMG",{width:!0,style:!0,src:!0}),k4.forEach(t),x4.forEach(t),__=p(yo),Bi=n(yo,"TD",{});var D4=s(Bi);Ys=n(D4,"A",{href:!0});var P4=s(Ys);Js=n(P4,"IMG",{width:!0,src:!0}),P4.forEach(t),D4.forEach(t),yo.forEach(t),v_=p(S),re=n(S,"TR",{});var wo=s(re);It=n(wo,"TD",{});var xp=s(It);Ga=n(xp,"A",{href:!0,rel:!0});var C4=s(Ga);b_=i(C4,"lllyasviel/control_v11e_sd15_ip2p"),C4.forEach(t),y_=n(xp,"BR",{}),w_=p(xp),Hi=n(xp,"EM",{});var T4=s(Hi);E_=i(T4,"Trained with pixel to pixel instruction"),T4.forEach(t),xp.forEach(t),$_=p(wo),Vi=n(wo,"TD",{});var N4=s(Vi);x_=i(N4,"No condition ."),N4.forEach(t),k_=p(wo),Wi=n(wo,"TD",{});var j4=s(Wi);Xs=n(j4,"A",{href:!0});var A4=s(Xs);Mt=n(A4,"IMG",{width:!0,style:!0,src:!0}),A4.forEach(t),j4.forEach(t),D_=p(wo),Ki=n(wo,"TD",{});var S4=s(Ki);Zs=n(S4,"A",{href:!0});var I4=s(Zs);Qs=n(I4,"IMG",{width:!0,src:!0}),I4.forEach(t),S4.forEach(t),wo.forEach(t),P_=p(S),le=n(S,"TR",{});var Eo=s(le);Oa=n(Eo,"TD",{});var jf=s(Oa);Ua=n(jf,"A",{href:!0,rel:!0});var M4=s(Ua);C_=i(M4,"lllyasviel/control_v11p_sd15_inpaint"),M4.forEach(t),T_=n(jf,"BR",{}),N_=i(jf," Trained with image inpainting"),jf.forEach(t),j_=p(Eo),Yi=n(Eo,"TD",{});var q4=s(Yi);A_=i(q4,"No condition."),q4.forEach(t),S_=p(Eo),Ji=n(Eo,"TD",{});var L4=s(Ji);er=n(L4,"A",{href:!0});var F4=s(er);qt=n(F4,"IMG",{width:!0,style:!0,src:!0}),F4.forEach(t),L4.forEach(t),I_=p(Eo),Xi=n(Eo,"TD",{});var G4=s(Xi);tr=n(G4,"A",{href:!0});var O4=s(tr);or=n(O4,"IMG",{width:!0,src:!0}),O4.forEach(t),G4.forEach(t),Eo.forEach(t),M_=p(S),ie=n(S,"TR",{});var $o=s(ie);Ra=n($o,"TD",{});var Af=s(Ra);za=n(Af,"A",{href:!0,rel:!0});var U4=s(za);q_=i(U4,"lllyasviel/control_v11p_sd15_mlsd"),U4.forEach(t),L_=n(Af,"BR",{}),F_=i(Af," Trained with multi-level line segment detection"),Af.forEach(t),G_=p($o),Zi=n($o,"TD",{});var R4=s(Zi);O_=i(R4,"An image with annotated line segments."),R4.forEach(t),U_=p($o),Qi=n($o,"TD",{});var z4=s(Qi);ar=n(z4,"A",{href:!0});var B4=s(ar);Lt=n(B4,"IMG",{width:!0,style:!0,src:!0}),B4.forEach(t),z4.forEach(t),R_=p($o),ec=n($o,"TD",{});var H4=s(ec);nr=n(H4,"A",{href:!0});var V4=s(nr);sr=n(V4,"IMG",{width:!0,src:!0}),V4.forEach(t),H4.forEach(t),$o.forEach(t),z_=p(S),ce=n(S,"TR",{});var xo=s(ce);Ba=n(xo,"TD",{});var Sf=s(Ba);Ha=n(Sf,"A",{href:!0,rel:!0});var W4=s(Ha);B_=i(W4,"lllyasviel/control_v11f1p_sd15_depth"),W4.forEach(t),H_=n(Sf,"BR",{}),V_=i(Sf," Trained with depth estimation"),Sf.forEach(t),W_=p(xo),tc=n(xo,"TD",{});var K4=s(tc);K_=i(K4,"An image with depth information, usually represented as a grayscale image."),K4.forEach(t),Y_=p(xo),oc=n(xo,"TD",{});var Y4=s(oc);rr=n(Y4,"A",{href:!0});var J4=s(rr);Ft=n(J4,"IMG",{width:!0,style:!0,src:!0}),J4.forEach(t),Y4.forEach(t),J_=p(xo),ac=n(xo,"TD",{});var X4=s(ac);lr=n(X4,"A",{href:!0});var Z4=s(lr);ir=n(Z4,"IMG",{width:!0,src:!0}),Z4.forEach(t),X4.forEach(t),xo.forEach(t),X_=p(S),pe=n(S,"TR",{});var ko=s(pe);Va=n(ko,"TD",{});var If=s(Va);Wa=n(If,"A",{href:!0,rel:!0});var Q4=s(Wa);Z_=i(Q4,"lllyasviel/control_v11p_sd15_normalbae"),Q4.forEach(t),Q_=n(If,"BR",{}),ev=i(If," Trained with surface normal estimation"),If.forEach(t),tv=p(ko),nc=n(ko,"TD",{});var eE=s(nc);ov=i(eE,"An image with surface normal information, usually represented as a color-coded image."),eE.forEach(t),av=p(ko),sc=n(ko,"TD",{});var tE=s(sc);cr=n(tE,"A",{href:!0});var oE=s(cr);Gt=n(oE,"IMG",{width:!0,style:!0,src:!0}),oE.forEach(t),tE.forEach(t),nv=p(ko),rc=n(ko,"TD",{});var aE=s(rc);pr=n(aE,"A",{href:!0});var nE=s(pr);dr=n(nE,"IMG",{width:!0,src:!0}),nE.forEach(t),aE.forEach(t),ko.forEach(t),sv=p(S),de=n(S,"TR",{});var Do=s(de);Ka=n(Do,"TD",{});var Mf=s(Ka);Ya=n(Mf,"A",{href:!0,rel:!0});var sE=s(Ya);rv=i(sE,"lllyasviel/control_v11p_sd15_seg"),sE.forEach(t),lv=n(Mf,"BR",{}),iv=i(Mf," Trained with image segmentation"),Mf.forEach(t),cv=p(Do),lc=n(Do,"TD",{});var rE=s(lc);pv=i(rE,"An image with segmented regions, usually represented as a color-coded image."),rE.forEach(t),dv=p(Do),ic=n(Do,"TD",{});var lE=s(ic);fr=n(lE,"A",{href:!0});var iE=s(fr);Ot=n(iE,"IMG",{width:!0,style:!0,src:!0}),iE.forEach(t),lE.forEach(t),fv=p(Do),cc=n(Do,"TD",{});var cE=s(cc);mr=n(cE,"A",{href:!0});var pE=s(mr);hr=n(pE,"IMG",{width:!0,src:!0}),pE.forEach(t),cE.forEach(t),Do.forEach(t),mv=p(S),fe=n(S,"TR",{});var Po=s(fe);Ja=n(Po,"TD",{});var qf=s(Ja);Xa=n(qf,"A",{href:!0,rel:!0});var dE=s(Xa);hv=i(dE,"lllyasviel/control_v11p_sd15_lineart"),dE.forEach(t),uv=n(qf,"BR",{}),gv=i(qf," Trained with line art generation"),qf.forEach(t),_v=p(Po),pc=n(Po,"TD",{});var fE=s(pc);vv=i(fE,"An image with line art, usually black lines on a white background."),fE.forEach(t),bv=p(Po),dc=n(Po,"TD",{});var mE=s(dc);ur=n(mE,"A",{href:!0});var hE=s(ur);Ut=n(hE,"IMG",{width:!0,style:!0,src:!0}),hE.forEach(t),mE.forEach(t),yv=p(Po),fc=n(Po,"TD",{});var uE=s(fc);gr=n(uE,"A",{href:!0});var gE=s(gr);_r=n(gE,"IMG",{width:!0,src:!0}),gE.forEach(t),uE.forEach(t),Po.forEach(t),wv=p(S),me=n(S,"TR",{});var Co=s(me);Za=n(Co,"TD",{});var Lf=s(Za);Qa=n(Lf,"A",{href:!0,rel:!0});var _E=s(Qa);Ev=i(_E,"lllyasviel/control_v11p_sd15s2_lineart_anime"),_E.forEach(t),$v=n(Lf,"BR",{}),xv=i(Lf," Trained with anime line art generation"),Lf.forEach(t),kv=p(Co),mc=n(Co,"TD",{});var vE=s(mc);Dv=i(vE,"An image with anime-style line art."),vE.forEach(t),Pv=p(Co),hc=n(Co,"TD",{});var bE=s(hc);vr=n(bE,"A",{href:!0});var yE=s(vr);Rt=n(yE,"IMG",{width:!0,style:!0,src:!0}),yE.forEach(t),bE.forEach(t),Cv=p(Co),uc=n(Co,"TD",{});var wE=s(uc);br=n(wE,"A",{href:!0});var EE=s(br);yr=n(EE,"IMG",{width:!0,src:!0}),EE.forEach(t),wE.forEach(t),Co.forEach(t),Tv=p(S),he=n(S,"TR",{});var To=s(he);en=n(To,"TD",{});var Ff=s(en);tn=n(Ff,"A",{href:!0,rel:!0});var $E=s(tn);Nv=i($E,"lllyasviel/control_v11p_sd15_openpose"),$E.forEach(t),jv=n(Ff,"BR",{}),Av=i(Ff," Trained with human pose estimation"),Ff.forEach(t),Sv=p(To),gc=n(To,"TD",{});var xE=s(gc);Iv=i(xE,"An image with human poses, usually represented as a set of keypoints or skeletons."),xE.forEach(t),Mv=p(To),_c=n(To,"TD",{});var kE=s(_c);wr=n(kE,"A",{href:!0});var DE=s(wr);zt=n(DE,"IMG",{width:!0,style:!0,src:!0}),DE.forEach(t),kE.forEach(t),qv=p(To),vc=n(To,"TD",{});var PE=s(vc);Er=n(PE,"A",{href:!0});var CE=s(Er);$r=n(CE,"IMG",{width:!0,src:!0}),CE.forEach(t),PE.forEach(t),To.forEach(t),Lv=p(S),ue=n(S,"TR",{});var No=s(ue);on=n(No,"TD",{});var Gf=s(on);an=n(Gf,"A",{href:!0,rel:!0});var TE=s(an);Fv=i(TE,"lllyasviel/control_v11p_sd15_scribble"),TE.forEach(t),Gv=n(Gf,"BR",{}),Ov=i(Gf," Trained with scribble-based image generation"),Gf.forEach(t),Uv=p(No),bc=n(No,"TD",{});var NE=s(bc);Rv=i(NE,"An image with scribbles, usually random or user-drawn strokes."),NE.forEach(t),zv=p(No),yc=n(No,"TD",{});var jE=s(yc);xr=n(jE,"A",{href:!0});var AE=s(xr);Bt=n(AE,"IMG",{width:!0,style:!0,src:!0}),AE.forEach(t),jE.forEach(t),Bv=p(No),wc=n(No,"TD",{});var SE=s(wc);kr=n(SE,"A",{href:!0});var IE=s(kr);Dr=n(IE,"IMG",{width:!0,src:!0}),IE.forEach(t),SE.forEach(t),No.forEach(t),Hv=p(S),ge=n(S,"TR",{});var jo=s(ge);nn=n(jo,"TD",{});var Of=s(nn);sn=n(Of,"A",{href:!0,rel:!0});var ME=s(sn);Vv=i(ME,"lllyasviel/control_v11p_sd15_softedge"),ME.forEach(t),Wv=n(Of,"BR",{}),Kv=i(Of," Trained with soft edge image generation"),Of.forEach(t),Yv=p(jo),Ec=n(jo,"TD",{});var qE=s(Ec);Jv=i(qE,"An image with soft edges, usually to create a more painterly or artistic effect."),qE.forEach(t),Xv=p(jo),$c=n(jo,"TD",{});var LE=s($c);Pr=n(LE,"A",{href:!0});var FE=s(Pr);Ht=n(FE,"IMG",{width:!0,style:!0,src:!0}),FE.forEach(t),LE.forEach(t),Zv=p(jo),xc=n(jo,"TD",{});var GE=s(xc);Cr=n(GE,"A",{href:!0});var OE=s(Cr);Tr=n(OE,"IMG",{width:!0,src:!0}),OE.forEach(t),GE.forEach(t),jo.forEach(t),Qv=p(S),_e=n(S,"TR",{});var Ao=s(_e);rn=n(Ao,"TD",{});var Uf=s(rn);ln=n(Uf,"A",{href:!0,rel:!0});var UE=s(ln);e1=i(UE,"lllyasviel/control_v11e_sd15_shuffle"),UE.forEach(t),t1=n(Uf,"BR",{}),o1=i(Uf," Trained with image shuffling"),Uf.forEach(t),a1=p(Ao),kc=n(Ao,"TD",{});var RE=s(kc);n1=i(RE,"An image with shuffled patches or regions."),RE.forEach(t),s1=p(Ao),Dc=n(Ao,"TD",{});var zE=s(Dc);Nr=n(zE,"A",{href:!0});var BE=s(Nr);Vt=n(BE,"IMG",{width:!0,style:!0,src:!0}),BE.forEach(t),zE.forEach(t),r1=p(Ao),Pc=n(Ao,"TD",{});var HE=s(Pc);jr=n(HE,"A",{href:!0});var VE=s(jr);Ar=n(VE,"IMG",{width:!0,src:!0}),VE.forEach(t),HE.forEach(t),Ao.forEach(t),S.forEach(t),Nf.forEach(t),Bd=p(o),Ve=n(o,"H2",{class:!0});var Rf=s(Ve);Wt=n(Rf,"A",{id:!0,class:!0,href:!0});var WE=s(Wt);Cc=n(WE,"SPAN",{});var KE=s(Cc);g(cn.$$.fragment,KE),KE.forEach(t),WE.forEach(t),l1=p(Rf),Tc=n(Rf,"SPAN",{});var YE=s(Tc);i1=i(YE,"StableDiffusionControlNetPipeline"),YE.forEach(t),Rf.forEach(t),Hd=p(o),D=n(o,"DIV",{class:!0});var P=s(D);g(pn.$$.fragment,P),c1=p(P),Nc=n(P,"P",{});var JE=s(Nc);p1=i(JE,"Pipeline for text-to-image generation using Stable Diffusion with ControlNet guidance."),JE.forEach(t),d1=p(P),dn=n(P,"P",{});var zf=s(dn);f1=i(zf,"This model inherits from "),Sr=n(zf,"A",{href:!0});var XE=s(Sr);m1=i(XE,"DiffusionPipeline"),XE.forEach(t),h1=i(zf,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),zf.forEach(t),u1=p(P),jc=n(P,"P",{});var ZE=s(jc);g1=i(ZE,"In addition the pipeline inherits the following loading methods:"),ZE.forEach(t),_1=p(P),Ac=n(P,"UL",{});var QE=s(Ac);fn=n(QE,"LI",{});var Bf=s(fn);Sc=n(Bf,"EM",{});var e$=s(Sc);v1=i(e$,"Textual-Inversion"),e$.forEach(t),b1=i(Bf,": "),Ir=n(Bf,"A",{href:!0});var t$=s(Ir);y1=i(t$,"loaders.TextualInversionLoaderMixin.load_textual_inversion()"),t$.forEach(t),Bf.forEach(t),QE.forEach(t),w1=p(P),Ee=n(P,"DIV",{class:!0});var Ur=s(Ee);g(mn.$$.fragment,Ur),E1=p(Ur),Ic=n(Ur,"P",{});var o$=s(Ic);$1=i(o$,"Function invoked when calling the pipeline for generation."),o$.forEach(t),x1=p(Ur),g(Kt.$$.fragment,Ur),Ur.forEach(t),k1=p(P),$e=n(P,"DIV",{class:!0});var Rr=s($e);g(hn.$$.fragment,Rr),D1=p(Rr),Mc=n(Rr,"P",{});var a$=s(Mc);P1=i(a$,"Enable sliced attention computation."),a$.forEach(t),C1=p(Rr),qc=n(Rr,"P",{});var n$=s(qc);T1=i(n$,`When this option is enabled, the attention module will split the input tensor in slices, to compute attention
in several steps. This is useful to save some memory in exchange for a small speed decrease.`),n$.forEach(t),Rr.forEach(t),N1=p(P),Yt=n(P,"DIV",{class:!0});var Hf=s(Yt);g(un.$$.fragment,Hf),j1=p(Hf),gn=n(Hf,"P",{});var Vf=s(gn);A1=i(Vf,"Disable sliced attention computation. If "),Lc=n(Vf,"CODE",{});var s$=s(Lc);S1=i(s$,"enable_attention_slicing"),s$.forEach(t),I1=i(Vf,` was previously invoked, this method will go
back to computing attention in one step.`),Vf.forEach(t),Hf.forEach(t),M1=p(P),xe=n(P,"DIV",{class:!0});var zr=s(xe);g(_n.$$.fragment,zr),q1=p(zr),Fc=n(zr,"P",{});var r$=s(Fc);L1=i(r$,"Enable sliced VAE decoding."),r$.forEach(t),F1=p(zr),Gc=n(zr,"P",{});var l$=s(Gc);G1=i(l$,`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.`),l$.forEach(t),zr.forEach(t),O1=p(P),Jt=n(P,"DIV",{class:!0});var Wf=s(Jt);g(vn.$$.fragment,Wf),U1=p(Wf),bn=n(Wf,"P",{});var Kf=s(bn);R1=i(Kf,"Disable sliced VAE decoding. If "),Oc=n(Kf,"CODE",{});var i$=s(Oc);z1=i(i$,"enable_vae_slicing"),i$.forEach(t),B1=i(Kf,` was previously invoked, this method will go back to
computing decoding in one step.`),Kf.forEach(t),Wf.forEach(t),H1=p(P),B=n(P,"DIV",{class:!0});var Pe=s(B);g(yn.$$.fragment,Pe),V1=p(Pe),Uc=n(Pe,"P",{});var c$=s(Uc);W1=i(c$,"Enable memory efficient attention as implemented in xformers."),c$.forEach(t),K1=p(Pe),Rc=n(Pe,"P",{});var p$=s(Rc);Y1=i(p$,`When this option is enabled, you should observe lower GPU memory usage and a potential speed up at inference
time. Speed up at training time is not guaranteed.`),p$.forEach(t),J1=p(Pe),zc=n(Pe,"P",{});var d$=s(zc);X1=i(d$,`Warning: When Memory Efficient Attention and Sliced attention are both enabled, the Memory Efficient Attention
is used.`),d$.forEach(t),Z1=p(Pe),g(Xt.$$.fragment,Pe),Pe.forEach(t),Q1=p(P),Zt=n(P,"DIV",{class:!0});var Yf=s(Zt);g(wn.$$.fragment,Yf),eb=p(Yf),Bc=n(Yf,"P",{});var f$=s(Bc);tb=i(f$,"Disable memory efficient attention as implemented in xformers."),f$.forEach(t),Yf.forEach(t),ob=p(P),I=n(P,"DIV",{class:!0});var U=s(I);g(En.$$.fragment,U),ab=p(U),We=n(U,"P",{});var Br=s(We);nb=i(Br,"Load textual inversion embeddings into the text encoder of stable diffusion pipelines. Both "),Hc=n(Br,"CODE",{});var m$=s(Hc);sb=i(m$,"diffusers"),m$.forEach(t),rb=i(Br,` and
`),Vc=n(Br,"CODE",{});var h$=s(Vc);lb=i(h$,"Automatic1111"),h$.forEach(t),ib=i(Br," formats are supported (see example below)."),Br.forEach(t),cb=p(U),g(Qt.$$.fragment,U),pb=p(U),g(eo.$$.fragment,U),db=p(U),Wc=n(U,"P",{});var u$=s(Wc);fb=i(u$,"Example:"),u$.forEach(t),mb=p(U),g(to.$$.fragment,U),hb=p(U),Kc=n(U,"P",{});var g$=s(Kc);ub=i(g$,"To load a textual inversion embedding vector in Automatic1111 format, make sure to first download the vector,"),g$.forEach(t),gb=p(U),g(oo.$$.fragment,U),U.forEach(t),_b=p(P),ao=n(P,"DIV",{class:!0});var Jf=s(ao);g($n.$$.fragment,Jf),vb=p(Jf),xn=n(Jf,"P",{});var Xf=s(xn);bb=i(Xf,"Disable tiled VAE decoding. If "),Yc=n(Xf,"CODE",{});var _$=s(Yc);yb=i(_$,"enable_vae_tiling"),_$.forEach(t),wb=i(Xf,` was previously invoked, this method will go back to
computing decoding in one step.`),Xf.forEach(t),Jf.forEach(t),Eb=p(P),no=n(P,"DIV",{class:!0});var Zf=s(no);g(kn.$$.fragment,Zf),$b=p(Zf),H=n(Zf,"P",{});var Ce=s(H);xb=i(Ce,`Offloads all models to CPU using accelerate, reducing memory usage with a low impact on performance. Compared
to `),Jc=n(Ce,"CODE",{});var v$=s(Jc);kb=i(v$,"enable_sequential_cpu_offload"),v$.forEach(t),Db=i(Ce,", this method moves one whole model at a time to the GPU when its "),Xc=n(Ce,"CODE",{});var b$=s(Xc);Pb=i(b$,"forward"),b$.forEach(t),Cb=i(Ce,`
method is called, and the model remains in GPU until the next model runs. Memory savings are lower than with
`),Zc=n(Ce,"CODE",{});var y$=s(Zc);Tb=i(y$,"enable_sequential_cpu_offload"),y$.forEach(t),Nb=i(Ce,", but performance is much better due to the iterative execution of the "),Qc=n(Ce,"CODE",{});var w$=s(Qc);jb=i(w$,"unet"),w$.forEach(t),Ab=i(Ce,"."),Ce.forEach(t),Zf.forEach(t),Sb=p(P),so=n(P,"DIV",{class:!0});var Qf=s(so);g(Dn.$$.fragment,Qf),Ib=p(Qf),Ke=n(Qf,"P",{});var Hr=s(Ke);Mb=i(Hr,`Offloads all models to CPU using accelerate, significantly reducing memory usage. When called, unet,
text_encoder, vae, controlnet, and safety checker have their state dicts saved to CPU and then are moved to a
`),ep=n(Hr,"CODE",{});var E$=s(ep);qb=i(E$,"torch.device('meta') and loaded to GPU only when their specific submodule has its "),E$.forEach(t),Lb=i(Hr,"forward"),tp=n(Hr,"CODE",{});var $$=s(tp);Fb=i($$,"method called. Note that offloading happens on a submodule basis. Memory savings are higher than with"),$$.forEach(t),Gb=i(Hr,"enable_model_cpu_offload`, but performance is lower."),Hr.forEach(t),Qf.forEach(t),Ob=p(P),ke=n(P,"DIV",{class:!0});var Vr=s(ke);g(Pn.$$.fragment,Vr),Ub=p(Vr),op=n(Vr,"P",{});var x$=s(op);Rb=i(x$,"Enable tiled VAE decoding."),x$.forEach(t),zb=p(Vr),ap=n(Vr,"P",{});var k$=s(ap);Bb=i(k$,`When this option is enabled, the VAE will split the input tensor into tiles to compute decoding and encoding in
several steps. This is useful to save a large amount of memory and to allow the processing of larger images.`),k$.forEach(t),Vr.forEach(t),P.forEach(t),Vd=p(o),Ye=n(o,"H2",{class:!0});var em=s(Ye);ro=n(em,"A",{id:!0,class:!0,href:!0});var D$=s(ro);np=n(D$,"SPAN",{});var P$=s(np);g(Cn.$$.fragment,P$),P$.forEach(t),D$.forEach(t),Hb=p(em),sp=n(em,"SPAN",{});var C$=s(sp);Vb=i(C$,"FlaxStableDiffusionControlNetPipeline"),C$.forEach(t),em.forEach(t),Wd=p(o),V=n(o,"DIV",{class:!0});var So=s(V);g(Tn.$$.fragment,So),Wb=p(So),rp=n(So,"P",{});var T$=s(rp);Kb=i(T$,"Pipeline for text-to-image generation using Stable Diffusion with ControlNet Guidance."),T$.forEach(t),Yb=p(So),Nn=n(So,"P",{});var tm=s(Nn);Jb=i(tm,"This model inherits from "),lp=n(tm,"CODE",{});var N$=s(lp);Xb=i(N$,"FlaxDiffusionPipeline"),N$.forEach(t),Zb=i(tm,`. Check the superclass documentation for the generic methods the
library implements for all the pipelines (such as downloading or saving, running on a particular device, etc.)`),tm.forEach(t),Qb=p(So),De=n(So,"DIV",{class:!0});var Wr=s(De);g(jn.$$.fragment,Wr),ey=p(Wr),ip=n(Wr,"P",{});var j$=s(ip);ty=i(j$,"Function invoked when calling the pipeline for generation."),j$.forEach(t),oy=p(Wr),g(lo.$$.fragment,Wr),Wr.forEach(t),So.forEach(t),this.h()},h(){r(h,"name","hf:doc:metadata"),r(h,"content",JSON.stringify(V$)),r($,"id","texttoimage-generation-with-controlnet-conditioning"),r($,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r($,"href","#texttoimage-generation-with-controlnet-conditioning"),r(E,"class","relative group"),r(K,"id","overview"),r(K,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(K,"href","#overview"),r(L,"class","relative group"),r(qo,"href","https://arxiv.org/abs/2302.05543"),r(qo,"rel","nofollow"),r(Lo,"href","https://huggingface.co/takuma104"),r(Lo,"rel","nofollow"),r(Fo,"href","https://arxiv.org/abs/2302.05543"),r(Fo,"rel","nofollow"),r(Go,"href","https://github.com/lllyasviel/ControlNet"),r(Go,"rel","nofollow"),r(Ze,"id","available-pipelines"),r(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"),r(Ze,"href","#available-pipelines"),r(Te,"class","relative group"),r(Fn,"align","center"),r(Uo,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_controlnet.py"),r(Uo,"rel","nofollow"),r(Ro,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/controlnet.ipynb"),r(Ro,"rel","nofollow"),r(Gn,"align","center"),r(et,"id","usage-example"),r(et,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(et,"href","#usage-example"),r(Ae,"class","relative group"),r(Un,"href","/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/controlnet#diffusers.StableDiffusionControlNetPipeline"),r(On,"start","2"),r(Ho,"href","https://huggingface.co/lllyasviel/sd-controlnet-canny"),r(Ho,"rel","nofollow"),w(zn.src,ny="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/input_image_vermeer.png")||r(zn,"src",ny),r(zn,"alt","img"),r(Bn,"href","#controlnet-with-stable-diffusion-1.5"),w(Jn.src,sy="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/vermeer_canny_edged.png")||r(Jn,"src",sy),r(Jn,"alt","img"),r(Xn,"href","runwayml/stable-diffusion-v1-5"),r(Zn,"href","/docs/diffusers/v0.16.0/en/api/schedulers/unipc#diffusers.UniPCMultistepScheduler"),w(os.src,ry="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/vermeer_disco_dancing.png")||r(os,"src",ry),r(os,"alt","img"),r(as,"href","#controlnet-with-stable-diffusion-1.5"),r(rt,"id","combining-multiple-conditionings"),r(rt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(rt,"href","#combining-multiple-conditionings"),r(Ie,"class","relative group"),r(ct,"id","canny-conditioning"),r(ct,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(ct,"href","#canny-conditioning"),r(Me,"class","relative group"),w(rs.src,ly="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/landscape.png")||r(rs,"src",ly),w(is.src,iy="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/controlnet/landscape_canny_masked.png")||r(is,"src",iy),r(pt,"id","openpose-conditioning"),r(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"),r(pt,"href","#openpose-conditioning"),r(qe,"class","relative group"),w(aa.src,cy="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/person.png")||r(aa,"src",cy),r(aa,"width","600"),w(sa.src,py="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/controlnet/person_pose.png")||r(sa,"src",py),r(sa,"width","600"),r(dt,"id","running-controlnet-with-multiple-conditionings"),r(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"),r(dt,"href","#running-controlnet-with-multiple-conditionings"),r(Le,"class","relative group"),w(ia.src,dy="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/controlnet/multi_controlnet_output.png")||r(ia,"src",dy),r(ia,"width","600"),r(ft,"id","guess-mode"),r(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"),r(ft,"href","#guess-mode"),r(Fe,"class","relative group"),r(pa,"href","https://github.com/lllyasviel/ControlNet#guess-mode--non-prompt-mode"),r(pa,"rel","nofollow"),r(da,"href","https://arxiv.org/abs/2302.05543"),r(da,"rel","nofollow"),r(mt,"id","the-core-implementation"),r(mt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(mt,"href","#the-core-implementation"),r(Ge,"class","relative group"),r(ut,"id","usage"),r(ut,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(ut,"href","#usage"),r(Oe,"class","relative group"),r(ha,"href","https://github.com/lllyasviel/ControlNet#guess-mode--non-prompt-mode"),r(ha,"rel","nofollow"),r(gt,"id","output-image-comparison"),r(gt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(gt,"href","#output-image-comparison"),r(Ue,"class","relative group"),r(ms,"width","128"),w(ms.src,fy="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_guess_mode/output_images/diffusers/output_bird_canny_0.png")||r(ms,"src",fy),r(fs,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_guess_mode/output_images/diffusers/output_bird_canny_0.png"),r(us,"width","128"),w(us.src,my="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_guess_mode/output_images/diffusers/output_bird_canny_0_gm.png")||r(us,"src",my),r(hs,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare_guess_mode/output_images/diffusers/output_bird_canny_0_gm.png"),r(vt,"id","available-checkpoints"),r(vt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(vt,"href","#available-checkpoints"),r(Re,"class","relative group"),r(ya,"href","https://huggingface.co/lllyasviel"),r(ya,"rel","nofollow"),r(gs,"href","#controlnet-v1.1"),r(yt,"id","controlnet-v10"),r(yt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(yt,"href","#controlnet-v10"),r(Be,"class","relative group"),r(Ea,"href","https://huggingface.co/lllyasviel/sd-controlnet-canny"),r(Ea,"rel","nofollow"),r($t,"width","64"),A($t,"margin","0"),A($t,"padding","0"),w($t.src,hy="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_bird_canny.png")||r($t,"src",hy),r(_s,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_bird_canny.png"),r(bs,"width","64"),w(bs.src,uy="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_bird_canny_1.png")||r(bs,"src",uy),r(vs,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_bird_canny_1.png"),r($a,"href","https://huggingface.co/lllyasviel/sd-controlnet-depth"),r($a,"rel","nofollow"),r(ws,"width","64"),w(ws.src,gy="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_vermeer_depth.png")||r(ws,"src",gy),r(ys,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_vermeer_depth.png"),r($s,"width","64"),w($s.src,_y="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_vermeer_depth_2.png")||r($s,"src",_y),r(Es,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_vermeer_depth_2.png"),r(xa,"href","https://huggingface.co/lllyasviel/sd-controlnet-hed"),r(xa,"rel","nofollow"),r(ks,"width","64"),w(ks.src,vy="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_bird_hed.png")||r(ks,"src",vy),r(xs,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_bird_hed.png"),r(Ps,"width","64"),w(Ps.src,by="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_bird_hed_1.png")||r(Ps,"src",by),r(Ds,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_bird_hed_1.png"),r(ka,"href","https://huggingface.co/lllyasviel/sd-controlnet-mlsd"),r(ka,"rel","nofollow"),r(Ts,"width","64"),w(Ts.src,yy="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_room_mlsd.png")||r(Ts,"src",yy),r(Cs,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_room_mlsd.png"),r(js,"width","64"),w(js.src,wy="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_room_mlsd_0.png")||r(js,"src",wy),r(Ns,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_room_mlsd_0.png"),r(Da,"href","https://huggingface.co/lllyasviel/sd-controlnet-normal"),r(Da,"rel","nofollow"),r(Ca,"href","https://en.wikipedia.org/wiki/Normal_mapping"),r(Ca,"rel","nofollow"),r(Ss,"width","64"),w(Ss.src,Ey="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_human_normal.png")||r(Ss,"src",Ey),r(As,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_human_normal.png"),r(Ms,"width","64"),w(Ms.src,$y="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_human_normal_1.png")||r(Ms,"src",$y),r(Is,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_human_normal_1.png"),r(Ta,"href","https://huggingface.co/lllyasviel/sd-controlnet_openpose"),r(Ta,"rel","nofollow"),r(ja,"href","https://github.com/CMU-Perceptual-Computing-Lab/openpose"),r(ja,"rel","nofollow"),r(Ls,"width","64"),w(Ls.src,xy="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_human_openpose.png")||r(Ls,"src",xy),r(qs,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_human_openpose.png"),r(Gs,"width","64"),w(Gs.src,ky="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_human_openpose_0.png")||r(Gs,"src",ky),r(Fs,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_human_openpose_0.png"),r(Aa,"href","https://huggingface.co/lllyasviel/sd-controlnet_scribble"),r(Aa,"rel","nofollow"),r(Us,"width","64"),w(Us.src,Dy="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_vermeer_scribble.png")||r(Us,"src",Dy),r(Os,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_vermeer_scribble.png"),r(zs,"width","64"),w(zs.src,Py="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_vermeer_scribble_0.png")||r(zs,"src",Py),r(Rs,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_vermeer_scribble_0.png"),r(Ia,"href","https://huggingface.co/lllyasviel/sd-controlnet_seg"),r(Ia,"rel","nofollow"),r(qa,"href","https://groups.csail.mit.edu/vision/datasets/ADE20K/"),r(qa,"rel","nofollow"),r(Hs,"width","64"),w(Hs.src,Cy="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/control_images/converted/control_room_seg.png")||r(Hs,"src",Cy),r(Bs,"href","https://huggingface.co/takuma104/controlnet_dev/blob/main/gen_compare/control_images/converted/control_room_seg.png"),r(Ws,"width","64"),w(Ws.src,Ty="https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_room_seg_1.png")||r(Ws,"src",Ty),r(Vs,"href","https://huggingface.co/takuma104/controlnet_dev/resolve/main/gen_compare/output_images/diffusers/output_room_seg_1.png"),r(Nt,"id","controlnet-v11"),r(Nt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(Nt,"href","#controlnet-v11"),r(He,"class","relative group"),r(Fa,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_canny"),r(Fa,"rel","nofollow"),r(St,"width","64"),A(St,"margin","0"),A(St,"padding","0"),w(St.src,Ny="https://huggingface.co/lllyasviel/control_v11p_sd15_canny/resolve/main/images/control.png")||r(St,"src",Ny),r(Ks,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_canny/resolve/main/images/control.png"),r(Js,"width","64"),w(Js.src,jy="https://huggingface.co/lllyasviel/control_v11p_sd15_canny/resolve/main/images/image_out.png")||r(Js,"src",jy),r(Ys,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_canny/resolve/main/images/image_out.png"),r(Ga,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p"),r(Ga,"rel","nofollow"),r(Mt,"width","64"),A(Mt,"margin","0"),A(Mt,"padding","0"),w(Mt.src,Ay="https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p/resolve/main/images/control.png")||r(Mt,"src",Ay),r(Xs,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p/resolve/main/images/control.png"),r(Qs,"width","64"),w(Qs.src,Sy="https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p/resolve/main/images/image_out.png")||r(Qs,"src",Sy),r(Zs,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_ip2p/resolve/main/images/image_out.png"),r(Ua,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint"),r(Ua,"rel","nofollow"),r(qt,"width","64"),A(qt,"margin","0"),A(qt,"padding","0"),w(qt.src,Iy="https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint/resolve/main/images/control.png")||r(qt,"src",Iy),r(er,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint/resolve/main/images/control.png"),r(or,"width","64"),w(or.src,My="https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint/resolve/main/images/output.png")||r(or,"src",My),r(tr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_inpaint/resolve/main/images/output.png"),r(za,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd"),r(za,"rel","nofollow"),r(Lt,"width","64"),A(Lt,"margin","0"),A(Lt,"padding","0"),w(Lt.src,qy="https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd/resolve/main/images/control.png")||r(Lt,"src",qy),r(ar,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd/resolve/main/images/control.png"),r(sr,"width","64"),w(sr.src,Ly="https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd/resolve/main/images/image_out.png")||r(sr,"src",Ly),r(nr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_mlsd/resolve/main/images/image_out.png"),r(Ha,"href","https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth"),r(Ha,"rel","nofollow"),r(Ft,"width","64"),A(Ft,"margin","0"),A(Ft,"padding","0"),w(Ft.src,Fy="https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth/resolve/main/images/control.png")||r(Ft,"src",Fy),r(rr,"href","https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth/resolve/main/images/control.png"),r(ir,"width","64"),w(ir.src,Gy="https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth/resolve/main/images/image_out.png")||r(ir,"src",Gy),r(lr,"href","https://huggingface.co/lllyasviel/control_v11f1p_sd15_depth/resolve/main/images/image_out.png"),r(Wa,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae"),r(Wa,"rel","nofollow"),r(Gt,"width","64"),A(Gt,"margin","0"),A(Gt,"padding","0"),w(Gt.src,Oy="https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae/resolve/main/images/control.png")||r(Gt,"src",Oy),r(cr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae/resolve/main/images/control.png"),r(dr,"width","64"),w(dr.src,Uy="https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae/resolve/main/images/image_out.png")||r(dr,"src",Uy),r(pr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_normalbae/resolve/main/images/image_out.png"),r(Ya,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_seg"),r(Ya,"rel","nofollow"),r(Ot,"width","64"),A(Ot,"margin","0"),A(Ot,"padding","0"),w(Ot.src,Ry="https://huggingface.co/lllyasviel/control_v11p_sd15_seg/resolve/main/images/control.png")||r(Ot,"src",Ry),r(fr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_seg/resolve/main/images/control.png"),r(hr,"width","64"),w(hr.src,zy="https://huggingface.co/lllyasviel/control_v11p_sd15_seg/resolve/main/images/image_out.png")||r(hr,"src",zy),r(mr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_seg/resolve/main/images/image_out.png"),r(Xa,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_lineart"),r(Xa,"rel","nofollow"),r(Ut,"width","64"),A(Ut,"margin","0"),A(Ut,"padding","0"),w(Ut.src,By="https://huggingface.co/lllyasviel/control_v11p_sd15_lineart/resolve/main/images/control.png")||r(Ut,"src",By),r(ur,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_lineart/resolve/main/images/control.png"),r(_r,"width","64"),w(_r.src,Hy="https://huggingface.co/lllyasviel/control_v11p_sd15_lineart/resolve/main/images/image_out.png")||r(_r,"src",Hy),r(gr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_lineart/resolve/main/images/image_out.png"),r(Qa,"href","https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime"),r(Qa,"rel","nofollow"),r(Rt,"width","64"),A(Rt,"margin","0"),A(Rt,"padding","0"),w(Rt.src,Vy="https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime/resolve/main/images/control.png")||r(Rt,"src",Vy),r(vr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime/resolve/main/images/control.png"),r(yr,"width","64"),w(yr.src,Wy="https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime/resolve/main/images/image_out.png")||r(yr,"src",Wy),r(br,"href","https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime/resolve/main/images/image_out.png"),r(tn,"href","https://huggingface.co/lllyasviel/control_v11p_sd15s2_lineart_anime"),r(tn,"rel","nofollow"),r(zt,"width","64"),A(zt,"margin","0"),A(zt,"padding","0"),w(zt.src,Ky="https://huggingface.co/lllyasviel/control_v11p_sd15_openpose/resolve/main/images/control.png")||r(zt,"src",Ky),r(wr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_openpose/resolve/main/images/control.png"),r($r,"width","64"),w($r.src,Yy="https://huggingface.co/lllyasviel/control_v11p_sd15_openpose/resolve/main/images/image_out.png")||r($r,"src",Yy),r(Er,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_openpose/resolve/main/images/image_out.png"),r(an,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_scribble"),r(an,"rel","nofollow"),r(Bt,"width","64"),A(Bt,"margin","0"),A(Bt,"padding","0"),w(Bt.src,Jy="https://huggingface.co/lllyasviel/control_v11p_sd15_scribble/resolve/main/images/control.png")||r(Bt,"src",Jy),r(xr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_scribble/resolve/main/images/control.png"),r(Dr,"width","64"),w(Dr.src,Xy="https://huggingface.co/lllyasviel/control_v11p_sd15_scribble/resolve/main/images/image_out.png")||r(Dr,"src",Xy),r(kr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_scribble/resolve/main/images/image_out.png"),r(sn,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_softedge"),r(sn,"rel","nofollow"),r(Ht,"width","64"),A(Ht,"margin","0"),A(Ht,"padding","0"),w(Ht.src,Zy="https://huggingface.co/lllyasviel/control_v11p_sd15_softedge/resolve/main/images/control.png")||r(Ht,"src",Zy),r(Pr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_softedge/resolve/main/images/control.png"),r(Tr,"width","64"),w(Tr.src,Qy="https://huggingface.co/lllyasviel/control_v11p_sd15_softedge/resolve/main/images/image_out.png")||r(Tr,"src",Qy),r(Cr,"href","https://huggingface.co/lllyasviel/control_v11p_sd15_softedge/resolve/main/images/image_out.png"),r(ln,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle"),r(ln,"rel","nofollow"),r(Vt,"width","64"),A(Vt,"margin","0"),A(Vt,"padding","0"),w(Vt.src,ew="https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle/resolve/main/images/control.png")||r(Vt,"src",ew),r(Nr,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle/resolve/main/images/control.png"),r(Ar,"width","64"),w(Ar.src,tw="https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle/resolve/main/images/image_out.png")||r(Ar,"src",tw),r(jr,"href","https://huggingface.co/lllyasviel/control_v11e_sd15_shuffle/resolve/main/images/image_out.png"),r(Wt,"id","diffusers.StableDiffusionControlNetPipeline"),r(Wt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(Wt,"href","#diffusers.StableDiffusionControlNetPipeline"),r(Ve,"class","relative group"),r(Sr,"href","/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),r(Ir,"href","/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.load_textual_inversion"),r(Ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(Yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(Jt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(Zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(ao,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(no,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(so,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(ro,"id","diffusers.FlaxStableDiffusionControlNetPipeline"),r(ro,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(ro,"href","#diffusers.FlaxStableDiffusionControlNetPipeline"),r(Ye,"class","relative group"),r(De,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),r(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,d){e(document.head,h),f(o,C,d),f(o,E,d),e(E,$),e($,T),_(m,T,null),e(E,x),e(E,M),e(M,k),f(o,N,d),f(o,L,d),e(L,K),e(K,Kr),_(Io,Kr,null),e(L,om),e(L,Yr),e(Yr,am),f(o,Pp,d),f(o,Mo,d),e(Mo,qo),e(qo,nm),e(Mo,sm),f(o,Cp,d),f(o,In,d),e(In,rm),f(o,Tp,d),f(o,Mn,d),e(Mn,lm),f(o,Np,d),f(o,qn,d),e(qn,Jr),e(Jr,im),f(o,jp,d),f(o,Je,d),e(Je,cm),e(Je,Lo),e(Lo,pm),e(Je,dm),f(o,Ap,d),f(o,Ln,d),e(Ln,fm),f(o,Sp,d),f(o,Xe,d),e(Xe,Xr),e(Xr,Fo),e(Fo,mm),e(Xe,hm),e(Xe,Zr),e(Zr,Go),e(Go,um),f(o,Ip,d),f(o,Te,d),e(Te,Ze),e(Ze,Qr),_(Oo,Qr,null),e(Te,gm),e(Te,el),e(el,_m),f(o,Mp,d),f(o,Qe,d),e(Qe,tl),e(tl,Ne),e(Ne,ol),e(ol,vm),e(Ne,bm),e(Ne,al),e(al,ym),e(Ne,wm),e(Ne,Fn),e(Fn,Em),e(Qe,$m),e(Qe,nl),e(nl,je),e(je,sl),e(sl,Uo),e(Uo,xm),e(je,km),e(je,rl),e(rl,ll),e(ll,Dm),e(je,Pm),e(je,Gn),e(Gn,Ro),e(Ro,Cm),f(o,qp,d),f(o,Ae,d),e(Ae,et),e(et,il),_(zo,il,null),e(Ae,Tm),e(Ae,cl),e(cl,Nm),f(o,Lp,d),f(o,tt,d),e(tt,jm),e(tt,pl),e(pl,Am),e(tt,Sm),f(o,Fp,d),f(o,ot,d),e(ot,dl),e(dl,fl),e(fl,ml),e(ml,Im),e(ot,Mm),e(ot,hl),e(hl,On),e(On,Bo),e(Bo,qm),e(Bo,Un),e(Un,Lm),e(Bo,Fm),f(o,Gp,d),f(o,at,d),e(at,Gm),e(at,Ho),e(Ho,Om),e(at,Um),f(o,Op,d),_(Vo,o,d),f(o,Up,d),f(o,Rn,d),e(Rn,zn),f(o,Rp,d),f(o,ve,d),e(ve,Rm),e(ve,ul),e(ul,zm),e(ve,Bm),e(ve,Bn),e(Bn,Hm),e(ve,Vm),f(o,zp,d),f(o,Hn,d),e(Hn,Wm),f(o,Bp,d),_(Wo,o,d),f(o,Hp,d),f(o,Vn,d),e(Vn,Km),f(o,Vp,d),_(Ko,o,d),f(o,Wp,d),f(o,Wn,d),e(Wn,Ym),f(o,Kp,d),_(Yo,o,d),f(o,Yp,d),f(o,Kn,d),e(Kn,Jm),f(o,Jp,d),f(o,Yn,d),e(Yn,Jn),f(o,Xp,d),f(o,nt,d),e(nt,Xm),e(nt,Xn),e(Xn,Zm),e(nt,Qm),f(o,Zp,d),_(Jo,o,d),f(o,Qp,d),f(o,st,d),e(st,eh),e(st,Zn),e(Zn,th),e(st,oh),f(o,ed,d),_(Xo,o,d),f(o,td,d),f(o,Qn,d),e(Qn,ah),f(o,od,d),_(Zo,o,d),f(o,ad,d),f(o,es,d),e(es,nh),f(o,nd,d),f(o,ts,d),e(ts,os),f(o,sd,d),f(o,Se,d),e(Se,gl),e(gl,sh),e(Se,rh),e(Se,as),e(as,lh),e(Se,ih),f(o,rd,d),f(o,Ie,d),e(Ie,rt),e(rt,_l),_(Qo,_l,null),e(Ie,ch),e(Ie,vl),e(vl,ph),f(o,ld,d),f(o,lt,d),e(lt,dh),e(lt,bl),e(bl,fh),e(lt,mh),f(o,id,d),f(o,ns,d),e(ns,hh),f(o,cd,d),f(o,it,d),e(it,uh),e(it,yl),e(yl,gh),e(it,_h),f(o,pd,d),f(o,Me,d),e(Me,ct),e(ct,wl),_(ea,wl,null),e(Me,vh),e(Me,El),e(El,bh),f(o,dd,d),f(o,ss,d),e(ss,yh),f(o,fd,d),f(o,rs,d),f(o,md,d),f(o,ls,d),e(ls,wh),f(o,hd,d),_(ta,o,d),f(o,ud,d),f(o,is,d),f(o,gd,d),f(o,qe,d),e(qe,pt),e(pt,$l),_(oa,$l,null),e(qe,Eh),e(qe,xl),e(xl,$h),f(o,_d,d),f(o,cs,d),e(cs,xh),f(o,vd,d),f(o,aa,d),f(o,bd,d),f(o,ps,d),e(ps,kh),f(o,yd,d),_(na,o,d),f(o,wd,d),f(o,sa,d),f(o,Ed,d),f(o,Le,d),e(Le,dt),e(dt,kl),_(ra,kl,null),e(Le,Dh),e(Le,Dl),e(Dl,Ph),f(o,$d,d),_(la,o,d),f(o,xd,d),f(o,ia,d),f(o,kd,d),f(o,Fe,d),e(Fe,ft),e(ft,Pl),_(ca,Pl,null),e(Fe,Ch),e(Fe,Cl),e(Cl,Th),f(o,Dd,d),f(o,be,d),e(be,Nh),e(be,pa),e(pa,jh),e(be,Ah),e(be,da),e(da,Sh),e(be,Ih),f(o,Pd,d),f(o,ds,d),e(ds,Tl),e(Tl,Mh),f(o,Cd,d),f(o,Ge,d),e(Ge,mt),e(mt,Nl),_(fa,Nl,null),e(Ge,qh),e(Ge,jl),e(jl,Lh),f(o,Td,d),f(o,ye,d),e(ye,Fh),e(ye,Al),e(Al,Gh),e(ye,Oh),e(ye,Sl),e(Sl,Uh),e(ye,Rh),f(o,Nd,d),f(o,ht,d),e(ht,zh),e(ht,Il),e(Il,Bh),e(ht,Hh),f(o,jd,d),f(o,Oe,d),e(Oe,ut),e(ut,Ml),_(ma,Ml,null),e(Oe,Vh),e(Oe,ql),e(ql,Wh),f(o,Ad,d),f(o,W,d),e(W,Kh),e(W,Ll),e(Ll,Yh),e(W,Jh),e(W,Fl),e(Fl,Xh),e(W,Zh),e(W,ha),e(ha,Qh),e(W,eu),f(o,Sd,d),_(ua,o,d),f(o,Id,d),f(o,Ue,d),e(Ue,gt),e(gt,Gl),_(ga,Gl,null),e(Ue,tu),e(Ue,Ol),e(Ol,ou),f(o,Md,d),f(o,_t,d),e(_t,Ul),e(Ul,_a),e(_a,Rl),e(Rl,au),e(_a,nu),e(_a,zl),e(zl,su),e(_t,ru),e(_t,Bl),e(Bl,va),e(va,Hl),e(Hl,fs),e(fs,ms),e(va,lu),e(va,Vl),e(Vl,hs),e(hs,us),f(o,qd,d),f(o,Re,d),e(Re,vt),e(vt,Wl),_(ba,Wl,null),e(Re,iu),e(Re,Kl),e(Kl,cu),f(o,Ld,d),f(o,we,d),e(we,pu),e(we,Yl),e(Yl,du),e(we,fu),e(we,Jl),e(Jl,mu),e(we,hu),f(o,Fd,d),f(o,bt,d),e(bt,uu),e(bt,ya),e(ya,gu),e(bt,_u),f(o,Gd,d),f(o,ze,d),e(ze,Xl),e(Xl,vu),e(ze,bu),e(ze,gs),e(gs,yu),e(ze,wu),f(o,Od,d),f(o,Be,d),e(Be,yt),e(yt,Zl),_(wa,Zl,null),e(Be,Eu),e(Be,Ql),e(Ql,$u),f(o,Ud,d),f(o,wt,d),e(wt,ei),e(ei,Y),e(Y,ti),e(ti,xu),e(Y,ku),e(Y,oi),e(oi,Du),e(Y,Pu),e(Y,ai),e(ai,Cu),e(Y,Tu),e(Y,ni),e(ni,Nu),e(wt,ju),e(wt,q),e(q,J),e(J,Et),e(Et,Ea),e(Ea,Au),e(Et,Su),e(Et,Iu),e(Et,si),e(si,Mu),e(J,qu),e(J,ri),e(ri,Lu),e(J,Fu),e(J,li),e(li,_s),e(_s,$t),e(J,Gu),e(J,ii),e(ii,vs),e(vs,bs),e(q,Ou),e(q,X),e(X,xt),e(xt,$a),e($a,Uu),e(xt,Ru),e(xt,zu),e(xt,ci),e(ci,Bu),e(X,Hu),e(X,pi),e(pi,Vu),e(X,Wu),e(X,di),e(di,ys),e(ys,ws),e(X,Ku),e(X,fi),e(fi,Es),e(Es,$s),e(q,Yu),e(q,Z),e(Z,kt),e(kt,xa),e(xa,Ju),e(kt,Xu),e(kt,Zu),e(kt,mi),e(mi,Qu),e(Z,eg),e(Z,hi),e(hi,tg),e(Z,og),e(Z,ui),e(ui,xs),e(xs,ks),e(Z,ag),e(Z,gi),e(gi,Ds),e(Ds,Ps),e(q,ng),e(q,Q),e(Q,Dt),e(Dt,ka),e(ka,sg),e(Dt,rg),e(Dt,lg),e(Dt,_i),e(_i,ig),e(Q,cg),e(Q,vi),e(vi,pg),e(Q,dg),e(Q,bi),e(bi,Cs),e(Cs,Ts),e(Q,fg),e(Q,yi),e(yi,Ns),e(Ns,js),e(q,mg),e(q,ee),e(ee,Pt),e(Pt,Da),e(Da,hg),e(Pt,ug),e(Pt,gg),e(Pt,wi),e(wi,_g),e(ee,vg),e(ee,Pa),e(Pa,bg),e(Pa,Ca),e(Ca,yg),e(Pa,wg),e(ee,Eg),e(ee,Ei),e(Ei,As),e(As,Ss),e(ee,$g),e(ee,$i),e($i,Is),e(Is,Ms),e(q,xg),e(q,te),e(te,Ct),e(Ct,Ta),e(Ta,kg),e(Ct,Dg),e(Ct,Pg),e(Ct,xi),e(xi,Cg),e(te,Tg),e(te,Na),e(Na,Ng),e(Na,ja),e(ja,jg),e(Na,Ag),e(te,Sg),e(te,ki),e(ki,qs),e(qs,Ls),e(te,Ig),e(te,Di),e(Di,Fs),e(Fs,Gs),e(q,Mg),e(q,oe),e(oe,Tt),e(Tt,Aa),e(Aa,qg),e(Tt,Lg),e(Tt,Fg),e(Tt,Pi),e(Pi,Gg),e(oe,Og),e(oe,Ci),e(Ci,Ug),e(oe,Rg),e(oe,Ti),e(Ti,Os),e(Os,Us),e(oe,zg),e(oe,Ni),e(Ni,Rs),e(Rs,zs),e(q,Bg),e(q,ae),e(ae,Sa),e(Sa,Ia),e(Ia,Hg),e(Sa,Vg),e(Sa,ji),e(ji,Wg),e(ae,Kg),e(ae,Ma),e(Ma,Yg),e(Ma,qa),e(qa,Jg),e(Ma,Xg),e(ae,Zg),e(ae,Ai),e(Ai,Bs),e(Bs,Hs),e(ae,Qg),e(ae,Si),e(Si,Vs),e(Vs,Ws),f(o,Rd,d),f(o,He,d),e(He,Nt),e(Nt,Ii),_(La,Ii,null),e(He,e_),e(He,Mi),e(Mi,t_),f(o,zd,d),f(o,jt,d),e(jt,qi),e(qi,ne),e(ne,Li),e(Li,o_),e(ne,a_),e(ne,Fi),e(Fi,n_),e(ne,s_),e(ne,Gi),e(Gi,r_),e(ne,l_),e(ne,Oi),e(Oi,i_),e(jt,c_),e(jt,j),e(j,se),e(se,At),e(At,Fa),e(Fa,p_),e(At,d_),e(At,f_),e(At,Ui),e(Ui,m_),e(se,h_),e(se,Ri),e(Ri,u_),e(se,g_),e(se,zi),e(zi,Ks),e(Ks,St),e(se,__),e(se,Bi),e(Bi,Ys),e(Ys,Js),e(j,v_),e(j,re),e(re,It),e(It,Ga),e(Ga,b_),e(It,y_),e(It,w_),e(It,Hi),e(Hi,E_),e(re,$_),e(re,Vi),e(Vi,x_),e(re,k_),e(re,Wi),e(Wi,Xs),e(Xs,Mt),e(re,D_),e(re,Ki),e(Ki,Zs),e(Zs,Qs),e(j,P_),e(j,le),e(le,Oa),e(Oa,Ua),e(Ua,C_),e(Oa,T_),e(Oa,N_),e(le,j_),e(le,Yi),e(Yi,A_),e(le,S_),e(le,Ji),e(Ji,er),e(er,qt),e(le,I_),e(le,Xi),e(Xi,tr),e(tr,or),e(j,M_),e(j,ie),e(ie,Ra),e(Ra,za),e(za,q_),e(Ra,L_),e(Ra,F_),e(ie,G_),e(ie,Zi),e(Zi,O_),e(ie,U_),e(ie,Qi),e(Qi,ar),e(ar,Lt),e(ie,R_),e(ie,ec),e(ec,nr),e(nr,sr),e(j,z_),e(j,ce),e(ce,Ba),e(Ba,Ha),e(Ha,B_),e(Ba,H_),e(Ba,V_),e(ce,W_),e(ce,tc),e(tc,K_),e(ce,Y_),e(ce,oc),e(oc,rr),e(rr,Ft),e(ce,J_),e(ce,ac),e(ac,lr),e(lr,ir),e(j,X_),e(j,pe),e(pe,Va),e(Va,Wa),e(Wa,Z_),e(Va,Q_),e(Va,ev),e(pe,tv),e(pe,nc),e(nc,ov),e(pe,av),e(pe,sc),e(sc,cr),e(cr,Gt),e(pe,nv),e(pe,rc),e(rc,pr),e(pr,dr),e(j,sv),e(j,de),e(de,Ka),e(Ka,Ya),e(Ya,rv),e(Ka,lv),e(Ka,iv),e(de,cv),e(de,lc),e(lc,pv),e(de,dv),e(de,ic),e(ic,fr),e(fr,Ot),e(de,fv),e(de,cc),e(cc,mr),e(mr,hr),e(j,mv),e(j,fe),e(fe,Ja),e(Ja,Xa),e(Xa,hv),e(Ja,uv),e(Ja,gv),e(fe,_v),e(fe,pc),e(pc,vv),e(fe,bv),e(fe,dc),e(dc,ur),e(ur,Ut),e(fe,yv),e(fe,fc),e(fc,gr),e(gr,_r),e(j,wv),e(j,me),e(me,Za),e(Za,Qa),e(Qa,Ev),e(Za,$v),e(Za,xv),e(me,kv),e(me,mc),e(mc,Dv),e(me,Pv),e(me,hc),e(hc,vr),e(vr,Rt),e(me,Cv),e(me,uc),e(uc,br),e(br,yr),e(j,Tv),e(j,he),e(he,en),e(en,tn),e(tn,Nv),e(en,jv),e(en,Av),e(he,Sv),e(he,gc),e(gc,Iv),e(he,Mv),e(he,_c),e(_c,wr),e(wr,zt),e(he,qv),e(he,vc),e(vc,Er),e(Er,$r),e(j,Lv),e(j,ue),e(ue,on),e(on,an),e(an,Fv),e(on,Gv),e(on,Ov),e(ue,Uv),e(ue,bc),e(bc,Rv),e(ue,zv),e(ue,yc),e(yc,xr),e(xr,Bt),e(ue,Bv),e(ue,wc),e(wc,kr),e(kr,Dr),e(j,Hv),e(j,ge),e(ge,nn),e(nn,sn),e(sn,Vv),e(nn,Wv),e(nn,Kv),e(ge,Yv),e(ge,Ec),e(Ec,Jv),e(ge,Xv),e(ge,$c),e($c,Pr),e(Pr,Ht),e(ge,Zv),e(ge,xc),e(xc,Cr),e(Cr,Tr),e(j,Qv),e(j,_e),e(_e,rn),e(rn,ln),e(ln,e1),e(rn,t1),e(rn,o1),e(_e,a1),e(_e,kc),e(kc,n1),e(_e,s1),e(_e,Dc),e(Dc,Nr),e(Nr,Vt),e(_e,r1),e(_e,Pc),e(Pc,jr),e(jr,Ar),f(o,Bd,d),f(o,Ve,d),e(Ve,Wt),e(Wt,Cc),_(cn,Cc,null),e(Ve,l1),e(Ve,Tc),e(Tc,i1),f(o,Hd,d),f(o,D,d),_(pn,D,null),e(D,c1),e(D,Nc),e(Nc,p1),e(D,d1),e(D,dn),e(dn,f1),e(dn,Sr),e(Sr,m1),e(dn,h1),e(D,u1),e(D,jc),e(jc,g1),e(D,_1),e(D,Ac),e(Ac,fn),e(fn,Sc),e(Sc,v1),e(fn,b1),e(fn,Ir),e(Ir,y1),e(D,w1),e(D,Ee),_(mn,Ee,null),e(Ee,E1),e(Ee,Ic),e(Ic,$1),e(Ee,x1),_(Kt,Ee,null),e(D,k1),e(D,$e),_(hn,$e,null),e($e,D1),e($e,Mc),e(Mc,P1),e($e,C1),e($e,qc),e(qc,T1),e(D,N1),e(D,Yt),_(un,Yt,null),e(Yt,j1),e(Yt,gn),e(gn,A1),e(gn,Lc),e(Lc,S1),e(gn,I1),e(D,M1),e(D,xe),_(_n,xe,null),e(xe,q1),e(xe,Fc),e(Fc,L1),e(xe,F1),e(xe,Gc),e(Gc,G1),e(D,O1),e(D,Jt),_(vn,Jt,null),e(Jt,U1),e(Jt,bn),e(bn,R1),e(bn,Oc),e(Oc,z1),e(bn,B1),e(D,H1),e(D,B),_(yn,B,null),e(B,V1),e(B,Uc),e(Uc,W1),e(B,K1),e(B,Rc),e(Rc,Y1),e(B,J1),e(B,zc),e(zc,X1),e(B,Z1),_(Xt,B,null),e(D,Q1),e(D,Zt),_(wn,Zt,null),e(Zt,eb),e(Zt,Bc),e(Bc,tb),e(D,ob),e(D,I),_(En,I,null),e(I,ab),e(I,We),e(We,nb),e(We,Hc),e(Hc,sb),e(We,rb),e(We,Vc),e(Vc,lb),e(We,ib),e(I,cb),_(Qt,I,null),e(I,pb),_(eo,I,null),e(I,db),e(I,Wc),e(Wc,fb),e(I,mb),_(to,I,null),e(I,hb),e(I,Kc),e(Kc,ub),e(I,gb),_(oo,I,null),e(D,_b),e(D,ao),_($n,ao,null),e(ao,vb),e(ao,xn),e(xn,bb),e(xn,Yc),e(Yc,yb),e(xn,wb),e(D,Eb),e(D,no),_(kn,no,null),e(no,$b),e(no,H),e(H,xb),e(H,Jc),e(Jc,kb),e(H,Db),e(H,Xc),e(Xc,Pb),e(H,Cb),e(H,Zc),e(Zc,Tb),e(H,Nb),e(H,Qc),e(Qc,jb),e(H,Ab),e(D,Sb),e(D,so),_(Dn,so,null),e(so,Ib),e(so,Ke),e(Ke,Mb),e(Ke,ep),e(ep,qb),e(Ke,Lb),e(Ke,tp),e(tp,Fb),e(Ke,Gb),e(D,Ob),e(D,ke),_(Pn,ke,null),e(ke,Ub),e(ke,op),e(op,Rb),e(ke,zb),e(ke,ap),e(ap,Bb),f(o,Vd,d),f(o,Ye,d),e(Ye,ro),e(ro,np),_(Cn,np,null),e(Ye,Hb),e(Ye,sp),e(sp,Vb),f(o,Wd,d),f(o,V,d),_(Tn,V,null),e(V,Wb),e(V,rp),e(rp,Kb),e(V,Yb),e(V,Nn),e(Nn,Jb),e(Nn,lp),e(lp,Xb),e(Nn,Zb),e(V,Qb),e(V,De),_(jn,De,null),e(De,ey),e(De,ip),e(ip,ty),e(De,oy),_(lo,De,null),Kd=!0},p(o,[d]){const An={};d&2&&(An.$$scope={dirty:d,ctx:o}),Kt.$set(An);const cp={};d&2&&(cp.$$scope={dirty:d,ctx:o}),Xt.$set(cp);const pp={};d&2&&(pp.$$scope={dirty:d,ctx:o}),Qt.$set(pp);const dp={};d&2&&(dp.$$scope={dirty:d,ctx:o}),eo.$set(dp);const Sn={};d&2&&(Sn.$$scope={dirty:d,ctx:o}),to.$set(Sn);const fp={};d&2&&(fp.$$scope={dirty:d,ctx:o}),oo.$set(fp);const mp={};d&2&&(mp.$$scope={dirty:d,ctx:o}),lo.$set(mp)},i(o){Kd||(v(m.$$.fragment,o),v(Io.$$.fragment,o),v(Oo.$$.fragment,o),v(zo.$$.fragment,o),v(Vo.$$.fragment,o),v(Wo.$$.fragment,o),v(Ko.$$.fragment,o),v(Yo.$$.fragment,o),v(Jo.$$.fragment,o),v(Xo.$$.fragment,o),v(Zo.$$.fragment,o),v(Qo.$$.fragment,o),v(ea.$$.fragment,o),v(ta.$$.fragment,o),v(oa.$$.fragment,o),v(na.$$.fragment,o),v(ra.$$.fragment,o),v(la.$$.fragment,o),v(ca.$$.fragment,o),v(fa.$$.fragment,o),v(ma.$$.fragment,o),v(ua.$$.fragment,o),v(ga.$$.fragment,o),v(ba.$$.fragment,o),v(wa.$$.fragment,o),v(La.$$.fragment,o),v(cn.$$.fragment,o),v(pn.$$.fragment,o),v(mn.$$.fragment,o),v(Kt.$$.fragment,o),v(hn.$$.fragment,o),v(un.$$.fragment,o),v(_n.$$.fragment,o),v(vn.$$.fragment,o),v(yn.$$.fragment,o),v(Xt.$$.fragment,o),v(wn.$$.fragment,o),v(En.$$.fragment,o),v(Qt.$$.fragment,o),v(eo.$$.fragment,o),v(to.$$.fragment,o),v(oo.$$.fragment,o),v($n.$$.fragment,o),v(kn.$$.fragment,o),v(Dn.$$.fragment,o),v(Pn.$$.fragment,o),v(Cn.$$.fragment,o),v(Tn.$$.fragment,o),v(jn.$$.fragment,o),v(lo.$$.fragment,o),Kd=!0)},o(o){b(m.$$.fragment,o),b(Io.$$.fragment,o),b(Oo.$$.fragment,o),b(zo.$$.fragment,o),b(Vo.$$.fragment,o),b(Wo.$$.fragment,o),b(Ko.$$.fragment,o),b(Yo.$$.fragment,o),b(Jo.$$.fragment,o),b(Xo.$$.fragment,o),b(Zo.$$.fragment,o),b(Qo.$$.fragment,o),b(ea.$$.fragment,o),b(ta.$$.fragment,o),b(oa.$$.fragment,o),b(na.$$.fragment,o),b(ra.$$.fragment,o),b(la.$$.fragment,o),b(ca.$$.fragment,o),b(fa.$$.fragment,o),b(ma.$$.fragment,o),b(ua.$$.fragment,o),b(ga.$$.fragment,o),b(ba.$$.fragment,o),b(wa.$$.fragment,o),b(La.$$.fragment,o),b(cn.$$.fragment,o),b(pn.$$.fragment,o),b(mn.$$.fragment,o),b(Kt.$$.fragment,o),b(hn.$$.fragment,o),b(un.$$.fragment,o),b(_n.$$.fragment,o),b(vn.$$.fragment,o),b(yn.$$.fragment,o),b(Xt.$$.fragment,o),b(wn.$$.fragment,o),b(En.$$.fragment,o),b(Qt.$$.fragment,o),b(eo.$$.fragment,o),b(to.$$.fragment,o),b(oo.$$.fragment,o),b($n.$$.fragment,o),b(kn.$$.fragment,o),b(Dn.$$.fragment,o),b(Pn.$$.fragment,o),b(Cn.$$.fragment,o),b(Tn.$$.fragment,o),b(jn.$$.fragment,o),b(lo.$$.fragment,o),Kd=!1},d(o){t(h),o&&t(C),o&&t(E),y(m),o&&t(N),o&&t(L),y(Io),o&&t(Pp),o&&t(Mo),o&&t(Cp),o&&t(In),o&&t(Tp),o&&t(Mn),o&&t(Np),o&&t(qn),o&&t(jp),o&&t(Je),o&&t(Ap),o&&t(Ln),o&&t(Sp),o&&t(Xe),o&&t(Ip),o&&t(Te),y(Oo),o&&t(Mp),o&&t(Qe),o&&t(qp),o&&t(Ae),y(zo),o&&t(Lp),o&&t(tt),o&&t(Fp),o&&t(ot),o&&t(Gp),o&&t(at),o&&t(Op),y(Vo,o),o&&t(Up),o&&t(Rn),o&&t(Rp),o&&t(ve),o&&t(zp),o&&t(Hn),o&&t(Bp),y(Wo,o),o&&t(Hp),o&&t(Vn),o&&t(Vp),y(Ko,o),o&&t(Wp),o&&t(Wn),o&&t(Kp),y(Yo,o),o&&t(Yp),o&&t(Kn),o&&t(Jp),o&&t(Yn),o&&t(Xp),o&&t(nt),o&&t(Zp),y(Jo,o),o&&t(Qp),o&&t(st),o&&t(ed),y(Xo,o),o&&t(td),o&&t(Qn),o&&t(od),y(Zo,o),o&&t(ad),o&&t(es),o&&t(nd),o&&t(ts),o&&t(sd),o&&t(Se),o&&t(rd),o&&t(Ie),y(Qo),o&&t(ld),o&&t(lt),o&&t(id),o&&t(ns),o&&t(cd),o&&t(it),o&&t(pd),o&&t(Me),y(ea),o&&t(dd),o&&t(ss),o&&t(fd),o&&t(rs),o&&t(md),o&&t(ls),o&&t(hd),y(ta,o),o&&t(ud),o&&t(is),o&&t(gd),o&&t(qe),y(oa),o&&t(_d),o&&t(cs),o&&t(vd),o&&t(aa),o&&t(bd),o&&t(ps),o&&t(yd),y(na,o),o&&t(wd),o&&t(sa),o&&t(Ed),o&&t(Le),y(ra),o&&t($d),y(la,o),o&&t(xd),o&&t(ia),o&&t(kd),o&&t(Fe),y(ca),o&&t(Dd),o&&t(be),o&&t(Pd),o&&t(ds),o&&t(Cd),o&&t(Ge),y(fa),o&&t(Td),o&&t(ye),o&&t(Nd),o&&t(ht),o&&t(jd),o&&t(Oe),y(ma),o&&t(Ad),o&&t(W),o&&t(Sd),y(ua,o),o&&t(Id),o&&t(Ue),y(ga),o&&t(Md),o&&t(_t),o&&t(qd),o&&t(Re),y(ba),o&&t(Ld),o&&t(we),o&&t(Fd),o&&t(bt),o&&t(Gd),o&&t(ze),o&&t(Od),o&&t(Be),y(wa),o&&t(Ud),o&&t(wt),o&&t(Rd),o&&t(He),y(La),o&&t(zd),o&&t(jt),o&&t(Bd),o&&t(Ve),y(cn),o&&t(Hd),o&&t(D),y(pn),y(mn),y(Kt),y(hn),y(un),y(_n),y(vn),y(yn),y(Xt),y(wn),y(En),y(Qt),y(eo),y(to),y(oo),y($n),y(kn),y(Dn),y(Pn),o&&t(Vd),o&&t(Ye),y(Cn),o&&t(Wd),o&&t(V),y(Tn),y(jn),y(lo)}}}const V$={local:"texttoimage-generation-with-controlnet-conditioning",sections:[{local:"overview",title:"Overview"},{local:"available-pipelines",title:"Available Pipelines:"},{local:"usage-example",title:"Usage example"},{local:"combining-multiple-conditionings",sections:[{local:"canny-conditioning",title:"Canny conditioning"},{local:"openpose-conditioning",title:"Openpose conditioning"},{local:"running-controlnet-with-multiple-conditionings",title:"Running ControlNet with multiple conditionings"},{local:"guess-mode",sections:[{local:"the-core-implementation",title:"The core implementation:"},{local:"usage",title:"Usage:"},{local:"output-image-comparison",title:"Output image comparison:"}],title:"Guess Mode"}],title:"Combining multiple conditionings"},{local:"available-checkpoints",sections:[{local:"controlnet-v10",title:"ControlNet v1.0"},{local:"controlnet-v11",title:"ControlNet v1.1"}],title:"Available checkpoints"},{local:"diffusers.StableDiffusionControlNetPipeline",title:"StableDiffusionControlNetPipeline"},{local:"diffusers.FlaxStableDiffusionControlNetPipeline",title:"FlaxStableDiffusionControlNetPipeline"}],title:"Text-to-Image Generation with ControlNet Conditioning"};function W$(G){return L$(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class e3 extends S${constructor(h){super();I$(this,h,W$,H$,M$,{})}}export{e3 as default,V$ as metadata};
