import{s as rl,o as cl,n as k}from"../chunks/scheduler.53228c21.js";import{S as ml,i as dl,e as J,s as d,c as b,h as Ml,a as g,d as a,b as M,f as pl,g as T,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.20a72e0e.js";import{C as E}from"../chunks/CodeBlock.d30a6509.js";import{D as yl}from"../chunks/DocNotebookDropdown.74a16910.js";import{H as v,E as fl}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.4d82655d.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"/>',N;return y=new E({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUlMkMlMjBVTmV0MkRDb25kaXRpb25Nb2RlbCUyQyUyMExDTVNjaGVkdWxlciUwQWltcG9ydCUyMHRvcmNoJTBBJTBBdW5ldCUyMCUzRCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsLmZyb21fcHJldH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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(),b(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),T(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),N=!0},p:k,i(f){N||(Z(y.$$.fragment,f),N=!0)},o(f){W(y.$$.fragment,f),N=!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"/>',N;return y=new E({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(),b(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),T(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),N=!0},p:k,i(f){N||(Z(y.$$.fragment,f),N=!0)},o(f){W(y.$$.fragment,f),N=!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(){b(s.$$.fragment),h=d(),b(r.$$.fragment)},l(l){T(s.$$.fragment,l),h=M(l),T(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 E({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQXV0b1BpcGVsaW5lRm9ySW1hZ2UySW1hZ2UlMkMlMjBVTmV0MkRDb25kaXRpb25Nb2RlbCUyQyUyMExDTVNjaGVkdWxlciUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTBBJTBBdW5ldCUyMCUzRCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJTaW1pYW5MdW8lMkZMQ01fRHJlYW1zaGFwZXJfdjclMjIlMkMlMEElMjAlMjAlMjAlMjBzd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9pbWFnZSUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q0JTJDJTBBJTIwJTIwJTIwJTIwZ3VpZGFuY2Vfc2NhbGUlM0Q3LjUlMkMlMEElMjAlMjAlMjAlMjBzdHJlbmd0aCUzRDAuNSUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUwQSkuaW1hZ2VzJTVCMCU1RCUwQWltYWdl",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(),b(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),T(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:k,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='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 E({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQXV0b1BpcGVsaW5lR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c2VlZCgwKSUwQWltYWdlJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBpbWFnZSUzRGluaXRfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENCUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEMSUyQyUwQSUyMCUyMCUyMCUyMHN0cmVuZ3RoJTNEMC42JTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTBBKS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2U=",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(),b(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),T(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:k,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,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:[bl]},$$scope:{ctx:I}}}),{c(){b(s.$$.fragment),h=d(),b(r.$$.fragment)},l(l){T(s.$$.fragment,l),h=M(l),T(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 E({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(),b(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),T(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:k,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 E({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMkMlMjBMQ01TY2hlZHVsZXIlMEElMEFwaXBlJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJpbGl0eWFpJTJGc3R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yword">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(),b(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),T(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:k,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(){b(s.$$.fragment),h=d(),b(r.$$.fragment)},l(l){T(s.$$.fragment,l),h=M(l),T(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 E({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBjdjIlMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW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vcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEFwaXBlJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uQ29udHJvbE5ldFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJTaW1pYW5MdW8lMkZMQ01fRHJlYW1zaGFwZXJfdjclMjIlMkMlMEElMjAlMjAlMjAlMjBjb250cm9sbmV0JTNEY29udHJvbG5ldCUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUwQSUyMCUyMCUyMCUyMHNhZmV0eV9jaGVja2VyJTNETm9uZSUyQyUwQSkudG8oJTIyY3VkYSUyMiklMEFwaXBlLnNjaGVkdWxlciUyMCUzRCUyMExDTVNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlLnNjaGVkdWxlci5jb25maWcpJTBBJTBBZ2VuZXJhdG9yJTIwJTNEJTIwdG9yY2gubWFudWFsX3NlZWQoMCklMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwJTIydGhlJTIwbW9uYSUyMGxpc2ElMjIlMkMlMEElMjAlMjAlMjAlMjBpbWFnZSUzRGNhbm55X2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDQlMkMlMEElMjAlMjAlMjAlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3IlMkMlMEEpLmltYWdlcyU1QjAlNUQlMEFtYWtlX2ltYWdlX2dyaWQoJTVCY2FubnlfaW1hZ2UlMkMlMjBpbWFnZSU1RCUyQyUyMHJvd3MlM0QxJTJDJTIwY29scyUzRDIp",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(),b(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),T(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:k,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 E({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBjdjIlMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uQ29udHJvbE5ldFBpcGVsaW5lJTJDJTIwQ29udHJvbE5ldE1vZGVsJT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NUIwJTVEJTBBaW1hZ2U=",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(),b(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),T(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:k,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(){b(s.$$.fragment),h=d(),b(r.$$.fragment)},l(l){T(s.$$.fragment,l),h=M(l),T(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 E({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBjdjIlMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uWExBZGFwdGVyUGlwZWxpbmUlMkMlMjBVTmV0MkRDb25kaXRpb25Nb2RlbCUyQyUyMFQySUFkYXB0ZXIlMkMlMjBMQ01TY2hlZHVsZXIlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUyQyUyMG1ha2VfaW1hZ2VfZ3JpZCUwQSUwQSUyMyUyMGRldGVjdCUyMHRoZSUyMGNhbm55JTIwbWFwJTIwaW4lMjBsb3clMjByZXNvbHV0aW9uJTIwdG8lMjBhdm9pZCUyMGhpZ2gtZnJlcXVlbmN5JTIwZGV0YWlscyUwQWltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmhmLmNvJTJGZGF0YXNldHMlMkZodWdnaW5nZmFjZSUyRmRvY3VtZW50YXRpb24taW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZkaWZmdXNlcnMlMkZpbnB1dF9pbWFn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UyMCUyMCUyMGltYWdlJTNEY2FubnlfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENCUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNENSUyQyUwQSUyMCUyMCUyMCUyMGFkYXB0ZXJfY29uZGl0aW9uaW5nX3NjYWxlJTNEMC44JTJDJTBBJTIwJTIwJTIwJTIwYWRhcHRlcl9jb25kaXRpb25pbmdfZmFjdG9yJTNEMSUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",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(),b(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),T(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:k,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 E({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBjdjIlMEFpbXBvcnQlMjBudW1weSUyMGFzJTIwbnAlMEFmcm9tJTIwUElMJTIwaW1wb3J0JTIwSW1hZ2UlMEElMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwU3RhYmxlRGlmZnVzaW9uWExBZGFwdGVyUGlwZWxpbmUlMkMlMjBVTmV0MkRDb25kaXRpb25Nb2RlbCUyQyUyMFQySUFkYXB0ZXIlMkMlMjBMQ01TY2hlZHVsZXIlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwbG9hZF9pbWFnZSUyQyUyMG1ha2VfaW1hZ2VfZ3JpZCUwQSUwQSUyMyUyMGRldGVjdCUyMHRoZSUyMGNhbm55JTIwbWFwJTIwaW4lMjBsb3clMjByZXNvbHV0aW9uJTIwdG8lMjBhdm9pZCUyMGhpZ2gtZnJlcXVlbmN5JTIwZGV0YWlscyUwQWltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMEElMjAlMjAlMjAlMjAlMjJodHRwcyUzQSUyRiUyRmhmLmNvJTJGZGF0YXNldHMlMkZodWdnaW5nZmFjZSUyRmRvY3VtZW50YXRpb24taW1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zRDEuNSUyQyUwQSUyMCUyMCUyMCUyMGFkYXB0ZXJfY29uZGl0aW9uaW5nX3NjYWxlJTNEMC44JTJDJTBBJTIwJTIwJTIwJTIwYWRhcHRlcl9jb25kaXRpb25pbmdfZmFjdG9yJTNEMSUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUyQyUwQSkuaW1hZ2VzJTVCMCU1RA==",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(),b(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),T(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:k,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 Nl(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(){b(s.$$.fragment),h=d(),b(r.$$.fragment)},l(l){T(s.$$.fragment,l),h=M(l),T(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 El(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,N,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,Q,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,X,fe,A,Je,$,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,be,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>',Te,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="../tutorials/using_peft_for_inference">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,Ne,ae,Ee,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.',ke,Y,ve,oe,Qe,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.',Xe,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.',$e,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 yl({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;",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"}]}}),t=new v({props:{title:"Latent Consistency Model",local:"latent-consistency-model",headingTag:"h1"}}),H=new v({props:{title:"Text-to-image",local:"text-to-image",headingTag:"h2"}}),X=new Me({props:{id:"lcm-text2img",options:["LCM","LCM-LoRA"],$$slots:{default:[Ul]},$$scope:{ctx:I}}}),A=new v({props:{title:"Image-to-image",local:"image-to-image",headingTag:"h2"}}),$=new Me({props:{id:"lcm-img2img",options:["LCM","LCM-LoRA"],$$slots:{default:[Tl]},$$scope:{ctx:I}}}),z=new v({props:{title:"Inpainting",local:"inpainting",headingTag:"h2"}}),D=new E({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQXV0b1BpcGVsaW5lRm9ySW5wYWludGluZyUyQyUyMExDTVNjaGVkdWxlciUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBsb2FkX2ltYWdlJTJDJTIwbWFrZV9pbWFnZV9ncmlkJTBBJTBBcGlwZSUyMCUzRCUyMEF1dG9QaXBlbGluZUZvcklucGFpbnRpbmcuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyRnN0YWJsZS1kaWZmdXNpb24taW5wYWludGluZyUyMiUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUwQSUyMCUyMCUyMCUyMHZhcmlhbnQlM0QlMjJmcDE2JTIyJTJDJTBBKS50byglMjJjdWRhJTIyKSUwQSUwQXBpcGUuc2NoZWR1bGVyJTIwJTNEJTIwTENNU2NoZWR1bGVyLmZyb21fY29uZmlnKHBpcGUuc2NoZWR1bGVyLmNvbmZpZyklMEElMEFwaXBlLmxvYWRfbG9yYV93ZWlnaHRzKCUyMmxhdGVudC1jb25zaXN0ZW5jeSUyRmxjbS1sb3JhLXNkdjEtNSUyMiklMEElMEFpbml0X2ltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZodWdnaW5nZmFjZSUyRmRvY3VtZW50YXRpb24taW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZkaWZmdXNlcnMlMkZpbnBhaW50LnBuZyUyMiklMEFtYXNrX2ltYWdlJTIwJTNEJTIwbG9hZF9pbWFnZSglMjJodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGZGF0YXNldHMlMkZodWdnaW5nZmFjZSUyRmRvY3VtZW50YXRpb24taW1hZ2VzJTJGcmVzb2x2ZSUyRm1haW4lMkZkaWZmdXNlcnMlMkZpbnBhaW50X21hc2sucG5nJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMmNvbmNlcHQlMjBhcnQlMjBkaWdpdGFsJTIwcGFpbnRpbmclMjBvZiUyMGFuJTIwZWx2ZW4lMjBjYXN0bGUlMkMlMjBpbnNwaXJlZCUyMGJ5JTIwbG9yZCUyMG9mJTIwdGhlJTIwcmluZ3MlMkMlMjBoaWdobHklMjBkZXRhaWxlZCUyQyUyMDhrJTIyJTBBZ2VuZXJhdG9yJTIwJTNEJTIwdG9yY2gubWFudWFsX3NlZWQoMCklMEFpbWFnZSUyMCUzRCUyMHBpcGUoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEcHJvbXB0JTJDJTBBJTIwJTIwJTIwJTIwaW1hZ2UlM0Rpbml0X2ltYWdlJTJDJTBBJTIwJTIwJTIwJTIwbWFza19pbWFnZSUzRG1hc2tfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3IlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENCUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNENCUyQyUwQSkuaW1hZ2VzJTVCMCU1RCUwQWltYWdl",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;stable-diffusion-v1-5/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 v({props:{title:"Adapters",local:"adapters",headingTag:"h2"}}),O=new v({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 v({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 v({props:{title:"T2I-Adapter",local:"t2i-adapter",headingTag:"h3"}}),Y=new Me({props:{id:"lcm-t2i",options:["LCM","LCM-LoRA"],$$slots:{default:[Nl]},$$scope:{ctx:I}}}),oe=new v({props:{title:"AnimateDiff",local:"animatediff",headingTag:"h3"}}),ce=new E({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwTW90aW9uQ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hcHRlcnMoJTVCJTIybGNtJTIyJTJDJTIwJTIybW90aW9uLWxvcmElMjIlNUQlMkMlMjBhZGFwdGVyX3dlaWdodHMlM0QlNUIwLjU1JTJDJTIwMS4yJTVEKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMmJlc3QlMjBxdWFsaXR5JTJDJTIwbWFzdGVycGllY2UlMkMlMjAxZ2lybCUyQyUyMGxvb2tpbmclMjBhdCUyMHZpZXdlciUyQyUyMGJsdXJyeSUyMGJhY2tncm91bmQlMkMlMjB1cHBlciUyMGJvZHklMkMlMjBjb250ZW1wb3JhcnklMkMlMjBkcmVzcyUyMiUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLm1hbnVhbF9zZWVkKDApJTBBZnJhbWVzJTIwJTNEJTIwcGlwZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlM0Rwcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNENSUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEMS4yNSUyQyUwQSUyMCUyMCUyMCUyMGNyb3NzX2F0dGVudGlvbl9rd2FyZ3MlM0QlN0IlMjJzY2FsZSUyMiUzQSUyMDElN0QlMkMlMEElMjAlMjAlMjAlMjBudW1fZnJhbWVzJTNEMjQlMkMlMEElMjAlMjAlMjAlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3IlMEEpLmZyYW1lcyU1QjAlNUQlMEFleHBvcnRfdG9fZ2lmKGZyYW1lcyUyQyUyMCUyMmFuaW1hdGlvbi5naWYlMjIp",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(),b(l.$$.fragment),n=d(),b(m.$$.fragment),u=d(),b(t.$$.fragment),y=d(),G=J("p"),G.innerHTML=p,w=d(),N=J("p"),N.innerHTML=f,B=d(),x=J("p"),x.textContent=Fe,ue=d(),Q=J("blockquote"),Q.innerHTML=xe,he=d(),b(H.$$.fragment),ye=d(),b(X.$$.fragment),fe=d(),b(A.$$.fragment),Je=d(),b($.$$.fragment),ge=d(),b(z.$$.fragment),Ue=d(),q=J("p"),q.innerHTML=He,we=d(),b(D.$$.fragment),be=d(),V=J("div"),V.innerHTML=Ae,Te=d(),b(K.$$.fragment),je=d(),P=J("p"),P.textContent=ze,Ze=d(),b(O.$$.fragment),We=d(),ee=J("p"),ee.innerHTML=qe,Ce=d(),b(L.$$.fragment),Ge=d(),b(le.$$.fragment),Ie=d(),se=J("p"),se.innerHTML=De,Be=d(),te=J("p"),te.innerHTML=Ke,Re=d(),b(S.$$.fragment),Ne=d(),b(ae.$$.fragment),Ee=d(),ne=J("p"),ne.innerHTML=Pe,_e=d(),ie=J("p"),ie.innerHTML=Oe,ke=d(),b(Y.$$.fragment),ve=d(),b(oe.$$.fragment),Qe=d(),pe=J("p"),pe.innerHTML=el,Xe=d(),re=J("p"),re.innerHTML=ll,$e=d(),b(ce.$$.fragment),Ve=d(),F=J("div"),F.innerHTML=sl,Le=d(),b(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),T(l.$$.fragment,e),n=M(e),T(m.$$.fragment,e),u=M(e),T(t.$$.fragment,e),y=M(e),G=g(e,"P",{"data-svelte-h":!0}),U(G)!=="svelte-fadb22"&&(G.innerHTML=p),w=M(e),N=g(e,"P",{"data-svelte-h":!0}),U(N)!=="svelte-1nhlbs8"&&(N.innerHTML=f),B=M(e),x=g(e,"P",{"data-svelte-h":!0}),U(x)!=="svelte-vcrp3b"&&(x.textContent=Fe),ue=M(e),Q=g(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),U(Q)!=="svelte-k4lcym"&&(Q.innerHTML=xe),he=M(e),T(H.$$.fragment,e),ye=M(e),T(X.$$.fragment,e),fe=M(e),T(A.$$.fragment,e),Je=M(e),T($.$$.fragment,e),ge=M(e),T(z.$$.fragment,e),Ue=M(e),q=g(e,"P",{"data-svelte-h":!0}),U(q)!=="svelte-d6f0ch"&&(q.innerHTML=He),we=M(e),T(D.$$.fragment,e),be=M(e),V=g(e,"DIV",{class:!0,"data-svelte-h":!0}),U(V)!=="svelte-1olacag"&&(V.innerHTML=Ae),Te=M(e),T(K.$$.fragment,e),je=M(e),P=g(e,"P",{"data-svelte-h":!0}),U(P)!=="svelte-i3adm8"&&(P.textContent=ze),Ze=M(e),T(O.$$.fragment,e),We=M(e),ee=g(e,"P",{"data-svelte-h":!0}),U(ee)!=="svelte-2ivo4o"&&(ee.innerHTML=qe),Ce=M(e),T(L.$$.fragment,e),Ge=M(e),T(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),T(S.$$.fragment,e),Ne=M(e),T(ae.$$.fragment,e),Ee=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),ke=M(e),T(Y.$$.fragment,e),ve=M(e),T(oe.$$.fragment,e),Qe=M(e),pe=g(e,"P",{"data-svelte-h":!0}),U(pe)!=="svelte-14vivd7"&&(pe.innerHTML=el),Xe=M(e),re=g(e,"P",{"data-svelte-h":!0}),U(re)!=="svelte-1tdp050"&&(re.innerHTML=ll),$e=M(e),T(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),T(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(Q,"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,N,c),i(e,B,c),i(e,x,c),i(e,ue,c),i(e,Q,c),i(e,he,c),j(H,e,c),i(e,ye,c),j(X,e,c),i(e,fe,c),j(A,e,c),i(e,Je,c),j($,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,be,c),i(e,V,c),i(e,Te,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,Ne,c),j(ae,e,c),i(e,Ee,c),i(e,ne,c),i(e,_e,c),i(e,ie,c),i(e,ke,c),j(Y,e,c),i(e,ve,c),j(oe,e,c),i(e,Qe,c),i(e,pe,c),i(e,Xe,c),i(e,re,c),i(e,$e,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}),X.$set(tl);const al={};c&2&&(al.$$scope={dirty:c,ctx:e}),$.$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(X.$$.fragment,e),Z(A.$$.fragment,e),Z($.$$.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(X.$$.fragment,e),W(A.$$.fragment,e),W($.$$.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(N),a(B),a(x),a(ue),a(Q),a(he),a(ye),a(fe),a(Je),a(ge),a(Ue),a(q),a(we),a(be),a(V),a(Te),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(Ne),a(Ee),a(ne),a(_e),a(ie),a(ke),a(ve),a(Qe),a(pe),a(Xe),a(re),a($e),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(X,e),C(A,e),C($,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 kl(I){return cl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Yl extends ml{constructor(s){super(),dl(this,s,kl,El,rl,{})}}export{Yl as component};
