import{s as rl,o as cl,n as v}from"../chunks/scheduler.53228c21.js";import{S as ml,i as dl,e as J,s as d,c as T,h as Ml,a as g,d as a,b as M,f as pl,g as b,j as U,k as R,l as ul,m as i,n as j,t as Z,o as W,p as C}from"../chunks/index.100fac89.js";import{C as hl}from"../chunks/CopyLLMTxtMenu.9360b11d.js";import{C as N}from"../chunks/CodeBlock.d30a6509.js";import{D as yl}from"../chunks/DocNotebookDropdown.1a28089c.js";import{H as Q,E as fl}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.c9001d7a.js";import{H as Me,a as _}from"../chunks/HfOption.fad27e59.js";function Jl(I){let s,h='To use LCMs, you need to load the LCM checkpoint for your supported model into <a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a> and replace the scheduler with the <a href="/docs/diffusers/main/en/api/schedulers/lcm#diffusers.LCMScheduler">LCMScheduler</a>. Then you can use the pipeline as usual, and pass a text prompt to generate an image in just 4 steps.',r,o,l="A couple of notes to keep in mind when using LCMs are:",n,m,u="<li>Typically, batch size is doubled inside the pipeline for classifier-free guidance. But LCM applies guidance with guidance embeddings and doesn’t need to double the batch size, which leads to faster inference. The downside is that negative prompts don’t work with LCM because they don’t have any effect on the denoising process.</li> <li>The ideal range for <code>guidance_scale</code> is [3., 13.] because that is what the UNet was trained with. However, disabling <code>guidance_scale</code> with a value of 1.0 is also effective in most cases.</li>",t,y,G,p,w='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/lcm/lcm_full_sdxl_t2i.png"/>',E;return y=new N({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUlMkMlMjBVTmV0MkRDb25kaXRpb25Nb2RlbCUyQyUyMExDTVNjaGVkdWxlciUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdW5ldCUyMCUzRCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsLmZyb21fcHJ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word">import</span> StableDiffusionXLPipeline, UNet2DConditionModel, LCMScheduler
<span class="hljs-keyword">import</span> torch

unet = UNet2DConditionModel.from_pretrained(
    <span class="hljs-string">&quot;latent-consistency/lcm-sdxl&quot;</span>,
    torch_dtype=torch.float16,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
)
pipe = StableDiffusionXLPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, unet=unet, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)

prompt = <span class="hljs-string">&quot;Self-portrait oil painting, a beautiful cyborg with golden hair, 8k&quot;</span>
generator = torch.manual_seed(<span class="hljs-number">0</span>)
image = pipe(
    prompt=prompt, num_inference_steps=<span class="hljs-number">4</span>, generator=generator, guidance_scale=<span class="hljs-number">8.0</span>
).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),{c(){s=J("p"),s.innerHTML=h,r=d(),o=J("p"),o.textContent=l,n=d(),m=J("ul"),m.innerHTML=u,t=d(),T(y.$$.fragment),G=d(),p=J("div"),p.innerHTML=w,this.h()},l(f){s=g(f,"P",{"data-svelte-h":!0}),U(s)!=="svelte-c1j69g"&&(s.innerHTML=h),r=M(f),o=g(f,"P",{"data-svelte-h":!0}),U(o)!=="svelte-185mgq9"&&(o.textContent=l),n=M(f),m=g(f,"UL",{"data-svelte-h":!0}),U(m)!=="svelte-1mvqiqn"&&(m.innerHTML=u),t=M(f),b(y.$$.fragment,f),G=M(f),p=g(f,"DIV",{class:!0,"data-svelte-h":!0}),U(p)!=="svelte-r54e1a"&&(p.innerHTML=w),this.h()},h(){R(p,"class","flex justify-center")},m(f,B){i(f,s,B),i(f,r,B),i(f,o,B),i(f,n,B),i(f,m,B),i(f,t,B),j(y,f,B),i(f,G,B),i(f,p,B),E=!0},p:v,i(f){E||(Z(y.$$.fragment,f),E=!0)},o(f){W(y.$$.fragment,f),E=!1},d(f){f&&(a(s),a(r),a(o),a(n),a(m),a(t),a(G),a(p)),C(y,f)}}}function gl(I){let s,h='To use LCM-LoRAs, you need to replace the scheduler with the <a href="/docs/diffusers/main/en/api/schedulers/lcm#diffusers.LCMScheduler">LCMScheduler</a> and load the LCM-LoRA weights with the <a href="/docs/diffusers/main/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.load_lora_weights">load_lora_weights()</a> method. Then you can use the pipeline as usual, and pass a text prompt to generate an image in just 4 steps.',r,o,l="A couple of notes to keep in mind when using LCM-LoRAs are:",n,m,u='<li>Typically, batch size is doubled inside the pipeline for classifier-free guidance. But LCM applies guidance with guidance embeddings and doesn’t need to double the batch size, which leads to faster inference. The downside is that negative prompts don’t work with LCM because they don’t have any effect on the denoising process.</li> <li>You could use guidance with LCM-LoRAs, but it is very sensitive to high <code>guidance_scale</code> values and can lead to artifacts in the generated image. The best values we’ve found are between [1.0, 2.0].</li> <li>Replace <a href="https://hf.co/stabilityai/stable-diffusion-xl-base-1.0" rel="nofollow">stabilityai/stable-diffusion-xl-base-1.0</a> with any finetuned model. For example, try using the <a href="https://huggingface.co/Linaqruf/animagine-xl" rel="nofollow">animagine-xl</a> checkpoint to generate anime images with SDXL.</li>',t,y,G,p,w='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/lcm/lcm_sdxl_t2i.png"/>',E;return y=new N({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMkMlMjBMQ01TY2hlZHVsZXIlMEElMEFwaXBlJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi14bC1iYXNlLTEuMCUyMiUyQyUwQSUyMCUyMCUyMCUyMHZhcmlhbnQlM0QlMjJmcDE2JTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTBBKS50byglMjJjdWRhJTIyKSUwQXBpcGUuc2NoZWR1bGVyJTIwJTNEJTIwTENNU2NoZWR1bGVyLmZyb21fY29uZmlnKHBpcGUuc2NoZWR1bGVyLmNvbmZpZyklMEFwaXBlLmxvYWRfbG9yYV93ZWlnaHRzKCUyMmxhdGVudC1jb25zaXN0ZW5jeSUyRmxjbS1sb3JhLXNkeGwlMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyU2VsZi1wb3J0cmFpdCUyMG9pbCUyMHBhaW50aW5nJTJDJTIwYSUyMGJlYXV0aWZ1bCUyMGN5Ym9yZyUyMHdpdGglMjBnb2xkZW4lMjBoYWlyJTJDJTIwOGslMjIlMEFnZW5lcmF0b3IlMjAlM0QlMjB0b3JjaC5tYW51YWxfc2VlZCg0MiklMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDQlMkMlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3IlMkMlMjBndWlkYW5jZV9zY2FsZSUzRDEuMCUwQSkuaW1hZ2VzJTVCMCU1RCUwQWltYWdl",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline, LCMScheduler

pipe = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
    torch_dtype=torch.float16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
pipe.load_lora_weights(<span class="hljs-string">&quot;latent-consistency/lcm-lora-sdxl&quot;</span>)

prompt = <span class="hljs-string">&quot;Self-portrait oil painting, a beautiful cyborg with golden hair, 8k&quot;</span>
generator = torch.manual_seed(<span class="hljs-number">42</span>)
image = pipe(
    prompt=prompt, num_inference_steps=<span class="hljs-number">4</span>, generator=generator, guidance_scale=<span class="hljs-number">1.0</span>
).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),{c(){s=J("p"),s.innerHTML=h,r=d(),o=J("p"),o.textContent=l,n=d(),m=J("ul"),m.innerHTML=u,t=d(),T(y.$$.fragment),G=d(),p=J("div"),p.innerHTML=w,this.h()},l(f){s=g(f,"P",{"data-svelte-h":!0}),U(s)!=="svelte-16y4sws"&&(s.innerHTML=h),r=M(f),o=g(f,"P",{"data-svelte-h":!0}),U(o)!=="svelte-1l0tu8o"&&(o.textContent=l),n=M(f),m=g(f,"UL",{"data-svelte-h":!0}),U(m)!=="svelte-yd1arq"&&(m.innerHTML=u),t=M(f),b(y.$$.fragment,f),G=M(f),p=g(f,"DIV",{class:!0,"data-svelte-h":!0}),U(p)!=="svelte-1qjqi5a"&&(p.innerHTML=w),this.h()},h(){R(p,"class","flex justify-center")},m(f,B){i(f,s,B),i(f,r,B),i(f,o,B),i(f,n,B),i(f,m,B),i(f,t,B),j(y,f,B),i(f,G,B),i(f,p,B),E=!0},p:v,i(f){E||(Z(y.$$.fragment,f),E=!0)},o(f){W(y.$$.fragment,f),E=!1},d(f){f&&(a(s),a(r),a(o),a(n),a(m),a(t),a(G),a(p)),C(y,f)}}}function Ul(I){let s,h,r,o;return s=new _({props:{id:"lcm-text2img",option:"LCM",$$slots:{default:[Jl]},$$scope:{ctx:I}}}),r=new _({props:{id:"lcm-text2img",option:"LCM-LoRA",$$slots:{default:[gl]},$$scope:{ctx:I}}}),{c(){T(s.$$.fragment),h=d(),T(r.$$.fragment)},l(l){b(s.$$.fragment,l),h=M(l),b(r.$$.fragment,l)},m(l,n){j(s,l,n),i(l,h,n),j(r,l,n),o=!0},p(l,n){const m={};n&2&&(m.$$scope={dirty:n,ctx:l}),s.$set(m);const u={};n&2&&(u.$$scope={dirty:n,ctx:l}),r.$set(u)},i(l){o||(Z(s.$$.fragment,l),Z(r.$$.fragment,l),o=!0)},o(l){W(s.$$.fragment,l),W(r.$$.fragment,l),o=!1},d(l){l&&a(h),C(s,l),C(r,l)}}}function wl(I){let s,h='To use LCMs for image-to-image, you need to load the LCM checkpoint for your supported model into <a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a> and replace the scheduler with the <a href="/docs/diffusers/main/en/api/schedulers/lcm#diffusers.LCMScheduler">LCMScheduler</a>. Then you can use the pipeline as usual, and pass a text prompt and initial image to generate an image in just 4 steps.',r,o,l="<p>Experiment with different values for <code>num_inference_steps</code>, <code>strength</code>, and <code>guidance_scale</code> to get the best results.</p>",n,m,u,t,y='<div><img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/img2img-init.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">initial image</figcaption></div> <div><img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/lcm-img2img.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">generated image</figcaption></div>',G;return m=new N({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQXV0b1BpcGVsaW5lRm9ySW1hZ2UySW1hZ2UlMkMlMjBVTmV0MkRDb25kaXRpb25Nb2RlbCUyQyUyMExDTVNjaGVkdWxlciUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBJTBBdW5ldCUyMCUzRCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJTaW1pYW5MdW8lMkZMQ01fRHJlYW1zaGFwZXJfdjclMjIlMkMlMEElMjAlMjAlMjAlMjB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dF9pbWFnZSUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q0JTJDJTBBJTIwJTIwJTIwJTIwZ3VpZGFuY2Vfc2NhbGUlM0Q3LjUlMkMlMEElMjAlMjAlMjAlMjBzdHJlbmd0aCUzRDAuNSUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUwQSkuaW1hZ2VzJTVCMCU1RCUwQWltYWdl",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForImage2Image, UNet2DConditionModel, LCMScheduler
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

unet = UNet2DConditionModel.from_pretrained(
    <span class="hljs-string">&quot;SimianLuo/LCM_Dreamshaper_v7&quot;</span>,
    subfolder=<span class="hljs-string">&quot;unet&quot;</span>,
    torch_dtype=torch.float16,
)

pipe = AutoPipelineForImage2Image.from_pretrained(
    <span class="hljs-string">&quot;Lykon/dreamshaper-7&quot;</span>,
    unet=unet,
    torch_dtype=torch.float16,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)

init_image = load_image(<span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/img2img-init.png&quot;</span>)
prompt = <span class="hljs-string">&quot;Astronauts in a jungle, cold color palette, muted colors, detailed, 8k&quot;</span>
generator = torch.manual_seed(<span class="hljs-number">0</span>)
image = pipe(
    prompt,
    image=init_image,
    num_inference_steps=<span class="hljs-number">4</span>,
    guidance_scale=<span class="hljs-number">7.5</span>,
    strength=<span class="hljs-number">0.5</span>,
    generator=generator
).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),{c(){s=J("p"),s.innerHTML=h,r=d(),o=J("blockquote"),o.innerHTML=l,n=d(),T(m.$$.fragment),u=d(),t=J("div"),t.innerHTML=y,this.h()},l(p){s=g(p,"P",{"data-svelte-h":!0}),U(s)!=="svelte-1gm91p6"&&(s.innerHTML=h),r=M(p),o=g(p,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),U(o)!=="svelte-no4hyc"&&(o.innerHTML=l),n=M(p),b(m.$$.fragment,p),u=M(p),t=g(p,"DIV",{class:!0,"data-svelte-h":!0}),U(t)!=="svelte-f0uu5w"&&(t.innerHTML=y),this.h()},h(){R(o,"class","tip"),R(t,"class","flex gap-4")},m(p,w){i(p,s,w),i(p,r,w),i(p,o,w),i(p,n,w),j(m,p,w),i(p,u,w),i(p,t,w),G=!0},p:v,i(p){G||(Z(m.$$.fragment,p),G=!0)},o(p){W(m.$$.fragment,p),G=!1},d(p){p&&(a(s),a(r),a(o),a(n),a(u),a(t)),C(m,p)}}}function Tl(I){let s,h='To use LCM-LoRAs for image-to-image, you need to replace the scheduler with the <a href="/docs/diffusers/main/en/api/schedulers/lcm#diffusers.LCMScheduler">LCMScheduler</a> and load the LCM-LoRA weights with the <a href="/docs/diffusers/main/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.load_lora_weights">load_lora_weights()</a> method. Then you can use the pipeline as usual, and pass a text prompt and initial image to generate an image in just 4 steps.',r,o,l="<p>Experiment with different values for <code>num_inference_steps</code>, <code>strength</code>, and <code>guidance_scale</code> to get the best results.</p>",n,m,u,t,y='<div><img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/img2img-init.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">initial image</figcaption></div> <div><img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/lcm-lora-img2img.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">generated image</figcaption></div>',G;return m=new N({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQXV0b1BpcGVsaW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Wxfc2VlZCgwKSUwQWltYWdlJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBpbWFnZSUzRGluaXRfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENCUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEMSUyQyUwQSUyMCUyMCUyMCUyMHN0cmVuZ3RoJTNEMC42JTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTBBKS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2U=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForImage2Image, LCMScheduler
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> make_image_grid, load_image

pipe = AutoPipelineForImage2Image.from_pretrained(
    <span class="hljs-string">&quot;Lykon/dreamshaper-7&quot;</span>,
    torch_dtype=torch.float16,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

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

pipe.load_lora_weights(<span class="hljs-string">&quot;latent-consistency/lcm-lora-sdv1-5&quot;</span>)

init_image = load_image(<span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/img2img-init.png&quot;</span>)
prompt = <span class="hljs-string">&quot;Astronauts in a jungle, cold color palette, muted colors, detailed, 8k&quot;</span>

generator = torch.manual_seed(<span class="hljs-number">0</span>)
image = pipe(
    prompt,
    image=init_image,
    num_inference_steps=<span class="hljs-number">4</span>,
    guidance_scale=<span class="hljs-number">1</span>,
    strength=<span class="hljs-number">0.6</span>,
    generator=generator
).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),{c(){s=J("p"),s.innerHTML=h,r=d(),o=J("blockquote"),o.innerHTML=l,n=d(),T(m.$$.fragment),u=d(),t=J("div"),t.innerHTML=y,this.h()},l(p){s=g(p,"P",{"data-svelte-h":!0}),U(s)!=="svelte-18m7zh0"&&(s.innerHTML=h),r=M(p),o=g(p,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),U(o)!=="svelte-no4hyc"&&(o.innerHTML=l),n=M(p),b(m.$$.fragment,p),u=M(p),t=g(p,"DIV",{class:!0,"data-svelte-h":!0}),U(t)!=="svelte-1n6qllf"&&(t.innerHTML=y),this.h()},h(){R(o,"class","tip"),R(t,"class","flex gap-4")},m(p,w){i(p,s,w),i(p,r,w),i(p,o,w),i(p,n,w),j(m,p,w),i(p,u,w),i(p,t,w),G=!0},p:v,i(p){G||(Z(m.$$.fragment,p),G=!0)},o(p){W(m.$$.fragment,p),G=!1},d(p){p&&(a(s),a(r),a(o),a(n),a(u),a(t)),C(m,p)}}}function bl(I){let s,h,r,o;return s=new _({props:{id:"lcm-img2img",option:"LCM",$$slots:{default:[wl]},$$scope:{ctx:I}}}),r=new _({props:{id:"lcm-img2img",option:"LCM-LoRA",$$slots:{default:[Tl]},$$scope:{ctx:I}}}),{c(){T(s.$$.fragment),h=d(),T(r.$$.fragment)},l(l){b(s.$$.fragment,l),h=M(l),b(r.$$.fragment,l)},m(l,n){j(s,l,n),i(l,h,n),j(r,l,n),o=!0},p(l,n){const m={};n&2&&(m.$$scope={dirty:n,ctx:l}),s.$set(m);const u={};n&2&&(u.$$scope={dirty:n,ctx:l}),r.$set(u)},i(l){o||(Z(s.$$.fragment,l),Z(r.$$.fragment,l),o=!0)},o(l){W(s.$$.fragment,l),W(r.$$.fragment,l),o=!1},d(l){l&&a(h),C(s,l),C(r,l)}}}function jl(I){let s,h='Load the LCM checkpoint for your supported model into <a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a> and replace the scheduler with the <a href="/docs/diffusers/main/en/api/schedulers/lcm#diffusers.LCMScheduler">LCMScheduler</a>. Then you can use the <a href="/docs/diffusers/main/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.load_lora_weights">load_lora_weights()</a> method to load the LoRA weights into the LCM and generate a styled image in a few steps.',r,o,l,n,m='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/lcm/lcm_full_sdx_lora_mix.png"/>',u;return o=new N({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUlMkMlMjBVTmV0MkRDb25kaXRpb25Nb2RlbCUyQyUyMExDTVNjaGVkdWxlciUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdW5ldCUyMCUzRCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJsYXRlbnQtY29uc2lzdGVuY3klMkZsY20tc2R4bCUyMiUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUwQSUyMCUyMCUyMCUyMHZhcmlhbnQlM0QlMjJmcDE2JTIyJTJDJTBBKSUwQXBpcGUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24teGwtYmFzZS0xLjAlMjIlMkMlMjB1bmV0JTNEdW5ldCUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMHZhcmlhbnQlM0QlMjJmcDE2JTIyJTJDJTBBKS50byglMjJjdWRhJTIyKSUwQXBpcGUuc2NoZWR1bGVyJTIwJTNEJTIwTENNU2NoZWR1bGVyLmZyb21fY29uZmlnKHBpcGUuc2NoZWR1bGVyLmNvbmZpZyklMEFwaXBlLmxvYWRfbG9yYV93ZWlnaHRzKCUyMlRoZUxhc3RCZW4lMkZQYXBlcmN1dF9TRFhMJTIyJTJDJTIwd2VpZ2h0X25hbWUlM0QlMjJwYXBlcmN1dC5zYWZldGVuc29ycyUyMiUyQyUyMGFkYXB0ZXJfbmFtZSUzRCUyMnBhcGVyY3V0JTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMnBhcGVyY3V0JTJDJTIwYSUyMGN1dGUlMjBmb3glMjIlMEFnZW5lcmF0b3IlMjAlM0QlMjB0b3JjaC5tYW51YWxfc2VlZCgwKSUwQWltYWdlJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlM0Rwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENCUyQyUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUyQyUyMGd1aWRhbmNlX3NjYWxlJTNEOC4wJTBBKS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2U=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline, UNet2DConditionModel, LCMScheduler
<span class="hljs-keyword">import</span> torch

unet = UNet2DConditionModel.from_pretrained(
    <span class="hljs-string">&quot;latent-consistency/lcm-sdxl&quot;</span>,
    torch_dtype=torch.float16,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
)
pipe = StableDiffusionXLPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, unet=unet, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
pipe.load_lora_weights(<span class="hljs-string">&quot;TheLastBen/Papercut_SDXL&quot;</span>, weight_name=<span class="hljs-string">&quot;papercut.safetensors&quot;</span>, adapter_name=<span class="hljs-string">&quot;papercut&quot;</span>)

prompt = <span class="hljs-string">&quot;papercut, a cute fox&quot;</span>
generator = torch.manual_seed(<span class="hljs-number">0</span>)
image = pipe(
    prompt=prompt, num_inference_steps=<span class="hljs-number">4</span>, generator=generator, guidance_scale=<span class="hljs-number">8.0</span>
).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),{c(){s=J("p"),s.innerHTML=h,r=d(),T(o.$$.fragment),l=d(),n=J("div"),n.innerHTML=m,this.h()},l(t){s=g(t,"P",{"data-svelte-h":!0}),U(s)!=="svelte-1hfr2gt"&&(s.innerHTML=h),r=M(t),b(o.$$.fragment,t),l=M(t),n=g(t,"DIV",{class:!0,"data-svelte-h":!0}),U(n)!=="svelte-1205m44"&&(n.innerHTML=m),this.h()},h(){R(n,"class","flex justify-center")},m(t,y){i(t,s,y),i(t,r,y),j(o,t,y),i(t,l,y),i(t,n,y),u=!0},p:v,i(t){u||(Z(o.$$.fragment,t),u=!0)},o(t){W(o.$$.fragment,t),u=!1},d(t){t&&(a(s),a(r),a(l),a(n)),C(o,t)}}}function Zl(I){let s,h='Replace the scheduler with the <a href="/docs/diffusers/main/en/api/schedulers/lcm#diffusers.LCMScheduler">LCMScheduler</a>. Then you can use the <a href="/docs/diffusers/main/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.load_lora_weights">load_lora_weights()</a> method to load the LCM-LoRA weights and the style LoRA you want to use. Combine both LoRA adapters with the <code>~loaders.UNet2DConditionLoadersMixin.set_adapters</code> method and generate a styled image in a few steps.',r,o,l,n,m='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/lcm/lcm_sdx_lora_mix.png"/>',u;return o=new N({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMkMlMjBMQ01TY2hlZHVsZXIlMEElMEFwaXBlJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJpbGl0eWFpJTJG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s-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline, LCMScheduler

pipe = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
    torch_dtype=torch.float16
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

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

pipe.load_lora_weights(<span class="hljs-string">&quot;latent-consistency/lcm-lora-sdxl&quot;</span>, adapter_name=<span class="hljs-string">&quot;lcm&quot;</span>)
pipe.load_lora_weights(<span class="hljs-string">&quot;TheLastBen/Papercut_SDXL&quot;</span>, weight_name=<span class="hljs-string">&quot;papercut.safetensors&quot;</span>, adapter_name=<span class="hljs-string">&quot;papercut&quot;</span>)

pipe.set_adapters([<span class="hljs-string">&quot;lcm&quot;</span>, <span class="hljs-string">&quot;papercut&quot;</span>], adapter_weights=[<span class="hljs-number">1.0</span>, <span class="hljs-number">0.8</span>])

prompt = <span class="hljs-string">&quot;papercut, a cute fox&quot;</span>
generator = torch.manual_seed(<span class="hljs-number">0</span>)
image = pipe(prompt, num_inference_steps=<span class="hljs-number">4</span>, guidance_scale=<span class="hljs-number">1</span>, generator=generator).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),{c(){s=J("p"),s.innerHTML=h,r=d(),T(o.$$.fragment),l=d(),n=J("div"),n.innerHTML=m,this.h()},l(t){s=g(t,"P",{"data-svelte-h":!0}),U(s)!=="svelte-1qos997"&&(s.innerHTML=h),r=M(t),b(o.$$.fragment,t),l=M(t),n=g(t,"DIV",{class:!0,"data-svelte-h":!0}),U(n)!=="svelte-1onami8"&&(n.innerHTML=m),this.h()},h(){R(n,"class","flex justify-center")},m(t,y){i(t,s,y),i(t,r,y),j(o,t,y),i(t,l,y),i(t,n,y),u=!0},p:v,i(t){u||(Z(o.$$.fragment,t),u=!0)},o(t){W(o.$$.fragment,t),u=!1},d(t){t&&(a(s),a(r),a(l),a(n)),C(o,t)}}}function Wl(I){let s,h,r,o;return s=new _({props:{id:"lcm-lora",option:"LCM",$$slots:{default:[jl]},$$scope:{ctx:I}}}),r=new _({props:{id:"lcm-lora",option:"LCM-LoRA",$$slots:{default:[Zl]},$$scope:{ctx:I}}}),{c(){T(s.$$.fragment),h=d(),T(r.$$.fragment)},l(l){b(s.$$.fragment,l),h=M(l),b(r.$$.fragment,l)},m(l,n){j(s,l,n),i(l,h,n),j(r,l,n),o=!0},p(l,n){const m={};n&2&&(m.$$scope={dirty:n,ctx:l}),s.$set(m);const u={};n&2&&(u.$$scope={dirty:n,ctx:l}),r.$set(u)},i(l){o||(Z(s.$$.fragment,l),Z(r.$$.fragment,l),o=!0)},o(l){W(s.$$.fragment,l),W(r.$$.fragment,l),o=!1},d(l){l&&a(h),C(s,l),C(r,l)}}}function Cl(I){let s,h='Load a ControlNet model trained on canny images and pass it to the <a href="/docs/diffusers/main/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a>. Then you can load a LCM model into <a href="/docs/diffusers/main/en/api/pipelines/controlnet#diffusers.StableDiffusionControlNetPipeline">StableDiffusionControlNetPipeline</a> and replace the scheduler with the <a href="/docs/diffusers/main/en/api/schedulers/lcm#diffusers.LCMScheduler">LCMScheduler</a>. Now pass the canny image to the pipeline and generate an image.',r,o,l="<p>Experiment with different values for <code>num_inference_steps</code>, <code>controlnet_conditioning_scale</code>, <code>cross_attention_kwargs</code>, and <code>guidance_scale</code> to get the best results.</p>",n,m,u,t,y='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/lcm/lcm_full_sdv1-5_controlnet.png"/>',G;return m=new N({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBjdjIlMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEFmcm9tJTIwZGlmZnVzZXJzJTI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MHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uQ29udHJvbE5ldFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJTaW1pYW5MdW8lMkZMQ01fRHJlYW1zaGFwZXJfdjclMjIlMkMlMEElMjAlMjAlMjAlMjBjb250cm9sbmV0JTNEY29udHJvbG5ldCUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUwQSUyMCUyMCUyMCUyMHNhZmV0eV9jaGVja2VyJTNETm9uZSUyQyUwQSkudG8oJTIyY3VkYSUyMiklMEFwaXBlLnNjaGVkdWxlciUyMCUzRCUyMExDTVNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlLnNjaGVkdWxlci5jb25maWcpJTBBJTBBZ2VuZXJhdG9yJTIwJTNEJTIwdG9yY2gubWFudWFsX3NlZWQoMCklMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwJTIydGhlJTIwbW9uYSUyMGxpc2ElMjIlMkMlMEElMjAlMjAlMjAlMjBpbWFnZSUzRGNhbm55X2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDQlMkMlMEElMjAlMjAlMjAlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3IlMkMlMEEpLmltYWdlcyU1QjAlNUQlMEFtYWtlX2ltYWdlX2dyaWQoJTVCY2FubnlfaW1hZ2UlMkMlMjBpbWFnZSU1RCUyQyUyMHJvd3MlM0QxJTJDJTIwY29scyUzRDIp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> cv2
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline, ControlNetModel, LCMScheduler
<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://hf.co/datasets/huggingface/documentation-images/resolve/main/diffusers/input_image_vermeer.png&quot;</span>
).resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>))

image = np.array(image)

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

image = cv2.Canny(image, low_threshold, high_threshold)
image = image[:, :, <span class="hljs-literal">None</span>]
image = np.concatenate([image, image, image], axis=<span class="hljs-number">2</span>)
canny_image = Image.fromarray(image)

controlnet = ControlNetModel.from_pretrained(<span class="hljs-string">&quot;lllyasviel/sd-controlnet-canny&quot;</span>, torch_dtype=torch.float16)
pipe = StableDiffusionControlNetPipeline.from_pretrained(
    <span class="hljs-string">&quot;SimianLuo/LCM_Dreamshaper_v7&quot;</span>,
    controlnet=controlnet,
    torch_dtype=torch.float16,
    safety_checker=<span class="hljs-literal">None</span>,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)

generator = torch.manual_seed(<span class="hljs-number">0</span>)
image = pipe(
    <span class="hljs-string">&quot;the mona lisa&quot;</span>,
    image=canny_image,
    num_inference_steps=<span class="hljs-number">4</span>,
    generator=generator,
).images[<span class="hljs-number">0</span>]
make_image_grid([canny_image, image], rows=<span class="hljs-number">1</span>, cols=<span class="hljs-number">2</span>)`,wrap:!1}}),{c(){s=J("p"),s.innerHTML=h,r=d(),o=J("blockquote"),o.innerHTML=l,n=d(),T(m.$$.fragment),u=d(),t=J("div"),t.innerHTML=y,this.h()},l(p){s=g(p,"P",{"data-svelte-h":!0}),U(s)!=="svelte-1t6lo1z"&&(s.innerHTML=h),r=M(p),o=g(p,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),U(o)!=="svelte-1os48ku"&&(o.innerHTML=l),n=M(p),b(m.$$.fragment,p),u=M(p),t=g(p,"DIV",{class:!0,"data-svelte-h":!0}),U(t)!=="svelte-1f4gba0"&&(t.innerHTML=y),this.h()},h(){R(o,"class","tip"),R(t,"class","flex justify-center")},m(p,w){i(p,s,w),i(p,r,w),i(p,o,w),i(p,n,w),j(m,p,w),i(p,u,w),i(p,t,w),G=!0},p:v,i(p){G||(Z(m.$$.fragment,p),G=!0)},o(p){W(m.$$.fragment,p),G=!1},d(p){p&&(a(s),a(r),a(o),a(n),a(u),a(t)),C(m,p)}}}function Gl(I){let s,h='Load a ControlNet model trained on canny images and pass it to the <a href="/docs/diffusers/main/en/api/models/controlnet#diffusers.ControlNetModel">ControlNetModel</a>. Then you can load a Stable Diffusion v1.5 model into <a href="/docs/diffusers/main/en/api/pipelines/controlnet#diffusers.StableDiffusionControlNetPipeline">StableDiffusionControlNetPipeline</a> and replace the scheduler with the <a href="/docs/diffusers/main/en/api/schedulers/lcm#diffusers.LCMScheduler">LCMScheduler</a>. Use the <a href="/docs/diffusers/main/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.load_lora_weights">load_lora_weights()</a> method to load the LCM-LoRA weights, and pass the canny image to the pipeline and generate an image.',r,o,l="<p>Experiment with different values for <code>num_inference_steps</code>, <code>controlnet_conditioning_scale</code>, <code>cross_attention_kwargs</code>, and <code>guidance_scale</code> to get the best results.</p>",n,m,u,t,y='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/lcm/lcm_sdv1-5_controlnet.png"/>',G;return m=new N({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBjdjIlMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uQ29udHJvbE5ldFBpcGVsaW5lJTJDJTIwQ29udHJvbE5ldE1vZGV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XMlNUIwJTVEJTBBaW1hZ2U=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> cv2
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionControlNetPipeline, ControlNetModel, LCMScheduler
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image

image = load_image(
    <span class="hljs-string">&quot;https://hf.co/datasets/huggingface/documentation-images/resolve/main/diffusers/input_image_vermeer.png&quot;</span>
).resize((<span class="hljs-number">512</span>, <span class="hljs-number">512</span>))

image = np.array(image)

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

image = cv2.Canny(image, low_threshold, high_threshold)
image = image[:, :, <span class="hljs-literal">None</span>]
image = np.concatenate([image, image, image], axis=<span class="hljs-number">2</span>)
canny_image = Image.fromarray(image)

controlnet = ControlNetModel.from_pretrained(<span class="hljs-string">&quot;lllyasviel/sd-controlnet-canny&quot;</span>, torch_dtype=torch.float16)
pipe = StableDiffusionControlNetPipeline.from_pretrained(
    <span class="hljs-string">&quot;stable-diffusion-v1-5/stable-diffusion-v1-5&quot;</span>,
    controlnet=controlnet,
    torch_dtype=torch.float16,
    safety_checker=<span class="hljs-literal">None</span>,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

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

pipe.load_lora_weights(<span class="hljs-string">&quot;latent-consistency/lcm-lora-sdv1-5&quot;</span>)

generator = torch.manual_seed(<span class="hljs-number">0</span>)
image = pipe(
    <span class="hljs-string">&quot;the mona lisa&quot;</span>,
    image=canny_image,
    num_inference_steps=<span class="hljs-number">4</span>,
    guidance_scale=<span class="hljs-number">1.5</span>,
    controlnet_conditioning_scale=<span class="hljs-number">0.8</span>,
    cross_attention_kwargs={<span class="hljs-string">&quot;scale&quot;</span>: <span class="hljs-number">1</span>},
    generator=generator,
).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),{c(){s=J("p"),s.innerHTML=h,r=d(),o=J("blockquote"),o.innerHTML=l,n=d(),T(m.$$.fragment),u=d(),t=J("div"),t.innerHTML=y,this.h()},l(p){s=g(p,"P",{"data-svelte-h":!0}),U(s)!=="svelte-1lodz5c"&&(s.innerHTML=h),r=M(p),o=g(p,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),U(o)!=="svelte-1os48ku"&&(o.innerHTML=l),n=M(p),b(m.$$.fragment,p),u=M(p),t=g(p,"DIV",{class:!0,"data-svelte-h":!0}),U(t)!=="svelte-1s0658k"&&(t.innerHTML=y),this.h()},h(){R(o,"class","tip"),R(t,"class","flex justify-center")},m(p,w){i(p,s,w),i(p,r,w),i(p,o,w),i(p,n,w),j(m,p,w),i(p,u,w),i(p,t,w),G=!0},p:v,i(p){G||(Z(m.$$.fragment,p),G=!0)},o(p){W(m.$$.fragment,p),G=!1},d(p){p&&(a(s),a(r),a(o),a(n),a(u),a(t)),C(m,p)}}}function Il(I){let s,h,r,o;return s=new _({props:{id:"lcm-controlnet",option:"LCM",$$slots:{default:[Cl]},$$scope:{ctx:I}}}),r=new _({props:{id:"lcm-controlnet",option:"LCM-LoRA",$$slots:{default:[Gl]},$$scope:{ctx:I}}}),{c(){T(s.$$.fragment),h=d(),T(r.$$.fragment)},l(l){b(s.$$.fragment,l),h=M(l),b(r.$$.fragment,l)},m(l,n){j(s,l,n),i(l,h,n),j(r,l,n),o=!0},p(l,n){const m={};n&2&&(m.$$scope={dirty:n,ctx:l}),s.$set(m);const u={};n&2&&(u.$$scope={dirty:n,ctx:l}),r.$set(u)},i(l){o||(Z(s.$$.fragment,l),Z(r.$$.fragment,l),o=!0)},o(l){W(s.$$.fragment,l),W(r.$$.fragment,l),o=!1},d(l){l&&a(h),C(s,l),C(r,l)}}}function Bl(I){let s,h='Load a T2IAdapter trained on canny images and pass it to the <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/adapter#diffusers.StableDiffusionXLAdapterPipeline">StableDiffusionXLAdapterPipeline</a>. Then load a LCM checkpoint into <a href="/docs/diffusers/main/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a> and replace the scheduler with the <a href="/docs/diffusers/main/en/api/schedulers/lcm#diffusers.LCMScheduler">LCMScheduler</a>. Now pass the canny image to the pipeline and generate an image.',r,o,l,n,m='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/lcm-t2i.png"/>',u;return o=new N({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBjdjIlMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uWExBZGFwdGVyUGlwZWxpbmUlMkMlMjBVTmV0MkRDb25kaXRpb25Nb2RlbCUyQyUyMFQySUFkYXB0ZXIlMkMlMjBMQ01TY2hlZHVsZXIlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUyQyUyMG1ha2VfaW1hZ2VfZ3JpZCUwQSUwQSUyMyUyMGRldGVjdCUyMHRoZSUyMGNhbm55JTIwbWFwJTIwaW4lMjBsb3clMjByZXNvbHV0aW9uJTIwdG8lMjBhdm9pZCUyMGhpZ2gtZnJlcXVlbmN5JTIwZGV0YWlscyUwQWltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmhmLmNvJTJGZGF0YXNldHMlMkZodWdnaW5nZmFjZSUyRmRvY3VtZW50YXRpb24taW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZkaWZmdXNlcnMlMkZpbnB1dF9pb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yMCUyMCUyMCUyMGltYWdlJTNEY2FubnlfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENCUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNENSUyQyUwQSUyMCUyMCUyMCUyMGFkYXB0ZXJfY29uZGl0aW9uaW5nX3NjYWxlJTNEMC44JTJDJTBBJTIwJTIwJTIwJTIwYWRhcHRlcl9jb25kaXRpb25pbmdfZmFjdG9yJTNEMSUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> cv2
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLAdapterPipeline, UNet2DConditionModel, T2IAdapter, LCMScheduler
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image, make_image_grid

<span class="hljs-comment"># detect the canny map in low resolution to avoid high-frequency details</span>
image = load_image(
    <span class="hljs-string">&quot;https://hf.co/datasets/huggingface/documentation-images/resolve/main/diffusers/input_image_vermeer.png&quot;</span>
).resize((<span class="hljs-number">384</span>, <span class="hljs-number">384</span>))

image = np.array(image)

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

image = cv2.Canny(image, low_threshold, high_threshold)
image = image[:, :, <span class="hljs-literal">None</span>]
image = np.concatenate([image, image, image], axis=<span class="hljs-number">2</span>)
canny_image = Image.fromarray(image).resize((<span class="hljs-number">1024</span>, <span class="hljs-number">1216</span>))

adapter = T2IAdapter.from_pretrained(<span class="hljs-string">&quot;TencentARC/t2i-adapter-canny-sdxl-1.0&quot;</span>, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)

unet = UNet2DConditionModel.from_pretrained(
    <span class="hljs-string">&quot;latent-consistency/lcm-sdxl&quot;</span>,
    torch_dtype=torch.float16,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
)
pipe = StableDiffusionXLAdapterPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>,
    unet=unet,
    adapter=adapter,
    torch_dtype=torch.float16,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

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

prompt = <span class="hljs-string">&quot;the mona lisa, 4k picture, high quality&quot;</span>
negative_prompt = <span class="hljs-string">&quot;extra digit, fewer digits, cropped, worst quality, low quality, glitch, deformed, mutated, ugly, disfigured&quot;</span>

generator = torch.manual_seed(<span class="hljs-number">0</span>)
image = pipe(
    prompt=prompt,
    negative_prompt=negative_prompt,
    image=canny_image,
    num_inference_steps=<span class="hljs-number">4</span>,
    guidance_scale=<span class="hljs-number">5</span>,
    adapter_conditioning_scale=<span class="hljs-number">0.8</span>,
    adapter_conditioning_factor=<span class="hljs-number">1</span>,
    generator=generator,
).images[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){s=J("p"),s.innerHTML=h,r=d(),T(o.$$.fragment),l=d(),n=J("div"),n.innerHTML=m,this.h()},l(t){s=g(t,"P",{"data-svelte-h":!0}),U(s)!=="svelte-83916k"&&(s.innerHTML=h),r=M(t),b(o.$$.fragment,t),l=M(t),n=g(t,"DIV",{class:!0,"data-svelte-h":!0}),U(n)!=="svelte-1m6j6i7"&&(n.innerHTML=m),this.h()},h(){R(n,"class","flex justify-center")},m(t,y){i(t,s,y),i(t,r,y),j(o,t,y),i(t,l,y),i(t,n,y),u=!0},p:v,i(t){u||(Z(o.$$.fragment,t),u=!0)},o(t){W(o.$$.fragment,t),u=!1},d(t){t&&(a(s),a(r),a(l),a(n)),C(o,t)}}}function Rl(I){let s,h='Load a T2IAdapter trained on canny images and pass it to the <a href="/docs/diffusers/main/en/api/pipelines/stable_diffusion/adapter#diffusers.StableDiffusionXLAdapterPipeline">StableDiffusionXLAdapterPipeline</a>. Replace the scheduler with the <a href="/docs/diffusers/main/en/api/schedulers/lcm#diffusers.LCMScheduler">LCMScheduler</a>, and use the <a href="/docs/diffusers/main/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.load_lora_weights">load_lora_weights()</a> method to load the LCM-LoRA weights. Pass the canny image to the pipeline and generate an image.',r,o,l,n,m='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/lcm-lora-t2i.png"/>',u;return o=new N({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBjdjIlMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uWExBZGFwdGVyUGlwZWxpbmUlMkMlMjBVTmV0MkRDb25kaXRpb25Nb2RlbCUyQyUyMFQySUFkYXB0ZXIlMkMlMjBMQ01TY2hlZHVsZXIlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUyQyUyMG1ha2VfaW1hZ2VfZ3JpZCUwQSUwQSUyMyUyMGRldGVjdCUyMHRoZSUyMGNhbm55JTIwbWFwJTIwaW4lMjBsb3clMjByZXNvbHV0aW9uJTIwdG8lMjBhdm9pZCUyMGhpZ2gtZnJlcXVlbmN5JTIwZGV0YWlscyUwQWltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmhmLmNvJTJGZGF0YXNldHMlMkZodWdnaW5nZmFjZSUyRmRvY3VtZW50YXRpb24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ZSUzRDEuNSUyQyUwQSUyMCUyMCUyMCUyMGFkYXB0ZXJfY29uZGl0aW9uaW5nX3NjYWxlJTNEMC44JTJDJTBBJTIwJTIwJTIwJTIwYWRhcHRlcl9jb25kaXRpb25pbmdfZmFjdG9yJTNEMSUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> cv2
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image

<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLAdapterPipeline, UNet2DConditionModel, T2IAdapter, LCMScheduler
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image, make_image_grid

<span class="hljs-comment"># detect the canny map in low resolution to avoid high-frequency details</span>
image = load_image(
    <span class="hljs-string">&quot;https://hf.co/datasets/huggingface/documentation-images/resolve/main/diffusers/input_image_vermeer.png&quot;</span>
).resize((<span class="hljs-number">384</span>, <span class="hljs-number">384</span>))

image = np.array(image)

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

image = cv2.Canny(image, low_threshold, high_threshold)
image = image[:, :, <span class="hljs-literal">None</span>]
image = np.concatenate([image, image, image], axis=<span class="hljs-number">2</span>)
canny_image = Image.fromarray(image).resize((<span class="hljs-number">1024</span>, <span class="hljs-number">1024</span>))

adapter = T2IAdapter.from_pretrained(<span class="hljs-string">&quot;TencentARC/t2i-adapter-canny-sdxl-1.0&quot;</span>, torch_dtype=torch.float16, variant=<span class="hljs-string">&quot;fp16&quot;</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)

pipe = StableDiffusionXLAdapterPipeline.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>,
    adapter=adapter,
    torch_dtype=torch.float16,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

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

pipe.load_lora_weights(<span class="hljs-string">&quot;latent-consistency/lcm-lora-sdxl&quot;</span>)

prompt = <span class="hljs-string">&quot;the mona lisa, 4k picture, high quality&quot;</span>
negative_prompt = <span class="hljs-string">&quot;extra digit, fewer digits, cropped, worst quality, low quality, glitch, deformed, mutated, ugly, disfigured&quot;</span>

generator = torch.manual_seed(<span class="hljs-number">0</span>)
image = pipe(
    prompt=prompt,
    negative_prompt=negative_prompt,
    image=canny_image,
    num_inference_steps=<span class="hljs-number">4</span>,
    guidance_scale=<span class="hljs-number">1.5</span>,
    adapter_conditioning_scale=<span class="hljs-number">0.8</span>,
    adapter_conditioning_factor=<span class="hljs-number">1</span>,
    generator=generator,
).images[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){s=J("p"),s.innerHTML=h,r=d(),T(o.$$.fragment),l=d(),n=J("div"),n.innerHTML=m,this.h()},l(t){s=g(t,"P",{"data-svelte-h":!0}),U(s)!=="svelte-uo979p"&&(s.innerHTML=h),r=M(t),b(o.$$.fragment,t),l=M(t),n=g(t,"DIV",{class:!0,"data-svelte-h":!0}),U(n)!=="svelte-djnrvk"&&(n.innerHTML=m),this.h()},h(){R(n,"class","flex justify-center")},m(t,y){i(t,s,y),i(t,r,y),j(o,t,y),i(t,l,y),i(t,n,y),u=!0},p:v,i(t){u||(Z(o.$$.fragment,t),u=!0)},o(t){W(o.$$.fragment,t),u=!1},d(t){t&&(a(s),a(r),a(l),a(n)),C(o,t)}}}function El(I){let s,h,r,o;return s=new _({props:{id:"lcm-t2i",option:"LCM",$$slots:{default:[Bl]},$$scope:{ctx:I}}}),r=new _({props:{id:"lcm-t2i",option:"LCM-LoRA",$$slots:{default:[Rl]},$$scope:{ctx:I}}}),{c(){T(s.$$.fragment),h=d(),T(r.$$.fragment)},l(l){b(s.$$.fragment,l),h=M(l),b(r.$$.fragment,l)},m(l,n){j(s,l,n),i(l,h,n),j(r,l,n),o=!0},p(l,n){const m={};n&2&&(m.$$scope={dirty:n,ctx:l}),s.$set(m);const u={};n&2&&(u.$$scope={dirty:n,ctx:l}),r.$set(u)},i(l){o||(Z(s.$$.fragment,l),Z(r.$$.fragment,l),o=!0)},o(l){W(s.$$.fragment,l),W(r.$$.fragment,l),o=!1},d(l){l&&a(h),C(s,l),C(r,l)}}}function Nl(I){let s,h,r,o,l,n,m,u,t,y,G,p='<a href="https://hf.co/papers/2310.04378" rel="nofollow">Latent Consistency Models (LCMs)</a> enable fast high-quality image generation by directly predicting the reverse diffusion process in the latent rather than pixel space. In other words, LCMs try to predict the noiseless image from the noisy image in contrast to typical diffusion models that iteratively remove noise from the noisy image. By avoiding the iterative sampling process, LCMs are able to generate high-quality images in 2-4 steps instead of 20-30 steps.',w,E,f='LCMs are distilled from pretrained models which requires ~32 hours of A100 compute. To speed this up, <a href="https://hf.co/papers/2311.05556" rel="nofollow">LCM-LoRAs</a> train a <a href="https://huggingface.co/docs/peft/conceptual_guides/adapter#low-rank-adaptation-lora" rel="nofollow">LoRA adapter</a> which have much fewer parameters to train compared to the full model. The LCM-LoRA can be plugged into a diffusion model once it has been trained.',B,x,Fe="This guide will show you how to use LCMs and LCM-LoRAs for fast inference on tasks and how to use them with other adapters like ControlNet or T2I-Adapter.",ue,k,xe='<p>LCMs and LCM-LoRAs are available for Stable Diffusion v1.5, Stable Diffusion XL, and the SSD-1B model. You can find their checkpoints on the <a href="https://hf.co/collections/latent-consistency/latent-consistency-models-weights-654ce61a95edd6dffccef6a8" rel="nofollow">Latent Consistency</a> Collections.</p>',he,H,ye,$,fe,A,Je,X,ge,z,Ue,q,He='To use LCM-LoRAs for inpainting, you need to replace the scheduler with the <a href="/docs/diffusers/main/en/api/schedulers/lcm#diffusers.LCMScheduler">LCMScheduler</a> and load the LCM-LoRA weights with the <a href="/docs/diffusers/main/en/api/loaders/lora#diffusers.loaders.StableDiffusionLoraLoaderMixin.load_lora_weights">load_lora_weights()</a> method. Then you can use the pipeline as usual, and pass a text prompt, initial image, and mask image to generate an image in just 4 steps.',we,D,Te,V,Ae='<div><img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/inpaint.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">initial image</figcaption></div> <div><img class="rounded-xl" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/lcm-lora-inpaint.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">generated image</figcaption></div>',be,K,je,P,ze="LCMs are compatible with adapters like LoRA, ControlNet, T2I-Adapter, and AnimateDiff. You can bring the speed of LCMs to these adapters to generate images in a certain style or condition the model on another input like a canny image.",Ze,O,We,ee,qe='<a href="../using-diffusers/loading_adapters#lora">LoRA</a> adapters can be rapidly finetuned to learn a new style from just a few images and plugged into a pretrained model to generate images in that style.',Ce,L,Ge,le,Ie,se,De='<a href="./controlnet">ControlNet</a> are adapters that can be trained on a variety of inputs like canny edge, pose estimation, or depth. The ControlNet can be inserted into the pipeline to provide additional conditioning and control to the model for more accurate generation.',Be,te,Ke='You can find additional ControlNet models trained on other inputs in <a href="https://hf.co/lllyasviel" rel="nofollow">lllyasviel’s</a> repository.',Re,S,Ee,ae,Ne,ne,Pe='<a href="./t2i_adapter">T2I-Adapter</a> is an even more lightweight adapter than ControlNet, that provides an additional input to condition a pretrained model with. It is faster than ControlNet but the results may be slightly worse.',_e,ie,Oe='You can find additional T2I-Adapter checkpoints trained on other inputs in <a href="https://hf.co/TencentARC" rel="nofollow">TencentArc’s</a> repository.',ve,Y,Qe,oe,ke,pe,el='<a href="../api/pipelines/animatediff">AnimateDiff</a> is an adapter that adds motion to an image. It can be used with most Stable Diffusion models, effectively turning them into “video generation” models. Generating good results with a video model usually requires generating multiple frames (16-24), which can be very slow with a regular Stable Diffusion model. LCM-LoRA can speed up this process by only taking 4-8 steps for each frame.',$e,re,ll='Load a <a href="/docs/diffusers/main/en/api/pipelines/animatediff#diffusers.AnimateDiffPipeline">AnimateDiffPipeline</a> and pass a <code>MotionAdapter</code> to it. Then replace the scheduler with the <a href="/docs/diffusers/main/en/api/schedulers/lcm#diffusers.LCMScheduler">LCMScheduler</a>, and combine both LoRA adapters with the <code>~loaders.UNet2DConditionLoadersMixin.set_adapters</code> method. Now you can pass a prompt to the pipeline and generate an animated image.',Xe,ce,Ve,F,sl='<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/lcm-lora-animatediff.gif"/>',Le,me,Se,de,Ye;return l=new hl({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),m=new Q({props:{title:"Latent Consistency Model",local:"latent-consistency-model",headingTag:"h1"}}),t=new yl({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/en/inference_with_lcm.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/en/pytorch/inference_with_lcm.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/en/tensorflow/inference_with_lcm.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/inference_with_lcm.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/pytorch/inference_with_lcm.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/tensorflow/inference_with_lcm.ipynb"}]}}),H=new Q({props:{title:"Text-to-image",local:"text-to-image",headingTag:"h2"}}),$=new Me({props:{id:"lcm-text2img",options:["LCM","LCM-LoRA"],$$slots:{default:[Ul]},$$scope:{ctx:I}}}),A=new Q({props:{title:"Image-to-image",local:"image-to-image",headingTag:"h2"}}),X=new Me({props:{id:"lcm-img2img",options:["LCM","LCM-LoRA"],$$slots:{default:[bl]},$$scope:{ctx:I}}}),z=new Q({props:{title:"Inpainting",local:"inpainting",headingTag:"h2"}}),D=new N({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQXV0b1BpcGVsaW5lRm9ySW5wYWludGluZyUyQyUyMExDTVNjaGVkdWxlciUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTJDJTIwbWFrZV9pbWFnZV9ncmlkJTBBJTBBcGlwZSUyMCUzRCUyMEF1dG9QaXBlbGluZUZvcklucGFpbnRpbmcuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi1pbnBhaW50aW5nJTIyJTJDJTBBJTIwJTIwJTIwJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTBBJTIwJTIwJTIwJTIwdmFyaWFudCUzRCUyMmZwMTYlMjIlMkMlMEEpLnRvKCUyMmN1ZGElMjIpJTBBJTBBcGlwZS5zY2hlZHVsZXIlMjAlM0QlMjBMQ01TY2hlZHVsZXIuZnJvbV9jb25maWcocGlwZS5zY2hlZHVsZXIuY29uZmlnKSUwQSUwQXBpcGUubG9hZF9sb3JhX3dlaWdodHMoJTIybGF0ZW50LWNvbnNpc3RlbmN5JTJGbGNtLWxvcmEtc2R2MS01JTIyKSUwQSUwQWluaXRfaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmh1Z2dpbmdmYWNlJTJGZG9jdW1lbnRhdGlvbi1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyRmRpZmZ1c2VycyUyRmlucGFpbnQucG5nJTIyKSUwQW1hc2tfaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmh1Z2dpbmdmYWNlJTJGZG9jdW1lbnRhdGlvbi1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyRmRpZmZ1c2VycyUyRmlucGFpbnRfbWFzay5wbmclMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyY29uY2VwdCUyMGFydCUyMGRpZ2l0YWwlMjBwYWludGluZyUyMG9mJTIwYW4lMjBlbHZlbiUyMGNhc3RsZSUyQyUyMGluc3BpcmVkJTIwYnklMjBsb3JkJTIwb2YlMjB0aGUlMjByaW5ncyUyQyUyMGhpZ2hseSUyMGRldGFpbGVkJTJDJTIwOGslMjIlMEFnZW5lcmF0b3IlMjAlM0QlMjB0b3JjaC5tYW51YWxfc2VlZCgwKSUwQWltYWdlJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlM0Rwcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBpbWFnZSUzRGluaXRfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBtYXNrX2ltYWdlJTNEbWFza19pbWFnZSUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q0JTJDJTBBJTIwJTIwJTIwJTIwZ3VpZGFuY2Vfc2NhbGUlM0Q0JTJDJTBBKS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2U=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoPipelineForInpainting, LCMScheduler
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image, make_image_grid

pipe = AutoPipelineForInpainting.from_pretrained(
    <span class="hljs-string">&quot;runwayml/stable-diffusion-inpainting&quot;</span>,
    torch_dtype=torch.float16,
    variant=<span class="hljs-string">&quot;fp16&quot;</span>,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

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

pipe.load_lora_weights(<span class="hljs-string">&quot;latent-consistency/lcm-lora-sdv1-5&quot;</span>)

init_image = load_image(<span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/inpaint.png&quot;</span>)
mask_image = load_image(<span class="hljs-string">&quot;https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/inpaint_mask.png&quot;</span>)

prompt = <span class="hljs-string">&quot;concept art digital painting of an elven castle, inspired by lord of the rings, highly detailed, 8k&quot;</span>
generator = torch.manual_seed(<span class="hljs-number">0</span>)
image = pipe(
    prompt=prompt,
    image=init_image,
    mask_image=mask_image,
    generator=generator,
    num_inference_steps=<span class="hljs-number">4</span>,
    guidance_scale=<span class="hljs-number">4</span>,
).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),K=new Q({props:{title:"Adapters",local:"adapters",headingTag:"h2"}}),O=new Q({props:{title:"LoRA",local:"lora",headingTag:"h3"}}),L=new Me({props:{id:"lcm-lora",options:["LCM","LCM-LoRA"],$$slots:{default:[Wl]},$$scope:{ctx:I}}}),le=new Q({props:{title:"ControlNet",local:"controlnet",headingTag:"h3"}}),S=new Me({props:{id:"lcm-controlnet",options:["LCM","LCM-LoRA"],$$slots:{default:[Il]},$$scope:{ctx:I}}}),ae=new Q({props:{title:"T2I-Adapter",local:"t2i-adapter",headingTag:"h3"}}),Y=new Me({props:{id:"lcm-t2i",options:["LCM","LCM-LoRA"],$$slots:{default:[El]},$$scope:{ctx:I}}}),oe=new Q({props:{title:"AnimateDiff",local:"animatediff",headingTag:"h3"}}),ce=new N({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTW90aW9uQWRhcHRlciUyQyUy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TIybGNtJTIyJTJDJTIwJTIybW90aW9uLWxvcmElMjIlNUQlMkMlMjBhZGFwdGVyX3dlaWdodHMlM0QlNUIwLjU1JTJDJTIwMS4yJTVEKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMmJlc3QlMjBxdWFsaXR5JTJDJTIwbWFzdGVycGllY2UlMkMlMjAxZ2lybCUyQyUyMGxvb2tpbmclMjBhdCUyMHZpZXdlciUyQyUyMGJsdXJyeSUyMGJhY2tncm91bmQlMkMlMjB1cHBlciUyMGJvZHklMkMlMjBjb250ZW1wb3JhcnklMkMlMjBkcmVzcyUyMiUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLm1hbnVhbF9zZWVkKDApJTBBZnJhbWVzJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlM0Rwcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENSUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEMS4yNSUyQyUwQSUyMCUyMCUyMCUyMGNyb3NzX2F0dGVudGlvbl9rd2FyZ3MlM0QlN0IlMjJzY2FsZSUyMiUzQSUyMDElN0QlMkMlMEElMjAlMjAlMjAlMjBudW1fZnJhbWVzJTNEMjQlMkMlMEElMjAlMjAlMjAlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3IlMEEpLmZyYW1lcyU1QjAlNUQlMEFleHBvcnRfdG9fZ2lmKGZyYW1lcyUyQyUyMCUyMmFuaW1hdGlvbi5naWYlMjIp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> MotionAdapter, AnimateDiffPipeline, DDIMScheduler, LCMScheduler
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif

adapter = MotionAdapter.from_pretrained(<span class="hljs-string">&quot;guoyww/animatediff-motion-adapter-v1-5&quot;</span>)
pipe = AnimateDiffPipeline.from_pretrained(
    <span class="hljs-string">&quot;frankjoshua/toonyou_beta6&quot;</span>,
    motion_adapter=adapter,
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-comment"># set scheduler</span>
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)

<span class="hljs-comment"># load LCM-LoRA</span>
pipe.load_lora_weights(<span class="hljs-string">&quot;latent-consistency/lcm-lora-sdv1-5&quot;</span>, adapter_name=<span class="hljs-string">&quot;lcm&quot;</span>)
pipe.load_lora_weights(<span class="hljs-string">&quot;guoyww/animatediff-motion-lora-zoom-in&quot;</span>, weight_name=<span class="hljs-string">&quot;diffusion_pytorch_model.safetensors&quot;</span>, adapter_name=<span class="hljs-string">&quot;motion-lora&quot;</span>)

pipe.set_adapters([<span class="hljs-string">&quot;lcm&quot;</span>, <span class="hljs-string">&quot;motion-lora&quot;</span>], adapter_weights=[<span class="hljs-number">0.55</span>, <span class="hljs-number">1.2</span>])

prompt = <span class="hljs-string">&quot;best quality, masterpiece, 1girl, looking at viewer, blurry background, upper body, contemporary, dress&quot;</span>
generator = torch.manual_seed(<span class="hljs-number">0</span>)
frames = pipe(
    prompt=prompt,
    num_inference_steps=<span class="hljs-number">5</span>,
    guidance_scale=<span class="hljs-number">1.25</span>,
    cross_attention_kwargs={<span class="hljs-string">&quot;scale&quot;</span>: <span class="hljs-number">1</span>},
    num_frames=<span class="hljs-number">24</span>,
    generator=generator
).frames[<span class="hljs-number">0</span>]
export_to_gif(frames, <span class="hljs-string">&quot;animation.gif&quot;</span>)`,wrap:!1}}),me=new fl({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/using-diffusers/inference_with_lcm.md"}}),{c(){s=J("meta"),h=d(),r=J("p"),o=d(),T(l.$$.fragment),n=d(),T(m.$$.fragment),u=d(),T(t.$$.fragment),y=d(),G=J("p"),G.innerHTML=p,w=d(),E=J("p"),E.innerHTML=f,B=d(),x=J("p"),x.textContent=Fe,ue=d(),k=J("blockquote"),k.innerHTML=xe,he=d(),T(H.$$.fragment),ye=d(),T($.$$.fragment),fe=d(),T(A.$$.fragment),Je=d(),T(X.$$.fragment),ge=d(),T(z.$$.fragment),Ue=d(),q=J("p"),q.innerHTML=He,we=d(),T(D.$$.fragment),Te=d(),V=J("div"),V.innerHTML=Ae,be=d(),T(K.$$.fragment),je=d(),P=J("p"),P.textContent=ze,Ze=d(),T(O.$$.fragment),We=d(),ee=J("p"),ee.innerHTML=qe,Ce=d(),T(L.$$.fragment),Ge=d(),T(le.$$.fragment),Ie=d(),se=J("p"),se.innerHTML=De,Be=d(),te=J("p"),te.innerHTML=Ke,Re=d(),T(S.$$.fragment),Ee=d(),T(ae.$$.fragment),Ne=d(),ne=J("p"),ne.innerHTML=Pe,_e=d(),ie=J("p"),ie.innerHTML=Oe,ve=d(),T(Y.$$.fragment),Qe=d(),T(oe.$$.fragment),ke=d(),pe=J("p"),pe.innerHTML=el,$e=d(),re=J("p"),re.innerHTML=ll,Xe=d(),T(ce.$$.fragment),Ve=d(),F=J("div"),F.innerHTML=sl,Le=d(),T(me.$$.fragment),Se=d(),de=J("p"),this.h()},l(e){const c=Ml("svelte-u9bgzb",document.head);s=g(c,"META",{name:!0,content:!0}),c.forEach(a),h=M(e),r=g(e,"P",{}),pl(r).forEach(a),o=M(e),b(l.$$.fragment,e),n=M(e),b(m.$$.fragment,e),u=M(e),b(t.$$.fragment,e),y=M(e),G=g(e,"P",{"data-svelte-h":!0}),U(G)!=="svelte-fadb22"&&(G.innerHTML=p),w=M(e),E=g(e,"P",{"data-svelte-h":!0}),U(E)!=="svelte-1nhlbs8"&&(E.innerHTML=f),B=M(e),x=g(e,"P",{"data-svelte-h":!0}),U(x)!=="svelte-vcrp3b"&&(x.textContent=Fe),ue=M(e),k=g(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),U(k)!=="svelte-k4lcym"&&(k.innerHTML=xe),he=M(e),b(H.$$.fragment,e),ye=M(e),b($.$$.fragment,e),fe=M(e),b(A.$$.fragment,e),Je=M(e),b(X.$$.fragment,e),ge=M(e),b(z.$$.fragment,e),Ue=M(e),q=g(e,"P",{"data-svelte-h":!0}),U(q)!=="svelte-d6f0ch"&&(q.innerHTML=He),we=M(e),b(D.$$.fragment,e),Te=M(e),V=g(e,"DIV",{class:!0,"data-svelte-h":!0}),U(V)!=="svelte-1olacag"&&(V.innerHTML=Ae),be=M(e),b(K.$$.fragment,e),je=M(e),P=g(e,"P",{"data-svelte-h":!0}),U(P)!=="svelte-i3adm8"&&(P.textContent=ze),Ze=M(e),b(O.$$.fragment,e),We=M(e),ee=g(e,"P",{"data-svelte-h":!0}),U(ee)!=="svelte-1wvykf5"&&(ee.innerHTML=qe),Ce=M(e),b(L.$$.fragment,e),Ge=M(e),b(le.$$.fragment,e),Ie=M(e),se=g(e,"P",{"data-svelte-h":!0}),U(se)!=="svelte-1fviti6"&&(se.innerHTML=De),Be=M(e),te=g(e,"P",{"data-svelte-h":!0}),U(te)!=="svelte-1wwp3s2"&&(te.innerHTML=Ke),Re=M(e),b(S.$$.fragment,e),Ee=M(e),b(ae.$$.fragment,e),Ne=M(e),ne=g(e,"P",{"data-svelte-h":!0}),U(ne)!=="svelte-tl9wrs"&&(ne.innerHTML=Pe),_e=M(e),ie=g(e,"P",{"data-svelte-h":!0}),U(ie)!=="svelte-18ngb4o"&&(ie.innerHTML=Oe),ve=M(e),b(Y.$$.fragment,e),Qe=M(e),b(oe.$$.fragment,e),ke=M(e),pe=g(e,"P",{"data-svelte-h":!0}),U(pe)!=="svelte-14vivd7"&&(pe.innerHTML=el),$e=M(e),re=g(e,"P",{"data-svelte-h":!0}),U(re)!=="svelte-1tdp050"&&(re.innerHTML=ll),Xe=M(e),b(ce.$$.fragment,e),Ve=M(e),F=g(e,"DIV",{class:!0,"data-svelte-h":!0}),U(F)!=="svelte-8kha3o"&&(F.innerHTML=sl),Le=M(e),b(me.$$.fragment,e),Se=M(e),de=g(e,"P",{}),pl(de).forEach(a),this.h()},h(){R(s,"name","hf:doc:metadata"),R(s,"content",_l),R(k,"class","tip"),R(V,"class","flex gap-4"),R(F,"class","flex justify-center")},m(e,c){ul(document.head,s),i(e,h,c),i(e,r,c),i(e,o,c),j(l,e,c),i(e,n,c),j(m,e,c),i(e,u,c),j(t,e,c),i(e,y,c),i(e,G,c),i(e,w,c),i(e,E,c),i(e,B,c),i(e,x,c),i(e,ue,c),i(e,k,c),i(e,he,c),j(H,e,c),i(e,ye,c),j($,e,c),i(e,fe,c),j(A,e,c),i(e,Je,c),j(X,e,c),i(e,ge,c),j(z,e,c),i(e,Ue,c),i(e,q,c),i(e,we,c),j(D,e,c),i(e,Te,c),i(e,V,c),i(e,be,c),j(K,e,c),i(e,je,c),i(e,P,c),i(e,Ze,c),j(O,e,c),i(e,We,c),i(e,ee,c),i(e,Ce,c),j(L,e,c),i(e,Ge,c),j(le,e,c),i(e,Ie,c),i(e,se,c),i(e,Be,c),i(e,te,c),i(e,Re,c),j(S,e,c),i(e,Ee,c),j(ae,e,c),i(e,Ne,c),i(e,ne,c),i(e,_e,c),i(e,ie,c),i(e,ve,c),j(Y,e,c),i(e,Qe,c),j(oe,e,c),i(e,ke,c),i(e,pe,c),i(e,$e,c),i(e,re,c),i(e,Xe,c),j(ce,e,c),i(e,Ve,c),i(e,F,c),i(e,Le,c),j(me,e,c),i(e,Se,c),i(e,de,c),Ye=!0},p(e,[c]){const tl={};c&2&&(tl.$$scope={dirty:c,ctx:e}),$.$set(tl);const al={};c&2&&(al.$$scope={dirty:c,ctx:e}),X.$set(al);const nl={};c&2&&(nl.$$scope={dirty:c,ctx:e}),L.$set(nl);const il={};c&2&&(il.$$scope={dirty:c,ctx:e}),S.$set(il);const ol={};c&2&&(ol.$$scope={dirty:c,ctx:e}),Y.$set(ol)},i(e){Ye||(Z(l.$$.fragment,e),Z(m.$$.fragment,e),Z(t.$$.fragment,e),Z(H.$$.fragment,e),Z($.$$.fragment,e),Z(A.$$.fragment,e),Z(X.$$.fragment,e),Z(z.$$.fragment,e),Z(D.$$.fragment,e),Z(K.$$.fragment,e),Z(O.$$.fragment,e),Z(L.$$.fragment,e),Z(le.$$.fragment,e),Z(S.$$.fragment,e),Z(ae.$$.fragment,e),Z(Y.$$.fragment,e),Z(oe.$$.fragment,e),Z(ce.$$.fragment,e),Z(me.$$.fragment,e),Ye=!0)},o(e){W(l.$$.fragment,e),W(m.$$.fragment,e),W(t.$$.fragment,e),W(H.$$.fragment,e),W($.$$.fragment,e),W(A.$$.fragment,e),W(X.$$.fragment,e),W(z.$$.fragment,e),W(D.$$.fragment,e),W(K.$$.fragment,e),W(O.$$.fragment,e),W(L.$$.fragment,e),W(le.$$.fragment,e),W(S.$$.fragment,e),W(ae.$$.fragment,e),W(Y.$$.fragment,e),W(oe.$$.fragment,e),W(ce.$$.fragment,e),W(me.$$.fragment,e),Ye=!1},d(e){e&&(a(h),a(r),a(o),a(n),a(u),a(y),a(G),a(w),a(E),a(B),a(x),a(ue),a(k),a(he),a(ye),a(fe),a(Je),a(ge),a(Ue),a(q),a(we),a(Te),a(V),a(be),a(je),a(P),a(Ze),a(We),a(ee),a(Ce),a(Ge),a(Ie),a(se),a(Be),a(te),a(Re),a(Ee),a(Ne),a(ne),a(_e),a(ie),a(ve),a(Qe),a(ke),a(pe),a($e),a(re),a(Xe),a(Ve),a(F),a(Le),a(Se),a(de)),a(s),C(l,e),C(m,e),C(t,e),C(H,e),C($,e),C(A,e),C(X,e),C(z,e),C(D,e),C(K,e),C(O,e),C(L,e),C(le,e),C(S,e),C(ae,e),C(Y,e),C(oe,e),C(ce,e),C(me,e)}}}const _l='{"title":"Latent Consistency Model","local":"latent-consistency-model","sections":[{"title":"Text-to-image","local":"text-to-image","sections":[],"depth":2},{"title":"Image-to-image","local":"image-to-image","sections":[],"depth":2},{"title":"Inpainting","local":"inpainting","sections":[],"depth":2},{"title":"Adapters","local":"adapters","sections":[{"title":"LoRA","local":"lora","sections":[],"depth":3},{"title":"ControlNet","local":"controlnet","sections":[],"depth":3},{"title":"T2I-Adapter","local":"t2i-adapter","sections":[],"depth":3},{"title":"AnimateDiff","local":"animatediff","sections":[],"depth":3}],"depth":2}],"depth":1}';function vl(I){return cl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Yl extends ml{constructor(s){super(),dl(this,s,vl,Nl,rl,{})}}export{Yl as component};
