import{s as wo,o as vo,n as R}from"../chunks/scheduler.182ea377.js";import{S as Mo,i as To,g as r,s as a,r as g,A as xo,h as d,f as n,c as s,j,u,x as c,k as I,y as i,a as o,v as h,d as _,t as b,w as y}from"../chunks/index.abf12888.js";import{T as _a}from"../chunks/Tip.230e2334.js";import{D as k}from"../chunks/Docstring.93f6f462.js";import{C as Z}from"../chunks/CodeBlock.57fe6e13.js";import{E as rn}from"../chunks/ExampleCodeBlock.658f5cd6.js";import{H as L}from"../chunks/Heading.16916d63.js";function Uo($){let p,v="Examples:",f,m,w;return m=new Z({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkaWZmdXNlcnMlMjBpbXBvcnQlMjBTdGFibGVEaWZmdXNpb25BZGFwdGVyUGlwZWxpbmUlMkMlMjBUMklBZGFwdGVyJTBBJTBBaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmRpZmZ1c2VycyUyRmRvY3MtaW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZ0MmktYWRhcHRlciUyRmNvbG9yX3JlZi5wbmclMjIlMEEpJTBBJTBBY29sb3JfcGFsZXR0ZSUyMCUzRCUyMGltYWdlLnJlc2l6ZSgoOCUyQyUyMDgpKSUwQWNvbG9yX3BhbGV0dGUlMjAlM0QlMjBjb2xvcl9wYWxldHRlLnJlc2l6ZSgoNTEyJTJDJTIwNTEyKSUyQyUyMHJlc2FtcGxlJTNESW1hZ2UuUmVzYW1wbGluZy5ORUFSRVNUKSUwQSUwQWFkYXB0ZXIlMjAlM0QlMjBUMklBZGFwdGVyLmZyb21fcHJldHJhaW5lZCglMjJUZW5jZW50QVJDJTJGdDJpYWRhcHRlcl9jb2xvcl9zZDE0djElMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvbkFkYXB0ZXJQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyQ29tcFZpcyUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNCUyMiUyQyUwQSUyMCUyMCUyMCUyMGFkYXB0ZXIlM0RhZGFwdGVyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBKSUwQSUwQXBpcGUudG8oJTIyY3VkYSUyMiklMEElMEFvdXRfaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMCUyMkF0JTIwbmlnaHQlMkMlMjBnbG93aW5nJTIwY3ViZXMlMjBpbiUyMGZyb250JTIwb2YlMjB0aGUlMjBiZWFjaCUyMiUyQyUwQSUyMCUyMCUyMCUyMGltYWdlJTNEY29sb3JfcGFsZXR0ZSUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",highlighted:`<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.utils <span class="hljs-keyword">import</span> load_image
<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> StableDiffusionAdapterPipeline, T2IAdapter

<span class="hljs-meta">&gt;&gt;&gt; </span>image = load_image(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/color_ref.png&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>color_palette = image.resize((<span class="hljs-number">8</span>, <span class="hljs-number">8</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>color_palette = color_palette.resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>), resample=Image.Resampling.NEAREST)

<span class="hljs-meta">&gt;&gt;&gt; </span>adapter = T2IAdapter.from_pretrained(<span class="hljs-string">&quot;TencentARC/t2iadapter_color_sd14v1&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionAdapterPipeline.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>,
<span class="hljs-meta">... </span>    adapter=adapter,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>out_image = pipe(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;At night, glowing cubes in front of the beach&quot;</span>,
<span class="hljs-meta">... </span>    image=color_palette,
<span class="hljs-meta">... </span>).images[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){p=r("p"),p.textContent=v,f=a(),g(m.$$.fragment)},l(l){p=d(l,"P",{"data-svelte-h":!0}),c(p)!=="svelte-kvfsh7"&&(p.textContent=v),f=s(l),u(m.$$.fragment,l)},m(l,T){o(l,p,T),o(l,f,T),h(m,l,T),w=!0},p:R,i(l){w||(_(m.$$.fragment,l),w=!0)},o(l){b(m.$$.fragment,l),w=!1},d(l){l&&(n(p),n(f)),y(m,l)}}}function Jo($){let p,v=`⚠️ Don’t enable attention slicing if you’re already using <code>scaled_dot_product_attention</code> (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won’t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`;return{c(){p=r("p"),p.innerHTML=v},l(f){p=d(f,"P",{"data-svelte-h":!0}),c(p)!=="svelte-ackzsn"&&(p.innerHTML=v)},m(f,m){o(f,p,m)},p:R,d(f){f&&n(p)}}}function $o($){let p,v="Examples:",f,m,w;return m=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUyQyUwQSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIwb24lMjBtYXJzJTIyJTBBcGlwZS5lbmFibGVfYXR0ZW50aW9uX3NsaWNpbmcoKSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_attention_slicing()
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){p=r("p"),p.textContent=v,f=a(),g(m.$$.fragment)},l(l){p=d(l,"P",{"data-svelte-h":!0}),c(p)!=="svelte-kvfsh7"&&(p.textContent=v),f=s(l),u(m.$$.fragment,l)},m(l,T){o(l,p,T),o(l,f,T),h(m,l,T),w=!0},p:R,i(l){w||(_(m.$$.fragment,l),w=!0)},o(l){b(m.$$.fragment,l),w=!1},d(l){l&&(n(p),n(f)),y(m,l)}}}function jo($){let p,v=`⚠️ When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`;return{c(){p=r("p"),p.textContent=v},l(f){p=d(f,"P",{"data-svelte-h":!0}),c(p)!=="svelte-17p1lpg"&&(p.textContent=v)},m(f,m){o(f,p,m)},p:R,d(f){f&&n(p)}}}function Io($){let p,v="Examples:",f,m,w;return m=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIweGZvcm1lcnMub3BzJTIwaW1wb3J0JTIwTWVtb3J5RWZmaWNpZW50QXR0ZW50aW9uRmxhc2hBdHRlbnRpb25PcCUwQSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKGF0dGVudGlvbl9vcCUzRE1lbW9yeUVmZmljaWVudEF0dGVudGlvbkZsYXNoQXR0ZW50aW9uT3ApJTBBJTIzJTIwV29ya2Fyb3VuZCUyMGZvciUyMG5vdCUyMGFjY2VwdGluZyUyMGF0dGVudGlvbiUyMHNoYXBlJTIwdXNpbmclMjBWQUUlMjBmb3IlMjBGbGFzaCUyMEF0dGVudGlvbiUwQXBpcGUudmFlLmVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbihhdHRlbnRpb25fb3AlM0ROb25lKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Workaround for not accepting attention shape using VAE for Flash Attention</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_xformers_memory_efficient_attention(attention_op=<span class="hljs-literal">None</span>)`,wrap:!1}}),{c(){p=r("p"),p.textContent=v,f=a(),g(m.$$.fragment)},l(l){p=d(l,"P",{"data-svelte-h":!0}),c(p)!=="svelte-kvfsh7"&&(p.textContent=v),f=s(l),u(m.$$.fragment,l)},m(l,T){o(l,p,T),o(l,f,T),h(m,l,T),w=!0},p:R,i(l){w||(_(m.$$.fragment,l),w=!0)},o(l){b(m.$$.fragment,l),w=!1},d(l){l&&(n(p),n(f)),y(m,l)}}}function ko($){let p,v="Examples:",f,m,w;return m=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwVDJJQWRhcHRlciUyQyUyMFN0YWJsZURpZmZ1c2lvblhMQWRhcHRlclBpcGVsaW5lJTJDJTIwRERQTVNjaGVkdWxlciUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBJTBBc2tldGNoX2ltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGQWRhcHRlciUyRnQyaWFkYXB0ZXIlMkZyZXNvbHZlJTJGbWFpbiUyRnNrZXRjaC5wbmclMjIpLmNvbnZlcnQoJTIyTCUyMiklMEElMEFtb2RlbF9pZCUyMCUzRCUyMCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi14bC1iYXNlLTEuMCUyMiUwQSUwQWFkYXB0ZXIlMjAlM0QlMjBUMklBZGFwdGVyLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJBZGFwdGVyJTJGdDJpYWRhcHRlciUyMiUyQyUwQSUyMCUyMCUyMCUyMHN1YmZvbGRlciUzRCUyMnNrZXRjaF9zZHhsXzEuMCUyMiUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUwQSUyMCUyMCUyMCUyMGFkYXB0ZXJfdHlwZSUzRCUyMmZ1bGxfYWRhcHRlcl94bCUyMiUyQyUwQSklMEFzY2hlZHVsZXIlMjAlM0QlMjBERFBNU2NoZWR1bGVyLmZyb21fcHJldHJhaW5lZChtb2RlbF9pZCUyQyUyMHN1YmZvbGRlciUzRCUyMnNjaGVkdWxlciUyMiklMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uWExBZGFwdGVyUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMG1vZGVsX2lkJTJDJTIwYWRhcHRlciUzRGFkYXB0ZXIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUyMHNjaGVkdWxlciUzRHNjaGVkdWxlciUwQSkudG8oJTIyY3VkYSUyMiklMEElMEFnZW5lcmF0b3IlMjAlM0QlMjB0b3JjaC5tYW51YWxfc2VlZCg0MiklMEFza2V0Y2hfaW1hZ2Vfb3V0JTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlM0QlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBkb2clMjBpbiUyMHJlYWwlMjB3b3JsZCUyQyUyMGhpZ2glMjBxdWFsaXR5JTIyJTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfcHJvbXB0JTNEJTIyZXh0cmElMjBkaWdpdCUyQyUyMGZld2VyJTIwZGlnaXRzJTJDJTIwY3JvcHBlZCUyQyUyMHdvcnN0JTIwcXVhbGl0eSUyQyUyMGxvdyUyMHF1YWxpdHklMjIlMkMlMEElMjAlMjAlMjAlMjBpbWFnZSUzRHNrZXRjaF9pbWFnZSUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNENy41JTJDJTBBKS5pbWFnZXMlNUIwJTVE",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> T2IAdapter, StableDiffusionXLAdapterPipeline, DDPMScheduler
<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>sketch_image = load_image(<span class="hljs-string">&quot;https://huggingface.co/Adapter/t2iadapter/resolve/main/sketch.png&quot;</span>).convert(<span class="hljs-string">&quot;L&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>model_id = <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>adapter = T2IAdapter.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Adapter/t2iadapter&quot;</span>,
<span class="hljs-meta">... </span>    subfolder=<span class="hljs-string">&quot;sketch_sdxl_1.0&quot;</span>,
<span class="hljs-meta">... </span>    torch_dtype=torch.float16,
<span class="hljs-meta">... </span>    adapter_type=<span class="hljs-string">&quot;full_adapter_xl&quot;</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>scheduler = DDPMScheduler.from_pretrained(model_id, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = StableDiffusionXLAdapterPipeline.from_pretrained(
<span class="hljs-meta">... </span>    model_id, adapter=adapter, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>, scheduler=scheduler
<span class="hljs-meta">... </span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>generator = torch.manual_seed(<span class="hljs-number">42</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>sketch_image_out = pipe(
<span class="hljs-meta">... </span>    prompt=<span class="hljs-string">&quot;a photo of a dog in real world, high quality&quot;</span>,
<span class="hljs-meta">... </span>    negative_prompt=<span class="hljs-string">&quot;extra digit, fewer digits, cropped, worst quality, low quality&quot;</span>,
<span class="hljs-meta">... </span>    image=sketch_image,
<span class="hljs-meta">... </span>    generator=generator,
<span class="hljs-meta">... </span>    guidance_scale=<span class="hljs-number">7.5</span>,
<span class="hljs-meta">... </span>).images[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){p=r("p"),p.textContent=v,f=a(),g(m.$$.fragment)},l(l){p=d(l,"P",{"data-svelte-h":!0}),c(p)!=="svelte-kvfsh7"&&(p.textContent=v),f=s(l),u(m.$$.fragment,l)},m(l,T){o(l,p,T),o(l,f,T),h(m,l,T),w=!0},p:R,i(l){w||(_(m.$$.fragment,l),w=!0)},o(l){b(m.$$.fragment,l),w=!1},d(l){l&&(n(p),n(f)),y(m,l)}}}function Zo($){let p,v=`⚠️ Don’t enable attention slicing if you’re already using <code>scaled_dot_product_attention</code> (SDPA) from PyTorch
2.0 or xFormers. These attention computations are already very memory efficient so you won’t need to enable
this function. If you enable attention slicing with SDPA or xFormers, it can lead to serious slow downs!`;return{c(){p=r("p"),p.innerHTML=v},l(f){p=d(f,"P",{"data-svelte-h":!0}),c(p)!=="svelte-ackzsn"&&(p.innerHTML=v)},m(f,m){o(f,p,m)},p:R,d(f){f&&n(p)}}}function Co($){let p,v="Examples:",f,m,w;return m=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUyQyUwQSklMEElMEFwcm9tcHQlMjAlM0QlMjAlMjJhJTIwcGhvdG8lMjBvZiUyMGFuJTIwYXN0cm9uYXV0JTIwcmlkaW5nJTIwYSUyMGhvcnNlJTIwb24lMjBtYXJzJTIyJTBBcGlwZS5lbmFibGVfYXR0ZW50aW9uX3NsaWNpbmcoKSUwQWltYWdlJTIwJTNEJTIwcGlwZShwcm9tcHQpLmltYWdlcyU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

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

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;a photo of an astronaut riding a horse on mars&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_attention_slicing()
<span class="hljs-meta">&gt;&gt;&gt; </span>image = pipe(prompt).images[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){p=r("p"),p.textContent=v,f=a(),g(m.$$.fragment)},l(l){p=d(l,"P",{"data-svelte-h":!0}),c(p)!=="svelte-kvfsh7"&&(p.textContent=v),f=s(l),u(m.$$.fragment,l)},m(l,T){o(l,p,T),o(l,f,T),h(m,l,T),w=!0},p:R,i(l){w||(_(m.$$.fragment,l),w=!0)},o(l){b(m.$$.fragment,l),w=!1},d(l){l&&(n(p),n(f)),y(m,l)}}}function Ao($){let p,v=`⚠️ When memory efficient attention and sliced attention are both enabled, memory efficient attention takes
precedent.`;return{c(){p=r("p"),p.textContent=v},l(f){p=d(f,"P",{"data-svelte-h":!0}),c(p)!=="svelte-17p1lpg"&&(p.textContent=v)},m(f,m){o(f,p,m)},p:R,d(f){f&&n(p)}}}function So($){let p,v="Examples:",f,m,w;return m=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEFmcm9tJTIweGZvcm1lcnMub3BzJTIwaW1wb3J0JTIwTWVtb3J5RWZmaWNpZW50QXR0ZW50aW9uRmxhc2hBdHRlbnRpb25PcCUwQSUwQXBpcGUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLTItMSUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwcGlwZS50byglMjJjdWRhJTIyKSUwQXBpcGUuZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uKGF0dGVudGlvbl9vcCUzRE1lbW9yeUVmZmljaWVudEF0dGVudGlvbkZsYXNoQXR0ZW50aW9uT3ApJTBBJTIzJTIwV29ya2Fyb3VuZCUyMGZvciUyMG5vdCUyMGFjY2VwdGluZyUyMGF0dGVudGlvbiUyMHNoYXBlJTIwdXNpbmclMjBWQUUlMjBmb3IlMjBGbGFzaCUyMEF0dGVudGlvbiUwQXBpcGUudmFlLmVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbihhdHRlbnRpb25fb3AlM0ROb25lKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> xformers.ops <span class="hljs-keyword">import</span> MemoryEfficientAttentionFlashAttentionOp

<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-2-1&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe = pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Workaround for not accepting attention shape using VAE for Flash Attention</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>pipe.vae.enable_xformers_memory_efficient_attention(attention_op=<span class="hljs-literal">None</span>)`,wrap:!1}}),{c(){p=r("p"),p.textContent=v,f=a(),g(m.$$.fragment)},l(l){p=d(l,"P",{"data-svelte-h":!0}),c(p)!=="svelte-kvfsh7"&&(p.textContent=v),f=s(l),u(m.$$.fragment,l)},m(l,T){o(l,p,T),o(l,f,T),h(m,l,T),w=!0},p:R,i(l){w||(_(m.$$.fragment,l),w=!0)},o(l){b(m.$$.fragment,l),w=!1},d(l){l&&(n(p),n(f)),y(m,l)}}}function Go($){let p,v,f,m,w,l,T,pn,fe,hs='<a href="https://arxiv.org/abs/2302.08453" rel="nofollow">T2I-Adapter: Learning Adapters to Dig out More Controllable Ability for Text-to-Image Diffusion Models</a> by Chong Mou, Xintao Wang, Liangbin Xie, Jian Zhang, Zhongang Qi, Ying Shan, Xiaohu Qie.',cn,ge,_s="Using the pretrained models we can provide control images (for example, a depth map) to control Stable Diffusion text-to-image generation so that it follows the structure of the depth image and fills in the details.",mn,ue,bs="The abstract of the paper is the following:",fn,he,ys="<em>The incredible generative ability of large-scale text-to-image (T2I) models has demonstrated strong power of learning complex structures and meaningful semantics. However, relying solely on text prompts cannot fully take advantage of the knowledge learned by the model, especially when flexible and accurate controlling (e.g., color and structure) is needed. In this paper, we aim to “dig out” the capabilities that T2I models have implicitly learned, and then explicitly use them to control the generation more granularly. Specifically, we propose to learn simple and lightweight T2I-Adapters to align internal knowledge in T2I models with external control signals, while freezing the original large T2I models. In this way, we can train various adapters according to different conditions, achieving rich control and editing effects in the color and structure of the generation results. Further, the proposed T2I-Adapters have attractive properties of practical value, such as composability and generalization ability. Extensive experiments demonstrate that our T2I-Adapter has promising generation quality and a wide range of applications.</em>",gn,_e,ws='This model was contributed by the community contributor <a href="https://github.com/HimariO" rel="nofollow">HimariO</a> ❤️ .',un,be,hn,ye,vs='<thead><tr><th>Pipeline</th> <th>Tasks</th> <th align="center">Demo</th></tr></thead> <tbody><tr><td><a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py" rel="nofollow">StableDiffusionAdapterPipeline</a></td> <td><em>Text-to-Image Generation with T2I-Adapter Conditioning</em></td> <td align="center">-</td></tr> <tr><td><a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_xl_adapter.py" rel="nofollow">StableDiffusionXLAdapterPipeline</a></td> <td><em>Text-to-Image Generation with T2I-Adapter Conditioning on StableDiffusion-XL</em></td> <td align="center">-</td></tr></tbody>',_n,we,bn,ve,Ms=`In the following we give a simple example of how to use a <em>T2I-Adapter</em> checkpoint with Diffusers for inference based on StableDiffusion-1.4/1.5.
All adapters use the same pipeline.`,yn,Me,Ts='<li>Images are first converted into the appropriate <em>control image</em> format.</li> <li>The <em>control image</em> and <em>prompt</em> are passed to the <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/adapter#diffusers.StableDiffusionAdapterPipeline">StableDiffusionAdapterPipeline</a>.</li>',wn,Te,xs='Let’s have a look at a simple example using the <a href="https://huggingface.co/TencentARC/t2iadapter_color_sd14v1" rel="nofollow">Color Adapter</a>.',vn,xe,Mn,Ue,Us='<img src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/color_ref.png" alt="img"/>',Tn,Je,Js="Then we can create our color palette by simply resizing it to 8 by 8 pixels and then scaling it back to original size.",xn,$e,Un,je,$s="Let’s take a look at the processed image.",Jn,Ie,js='<img src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/color_palette.png" alt="img"/>',$n,ke,Is="Next, create the adapter pipeline",jn,Ze,In,Ce,ks="Finally, pass the prompt and control image to the pipeline",kn,Ae,Zn,Se,Zs='<img src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/color_output.png" alt="img"/>',Cn,Ge,An,De,Cs=`In the following we give a simple example of how to use a <em>T2I-Adapter</em> checkpoint with Diffusers for inference based on StableDiffusion-XL.
All adapters use the same pipeline.`,Sn,Pe,As='<li>Images are first downloaded into the appropriate <em>control image</em> format.</li> <li>The <em>control image</em> and <em>prompt</em> are passed to the <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/adapter#diffusers.StableDiffusionXLAdapterPipeline">StableDiffusionXLAdapterPipeline</a>.</li>',Gn,Le,Ss='Let’s have a look at a simple example using the <a href="https://huggingface.co/Adapter/t2iadapter/tree/main/sketch_sdxl_1.0" rel="nofollow">Sketch Adapter</a>.',Dn,Xe,Pn,We,Gs='<img src="https://huggingface.co/Adapter/t2iadapter/resolve/main/sketch.png" alt="img"/>',Ln,Re,Ds="Then, create the adapter pipeline",Xn,Be,Wn,Ne,Ps="Finally, pass the prompt and control image to the pipeline",Rn,Fe,Bn,Ve,Ls='<img src="https://huggingface.co/Adapter/t2iadapter/resolve/main/sketch_output.png" alt="img"/>',Nn,Ee,Fn,Qe,Xs='Non-diffusers checkpoints can be found under <a href="https://huggingface.co/TencentARC/T2I-Adapter/tree/main/models" rel="nofollow">TencentARC/T2I-Adapter</a>.',Vn,He,En,Ye,Ws='<thead><tr><th>Model Name</th> <th>Control Image Overview</th> <th>Control Image Example</th> <th>Generated Image Example</th></tr></thead> <tbody><tr><td><a href="https://huggingface.co/TencentARC/t2iadapter_color_sd14v1" rel="nofollow">TencentARC/t2iadapter_color_sd14v1</a><br/> <em>Trained with spatial color palette</em></td> <td>An image with 8x8 color palette.</td> <td><a href="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/color_sample_input.png"><img width="64" style="margin:0;padding:0;" src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/color_sample_input.png"/></a></td> <td><a href="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/color_sample_output.png"><img width="64" src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/color_sample_output.png"/></a></td></tr> <tr><td><a href="https://huggingface.co/TencentARC/t2iadapter_canny_sd14v1" rel="nofollow">TencentARC/t2iadapter_canny_sd14v1</a><br/> <em>Trained with canny edge detection</em></td> <td>A monochrome image with white edges on a black background.</td> <td><a href="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/canny_sample_input.png"><img width="64" style="margin:0;padding:0;" src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/canny_sample_input.png"/></a></td> <td><a href="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/canny_sample_output.png"><img width="64" src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/canny_sample_output.png"/></a></td></tr> <tr><td><a href="https://huggingface.co/TencentARC/t2iadapter_sketch_sd14v1" rel="nofollow">TencentARC/t2iadapter_sketch_sd14v1</a><br/> <em>Trained with <a href="https://github.com/zhuoinoulu/pidinet" rel="nofollow">PidiNet</a> edge detection</em></td> <td>A hand-drawn monochrome image with white outlines on a black background.</td> <td><a href="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/sketch_sample_input.png"><img width="64" style="margin:0;padding:0;" src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/sketch_sample_input.png"/></a></td> <td><a href="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/sketch_sample_output.png"><img width="64" src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/sketch_sample_output.png"/></a></td></tr> <tr><td><a href="https://huggingface.co/TencentARC/t2iadapter_depth_sd14v1" rel="nofollow">TencentARC/t2iadapter_depth_sd14v1</a><br/> <em>Trained with Midas depth estimation</em></td> <td>A grayscale image with black representing deep areas and white representing shallow areas.</td> <td><a href="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/depth_sample_input.png"><img width="64" src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/depth_sample_input.png"/></a></td> <td><a href="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/depth_sample_output.png"><img width="64" src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/depth_sample_output.png"/></a></td></tr> <tr><td><a href="https://huggingface.co/TencentARC/t2iadapter_openpose_sd14v1" rel="nofollow">TencentARC/t2iadapter_openpose_sd14v1</a><br/> <em>Trained with OpenPose bone image</em></td> <td>A <a href="https://github.com/CMU-Perceptual-Computing-Lab/openpose" rel="nofollow">OpenPose bone</a> image.</td> <td><a href="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/openpose_sample_input.png"><img width="64" src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/openpose_sample_input.png"/></a></td> <td><a href="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/openpose_sample_output.png"><img width="64" src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/openpose_sample_output.png"/></a></td></tr> <tr><td><a href="https://huggingface.co/TencentARC/t2iadapter_keypose_sd14v1" rel="nofollow">TencentARC/t2iadapter_keypose_sd14v1</a><br/> <em>Trained with mmpose skeleton image</em></td> <td>A <a href="https://github.com/open-mmlab/mmpose" rel="nofollow">mmpose skeleton</a> image.</td> <td><a href="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/keypose_sample_input.png"><img width="64" src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/keypose_sample_input.png"/></a></td> <td><a href="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/keypose_sample_output.png"><img width="64" src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/keypose_sample_output.png"/></a></td></tr> <tr><td><a href="https://huggingface.co/TencentARC/t2iadapter_seg_sd14v1" rel="nofollow">TencentARC/t2iadapter_seg_sd14v1</a><br/><em>Trained with semantic segmentation</em></td> <td>An <a href="https://github.com/TencentARC/T2I-Adapter/discussions/25" rel="nofollow">custom</a> segmentation protocol image.</td> <td><a href="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/seg_sample_input.png"><img width="64" src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/seg_sample_input.png"/></a></td> <td><a href="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/seg_sample_output.png"><img width="64" src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/seg_sample_output.png"/></a></td></tr> <tr><td><a href="https://huggingface.co/TencentARC/t2iadapter_canny_sd15v2" rel="nofollow">TencentARC/t2iadapter_canny_sd15v2</a></td> <td></td> <td></td> <td></td></tr> <tr><td><a href="https://huggingface.co/TencentARC/t2iadapter_depth_sd15v2" rel="nofollow">TencentARC/t2iadapter_depth_sd15v2</a></td> <td></td> <td></td> <td></td></tr> <tr><td><a href="https://huggingface.co/TencentARC/t2iadapter_sketch_sd15v2" rel="nofollow">TencentARC/t2iadapter_sketch_sd15v2</a></td> <td></td> <td></td> <td></td></tr> <tr><td><a href="https://huggingface.co/TencentARC/t2iadapter_zoedepth_sd15v1" rel="nofollow">TencentARC/t2iadapter_zoedepth_sd15v1</a></td> <td></td> <td></td> <td></td></tr> <tr><td><a href="https://huggingface.co/Adapter/t2iadapter/tree/main/sketch_sdxl_1.0" rel="nofollow">Adapter/t2iadapter, subfolder=‘sketch_sdxl_1.0’</a></td> <td></td> <td></td> <td></td></tr> <tr><td><a href="https://huggingface.co/Adapter/t2iadapter/tree/main/canny_sdxl_1.0" rel="nofollow">Adapter/t2iadapter, subfolder=‘canny_sdxl_1.0’</a></td> <td></td> <td></td> <td></td></tr> <tr><td><a href="https://huggingface.co/Adapter/t2iadapter/tree/main/openpose_sdxl_1.0" rel="nofollow">Adapter/t2iadapter, subfolder=‘openpose_sdxl_1.0’</a></td> <td></td> <td></td> <td></td></tr></tbody>',Qn,ze,Hn,qe,Rs="<code>MultiAdapter</code> can be used for applying multiple conditionings at once.",Yn,Oe,Bs="Here we use the keypose adapter for the character posture and the depth adapter for creating the scene.",zn,Ke,qn,et,Ns="The two control images look as such:",On,tt,Fs='<img src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/keypose_sample_input.png" alt="img"/> <img src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/depth_sample_input.png" alt="img"/>',Kn,nt,Vs="<code>MultiAdapter</code> combines keypose and depth adapters.",ea,at,Es="<code>adapter_conditioning_scale</code> balances the relative influence of the different adapters.",ta,st,na,ot,Qs='<img src="https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/keypose_depth_sample_output.png" alt="img"/>',aa,it,sa,lt,Hs=`T2I-Adapter is similar to <a href="https://huggingface.co/docs/diffusers/main/en/api/pipelines/controlnet" rel="nofollow">ControlNet</a>.
T2I-Adapter uses a smaller auxiliary network which is only run once for the entire diffusion process.
However, T2I-Adapter performs slightly worse than ControlNet.`,oa,rt,ia,x,dt,ba,Dt,Ys=`Pipeline for text-to-image generation using Stable Diffusion augmented with T2I-Adapter
<a href="https://arxiv.org/abs/2302.08453" rel="nofollow">https://arxiv.org/abs/2302.08453</a>`,ya,Pt,zs=`This model inherits from <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>. 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.)`,wa,X,pt,va,Lt,qs="Function invoked when calling the pipeline for generation.",Ma,N,Ta,C,ct,xa,Xt,Os=`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`,Ua,F,Ja,V,$a,E,mt,ja,Wt,Ks=`Disable sliced attention computation. If <code>enable_attention_slicing</code> was previously called, attention is
computed in one step.`,Ia,Q,ft,ka,Rt,eo=`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`,Za,H,gt,Ca,Bt,to=`Disable sliced VAE decoding. If <code>enable_vae_slicing</code> was previously enabled, this method will go back to
computing decoding in one step.`,Aa,A,ut,Sa,Nt,no=`Enable memory efficient attention from <a href="https://facebookresearch.github.io/xformers/" rel="nofollow">xFormers</a>. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`,Ga,Y,Da,z,Pa,q,ht,La,Ft,ao='Disable memory efficient attention from <a href="https://facebookresearch.github.io/xformers/" rel="nofollow">xFormers</a>.',Xa,O,_t,Wa,Vt,so="Encodes the prompt into text encoder hidden states.",Ra,K,bt,Ba,Et,oo='See <a href="https://github.com/google-research/vdm/blob/dc27b98a554f65cdc654b800da5aa1846545d41b/model_vdm.py#L298" rel="nofollow">https://github.com/google-research/vdm/blob/dc27b98a554f65cdc654b800da5aa1846545d41b/model_vdm.py#L298</a>',la,yt,ra,M,wt,Na,Qt,io=`Pipeline for text-to-image generation using Stable Diffusion augmented with T2I-Adapter
<a href="https://arxiv.org/abs/2302.08453" rel="nofollow">https://arxiv.org/abs/2302.08453</a>`,Fa,Ht,lo=`This model inherits from <a href="/docs/diffusers/main/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>. 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.)`,Va,Yt,ro="The pipeline also inherits the following loading methods:",Ea,zt,po='<li><a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/inpaint#diffusers.StableDiffusionInpaintPipeline.load_textual_inversion">load_textual_inversion()</a> for loading textual inversion embeddings</li> <li><a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline.from_single_file">from_single_file()</a> for loading <code>.ckpt</code> files</li> <li><a href="/docs/diffusers/main/en/api/loaders/lora#diffusers.loaders.StableDiffusionXLLoraLoaderMixin.load_lora_weights">load_lora_weights()</a> for loading LoRA weights</li> <li><code>save_lora_weights()</code> for saving LoRA weights</li> <li><a href="/docs/diffusers/main/en/api/loaders/ip_adapter#diffusers.loaders.IPAdapterMixin.load_ip_adapter">load_ip_adapter()</a> for loading IP Adapters</li>',Qa,W,vt,Ha,qt,co="Function invoked when calling the pipeline for generation.",Ya,ee,za,S,Mt,qa,Ot,mo=`Enable sliced attention computation. When this option is enabled, the attention module splits the input tensor
in slices to compute attention in several steps. For more than one attention head, the computation is performed
sequentially over each head. This is useful to save some memory in exchange for a small speed decrease.`,Oa,te,Ka,ne,es,ae,Tt,ts,Kt,fo=`Disable sliced attention computation. If <code>enable_attention_slicing</code> was previously called, attention is
computed in one step.`,ns,se,xt,as,en,go=`Enable sliced VAE decoding. When this option is enabled, the VAE will split the input tensor in slices to
compute decoding in several steps. This is useful to save some memory and allow larger batch sizes.`,ss,oe,Ut,os,tn,uo=`Disable sliced VAE decoding. If <code>enable_vae_slicing</code> was previously enabled, this method will go back to
computing decoding in one step.`,is,G,Jt,ls,nn,ho=`Enable memory efficient attention from <a href="https://facebookresearch.github.io/xformers/" rel="nofollow">xFormers</a>. When this
option is enabled, you should observe lower GPU memory usage and a potential speed up during inference. Speed
up during training is not guaranteed.`,rs,ie,ds,le,ps,re,$t,cs,an,_o='Disable memory efficient attention from <a href="https://facebookresearch.github.io/xformers/" rel="nofollow">xFormers</a>.',ms,de,jt,fs,sn,bo="Encodes the prompt into text encoder hidden states.",gs,pe,It,us,on,yo='See <a href="https://github.com/google-research/vdm/blob/dc27b98a554f65cdc654b800da5aa1846545d41b/model_vdm.py#L298" rel="nofollow">https://github.com/google-research/vdm/blob/dc27b98a554f65cdc654b800da5aa1846545d41b/model_vdm.py#L298</a>',da,dn,pa;return w=new L({props:{title:"Text-to-Image Generation with Adapter Conditioning",local:"text-to-image-generation-with-adapter-conditioning",headingTag:"h1"}}),T=new L({props:{title:"Overview",local:"overview",headingTag:"h2"}}),be=new L({props:{title:"Available Pipelines:",local:"available-pipelines",headingTag:"h2"}}),we=new L({props:{title:"Usage example with the base model of StableDiffusion-1.4/1.5",local:"usage-example-with-the-base-model-of-stablediffusion-1415",headingTag:"h2"}}),xe=new Z({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMkMlMjBtYWtlX2ltYWdlX2dyaWQlMEElMEFpbWFnZSUyMCUzRCUyMGxvYWRfaW1hZ2UoJTIyaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmRhdGFzZXRzJTJGZGlmZnVzZXJzJTJGZG9jcy1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyRnQyaS1hZGFwdGVyJTJGY29sb3JfcmVmLnBuZyUyMik=",highlighted:`<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image, make_image_grid

image = load_image(<span class="hljs-string">&quot;https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/color_ref.png&quot;</span>)`,wrap:!1}}),$e=new Z({props:{code:"ZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBJTBBY29sb3JfcGFsZXR0ZSUyMCUzRCUyMGltYWdlLnJlc2l6ZSgoOCUyQyUyMDgpKSUwQWNvbG9yX3BhbGV0dGUlMjAlM0QlMjBjb2xvcl9wYWxldHRlLnJlc2l6ZSgoNTEyJTJDJTIwNTEyKSUyQyUyMHJlc2FtcGxlJTNESW1hZ2UuUmVzYW1wbGluZy5ORUFSRVNUKQ==",highlighted:`<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

color_palette = image.resize((<span class="hljs-number">8</span>, <span class="hljs-number">8</span>))
color_palette = color_palette.resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>), resample=Image.Resampling.NEAREST)`,wrap:!1}}),Ze=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uQWRhcHRlclBpcGVsaW5lJTJDJTIwVDJJQWRhcHRlciUwQSUwQWFkYXB0ZXIlMjAlM0QlMjBUMklBZGFwdGVyLmZyb21fcHJldHJhaW5lZCglMjJUZW5jZW50QVJDJTJGdDJpYWRhcHRlcl9jb2xvcl9zZDE0djElMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvbkFkYXB0ZXJQaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyQ29tcFZpcyUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNCUyMiUyQyUwQSUyMCUyMCUyMCUyMGFkYXB0ZXIlM0RhZGFwdGVyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBKSUwQXBpcGUudG8oJTIyY3VkYSUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionAdapterPipeline, T2IAdapter

adapter = T2IAdapter.from_pretrained(<span class="hljs-string">&quot;TencentARC/t2iadapter_color_sd14v1&quot;</span>, torch_dtype=torch.float16)
pipe = StableDiffusionAdapterPipeline.from_pretrained(
    <span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>,
    adapter=adapter,
    torch_dtype=torch.float16,
)
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),Ae=new Z({props:{code:"JTIzJTIwZml4JTIwdGhlJTIwcmFuZG9tJTIwc2VlZCUyQyUyMHNvJTIweW91JTIwd2lsbCUyMGdldCUyMHRoZSUyMHNhbWUlMjByZXN1bHQlMjBhcyUyMHRoZSUyMGV4YW1wbGUlMEFnZW5lcmF0b3IlMjAlM0QlMjB0b3JjaC5HZW5lcmF0b3IoJTIyY3VkYSUyMikubWFudWFsX3NlZWQoNyklMEElMEFvdXRfaW1hZ2UlMjAlM0QlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMCUyMkF0JTIwbmlnaHQlMkMlMjBnbG93aW5nJTIwY3ViZXMlMjBpbiUyMGZyb250JTIwb2YlMjB0aGUlMjBiZWFjaCUyMiUyQyUwQSUyMCUyMCUyMCUyMGltYWdlJTNEY29sb3JfcGFsZXR0ZSUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUyQyUwQSkuaW1hZ2VzJTVCMCU1RCUwQW1ha2VfaW1hZ2VfZ3JpZCglNUJpbWFnZSUyQyUyMGNvbG9yX3BhbGV0dGUlMkMlMjBvdXRfaW1hZ2UlNUQlMkMlMjByb3dzJTNEMSUyQyUyMGNvbHMlM0QzKQ==",highlighted:`<span class="hljs-comment"># fix the random seed, so you will get the same result as the example</span>
generator = torch.Generator(<span class="hljs-string">&quot;cuda&quot;</span>).manual_seed(<span class="hljs-number">7</span>)

out_image = pipe(
    <span class="hljs-string">&quot;At night, glowing cubes in front of the beach&quot;</span>,
    image=color_palette,
    generator=generator,
).images[<span class="hljs-number">0</span>]
make_image_grid([image, color_palette, out_image], rows=<span class="hljs-number">1</span>, cols=<span class="hljs-number">3</span>)`,wrap:!1}}),Ge=new L({props:{title:"Usage example with the base model of StableDiffusion-XL",local:"usage-example-with-the-base-model-of-stablediffusion-xl",headingTag:"h2"}}),Xe=new Z({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMkMlMjBtYWtlX2ltYWdlX2dyaWQlMEElMEFza2V0Y2hfaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZBZGFwdGVyJTJGdDJpYWRhcHRlciUyRnJlc29sdmUlMkZtYWluJTJGc2tldGNoLnBuZyUyMikuY29udmVydCglMjJMJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image, make_image_grid

sketch_image = load_image(<span class="hljs-string">&quot;https://huggingface.co/Adapter/t2iadapter/resolve/main/sketch.png&quot;</span>).convert(<span class="hljs-string">&quot;L&quot;</span>)`,wrap:!1}}),Be=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwKCUwQSUyMCUyMCUyMCUyMFQySUFkYXB0ZXIlMkMlMEElMjAlMjAlMjAlMjBTdGFibGVEaWZmdXNpb25YTEFkYXB0ZXJQaXBlbGluZSUyQyUwQSUyMCUyMCUyMCUyMEREUE1TY2hlZHVsZXIlMEEpJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24teGwtYmFzZS0xLjAlMjIlMEFhZGFwdGVyJTIwJTNEJTIwVDJJQWRhcHRlci5mcm9tX3ByZXRyYWluZWQoJTIyQWRhcHRlciUyRnQyaWFkYXB0ZXIlMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJza2V0Y2hfc2R4bF8xLjAlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjBhZGFwdGVyX3R5cGUlM0QlMjJmdWxsX2FkYXB0ZXJfeGwlMjIpJTBBc2NoZWR1bGVyJTIwJTNEJTIwRERQTVNjaGVkdWxlci5mcm9tX3ByZXRyYWluZWQobW9kZWxfaWQlMkMlMjBzdWJmb2xkZXIlM0QlMjJzY2hlZHVsZXIlMjIpJTBBJTBBcGlwZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblhMQWRhcHRlclBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUyQyUyMGFkYXB0ZXIlM0RhZGFwdGVyJTJDJTIwc2FmZXR5X2NoZWNrZXIlM0ROb25lJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTIwdmFyaWFudCUzRCUyMmZwMTYlMjIlMkMlMjBzY2hlZHVsZXIlM0RzY2hlZHVsZXIlMEEpJTBBJTBBcGlwZS50byglMjJjdWRhJTIyKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> (
    T2IAdapter,
    StableDiffusionXLAdapterPipeline,
    DDPMScheduler
)

model_id = <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>
adapter = T2IAdapter.from_pretrained(<span class="hljs-string">&quot;Adapter/t2iadapter&quot;</span>, subfolder=<span class="hljs-string">&quot;sketch_sdxl_1.0&quot;</span>, torch_dtype=torch.float16, adapter_type=<span class="hljs-string">&quot;full_adapter_xl&quot;</span>)
scheduler = DDPMScheduler.from_pretrained(model_id, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)

pipe = StableDiffusionXLAdapterPipeline.from_pretrained(
    model_id, adapter=adapter, safety_checker=<span class="hljs-literal">None</span>, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>, scheduler=scheduler
)

pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),Fe=new Z({props:{code:"JTIzJTIwZml4JTIwdGhlJTIwcmFuZG9tJTIwc2VlZCUyQyUyMHNvJTIweW91JTIwd2lsbCUyMGdldCUyMHRoZSUyMHNhbWUlMjByZXN1bHQlMjBhcyUyMHRoZSUyMGV4YW1wbGUlMEFnZW5lcmF0b3IlMjAlM0QlMjB0b3JjaC5HZW5lcmF0b3IoKS5tYW51YWxfc2VlZCg0MiklMEElMEFza2V0Y2hfaW1hZ2Vfb3V0JTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlM0QlMjJhJTIwcGhvdG8lMjBvZiUyMGElMjBkb2clMjBpbiUyMHJlYWwlMjB3b3JsZCUyQyUyMGhpZ2glMjBxdWFsaXR5JTIyJTJDJTBBJTIwJTIwJTIwJTIwbmVnYXRpdmVfcHJvbXB0JTNEJTIyZXh0cmElMjBkaWdpdCUyQyUyMGZld2VyJTIwZGlnaXRzJTJDJTIwY3JvcHBlZCUyQyUyMHdvcnN0JTIwcXVhbGl0eSUyQyUyMGxvdyUyMHF1YWxpdHklMjIlMkMlMEElMjAlMjAlMjAlMjBpbWFnZSUzRHNrZXRjaF9pbWFnZSUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNENy41JTBBKS5pbWFnZXMlNUIwJTVEJTBBbWFrZV9pbWFnZV9ncmlkKCU1QnNrZXRjaF9pbWFnZSUyQyUyMHNrZXRjaF9pbWFnZV9vdXQlNUQlMkMlMjByb3dzJTNEMSUyQyUyMGNvbHMlM0QyKQ==",highlighted:`<span class="hljs-comment"># fix the random seed, so you will get the same result as the example</span>
generator = torch.Generator().manual_seed(<span class="hljs-number">42</span>)

sketch_image_out = pipe(
    prompt=<span class="hljs-string">&quot;a photo of a dog in real world, high quality&quot;</span>,
    negative_prompt=<span class="hljs-string">&quot;extra digit, fewer digits, cropped, worst quality, low quality&quot;</span>,
    image=sketch_image,
    generator=generator,
    guidance_scale=<span class="hljs-number">7.5</span>
).images[<span class="hljs-number">0</span>]
make_image_grid([sketch_image, sketch_image_out], rows=<span class="hljs-number">1</span>, cols=<span class="hljs-number">2</span>)`,wrap:!1}}),Ee=new L({props:{title:"Available checkpoints",local:"available-checkpoints",headingTag:"h2"}}),He=new L({props:{title:"T2I-Adapter with Stable Diffusion 1.4",local:"t2i-adapter-with-stable-diffusion-14",headingTag:"h3"}}),ze=new L({props:{title:"Combining multiple adapters",local:"combining-multiple-adapters",headingTag:"h2"}}),Ke=new Z({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMkMlMjBtYWtlX2ltYWdlX2dyaWQlMEElMEFjb25kX2tleXBvc2UlMjAlM0QlMjBsb2FkX2ltYWdlKCUwQSUyMCUyMCUyMCUyMCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmRpZmZ1c2VycyUyRmRvY3MtaW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZ0MmktYWRhcHRlciUyRmtleXBvc2Vfc2FtcGxlX2lucHV0LnBuZyUyMiUwQSklMEFjb25kX2RlcHRoJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZkaWZmdXNlcnMlMkZkb2NzLWltYWdlcyUyRnJlc29sdmUlMkZtYWluJTJGdDJpLWFkYXB0ZXIlMkZkZXB0aF9zYW1wbGVfaW5wdXQucG5nJTIyJTBBKSUwQWNvbmQlMjAlM0QlMjAlNUJjb25kX2tleXBvc2UlMkMlMjBjb25kX2RlcHRoJTVEJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTVCJTIyQSUyMG1hbiUyMHdhbGtpbmclMjBpbiUyMGFuJTIwb2ZmaWNlJTIwcm9vbSUyMHdpdGglMjBhJTIwbmljZSUyMHZpZXclMjIlNUQ=",highlighted:`<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image, make_image_grid

cond_keypose = load_image(
    <span class="hljs-string">&quot;https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/keypose_sample_input.png&quot;</span>
)
cond_depth = load_image(
    <span class="hljs-string">&quot;https://huggingface.co/datasets/diffusers/docs-images/resolve/main/t2i-adapter/depth_sample_input.png&quot;</span>
)
cond = [cond_keypose, cond_depth]

prompt = [<span class="hljs-string">&quot;A man walking in an office room with a nice view&quot;</span>]`,wrap:!1}}),st=new Z({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uQWRhcHRlclBpcGVsaW5lJTJDJTIwTXVsdGlBZGFwdGVyJTJDJTIwVDJJQWRhcHRlciUwQSUwQWFkYXB0ZXJzJTIwJTNEJTIwTXVsdGlBZGFwdGVyKCUwQSUyMCUyMCUyMCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMFQySUFkYXB0ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMlRlbmNlbnRBUkMlMkZ0MmlhZGFwdGVyX2tleXBvc2Vfc2QxNHYxJTIyKSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMFQySUFkYXB0ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMlRlbmNlbnRBUkMlMkZ0MmlhZGFwdGVyX2RlcHRoX3NkMTR2MSUyMiklMkMlMEElMjAlMjAlMjAlMjAlNUQlMEEpJTBBYWRhcHRlcnMlMjAlM0QlMjBhZGFwdGVycy50byh0b3JjaC5mbG9hdDE2KSUwQSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25BZGFwdGVyUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMkNvbXBWaXMlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTQlMjIlMkMlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMEElMjAlMjAlMjAlMjBhZGFwdGVyJTNEYWRhcHRlcnMlMkMlMEEpLnRvKCUyMmN1ZGElMjIpJTBBJTBBaW1hZ2UlMjAlM0QlMjBwaXBlKHByb21wdCUyQyUyMGNvbmQlMkMlMjBhZGFwdGVyX2NvbmRpdGlvbmluZ19zY2FsZSUzRCU1QjAuOCUyQyUyMDAuOCU1RCkuaW1hZ2VzJTVCMCU1RCUwQW1ha2VfaW1hZ2VfZ3JpZCglNUJjb25kX2tleXBvc2UlMkMlMjBjb25kX2RlcHRoJTJDJTIwaW1hZ2UlNUQlMkMlMjByb3dzJTNEMSUyQyUyMGNvbHMlM0QzKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionAdapterPipeline, MultiAdapter, T2IAdapter

adapters = MultiAdapter(
    [
        T2IAdapter.from_pretrained(<span class="hljs-string">&quot;TencentARC/t2iadapter_keypose_sd14v1&quot;</span>),
        T2IAdapter.from_pretrained(<span class="hljs-string">&quot;TencentARC/t2iadapter_depth_sd14v1&quot;</span>),
    ]
)
adapters = adapters.to(torch.float16)

pipe = StableDiffusionAdapterPipeline.from_pretrained(
    <span class="hljs-string">&quot;CompVis/stable-diffusion-v1-4&quot;</span>,
    torch_dtype=torch.float16,
    adapter=adapters,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

image = pipe(prompt, cond, adapter_conditioning_scale=[<span class="hljs-number">0.8</span>, <span class="hljs-number">0.8</span>]).images[<span class="hljs-number">0</span>]
make_image_grid([cond_keypose, cond_depth, image], rows=<span class="hljs-number">1</span>, cols=<span class="hljs-number">3</span>)`,wrap:!1}}),it=new L({props:{title:"T2I-Adapter vs ControlNet",local:"t2i-adapter-vs-controlnet",headingTag:"h2"}}),rt=new L({props:{title:"StableDiffusionAdapterPipeline",local:"diffusers.StableDiffusionAdapterPipeline",headingTag:"h2"}}),dt=new k({props:{name:"class diffusers.StableDiffusionAdapterPipeline",anchor:"diffusers.StableDiffusionAdapterPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"adapter",val:": Union"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"safety_checker",val:": StableDiffusionSafetyChecker"},{name:"feature_extractor",val:": CLIPFeatureExtractor"},{name:"requires_safety_checker",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.StableDiffusionAdapterPipeline.adapter",description:`<strong>adapter</strong> (<code>T2IAdapter</code> or <code>MultiAdapter</code> or <code>List[T2IAdapter]</code>) &#x2014;
Provides additional conditioning to the unet during the denoising process. If you set multiple Adapter as a
list, the outputs from each Adapter are added together to create one combined additional conditioning.`,name:"adapter"},{anchor:"diffusers.StableDiffusionAdapterPipeline.adapter_weights",description:`<strong>adapter_weights</strong> (<code>List[float]</code>, <em>optional</em>, defaults to None) &#x2014;
List of floats representing the weight which will be multiply to each adapter&#x2019;s output before adding them
together.`,name:"adapter_weights"},{anchor:"diffusers.StableDiffusionAdapterPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionAdapterPipeline.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.StableDiffusionAdapterPipeline.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.StableDiffusionAdapterPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionAdapterPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionAdapterPipeline.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.StableDiffusionAdapterPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPFeatureExtractor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py#L166"}}),pt=new k({props:{name:"__call__",anchor:"diffusers.StableDiffusionAdapterPipeline.__call__",parameters:[{name:"prompt",val:": Union = None"},{name:"image",val:": Union = None"},{name:"height",val:": Optional = None"},{name:"width",val:": Optional = None"},{name:"num_inference_steps",val:": int = 50"},{name:"timesteps",val:": List = None"},{name:"guidance_scale",val:": float = 7.5"},{name:"negative_prompt",val:": Union = None"},{name:"num_images_per_prompt",val:": Optional = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": Union = None"},{name:"latents",val:": Optional = None"},{name:"prompt_embeds",val:": Optional = None"},{name:"negative_prompt_embeds",val:": Optional = None"},{name:"output_type",val:": Optional = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": Optional = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": Optional = None"},{name:"adapter_conditioning_scale",val:": Union = 1.0"},{name:"clip_skip",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>List[torch.FloatTensor]</code> or <code>List[PIL.Image.Image]</code> or <code>List[List[PIL.Image.Image]]</code>) &#x2014;
The Adapter input condition. Adapter uses this input condition to generate guidance to Unet. If the
type is specified as <code>Torch.FloatTensor</code>, it is passed to Adapter as is. PIL.Image.Image\` can also be
accepted as an image. The control image is automatically resized to fit the output image.`,name:"image"},{anchor:"diffusers.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__call__.timesteps",description:`<strong>timesteps</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Custom timesteps to use for the denoising process with schedulers which support a <code>timesteps</code> argument
in their <code>set_timesteps</code> method. If not defined, the default behavior when <code>num_inference_steps</code> is
passed will be used. Must be in descending order.`,name:"timesteps"},{anchor:"diffusers.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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. 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.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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>~pipelines.stable_diffusion.StableDiffusionAdapterPipelineOutput</code> instead
of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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.StableDiffusionAdapterPipeline.__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>AttnProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionAdapterPipeline.__call__.adapter_conditioning_scale",description:`<strong>adapter_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the adapter are multiplied by <code>adapter_conditioning_scale</code> before they are added to the
residual in the original unet. If multiple adapters are specified in init, you can set the
corresponding scale as a list.`,name:"adapter_conditioning_scale"},{anchor:"diffusers.StableDiffusionAdapterPipeline.__call__.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py#L657",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>~pipelines.stable_diffusion.StableDiffusionAdapterPipelineOutput</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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>~pipelines.stable_diffusion.StableDiffusionAdapterPipelineOutput</code> or <code>tuple</code></p>
`}}),N=new rn({props:{anchor:"diffusers.StableDiffusionAdapterPipeline.__call__.example",$$slots:{default:[Uo]},$$scope:{ctx:$}}}),ct=new k({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionAdapterPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": Union = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionAdapterPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1600"}}),F=new _a({props:{warning:!0,$$slots:{default:[Jo]},$$scope:{ctx:$}}}),V=new rn({props:{anchor:"diffusers.StableDiffusionAdapterPipeline.enable_attention_slicing.example",$$slots:{default:[$o]},$$scope:{ctx:$}}}),mt=new k({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionAdapterPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1640"}}),ft=new k({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionAdapterPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1662"}}),gt=new k({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionAdapterPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1669"}}),ut=new k({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionAdapterPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionAdapterPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1539"}}),Y=new _a({props:{warning:!0,$$slots:{default:[jo]},$$scope:{ctx:$}}}),z=new rn({props:{anchor:"diffusers.StableDiffusionAdapterPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[Io]},$$scope:{ctx:$}}}),ht=new k({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionAdapterPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1574"}}),_t=new k({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionAdapterPipeline.encode_prompt",parameters:[{name:"prompt",val:""},{name:"device",val:""},{name:"num_images_per_prompt",val:""},{name:"do_classifier_free_guidance",val:""},{name:"negative_prompt",val:" = None"},{name:"prompt_embeds",val:": Optional = None"},{name:"negative_prompt_embeds",val:": Optional = None"},{name:"lora_scale",val:": Optional = None"},{name:"clip_skip",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionAdapterPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt"},{anchor:"diffusers.StableDiffusionAdapterPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionAdapterPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableDiffusionAdapterPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionAdapterPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionAdapterPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionAdapterPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A LoRA scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"},{anchor:"diffusers.StableDiffusionAdapterPipeline.encode_prompt.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py#L285"}}),bt=new k({props:{name:"get_guidance_scale_embedding",anchor:"diffusers.StableDiffusionAdapterPipeline.get_guidance_scale_embedding",parameters:[{name:"w",val:": Tensor"},{name:"embedding_dim",val:": int = 512"},{name:"dtype",val:": dtype = torch.float32"}],parametersDescription:[{anchor:"diffusers.StableDiffusionAdapterPipeline.get_guidance_scale_embedding.w",description:`<strong>w</strong> (<code>torch.Tensor</code>) &#x2014;
Generate embedding vectors with a specified guidance scale to subsequently enrich timestep embeddings.`,name:"w"},{anchor:"diffusers.StableDiffusionAdapterPipeline.get_guidance_scale_embedding.embedding_dim",description:`<strong>embedding_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimension of the embeddings to generate.`,name:"embedding_dim"},{anchor:"diffusers.StableDiffusionAdapterPipeline.get_guidance_scale_embedding.dtype",description:`<strong>dtype</strong> (<code>torch.dtype</code>, <em>optional</em>, defaults to <code>torch.float32</code>) &#x2014;
Data type of the generated embeddings.`,name:"dtype"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_adapter.py#L616",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Embedding vectors with shape <code>(len(w), embedding_dim)</code>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>torch.FloatTensor</code></p>
`}}),yt=new L({props:{title:"StableDiffusionXLAdapterPipeline",local:"diffusers.StableDiffusionXLAdapterPipeline",headingTag:"h2"}}),wt=new k({props:{name:"class diffusers.StableDiffusionXLAdapterPipeline",anchor:"diffusers.StableDiffusionXLAdapterPipeline",parameters:[{name:"vae",val:": AutoencoderKL"},{name:"text_encoder",val:": CLIPTextModel"},{name:"text_encoder_2",val:": CLIPTextModelWithProjection"},{name:"tokenizer",val:": CLIPTokenizer"},{name:"tokenizer_2",val:": CLIPTokenizer"},{name:"unet",val:": UNet2DConditionModel"},{name:"adapter",val:": Union"},{name:"scheduler",val:": KarrasDiffusionSchedulers"},{name:"force_zeros_for_empty_prompt",val:": bool = True"},{name:"feature_extractor",val:": CLIPImageProcessor = None"},{name:"image_encoder",val:": CLIPVisionModelWithProjection = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLAdapterPipeline.adapter",description:`<strong>adapter</strong> (<code>T2IAdapter</code> or <code>MultiAdapter</code> or <code>List[T2IAdapter]</code>) &#x2014;
Provides additional conditioning to the unet during the denoising process. If you set multiple Adapter as a
list, the outputs from each Adapter are added together to create one combined additional conditioning.`,name:"adapter"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.adapter_weights",description:`<strong>adapter_weights</strong> (<code>List[float]</code>, <em>optional</em>, defaults to None) &#x2014;
List of floats representing the weight which will be multiply to each adapter&#x2019;s output before adding them
together.`,name:"adapter_weights"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.vae",description:`<strong>vae</strong> (<a href="/docs/diffusers/main/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>) &#x2014;
Variational Auto-Encoder (VAE) Model to encode and decode images to and from latent representations.`,name:"vae"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.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.StableDiffusionXLAdapterPipeline.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.StableDiffusionXLAdapterPipeline.unet",description:'<strong>unet</strong> (<a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>) &#x2014; Conditional U-Net architecture to denoise the encoded image latents.',name:"unet"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.scheduler",description:`<strong>scheduler</strong> (<a href="/docs/diffusers/main/en/api/schedulers/overview#diffusers.SchedulerMixin">SchedulerMixin</a>) &#x2014;
A scheduler to be used in combination with <code>unet</code> to denoise the encoded image latents. Can be one of
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">DDIMScheduler</a>, <a href="/docs/diffusers/main/en/api/schedulers/lms_discrete#diffusers.LMSDiscreteScheduler">LMSDiscreteScheduler</a>, or <a href="/docs/diffusers/main/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.`,name:"scheduler"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.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.StableDiffusionXLAdapterPipeline.feature_extractor",description:`<strong>feature_extractor</strong> (<code>CLIPFeatureExtractor</code>) &#x2014;
Model that extracts features from generated images to be used as inputs for the <code>safety_checker</code>.`,name:"feature_extractor"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_xl_adapter.py#L182"}}),vt=new k({props:{name:"__call__",anchor:"diffusers.StableDiffusionXLAdapterPipeline.__call__",parameters:[{name:"prompt",val:": Union = None"},{name:"prompt_2",val:": Union = None"},{name:"image",val:": Union = None"},{name:"height",val:": Optional = None"},{name:"width",val:": Optional = None"},{name:"num_inference_steps",val:": int = 50"},{name:"timesteps",val:": List = None"},{name:"denoising_end",val:": Optional = None"},{name:"guidance_scale",val:": float = 5.0"},{name:"negative_prompt",val:": Union = None"},{name:"negative_prompt_2",val:": Union = None"},{name:"num_images_per_prompt",val:": Optional = 1"},{name:"eta",val:": float = 0.0"},{name:"generator",val:": Union = None"},{name:"latents",val:": Optional = None"},{name:"prompt_embeds",val:": Optional = None"},{name:"negative_prompt_embeds",val:": Optional = None"},{name:"pooled_prompt_embeds",val:": Optional = None"},{name:"negative_pooled_prompt_embeds",val:": Optional = None"},{name:"ip_adapter_image",val:": Union = None"},{name:"ip_adapter_image_embeds",val:": Optional = None"},{name:"output_type",val:": Optional = 'pil'"},{name:"return_dict",val:": bool = True"},{name:"callback",val:": Optional = None"},{name:"callback_steps",val:": int = 1"},{name:"cross_attention_kwargs",val:": Optional = None"},{name:"guidance_rescale",val:": float = 0.0"},{name:"original_size",val:": Optional = None"},{name:"crops_coords_top_left",val:": Tuple = (0, 0)"},{name:"target_size",val:": Optional = None"},{name:"negative_original_size",val:": Optional = None"},{name:"negative_crops_coords_top_left",val:": Tuple = (0, 0)"},{name:"negative_target_size",val:": Optional = None"},{name:"adapter_conditioning_scale",val:": Union = 1.0"},{name:"adapter_conditioning_factor",val:": float = 1.0"},{name:"clip_skip",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__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.StableDiffusionXLAdapterPipeline.__call__.prompt_2",description:`<strong>prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to be sent to the <code>tokenizer_2</code> and <code>text_encoder_2</code>. If not defined, <code>prompt</code> is
used in both text-encoders`,name:"prompt_2"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__call__.image",description:`<strong>image</strong> (<code>torch.FloatTensor</code>, <code>PIL.Image.Image</code>, <code>List[torch.FloatTensor]</code> or <code>List[PIL.Image.Image]</code> or <code>List[List[PIL.Image.Image]]</code>) &#x2014;
The Adapter input condition. Adapter uses this input condition to generate guidance to Unet. If the
type is specified as <code>Torch.FloatTensor</code>, it is passed to Adapter as is. PIL.Image.Image\` can also be
accepted as an image. The control image is automatically resized to fit the output image.`,name:"image"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__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. Anything below 512 pixels won&#x2019;t work well for
<a href="https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0" rel="nofollow">stabilityai/stable-diffusion-xl-base-1.0</a>
and checkpoints that are not specifically fine-tuned on low resolutions.`,name:"height"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__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. Anything below 512 pixels won&#x2019;t work well for
<a href="https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0" rel="nofollow">stabilityai/stable-diffusion-xl-base-1.0</a>
and checkpoints that are not specifically fine-tuned on low resolutions.`,name:"width"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__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.StableDiffusionXLAdapterPipeline.__call__.timesteps",description:`<strong>timesteps</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Custom timesteps to use for the denoising process with schedulers which support a <code>timesteps</code> argument
in their <code>set_timesteps</code> method. If not defined, the default behavior when <code>num_inference_steps</code> is
passed will be used. Must be in descending order.`,name:"timesteps"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__call__.denoising_end",description:`<strong>denoising_end</strong> (<code>float</code>, <em>optional</em>) &#x2014;
When specified, determines the fraction (between 0.0 and 1.0) of the total denoising process to be
completed before it is intentionally prematurely terminated. As a result, the returned sample will
still retain a substantial amount of noise as determined by the discrete timesteps selected by the
scheduler. The denoising_end parameter should ideally be utilized when this pipeline forms a part of a
&#x201C;Mixture of Denoisers&#x201D; multi-pipeline setup, as elaborated in <a href="https://huggingface.co/docs/diffusers/api/pipelines/stable_diffusion/stable_diffusion_xl#refining-the-image-output" rel="nofollow"><strong>Refining the Image
Output</strong></a>`,name:"denoising_end"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__call__.guidance_scale",description:`<strong>guidance_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 5.0) &#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.StableDiffusionXLAdapterPipeline.__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.StableDiffusionXLAdapterPipeline.__call__.negative_prompt_2",description:`<strong>negative_prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation to be sent to <code>tokenizer_2</code> and
<code>text_encoder_2</code>. If not defined, <code>negative_prompt</code> is used in both text-encoders`,name:"negative_prompt_2"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__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.StableDiffusionXLAdapterPipeline.__call__.eta",description:`<strong>eta</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Corresponds to parameter eta (&#x3B7;) in the DDIM paper: <a href="https://arxiv.org/abs/2010.02502" rel="nofollow">https://arxiv.org/abs/2010.02502</a>. Only applies to
<a href="/docs/diffusers/main/en/api/schedulers/ddim#diffusers.DDIMScheduler">schedulers.DDIMScheduler</a>, will be ignored for others.`,name:"eta"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__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.StableDiffusionXLAdapterPipeline.__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.StableDiffusionXLAdapterPipeline.__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.StableDiffusionXLAdapterPipeline.__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.StableDiffusionXLAdapterPipeline.__call__.pooled_prompt_embeds",description:`<strong>pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting.
If not provided, pooled text embeddings will be generated from <code>prompt</code> input argument.`,name:"pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__call__.negative_pooled_prompt_embeds",description:`<strong>negative_pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, pooled negative_prompt_embeds will be generated from <code>negative_prompt</code>
input argument.
ip_adapter_image &#x2014; (<code>PipelineImageInput</code>, <em>optional</em>): Optional image input to work with IP Adapters.`,name:"negative_pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__call__.ip_adapter_image_embeds",description:`<strong>ip_adapter_image_embeds</strong> (<code>List[torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Pre-generated image embeddings for IP-Adapter. It should be a list of length same as number of IP-adapters.
Each element should be a tensor of shape <code>(batch_size, num_images, emb_dim)</code>. It should contain the negative image embedding
if <code>do_classifier_free_guidance</code> is set to <code>True</code>.
If not provided, embeddings are computed from the <code>ip_adapter_image</code> input argument.`,name:"ip_adapter_image_embeds"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__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.StableDiffusionXLAdapterPipeline.__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>~pipelines.stable_diffusion_xl.StableDiffusionAdapterPipelineOutput</code>
instead of a plain tuple.`,name:"return_dict"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__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.StableDiffusionXLAdapterPipeline.__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.StableDiffusionXLAdapterPipeline.__call__.cross_attention_kwargs",description:`<strong>cross_attention_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
A kwargs dictionary that if specified is passed along to the <code>AttentionProcessor</code> as defined under
<code>self.processor</code> in
<a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/attention_processor.py" rel="nofollow">diffusers.models.attention_processor</a>.`,name:"cross_attention_kwargs"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__call__.guidance_rescale",description:`<strong>guidance_rescale</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014;
Guidance rescale factor proposed by <a href="https://arxiv.org/pdf/2305.08891.pdf" rel="nofollow">Common Diffusion Noise Schedules and Sample Steps are
Flawed</a> <code>guidance_scale</code> is defined as <code>&#x3C6;</code> in equation 16. of
<a href="https://arxiv.org/pdf/2305.08891.pdf" rel="nofollow">Common Diffusion Noise Schedules and Sample Steps are Flawed</a>.
Guidance rescale factor should fix overexposure when using zero terminal SNR.`,name:"guidance_rescale"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__call__.original_size",description:`<strong>original_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
If <code>original_size</code> is not the same as <code>target_size</code> the image will appear to be down- or upsampled.
<code>original_size</code> defaults to <code>(height, width)</code> if not specified. Part of SDXL&#x2019;s micro-conditioning as
explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"original_size"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__call__.crops_coords_top_left",description:`<strong>crops_coords_top_left</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (0, 0)) &#x2014;
<code>crops_coords_top_left</code> can be used to generate an image that appears to be &#x201C;cropped&#x201D; from the position
<code>crops_coords_top_left</code> downwards. Favorable, well-centered images are usually achieved by setting
<code>crops_coords_top_left</code> to (0, 0). Part of SDXL&#x2019;s micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"crops_coords_top_left"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__call__.target_size",description:`<strong>target_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
For most cases, <code>target_size</code> should be set to the desired height and width of the generated image. If
not specified it will default to <code>(height, width)</code>. Part of SDXL&#x2019;s micro-conditioning as explained in
section 2.2 of <a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.
section 2.2 of <a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>.`,name:"target_size"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__call__.negative_original_size",description:`<strong>negative_original_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
To negatively condition the generation process based on a specific image resolution. Part of SDXL&#x2019;s
micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>. For more
information, refer to this issue thread: <a href="https://github.com/huggingface/diffusers/issues/4208" rel="nofollow">https://github.com/huggingface/diffusers/issues/4208</a>.`,name:"negative_original_size"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__call__.negative_crops_coords_top_left",description:`<strong>negative_crops_coords_top_left</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (0, 0)) &#x2014;
To negatively condition the generation process based on a specific crop coordinates. Part of SDXL&#x2019;s
micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>. For more
information, refer to this issue thread: <a href="https://github.com/huggingface/diffusers/issues/4208" rel="nofollow">https://github.com/huggingface/diffusers/issues/4208</a>.`,name:"negative_crops_coords_top_left"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__call__.negative_target_size",description:`<strong>negative_target_size</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to (1024, 1024)) &#x2014;
To negatively condition the generation process based on a target image resolution. It should be as same
as the <code>target_size</code> for most cases. Part of SDXL&#x2019;s micro-conditioning as explained in section 2.2 of
<a href="https://huggingface.co/papers/2307.01952" rel="nofollow">https://huggingface.co/papers/2307.01952</a>. For more
information, refer to this issue thread: <a href="https://github.com/huggingface/diffusers/issues/4208" rel="nofollow">https://github.com/huggingface/diffusers/issues/4208</a>.`,name:"negative_target_size"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__call__.adapter_conditioning_scale",description:`<strong>adapter_conditioning_scale</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The outputs of the adapter are multiplied by <code>adapter_conditioning_scale</code> before they are added to the
residual in the original unet. If multiple adapters are specified in init, you can set the
corresponding scale as a list.`,name:"adapter_conditioning_scale"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__call__.adapter_conditioning_factor",description:`<strong>adapter_conditioning_factor</strong> (<code>float</code>, <em>optional</em>, defaults to 1.0) &#x2014;
The fraction of timesteps for which adapter should be applied. If <code>adapter_conditioning_factor</code> is
<code>0.0</code>, adapter is not applied at all. If <code>adapter_conditioning_factor</code> is <code>1.0</code>, adapter is applied for
all timesteps. If <code>adapter_conditioning_factor</code> is <code>0.5</code>, adapter is applied for half of the timesteps.`,name:"adapter_conditioning_factor"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__call__.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_xl_adapter.py#L828",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>~pipelines.stable_diffusion.StableDiffusionAdapterPipelineOutput</code> if <code>return_dict</code> is True, otherwise a
<code>tuple</code>. When returning a tuple, the first element is a list with the generated images.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>~pipelines.stable_diffusion.StableDiffusionAdapterPipelineOutput</code> or <code>tuple</code></p>
`}}),ee=new rn({props:{anchor:"diffusers.StableDiffusionXLAdapterPipeline.__call__.example",$$slots:{default:[ko]},$$scope:{ctx:$}}}),Mt=new k({props:{name:"enable_attention_slicing",anchor:"diffusers.StableDiffusionXLAdapterPipeline.enable_attention_slicing",parameters:[{name:"slice_size",val:": Union = 'auto'"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLAdapterPipeline.enable_attention_slicing.slice_size",description:`<strong>slice_size</strong> (<code>str</code> or <code>int</code>, <em>optional</em>, defaults to <code>&quot;auto&quot;</code>) &#x2014;
When <code>&quot;auto&quot;</code>, halves the input to the attention heads, so attention will be computed in two steps. If
<code>&quot;max&quot;</code>, maximum amount of memory will be saved by running only one slice at a time. If a number is
provided, uses as many slices as <code>attention_head_dim // slice_size</code>. In this case, <code>attention_head_dim</code>
must be a multiple of <code>slice_size</code>.`,name:"slice_size"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1600"}}),te=new _a({props:{warning:!0,$$slots:{default:[Zo]},$$scope:{ctx:$}}}),ne=new rn({props:{anchor:"diffusers.StableDiffusionXLAdapterPipeline.enable_attention_slicing.example",$$slots:{default:[Co]},$$scope:{ctx:$}}}),Tt=new k({props:{name:"disable_attention_slicing",anchor:"diffusers.StableDiffusionXLAdapterPipeline.disable_attention_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1640"}}),xt=new k({props:{name:"enable_vae_slicing",anchor:"diffusers.StableDiffusionXLAdapterPipeline.enable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1662"}}),Ut=new k({props:{name:"disable_vae_slicing",anchor:"diffusers.StableDiffusionXLAdapterPipeline.disable_vae_slicing",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1669"}}),Jt=new k({props:{name:"enable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionXLAdapterPipeline.enable_xformers_memory_efficient_attention",parameters:[{name:"attention_op",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLAdapterPipeline.enable_xformers_memory_efficient_attention.attention_op",description:`<strong>attention_op</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
Override the default <code>None</code> operator for use as <code>op</code> argument to the
<a href="https://facebookresearch.github.io/xformers/components/ops.html#xformers.ops.memory_efficient_attention" rel="nofollow"><code>memory_efficient_attention()</code></a>
function of xFormers.`,name:"attention_op"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1539"}}),ie=new _a({props:{warning:!0,$$slots:{default:[Ao]},$$scope:{ctx:$}}}),le=new rn({props:{anchor:"diffusers.StableDiffusionXLAdapterPipeline.enable_xformers_memory_efficient_attention.example",$$slots:{default:[So]},$$scope:{ctx:$}}}),$t=new k({props:{name:"disable_xformers_memory_efficient_attention",anchor:"diffusers.StableDiffusionXLAdapterPipeline.disable_xformers_memory_efficient_attention",parameters:[],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/pipeline_utils.py#L1574"}}),jt=new k({props:{name:"encode_prompt",anchor:"diffusers.StableDiffusionXLAdapterPipeline.encode_prompt",parameters:[{name:"prompt",val:": str"},{name:"prompt_2",val:": Optional = None"},{name:"device",val:": Optional = None"},{name:"num_images_per_prompt",val:": int = 1"},{name:"do_classifier_free_guidance",val:": bool = True"},{name:"negative_prompt",val:": Optional = None"},{name:"negative_prompt_2",val:": Optional = None"},{name:"prompt_embeds",val:": Optional = None"},{name:"negative_prompt_embeds",val:": Optional = None"},{name:"pooled_prompt_embeds",val:": Optional = None"},{name:"negative_pooled_prompt_embeds",val:": Optional = None"},{name:"lora_scale",val:": Optional = None"},{name:"clip_skip",val:": Optional = None"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLAdapterPipeline.encode_prompt.prompt",description:`<strong>prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
prompt to be encoded`,name:"prompt"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.encode_prompt.prompt_2",description:`<strong>prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts to be sent to the <code>tokenizer_2</code> and <code>text_encoder_2</code>. If not defined, <code>prompt</code> is
used in both text-encoders
device &#x2014; (<code>torch.device</code>):
torch device`,name:"prompt_2"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.encode_prompt.num_images_per_prompt",description:`<strong>num_images_per_prompt</strong> (<code>int</code>) &#x2014;
number of images that should be generated per prompt`,name:"num_images_per_prompt"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.encode_prompt.do_classifier_free_guidance",description:`<strong>do_classifier_free_guidance</strong> (<code>bool</code>) &#x2014;
whether to use classifier free guidance or not`,name:"do_classifier_free_guidance"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.encode_prompt.negative_prompt",description:`<strong>negative_prompt</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation. If not defined, one has to pass
<code>negative_prompt_embeds</code> instead. Ignored when not using guidance (i.e., ignored if <code>guidance_scale</code> is
less than <code>1</code>).`,name:"negative_prompt"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.encode_prompt.negative_prompt_2",description:`<strong>negative_prompt_2</strong> (<code>str</code> or <code>List[str]</code>, <em>optional</em>) &#x2014;
The prompt or prompts not to guide the image generation to be sent to <code>tokenizer_2</code> and
<code>text_encoder_2</code>. If not defined, <code>negative_prompt</code> is used in both text-encoders`,name:"negative_prompt_2"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.encode_prompt.prompt_embeds",description:`<strong>prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting. If not
provided, text embeddings will be generated from <code>prompt</code> input argument.`,name:"prompt_embeds"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.encode_prompt.negative_prompt_embeds",description:`<strong>negative_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, negative_prompt_embeds will be generated from <code>negative_prompt</code> input
argument.`,name:"negative_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.encode_prompt.pooled_prompt_embeds",description:`<strong>pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt weighting.
If not provided, pooled text embeddings will be generated from <code>prompt</code> input argument.`,name:"pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.encode_prompt.negative_pooled_prompt_embeds",description:`<strong>negative_pooled_prompt_embeds</strong> (<code>torch.FloatTensor</code>, <em>optional</em>) &#x2014;
Pre-generated negative pooled text embeddings. Can be used to easily tweak text inputs, <em>e.g.</em> prompt
weighting. If not provided, pooled negative_prompt_embeds will be generated from <code>negative_prompt</code>
input argument.`,name:"negative_pooled_prompt_embeds"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.encode_prompt.lora_scale",description:`<strong>lora_scale</strong> (<code>float</code>, <em>optional</em>) &#x2014;
A lora scale that will be applied to all LoRA layers of the text encoder if LoRA layers are loaded.`,name:"lora_scale"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.encode_prompt.clip_skip",description:`<strong>clip_skip</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Number of layers to be skipped from CLIP while computing the prompt embeddings. A value of 1 means that
the output of the pre-final layer will be used for computing the prompt embeddings.`,name:"clip_skip"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_xl_adapter.py#L275"}}),It=new k({props:{name:"get_guidance_scale_embedding",anchor:"diffusers.StableDiffusionXLAdapterPipeline.get_guidance_scale_embedding",parameters:[{name:"w",val:": Tensor"},{name:"embedding_dim",val:": int = 512"},{name:"dtype",val:": dtype = torch.float32"}],parametersDescription:[{anchor:"diffusers.StableDiffusionXLAdapterPipeline.get_guidance_scale_embedding.w",description:`<strong>w</strong> (<code>torch.Tensor</code>) &#x2014;
Generate embedding vectors with a specified guidance scale to subsequently enrich timestep embeddings.`,name:"w"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.get_guidance_scale_embedding.embedding_dim",description:`<strong>embedding_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimension of the embeddings to generate.`,name:"embedding_dim"},{anchor:"diffusers.StableDiffusionXLAdapterPipeline.get_guidance_scale_embedding.dtype",description:`<strong>dtype</strong> (<code>torch.dtype</code>, <em>optional</em>, defaults to <code>torch.float32</code>) &#x2014;
Data type of the generated embeddings.`,name:"dtype"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/t2i_adapter/pipeline_stable_diffusion_xl_adapter.py#L787",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Embedding vectors with shape <code>(len(w), embedding_dim)</code>.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>torch.FloatTensor</code></p>
`}}),{c(){p=r("meta"),v=a(),f=r("p"),m=a(),g(w.$$.fragment),l=a(),g(T.$$.fragment),pn=a(),fe=r("p"),fe.innerHTML=hs,cn=a(),ge=r("p"),ge.textContent=_s,mn=a(),ue=r("p"),ue.textContent=bs,fn=a(),he=r("p"),he.innerHTML=ys,gn=a(),_e=r("p"),_e.innerHTML=ws,un=a(),g(be.$$.fragment),hn=a(),ye=r("table"),ye.innerHTML=vs,_n=a(),g(we.$$.fragment),bn=a(),ve=r("p"),ve.innerHTML=Ms,yn=a(),Me=r("ol"),Me.innerHTML=Ts,wn=a(),Te=r("p"),Te.innerHTML=xs,vn=a(),g(xe.$$.fragment),Mn=a(),Ue=r("p"),Ue.innerHTML=Us,Tn=a(),Je=r("p"),Je.textContent=Js,xn=a(),g($e.$$.fragment),Un=a(),je=r("p"),je.textContent=$s,Jn=a(),Ie=r("p"),Ie.innerHTML=js,$n=a(),ke=r("p"),ke.textContent=Is,jn=a(),g(Ze.$$.fragment),In=a(),Ce=r("p"),Ce.textContent=ks,kn=a(),g(Ae.$$.fragment),Zn=a(),Se=r("p"),Se.innerHTML=Zs,Cn=a(),g(Ge.$$.fragment),An=a(),De=r("p"),De.innerHTML=Cs,Sn=a(),Pe=r("ol"),Pe.innerHTML=As,Gn=a(),Le=r("p"),Le.innerHTML=Ss,Dn=a(),g(Xe.$$.fragment),Pn=a(),We=r("p"),We.innerHTML=Gs,Ln=a(),Re=r("p"),Re.textContent=Ds,Xn=a(),g(Be.$$.fragment),Wn=a(),Ne=r("p"),Ne.textContent=Ps,Rn=a(),g(Fe.$$.fragment),Bn=a(),Ve=r("p"),Ve.innerHTML=Ls,Nn=a(),g(Ee.$$.fragment),Fn=a(),Qe=r("p"),Qe.innerHTML=Xs,Vn=a(),g(He.$$.fragment),En=a(),Ye=r("table"),Ye.innerHTML=Ws,Qn=a(),g(ze.$$.fragment),Hn=a(),qe=r("p"),qe.innerHTML=Rs,Yn=a(),Oe=r("p"),Oe.textContent=Bs,zn=a(),g(Ke.$$.fragment),qn=a(),et=r("p"),et.textContent=Ns,On=a(),tt=r("p"),tt.innerHTML=Fs,Kn=a(),nt=r("p"),nt.innerHTML=Vs,ea=a(),at=r("p"),at.innerHTML=Es,ta=a(),g(st.$$.fragment),na=a(),ot=r("p"),ot.innerHTML=Qs,aa=a(),g(it.$$.fragment),sa=a(),lt=r("p"),lt.innerHTML=Hs,oa=a(),g(rt.$$.fragment),ia=a(),x=r("div"),g(dt.$$.fragment),ba=a(),Dt=r("p"),Dt.innerHTML=Ys,ya=a(),Pt=r("p"),Pt.innerHTML=zs,wa=a(),X=r("div"),g(pt.$$.fragment),va=a(),Lt=r("p"),Lt.textContent=qs,Ma=a(),g(N.$$.fragment),Ta=a(),C=r("div"),g(ct.$$.fragment),xa=a(),Xt=r("p"),Xt.textContent=Os,Ua=a(),g(F.$$.fragment),Ja=a(),g(V.$$.fragment),$a=a(),E=r("div"),g(mt.$$.fragment),ja=a(),Wt=r("p"),Wt.innerHTML=Ks,Ia=a(),Q=r("div"),g(ft.$$.fragment),ka=a(),Rt=r("p"),Rt.textContent=eo,Za=a(),H=r("div"),g(gt.$$.fragment),Ca=a(),Bt=r("p"),Bt.innerHTML=to,Aa=a(),A=r("div"),g(ut.$$.fragment),Sa=a(),Nt=r("p"),Nt.innerHTML=no,Ga=a(),g(Y.$$.fragment),Da=a(),g(z.$$.fragment),Pa=a(),q=r("div"),g(ht.$$.fragment),La=a(),Ft=r("p"),Ft.innerHTML=ao,Xa=a(),O=r("div"),g(_t.$$.fragment),Wa=a(),Vt=r("p"),Vt.textContent=so,Ra=a(),K=r("div"),g(bt.$$.fragment),Ba=a(),Et=r("p"),Et.innerHTML=oo,la=a(),g(yt.$$.fragment),ra=a(),M=r("div"),g(wt.$$.fragment),Na=a(),Qt=r("p"),Qt.innerHTML=io,Fa=a(),Ht=r("p"),Ht.innerHTML=lo,Va=a(),Yt=r("p"),Yt.textContent=ro,Ea=a(),zt=r("ul"),zt.innerHTML=po,Qa=a(),W=r("div"),g(vt.$$.fragment),Ha=a(),qt=r("p"),qt.textContent=co,Ya=a(),g(ee.$$.fragment),za=a(),S=r("div"),g(Mt.$$.fragment),qa=a(),Ot=r("p"),Ot.textContent=mo,Oa=a(),g(te.$$.fragment),Ka=a(),g(ne.$$.fragment),es=a(),ae=r("div"),g(Tt.$$.fragment),ts=a(),Kt=r("p"),Kt.innerHTML=fo,ns=a(),se=r("div"),g(xt.$$.fragment),as=a(),en=r("p"),en.textContent=go,ss=a(),oe=r("div"),g(Ut.$$.fragment),os=a(),tn=r("p"),tn.innerHTML=uo,is=a(),G=r("div"),g(Jt.$$.fragment),ls=a(),nn=r("p"),nn.innerHTML=ho,rs=a(),g(ie.$$.fragment),ds=a(),g(le.$$.fragment),ps=a(),re=r("div"),g($t.$$.fragment),cs=a(),an=r("p"),an.innerHTML=_o,ms=a(),de=r("div"),g(jt.$$.fragment),fs=a(),sn=r("p"),sn.textContent=bo,gs=a(),pe=r("div"),g(It.$$.fragment),us=a(),on=r("p"),on.innerHTML=yo,da=a(),dn=r("p"),this.h()},l(e){const t=xo("svelte-u9bgzb",document.head);p=d(t,"META",{name:!0,content:!0}),t.forEach(n),v=s(e),f=d(e,"P",{}),j(f).forEach(n),m=s(e),u(w.$$.fragment,e),l=s(e),u(T.$$.fragment,e),pn=s(e),fe=d(e,"P",{"data-svelte-h":!0}),c(fe)!=="svelte-1frzd9j"&&(fe.innerHTML=hs),cn=s(e),ge=d(e,"P",{"data-svelte-h":!0}),c(ge)!=="svelte-rz87yd"&&(ge.textContent=_s),mn=s(e),ue=d(e,"P",{"data-svelte-h":!0}),c(ue)!=="svelte-wu27l3"&&(ue.textContent=bs),fn=s(e),he=d(e,"P",{"data-svelte-h":!0}),c(he)!=="svelte-yrtfs"&&(he.innerHTML=ys),gn=s(e),_e=d(e,"P",{"data-svelte-h":!0}),c(_e)!=="svelte-1m3nepz"&&(_e.innerHTML=ws),un=s(e),u(be.$$.fragment,e),hn=s(e),ye=d(e,"TABLE",{"data-svelte-h":!0}),c(ye)!=="svelte-15wpul1"&&(ye.innerHTML=vs),_n=s(e),u(we.$$.fragment,e),bn=s(e),ve=d(e,"P",{"data-svelte-h":!0}),c(ve)!=="svelte-1arnca0"&&(ve.innerHTML=Ms),yn=s(e),Me=d(e,"OL",{"data-svelte-h":!0}),c(Me)!=="svelte-1yj0xra"&&(Me.innerHTML=Ts),wn=s(e),Te=d(e,"P",{"data-svelte-h":!0}),c(Te)!=="svelte-1gtojsx"&&(Te.innerHTML=xs),vn=s(e),u(xe.$$.fragment,e),Mn=s(e),Ue=d(e,"P",{"data-svelte-h":!0}),c(Ue)!=="svelte-8mkiuz"&&(Ue.innerHTML=Us),Tn=s(e),Je=d(e,"P",{"data-svelte-h":!0}),c(Je)!=="svelte-1vnw3f1"&&(Je.textContent=Js),xn=s(e),u($e.$$.fragment,e),Un=s(e),je=d(e,"P",{"data-svelte-h":!0}),c(je)!=="svelte-1nomn51"&&(je.textContent=$s),Jn=s(e),Ie=d(e,"P",{"data-svelte-h":!0}),c(Ie)!=="svelte-x98fz5"&&(Ie.innerHTML=js),$n=s(e),ke=d(e,"P",{"data-svelte-h":!0}),c(ke)!=="svelte-1al420d"&&(ke.textContent=Is),jn=s(e),u(Ze.$$.fragment,e),In=s(e),Ce=d(e,"P",{"data-svelte-h":!0}),c(Ce)!=="svelte-yyug88"&&(Ce.textContent=ks),kn=s(e),u(Ae.$$.fragment,e),Zn=s(e),Se=d(e,"P",{"data-svelte-h":!0}),c(Se)!=="svelte-b2o0wp"&&(Se.innerHTML=Zs),Cn=s(e),u(Ge.$$.fragment,e),An=s(e),De=d(e,"P",{"data-svelte-h":!0}),c(De)!=="svelte-1y2wyg6"&&(De.innerHTML=Cs),Sn=s(e),Pe=d(e,"OL",{"data-svelte-h":!0}),c(Pe)!=="svelte-j8d5w5"&&(Pe.innerHTML=As),Gn=s(e),Le=d(e,"P",{"data-svelte-h":!0}),c(Le)!=="svelte-1q04fzy"&&(Le.innerHTML=Ss),Dn=s(e),u(Xe.$$.fragment,e),Pn=s(e),We=d(e,"P",{"data-svelte-h":!0}),c(We)!=="svelte-1651djs"&&(We.innerHTML=Gs),Ln=s(e),Re=d(e,"P",{"data-svelte-h":!0}),c(Re)!=="svelte-1e55rj3"&&(Re.textContent=Ds),Xn=s(e),u(Be.$$.fragment,e),Wn=s(e),Ne=d(e,"P",{"data-svelte-h":!0}),c(Ne)!=="svelte-yyug88"&&(Ne.textContent=Ps),Rn=s(e),u(Fe.$$.fragment,e),Bn=s(e),Ve=d(e,"P",{"data-svelte-h":!0}),c(Ve)!=="svelte-1qebwe0"&&(Ve.innerHTML=Ls),Nn=s(e),u(Ee.$$.fragment,e),Fn=s(e),Qe=d(e,"P",{"data-svelte-h":!0}),c(Qe)!=="svelte-qop6by"&&(Qe.innerHTML=Xs),Vn=s(e),u(He.$$.fragment,e),En=s(e),Ye=d(e,"TABLE",{"data-svelte-h":!0}),c(Ye)!=="svelte-1l9s9j"&&(Ye.innerHTML=Ws),Qn=s(e),u(ze.$$.fragment,e),Hn=s(e),qe=d(e,"P",{"data-svelte-h":!0}),c(qe)!=="svelte-1uq2woy"&&(qe.innerHTML=Rs),Yn=s(e),Oe=d(e,"P",{"data-svelte-h":!0}),c(Oe)!=="svelte-1huix7d"&&(Oe.textContent=Bs),zn=s(e),u(Ke.$$.fragment,e),qn=s(e),et=d(e,"P",{"data-svelte-h":!0}),c(et)!=="svelte-aevisk"&&(et.textContent=Ns),On=s(e),tt=d(e,"P",{"data-svelte-h":!0}),c(tt)!=="svelte-1k4lejl"&&(tt.innerHTML=Fs),Kn=s(e),nt=d(e,"P",{"data-svelte-h":!0}),c(nt)!=="svelte-1aigb0j"&&(nt.innerHTML=Vs),ea=s(e),at=d(e,"P",{"data-svelte-h":!0}),c(at)!=="svelte-blouap"&&(at.innerHTML=Es),ta=s(e),u(st.$$.fragment,e),na=s(e),ot=d(e,"P",{"data-svelte-h":!0}),c(ot)!=="svelte-1ec5fzf"&&(ot.innerHTML=Qs),aa=s(e),u(it.$$.fragment,e),sa=s(e),lt=d(e,"P",{"data-svelte-h":!0}),c(lt)!=="svelte-70729v"&&(lt.innerHTML=Hs),oa=s(e),u(rt.$$.fragment,e),ia=s(e),x=d(e,"DIV",{class:!0});var J=j(x);u(dt.$$.fragment,J),ba=s(J),Dt=d(J,"P",{"data-svelte-h":!0}),c(Dt)!=="svelte-1pw3838"&&(Dt.innerHTML=Ys),ya=s(J),Pt=d(J,"P",{"data-svelte-h":!0}),c(Pt)!=="svelte-wu1jmh"&&(Pt.innerHTML=zs),wa=s(J),X=d(J,"DIV",{class:!0});var B=j(X);u(pt.$$.fragment,B),va=s(B),Lt=d(B,"P",{"data-svelte-h":!0}),c(Lt)!=="svelte-v78lg8"&&(Lt.textContent=qs),Ma=s(B),u(N.$$.fragment,B),B.forEach(n),Ta=s(J),C=d(J,"DIV",{class:!0});var D=j(C);u(ct.$$.fragment,D),xa=s(D),Xt=d(D,"P",{"data-svelte-h":!0}),c(Xt)!=="svelte-10jaql7"&&(Xt.textContent=Os),Ua=s(D),u(F.$$.fragment,D),Ja=s(D),u(V.$$.fragment,D),D.forEach(n),$a=s(J),E=d(J,"DIV",{class:!0});var kt=j(E);u(mt.$$.fragment,kt),ja=s(kt),Wt=d(kt,"P",{"data-svelte-h":!0}),c(Wt)!=="svelte-1lh0nh5"&&(Wt.innerHTML=Ks),kt.forEach(n),Ia=s(J),Q=d(J,"DIV",{class:!0});var Zt=j(Q);u(ft.$$.fragment,Zt),ka=s(Zt),Rt=d(Zt,"P",{"data-svelte-h":!0}),c(Rt)!=="svelte-14bnrb6"&&(Rt.textContent=eo),Zt.forEach(n),Za=s(J),H=d(J,"DIV",{class:!0});var Ct=j(H);u(gt.$$.fragment,Ct),Ca=s(Ct),Bt=d(Ct,"P",{"data-svelte-h":!0}),c(Bt)!=="svelte-1s3c06i"&&(Bt.innerHTML=to),Ct.forEach(n),Aa=s(J),A=d(J,"DIV",{class:!0});var P=j(A);u(ut.$$.fragment,P),Sa=s(P),Nt=d(P,"P",{"data-svelte-h":!0}),c(Nt)!=="svelte-e03q3e"&&(Nt.innerHTML=no),Ga=s(P),u(Y.$$.fragment,P),Da=s(P),u(z.$$.fragment,P),P.forEach(n),Pa=s(J),q=d(J,"DIV",{class:!0});var At=j(q);u(ht.$$.fragment,At),La=s(At),Ft=d(At,"P",{"data-svelte-h":!0}),c(Ft)!=="svelte-1vfte1e"&&(Ft.innerHTML=ao),At.forEach(n),Xa=s(J),O=d(J,"DIV",{class:!0});var St=j(O);u(_t.$$.fragment,St),Wa=s(St),Vt=d(St,"P",{"data-svelte-h":!0}),c(Vt)!=="svelte-16q0ax1"&&(Vt.textContent=so),St.forEach(n),Ra=s(J),K=d(J,"DIV",{class:!0});var Gt=j(K);u(bt.$$.fragment,Gt),Ba=s(Gt),Et=d(Gt,"P",{"data-svelte-h":!0}),c(Et)!=="svelte-vo59ec"&&(Et.innerHTML=oo),Gt.forEach(n),J.forEach(n),la=s(e),u(yt.$$.fragment,e),ra=s(e),M=d(e,"DIV",{class:!0});var U=j(M);u(wt.$$.fragment,U),Na=s(U),Qt=d(U,"P",{"data-svelte-h":!0}),c(Qt)!=="svelte-1pw3838"&&(Qt.innerHTML=io),Fa=s(U),Ht=d(U,"P",{"data-svelte-h":!0}),c(Ht)!=="svelte-wu1jmh"&&(Ht.innerHTML=lo),Va=s(U),Yt=d(U,"P",{"data-svelte-h":!0}),c(Yt)!=="svelte-14s6m4u"&&(Yt.textContent=ro),Ea=s(U),zt=d(U,"UL",{"data-svelte-h":!0}),c(zt)!=="svelte-v293x3"&&(zt.innerHTML=po),Qa=s(U),W=d(U,"DIV",{class:!0});var ln=j(W);u(vt.$$.fragment,ln),Ha=s(ln),qt=d(ln,"P",{"data-svelte-h":!0}),c(qt)!=="svelte-v78lg8"&&(qt.textContent=co),Ya=s(ln),u(ee.$$.fragment,ln),ln.forEach(n),za=s(U),S=d(U,"DIV",{class:!0});var ce=j(S);u(Mt.$$.fragment,ce),qa=s(ce),Ot=d(ce,"P",{"data-svelte-h":!0}),c(Ot)!=="svelte-10jaql7"&&(Ot.textContent=mo),Oa=s(ce),u(te.$$.fragment,ce),Ka=s(ce),u(ne.$$.fragment,ce),ce.forEach(n),es=s(U),ae=d(U,"DIV",{class:!0});var ca=j(ae);u(Tt.$$.fragment,ca),ts=s(ca),Kt=d(ca,"P",{"data-svelte-h":!0}),c(Kt)!=="svelte-1lh0nh5"&&(Kt.innerHTML=fo),ca.forEach(n),ns=s(U),se=d(U,"DIV",{class:!0});var ma=j(se);u(xt.$$.fragment,ma),as=s(ma),en=d(ma,"P",{"data-svelte-h":!0}),c(en)!=="svelte-14bnrb6"&&(en.textContent=go),ma.forEach(n),ss=s(U),oe=d(U,"DIV",{class:!0});var fa=j(oe);u(Ut.$$.fragment,fa),os=s(fa),tn=d(fa,"P",{"data-svelte-h":!0}),c(tn)!=="svelte-1s3c06i"&&(tn.innerHTML=uo),fa.forEach(n),is=s(U),G=d(U,"DIV",{class:!0});var me=j(G);u(Jt.$$.fragment,me),ls=s(me),nn=d(me,"P",{"data-svelte-h":!0}),c(nn)!=="svelte-e03q3e"&&(nn.innerHTML=ho),rs=s(me),u(ie.$$.fragment,me),ds=s(me),u(le.$$.fragment,me),me.forEach(n),ps=s(U),re=d(U,"DIV",{class:!0});var ga=j(re);u($t.$$.fragment,ga),cs=s(ga),an=d(ga,"P",{"data-svelte-h":!0}),c(an)!=="svelte-1vfte1e"&&(an.innerHTML=_o),ga.forEach(n),ms=s(U),de=d(U,"DIV",{class:!0});var ua=j(de);u(jt.$$.fragment,ua),fs=s(ua),sn=d(ua,"P",{"data-svelte-h":!0}),c(sn)!=="svelte-16q0ax1"&&(sn.textContent=bo),ua.forEach(n),gs=s(U),pe=d(U,"DIV",{class:!0});var ha=j(pe);u(It.$$.fragment,ha),us=s(ha),on=d(ha,"P",{"data-svelte-h":!0}),c(on)!=="svelte-vo59ec"&&(on.innerHTML=yo),ha.forEach(n),U.forEach(n),da=s(e),dn=d(e,"P",{}),j(dn).forEach(n),this.h()},h(){I(p,"name","hf:doc:metadata"),I(p,"content",Do),I(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),I(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){i(document.head,p),o(e,v,t),o(e,f,t),o(e,m,t),h(w,e,t),o(e,l,t),h(T,e,t),o(e,pn,t),o(e,fe,t),o(e,cn,t),o(e,ge,t),o(e,mn,t),o(e,ue,t),o(e,fn,t),o(e,he,t),o(e,gn,t),o(e,_e,t),o(e,un,t),h(be,e,t),o(e,hn,t),o(e,ye,t),o(e,_n,t),h(we,e,t),o(e,bn,t),o(e,ve,t),o(e,yn,t),o(e,Me,t),o(e,wn,t),o(e,Te,t),o(e,vn,t),h(xe,e,t),o(e,Mn,t),o(e,Ue,t),o(e,Tn,t),o(e,Je,t),o(e,xn,t),h($e,e,t),o(e,Un,t),o(e,je,t),o(e,Jn,t),o(e,Ie,t),o(e,$n,t),o(e,ke,t),o(e,jn,t),h(Ze,e,t),o(e,In,t),o(e,Ce,t),o(e,kn,t),h(Ae,e,t),o(e,Zn,t),o(e,Se,t),o(e,Cn,t),h(Ge,e,t),o(e,An,t),o(e,De,t),o(e,Sn,t),o(e,Pe,t),o(e,Gn,t),o(e,Le,t),o(e,Dn,t),h(Xe,e,t),o(e,Pn,t),o(e,We,t),o(e,Ln,t),o(e,Re,t),o(e,Xn,t),h(Be,e,t),o(e,Wn,t),o(e,Ne,t),o(e,Rn,t),h(Fe,e,t),o(e,Bn,t),o(e,Ve,t),o(e,Nn,t),h(Ee,e,t),o(e,Fn,t),o(e,Qe,t),o(e,Vn,t),h(He,e,t),o(e,En,t),o(e,Ye,t),o(e,Qn,t),h(ze,e,t),o(e,Hn,t),o(e,qe,t),o(e,Yn,t),o(e,Oe,t),o(e,zn,t),h(Ke,e,t),o(e,qn,t),o(e,et,t),o(e,On,t),o(e,tt,t),o(e,Kn,t),o(e,nt,t),o(e,ea,t),o(e,at,t),o(e,ta,t),h(st,e,t),o(e,na,t),o(e,ot,t),o(e,aa,t),h(it,e,t),o(e,sa,t),o(e,lt,t),o(e,oa,t),h(rt,e,t),o(e,ia,t),o(e,x,t),h(dt,x,null),i(x,ba),i(x,Dt),i(x,ya),i(x,Pt),i(x,wa),i(x,X),h(pt,X,null),i(X,va),i(X,Lt),i(X,Ma),h(N,X,null),i(x,Ta),i(x,C),h(ct,C,null),i(C,xa),i(C,Xt),i(C,Ua),h(F,C,null),i(C,Ja),h(V,C,null),i(x,$a),i(x,E),h(mt,E,null),i(E,ja),i(E,Wt),i(x,Ia),i(x,Q),h(ft,Q,null),i(Q,ka),i(Q,Rt),i(x,Za),i(x,H),h(gt,H,null),i(H,Ca),i(H,Bt),i(x,Aa),i(x,A),h(ut,A,null),i(A,Sa),i(A,Nt),i(A,Ga),h(Y,A,null),i(A,Da),h(z,A,null),i(x,Pa),i(x,q),h(ht,q,null),i(q,La),i(q,Ft),i(x,Xa),i(x,O),h(_t,O,null),i(O,Wa),i(O,Vt),i(x,Ra),i(x,K),h(bt,K,null),i(K,Ba),i(K,Et),o(e,la,t),h(yt,e,t),o(e,ra,t),o(e,M,t),h(wt,M,null),i(M,Na),i(M,Qt),i(M,Fa),i(M,Ht),i(M,Va),i(M,Yt),i(M,Ea),i(M,zt),i(M,Qa),i(M,W),h(vt,W,null),i(W,Ha),i(W,qt),i(W,Ya),h(ee,W,null),i(M,za),i(M,S),h(Mt,S,null),i(S,qa),i(S,Ot),i(S,Oa),h(te,S,null),i(S,Ka),h(ne,S,null),i(M,es),i(M,ae),h(Tt,ae,null),i(ae,ts),i(ae,Kt),i(M,ns),i(M,se),h(xt,se,null),i(se,as),i(se,en),i(M,ss),i(M,oe),h(Ut,oe,null),i(oe,os),i(oe,tn),i(M,is),i(M,G),h(Jt,G,null),i(G,ls),i(G,nn),i(G,rs),h(ie,G,null),i(G,ds),h(le,G,null),i(M,ps),i(M,re),h($t,re,null),i(re,cs),i(re,an),i(M,ms),i(M,de),h(jt,de,null),i(de,fs),i(de,sn),i(M,gs),i(M,pe),h(It,pe,null),i(pe,us),i(pe,on),o(e,da,t),o(e,dn,t),pa=!0},p(e,[t]){const J={};t&2&&(J.$$scope={dirty:t,ctx:e}),N.$set(J);const B={};t&2&&(B.$$scope={dirty:t,ctx:e}),F.$set(B);const D={};t&2&&(D.$$scope={dirty:t,ctx:e}),V.$set(D);const kt={};t&2&&(kt.$$scope={dirty:t,ctx:e}),Y.$set(kt);const Zt={};t&2&&(Zt.$$scope={dirty:t,ctx:e}),z.$set(Zt);const Ct={};t&2&&(Ct.$$scope={dirty:t,ctx:e}),ee.$set(Ct);const P={};t&2&&(P.$$scope={dirty:t,ctx:e}),te.$set(P);const At={};t&2&&(At.$$scope={dirty:t,ctx:e}),ne.$set(At);const St={};t&2&&(St.$$scope={dirty:t,ctx:e}),ie.$set(St);const Gt={};t&2&&(Gt.$$scope={dirty:t,ctx:e}),le.$set(Gt)},i(e){pa||(_(w.$$.fragment,e),_(T.$$.fragment,e),_(be.$$.fragment,e),_(we.$$.fragment,e),_(xe.$$.fragment,e),_($e.$$.fragment,e),_(Ze.$$.fragment,e),_(Ae.$$.fragment,e),_(Ge.$$.fragment,e),_(Xe.$$.fragment,e),_(Be.$$.fragment,e),_(Fe.$$.fragment,e),_(Ee.$$.fragment,e),_(He.$$.fragment,e),_(ze.$$.fragment,e),_(Ke.$$.fragment,e),_(st.$$.fragment,e),_(it.$$.fragment,e),_(rt.$$.fragment,e),_(dt.$$.fragment,e),_(pt.$$.fragment,e),_(N.$$.fragment,e),_(ct.$$.fragment,e),_(F.$$.fragment,e),_(V.$$.fragment,e),_(mt.$$.fragment,e),_(ft.$$.fragment,e),_(gt.$$.fragment,e),_(ut.$$.fragment,e),_(Y.$$.fragment,e),_(z.$$.fragment,e),_(ht.$$.fragment,e),_(_t.$$.fragment,e),_(bt.$$.fragment,e),_(yt.$$.fragment,e),_(wt.$$.fragment,e),_(vt.$$.fragment,e),_(ee.$$.fragment,e),_(Mt.$$.fragment,e),_(te.$$.fragment,e),_(ne.$$.fragment,e),_(Tt.$$.fragment,e),_(xt.$$.fragment,e),_(Ut.$$.fragment,e),_(Jt.$$.fragment,e),_(ie.$$.fragment,e),_(le.$$.fragment,e),_($t.$$.fragment,e),_(jt.$$.fragment,e),_(It.$$.fragment,e),pa=!0)},o(e){b(w.$$.fragment,e),b(T.$$.fragment,e),b(be.$$.fragment,e),b(we.$$.fragment,e),b(xe.$$.fragment,e),b($e.$$.fragment,e),b(Ze.$$.fragment,e),b(Ae.$$.fragment,e),b(Ge.$$.fragment,e),b(Xe.$$.fragment,e),b(Be.$$.fragment,e),b(Fe.$$.fragment,e),b(Ee.$$.fragment,e),b(He.$$.fragment,e),b(ze.$$.fragment,e),b(Ke.$$.fragment,e),b(st.$$.fragment,e),b(it.$$.fragment,e),b(rt.$$.fragment,e),b(dt.$$.fragment,e),b(pt.$$.fragment,e),b(N.$$.fragment,e),b(ct.$$.fragment,e),b(F.$$.fragment,e),b(V.$$.fragment,e),b(mt.$$.fragment,e),b(ft.$$.fragment,e),b(gt.$$.fragment,e),b(ut.$$.fragment,e),b(Y.$$.fragment,e),b(z.$$.fragment,e),b(ht.$$.fragment,e),b(_t.$$.fragment,e),b(bt.$$.fragment,e),b(yt.$$.fragment,e),b(wt.$$.fragment,e),b(vt.$$.fragment,e),b(ee.$$.fragment,e),b(Mt.$$.fragment,e),b(te.$$.fragment,e),b(ne.$$.fragment,e),b(Tt.$$.fragment,e),b(xt.$$.fragment,e),b(Ut.$$.fragment,e),b(Jt.$$.fragment,e),b(ie.$$.fragment,e),b(le.$$.fragment,e),b($t.$$.fragment,e),b(jt.$$.fragment,e),b(It.$$.fragment,e),pa=!1},d(e){e&&(n(v),n(f),n(m),n(l),n(pn),n(fe),n(cn),n(ge),n(mn),n(ue),n(fn),n(he),n(gn),n(_e),n(un),n(hn),n(ye),n(_n),n(bn),n(ve),n(yn),n(Me),n(wn),n(Te),n(vn),n(Mn),n(Ue),n(Tn),n(Je),n(xn),n(Un),n(je),n(Jn),n(Ie),n($n),n(ke),n(jn),n(In),n(Ce),n(kn),n(Zn),n(Se),n(Cn),n(An),n(De),n(Sn),n(Pe),n(Gn),n(Le),n(Dn),n(Pn),n(We),n(Ln),n(Re),n(Xn),n(Wn),n(Ne),n(Rn),n(Bn),n(Ve),n(Nn),n(Fn),n(Qe),n(Vn),n(En),n(Ye),n(Qn),n(Hn),n(qe),n(Yn),n(Oe),n(zn),n(qn),n(et),n(On),n(tt),n(Kn),n(nt),n(ea),n(at),n(ta),n(na),n(ot),n(aa),n(sa),n(lt),n(oa),n(ia),n(x),n(la),n(ra),n(M),n(da),n(dn)),n(p),y(w,e),y(T,e),y(be,e),y(we,e),y(xe,e),y($e,e),y(Ze,e),y(Ae,e),y(Ge,e),y(Xe,e),y(Be,e),y(Fe,e),y(Ee,e),y(He,e),y(ze,e),y(Ke,e),y(st,e),y(it,e),y(rt,e),y(dt),y(pt),y(N),y(ct),y(F),y(V),y(mt),y(ft),y(gt),y(ut),y(Y),y(z),y(ht),y(_t),y(bt),y(yt,e),y(wt),y(vt),y(ee),y(Mt),y(te),y(ne),y(Tt),y(xt),y(Ut),y(Jt),y(ie),y(le),y($t),y(jt),y(It)}}}const Do='{"title":"Text-to-Image Generation with Adapter Conditioning","local":"text-to-image-generation-with-adapter-conditioning","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Available Pipelines:","local":"available-pipelines","sections":[],"depth":2},{"title":"Usage example with the base model of StableDiffusion-1.4/1.5","local":"usage-example-with-the-base-model-of-stablediffusion-1415","sections":[],"depth":2},{"title":"Usage example with the base model of StableDiffusion-XL","local":"usage-example-with-the-base-model-of-stablediffusion-xl","sections":[],"depth":2},{"title":"Available checkpoints","local":"available-checkpoints","sections":[{"title":"T2I-Adapter with Stable Diffusion 1.4","local":"t2i-adapter-with-stable-diffusion-14","sections":[],"depth":3}],"depth":2},{"title":"Combining multiple adapters","local":"combining-multiple-adapters","sections":[],"depth":2},{"title":"T2I-Adapter vs ControlNet","local":"t2i-adapter-vs-controlnet","sections":[],"depth":2},{"title":"StableDiffusionAdapterPipeline","local":"diffusers.StableDiffusionAdapterPipeline","sections":[],"depth":2},{"title":"StableDiffusionXLAdapterPipeline","local":"diffusers.StableDiffusionXLAdapterPipeline","sections":[],"depth":2}],"depth":1}';function Po($){return vo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Vo extends Mo{constructor(p){super(),To(this,p,Po,Go,wo,{})}}export{Vo as component};
