import{s as Ft,o as zt,n as v}from"../chunks/scheduler.8c3d61f6.js";import{S as At,i as Ht,g as r,s as a,r as y,A as Et,h as f,f as l,c as p,j as Dt,u as h,x as u,k as as,y as Lt,a as t,v as U,d as T,t as J,w as b}from"../chunks/index.589a98e8.js";import{T as Yl}from"../chunks/Tip.42aa8582.js";import{C as Z}from"../chunks/CodeBlock.36627b28.js";import{D as Pt}from"../chunks/DocNotebookDropdown.108e4998.js";import{H as $,E as Ot}from"../chunks/EditOnGithub.e5a8d9cb.js";import{H as ql,a as ps}from"../chunks/HfOption.9804ab8b.js";function Kt(w){let i,c='Skip to the <a href="#diffusionpipeline-explained">DiffusionPipeline explained</a> section if you’re interested in an explanation about how the <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a> class works.';return{c(){i=r("p"),i.innerHTML=c},l(n){i=f(n,"P",{"data-svelte-h":!0}),u(i)!=="svelte-1quqy2v"&&(i.innerHTML=c)},m(n,d){t(n,i,d)},p:v,d(n){n&&l(i)}}}function ei(w){let i,c='The <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a> class is a simple and generic way to load the latest trending diffusion model from the <a href="https://huggingface.co/models?library=diffusers&amp;sort=trending" rel="nofollow">Hub</a>. It uses the <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained">from_pretrained()</a> method to automatically detect the correct pipeline class for a task from the checkpoint, downloads and caches all the required configuration and weight files, and returns a pipeline ready for inference.',n,d,o,m,j='This same checkpoint can also be used for an image-to-image task. The <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a> class can handle any task as long as you provide the appropriate inputs. For example, for an image-to-image task, you need to pass an initial image to the pipeline.',g,_,C;return d=new Z({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

pipeline = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, use_safetensors=<span class="hljs-literal">True</span>)`,wrap:!1}}),_=new Z({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlKSUwQSUwQWluaXRfaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmh1Z2dpbmdmYWNlJTJGZG9jdW1lbnRhdGlvbi1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyRmRpZmZ1c2VycyUyRmltZzJpbWctaW5pdC5wbmclMjIpJTBBcHJvbXB0JTIwJTNEJTIwJTIyQXN0cm9uYXV0JTIwaW4lMjBhJTIwanVuZ2xlJTJDJTIwY29sZCUyMGNvbG9yJTIwcGFsZXR0ZSUyQyUyMG11dGVkJTIwY29sb3JzJTJDJTIwZGV0YWlsZWQlMkMlMjA4ayUyMiUwQWltYWdlJTIwJTNEJTIwcGlwZWxpbmUoJTIyQXN0cm9uYXV0JTIwaW4lMjBhJTIwanVuZ2xlJTJDJTIwY29sZCUyMGNvbG9yJTIwcGFsZXR0ZSUyQyUyMG11dGVkJTIwY29sb3JzJTJDJTIwZGV0YWlsZWQlMkMlMjA4ayUyMiUyQyUyMGltYWdlJTNEaW5pdF9pbWFnZSkuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

pipeline = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, use_safetensors=<span class="hljs-literal">True</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;Astronaut in a jungle, cold color palette, muted colors, detailed, 8k&quot;</span>
image = pipeline(<span class="hljs-string">&quot;Astronaut in a jungle, cold color palette, muted colors, detailed, 8k&quot;</span>, image=init_image).images[<span class="hljs-number">0</span>]`,wrap:!1}}),{c(){i=r("p"),i.innerHTML=c,n=a(),y(d.$$.fragment),o=a(),m=r("p"),m.innerHTML=j,g=a(),y(_.$$.fragment)},l(M){i=f(M,"P",{"data-svelte-h":!0}),u(i)!=="svelte-6j1k0f"&&(i.innerHTML=c),n=p(M),h(d.$$.fragment,M),o=p(M),m=f(M,"P",{"data-svelte-h":!0}),u(m)!=="svelte-orfdtg"&&(m.innerHTML=j),g=p(M),h(_.$$.fragment,M)},m(M,I){t(M,i,I),t(M,n,I),U(d,M,I),t(M,o,I),t(M,m,I),t(M,g,I),U(_,M,I),C=!0},p:v,i(M){C||(T(d.$$.fragment,M),T(_.$$.fragment,M),C=!0)},o(M){J(d.$$.fragment,M),J(_.$$.fragment,M),C=!1},d(M){M&&(l(i),l(n),l(o),l(m),l(g)),b(d,M),b(_,M)}}}function si(w){let i,c='Checkpoints can be loaded by their specific pipeline class if you already know it. For example, to load a Stable Diffusion model, use the <a href="/docs/diffusers/pr_7685/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline">StableDiffusionPipeline</a> class.',n,d,o,m,j='This same checkpoint may also be used for another task like image-to-image. To differentiate what task you want to use the checkpoint for, you have to use the corresponding task-specific pipeline class. For example, to use the same checkpoint for image-to-image, use the <a href="/docs/diffusers/pr_7685/en/api/pipelines/stable_diffusion/img2img#diffusers.StableDiffusionImg2ImgPipeline">StableDiffusionImg2ImgPipeline</a> class.',g,_,C;return d=new Z({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

pipeline = StableDiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, use_safetensors=<span class="hljs-literal">True</span>)`,wrap:!1}}),_=new Z({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvbkltZzJJbWdQaXBlbGluZSUwQSUwQXBpcGVsaW5lJTIwJTNEJTIwU3RhYmxlRGlmZnVzaW9uSW1nMkltZ1BpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionImg2ImgPipeline

pipeline = StableDiffusionImg2ImgPipeline.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, use_safetensors=<span class="hljs-literal">True</span>)`,wrap:!1}}),{c(){i=r("p"),i.innerHTML=c,n=a(),y(d.$$.fragment),o=a(),m=r("p"),m.innerHTML=j,g=a(),y(_.$$.fragment)},l(M){i=f(M,"P",{"data-svelte-h":!0}),u(i)!=="svelte-dsmf11"&&(i.innerHTML=c),n=p(M),h(d.$$.fragment,M),o=p(M),m=f(M,"P",{"data-svelte-h":!0}),u(m)!=="svelte-1kdz72u"&&(m.innerHTML=j),g=p(M),h(_.$$.fragment,M)},m(M,I){t(M,i,I),t(M,n,I),U(d,M,I),t(M,o,I),t(M,m,I),t(M,g,I),U(_,M,I),C=!0},p:v,i(M){C||(T(d.$$.fragment,M),T(_.$$.fragment,M),C=!0)},o(M){J(d.$$.fragment,M),J(_.$$.fragment,M),C=!1},d(M){M&&(l(i),l(n),l(o),l(m),l(g)),b(d,M),b(_,M)}}}function li(w){let i,c,n,d;return i=new ps({props:{id:"pipelines",option:"generic pipeline",$$slots:{default:[ei]},$$scope:{ctx:w}}}),n=new ps({props:{id:"pipelines",option:"specific pipeline",$$slots:{default:[si]},$$scope:{ctx:w}}}),{c(){y(i.$$.fragment),c=a(),y(n.$$.fragment)},l(o){h(i.$$.fragment,o),c=p(o),h(n.$$.fragment,o)},m(o,m){U(i,o,m),t(o,c,m),U(n,o,m),d=!0},p(o,m){const j={};m&2&&(j.$$scope={dirty:m,ctx:o}),i.$set(j);const g={};m&2&&(g.$$scope={dirty:m,ctx:o}),n.$set(g)},i(o){d||(T(i.$$.fragment,o),T(n.$$.fragment,o),d=!0)},o(o){J(i.$$.fragment,o),J(n.$$.fragment,o),d=!1},d(o){o&&l(c),b(i,o),b(n,o)}}}function ti(w){let i,c='To switch between tasks (rather than features), use the <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pipe">from_pipe()</a> method with the <a href="../api/pipelines/auto_pipeline">AutoPipeline</a> class, which automatically identifies the pipeline class based on the task (learn more in the <a href="../tutorials/autopipeline">AutoPipeline</a> tutorial).';return{c(){i=r("p"),i.innerHTML=c},l(n){i=f(n,"P",{"data-svelte-h":!0}),u(i)!=="svelte-tf454r"&&(i.innerHTML=c)},m(n,d){t(n,i,d)},p:v,d(n){n&&l(i)}}}function ii(w){let i,c='Some pipeline methods may not function properly on new pipelines created with <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pipe">from_pipe()</a>. For instance, the <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline.enable_model_cpu_offload">enable_model_cpu_offload()</a> method installs hooks on the model components based on a unique offloading sequence for each pipeline. If the models are executed in a different order in the new pipeline, the CPU offloading may not work correctly.',n,d,o='To ensure everything works as expected, we recommend re-applying a pipeline method on a new pipeline created with <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pipe">from_pipe()</a>.';return{c(){i=r("p"),i.innerHTML=c,n=a(),d=r("p"),d.innerHTML=o},l(m){i=f(m,"P",{"data-svelte-h":!0}),u(i)!=="svelte-ylr4wg"&&(i.innerHTML=c),n=p(m),d=f(m,"P",{"data-svelte-h":!0}),u(d)!=="svelte-8akhc2"&&(d.innerHTML=o)},m(m,j){t(m,i,j),t(m,n,j),t(m,d,j)},p:v,d(m){m&&(l(i),l(n),l(d))}}}function ni(w){let i,c='When the checkpoints have identical model structures, but they were trained on different datasets and with a different training setup, they should be stored in separate repositories. For example, <a href="https://hf.co/stabilityai/stable-diffusion-2" rel="nofollow">stabilityai/stable-diffusion-2</a> and <a href="https://hf.co/stabilityai/stable-diffusion-2-1" rel="nofollow">stabilityai/stable-diffusion-2-1</a> are stored in separate repositories.';return{c(){i=r("p"),i.innerHTML=c},l(n){i=f(n,"P",{"data-svelte-h":!0}),u(i)!=="svelte-11b88rc"&&(i.innerHTML=c)},m(n,d){t(n,i,d)},p:v,d(n){n&&l(i)}}}function ai(w){let i,c;return i=new Z({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlbGluZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUyQyUyMHZhcmlhbnQlM0QlMjJmcDE2JTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSUwQSk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">import</span> torch

pipeline = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>
)`,wrap:!1}}),{c(){y(i.$$.fragment)},l(n){h(i.$$.fragment,n)},m(n,d){U(i,n,d),c=!0},p:v,i(n){c||(T(i.$$.fragment,n),c=!0)},o(n){J(i.$$.fragment,n),c=!1},d(n){b(i,n)}}}function pi(w){let i,c;return i=new Z({props:{code:"cGlwZWxpbmUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMkMlMjB2YXJpYW50JTNEJTIybm9uX2VtYSUyMiUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUlMEEp",highlighted:`pipeline = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, variant=<span class="hljs-string">&quot;non_ema&quot;</span>, use_safetensors=<span class="hljs-literal">True</span>
)`,wrap:!1}}),{c(){y(i.$$.fragment)},l(n){h(i.$$.fragment,n)},m(n,d){U(i,n,d),c=!0},p:v,i(n){c||(T(i.$$.fragment,n),c=!0)},o(n){J(i.$$.fragment,n),c=!1},d(n){b(i,n)}}}function oi(w){let i,c,n,d;return i=new ps({props:{id:"variants",option:"fp16",$$slots:{default:[ai]},$$scope:{ctx:w}}}),n=new ps({props:{id:"variants",option:"non-EMA",$$slots:{default:[pi]},$$scope:{ctx:w}}}),{c(){y(i.$$.fragment),c=a(),y(n.$$.fragment)},l(o){h(i.$$.fragment,o),c=p(o),h(n.$$.fragment,o)},m(o,m){U(i,o,m),t(o,c,m),U(n,o,m),d=!0},p(o,m){const j={};m&2&&(j.$$scope={dirty:m,ctx:o}),i.$set(j);const g={};m&2&&(g.$$scope={dirty:m,ctx:o}),n.$set(g)},i(o){d||(T(i.$$.fragment,o),T(n.$$.fragment,o),d=!0)},o(o){J(i.$$.fragment,o),J(n.$$.fragment,o),d=!1},d(o){o&&l(c),b(i,o),b(n,o)}}}function ri(w){let i,c;return i=new Z({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUuc2F2ZV9wcmV0cmFpbmVkKCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTIwdmFyaWFudCUzRCUyMmZwMTYlMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

pipeline.save_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>)`,wrap:!1}}),{c(){y(i.$$.fragment)},l(n){h(i.$$.fragment,n)},m(n,d){U(i,n,d),c=!0},p:v,i(n){c||(T(i.$$.fragment,n),c=!0)},o(n){J(i.$$.fragment,n),c=!1},d(n){b(i,n)}}}function fi(w){let i,c;return i=new Z({props:{code:"cGlwZWxpbmUuc2F2ZV9wcmV0cmFpbmVkKCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTIwdmFyaWFudCUzRCUyMm5vbl9lbWElMjIp",highlighted:'pipeline.save_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, variant=<span class="hljs-string">&quot;non_ema&quot;</span>)',wrap:!1}}),{c(){y(i.$$.fragment)},l(n){h(i.$$.fragment,n)},m(n,d){U(i,n,d),c=!0},p:v,i(n){c||(T(i.$$.fragment,n),c=!0)},o(n){J(i.$$.fragment,n),c=!1},d(n){b(i,n)}}}function ui(w){let i,c,n,d;return i=new ps({props:{id:"save",option:"fp16",$$slots:{default:[ri]},$$scope:{ctx:w}}}),n=new ps({props:{id:"save",option:"non_ema",$$slots:{default:[fi]},$$scope:{ctx:w}}}),{c(){y(i.$$.fragment),c=a(),y(n.$$.fragment)},l(o){h(i.$$.fragment,o),c=p(o),h(n.$$.fragment,o)},m(o,m){U(i,o,m),t(o,c,m),U(n,o,m),d=!0},p(o,m){const j={};m&2&&(j.$$scope={dirty:m,ctx:o}),i.$set(j);const g={};m&2&&(g.$$scope={dirty:m,ctx:o}),n.$set(g)},i(o){d||(T(i.$$.fragment,o),T(n.$$.fragment,o),d=!0)},o(o){J(i.$$.fragment,o),J(n.$$.fragment,o),d=!1},d(o){o&&l(c),b(i,o),b(n,o)}}}function ci(w){let i,c,n,d,o,m,j,g,_,C='Diffusion systems consist of multiple components like parameterized models and schedulers that interact in complex ways. That is why we designed the <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a> to wrap the complexity of the entire diffusion system into an easy-to-use API. At the same time, the <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a> is entirely customizable so you can modify each component to build a diffusion system for your use case.',M,I,Sl="This guide will show you how to load:",rs,x,xl="<li>pipelines from the Hub and locally</li> <li>different components into a pipeline</li> <li>multiple pipelines without increasing memory usage</li> <li>checkpoint variants such as different floating point types or non-exponential mean averaged (EMA) weights</li>",fs,D,us,G,cs,F,Dl="There are two ways to load a pipeline for a task:",ds,z,Fl='<li>Load the generic <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a> class and allow it to automatically detect the correct pipeline class from the checkpoint.</li> <li>Load a specific pipeline class for a specific task.</li>',ms,V,Ms,A,zl="Use the Space below to gauge a pipeline’s memory requirements before you download and load it to see if it runs on your hardware.",ys,k,Al='<iframe src="https://diffusers-compute-pipeline-size.hf.space?__theme=light" width="850" height="1600"></iframe>',hs,W,Hl='<iframe src="https://diffusers-compute-pipeline-size.hf.space?__theme=dark" width="850" height="1600"></iframe>',Us,H,Ts,E,El='To load a pipeline locally, use <a href="https://git-lfs.github.com/" rel="nofollow">git-lfs</a> to manually download a checkpoint to your local disk.',Js,L,bs,P,Ll='This creates a local folder, ./stable-diffusion-v1-5, on your disk and you should pass its path to <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained">from_pretrained()</a>.',ws,O,js,K,Pl='The <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained">from_pretrained()</a> method won’t download files from the Hub when it detects a local path, but this also means it won’t download and cache the latest changes to a checkpoint.',Zs,ee,gs,se,Ol="You can customize a pipeline by loading different components into it. This is important because you can:",_s,le,Kl="<li>change to a scheduler with faster generation speed or higher generation quality depending on your needs (call the <code>scheduler.compatibles</code> method on your pipeline to see compatible schedulers)</li> <li>change a default pipeline component to a newer and better performing one</li>",Is,te,et='For example, let’s customize the default <a href="https://hf.co/stabilityai/stable-diffusion-xl-base-1.0" rel="nofollow">stabilityai/stable-diffusion-xl-base-1.0</a> checkpoint with:',Cs,ie,st='<li>The <a href="/docs/diffusers/pr_7685/en/api/schedulers/heun#diffusers.HeunDiscreteScheduler">HeunDiscreteScheduler</a> to generate higher quality images at the expense of slower generation speed. You must pass the <code>subfolder=&quot;scheduler&quot;</code> parameter in <a href="/docs/diffusers/pr_7685/en/api/schedulers/overview#diffusers.SchedulerMixin.from_pretrained">from_pretrained()</a> to load the scheduler configuration into the correct <a href="https://hf.co/stabilityai/stable-diffusion-xl-base-1.0/tree/main/scheduler" rel="nofollow">subfolder</a> of the pipeline repository.</li> <li>A more stable VAE that runs in fp16.</li>',$s,ne,vs,ae,lt='Now pass the new scheduler and VAE to the <a href="/docs/diffusers/pr_7685/en/api/pipelines/stable_diffusion/stable_diffusion_xl#diffusers.StableDiffusionXLPipeline">StableDiffusionXLPipeline</a>.',Gs,pe,Vs,oe,ks,re,tt="When you load multiple pipelines that share the same model components, it makes sense to reuse the shared components instead of reloading everything into memory again, especially if your hardware is memory-constrained. For example:",Ws,fe,it='<li>You generated an image with the <a href="/docs/diffusers/pr_7685/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline">StableDiffusionPipeline</a> but you want to improve its quality with the <a href="/docs/diffusers/pr_7685/en/api/pipelines/self_attention_guidance#diffusers.StableDiffusionSAGPipeline">StableDiffusionSAGPipeline</a>. Both of these pipelines share the same pretrained model, so it’d be a waste of memory to load the same model twice.</li> <li>You want to add a model component, like a <a href="../api/pipelines/animatediff#animatediffpipeline"><code>MotionAdapter</code></a>, to <a href="/docs/diffusers/pr_7685/en/api/pipelines/animatediff#diffusers.AnimateDiffPipeline">AnimateDiffPipeline</a> which was instantiated from an existing <a href="/docs/diffusers/pr_7685/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline">StableDiffusionPipeline</a>. Again, both pipelines share the same pretrained model, so it’d be a waste of memory to load an entirely new pipeline again.</li>',Bs,ue,nt='With the <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pipe">DiffusionPipeline.from_pipe()</a> API, you can switch between multiple pipelines to take advantage of their different features without increasing memory-usage. It is similar to turning on and off a feature in your pipeline.',Rs,B,Xs,ce,at='Let’s start with a <a href="/docs/diffusers/pr_7685/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline">StableDiffusionPipeline</a> and then reuse the loaded model components to create a <a href="/docs/diffusers/pr_7685/en/api/pipelines/self_attention_guidance#diffusers.StableDiffusionSAGPipeline">StableDiffusionSAGPipeline</a> to increase generation quality. You’ll use the <a href="/docs/diffusers/pr_7685/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline">StableDiffusionPipeline</a> with an <a href="./ip_adapter">IP-Adapter</a> to generate a bear eating pizza.',Qs,de,Ns,R,pt='<img class="rounded-xl" src="https://huggingface.co/datasets/YiYiXu/testing-images/resolve/main/from_pipe_out_sd_0.png"/>',Ys,me,ot="For reference, you can check how much memory this process consumed.",qs,Me,Ss,ye,rt='Now, reuse the same pipeline components from <a href="/docs/diffusers/pr_7685/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline">StableDiffusionPipeline</a> in <a href="/docs/diffusers/pr_7685/en/api/pipelines/self_attention_guidance#diffusers.StableDiffusionSAGPipeline">StableDiffusionSAGPipeline</a> with the <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pipe">from_pipe()</a> method.',xs,X,Ds,he,Fs,Q,ft='<img class="rounded-xl" src="https://huggingface.co/datasets/YiYiXu/testing-images/resolve/main/from_pipe_out_sag_1.png"/>',zs,Ue,ut='If you check the memory usage, you’ll see it remains the same as before because <a href="/docs/diffusers/pr_7685/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline">StableDiffusionPipeline</a> and <a href="/docs/diffusers/pr_7685/en/api/pipelines/self_attention_guidance#diffusers.StableDiffusionSAGPipeline">StableDiffusionSAGPipeline</a> are sharing the same pipeline components. This allows you to use them interchangeably without any additional memory overhead.',As,Te,Hs,Je,ct='Let’s animate the image with the <a href="/docs/diffusers/pr_7685/en/api/pipelines/animatediff#diffusers.AnimateDiffPipeline">AnimateDiffPipeline</a> and also add a <code>MotionAdapter</code> module to the pipeline. For the <a href="/docs/diffusers/pr_7685/en/api/pipelines/animatediff#diffusers.AnimateDiffPipeline">AnimateDiffPipeline</a>, you need to unload the IP-Adapter first and reload it <em>after</em> you’ve created your new pipeline (this only applies to the <a href="/docs/diffusers/pr_7685/en/api/pipelines/animatediff#diffusers.AnimateDiffPipeline">AnimateDiffPipeline</a>).',Es,be,Ls,N,dt='<img class="rounded-xl" src="https://huggingface.co/datasets/YiYiXu/testing-images/resolve/main/from_pipe_out_animate_3.gif"/>',Ps,we,mt='The <a href="/docs/diffusers/pr_7685/en/api/pipelines/animatediff#diffusers.AnimateDiffPipeline">AnimateDiffPipeline</a> is more memory-intensive and consumes 15GB of memory (see the <a href="#memory-usage-of-from_pipe">Memory-usage of from_pipe</a> section to learn what this means for your memory-usage).',Os,je,Ks,Ze,el,ge,Mt='Pipelines loaded with <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pipe">from_pipe()</a> can be customized with different model components or methods. However, whenever you modify the <em>state</em> of the model components, it affects all the other pipelines that share the same components. For example, if you call <a href="/docs/diffusers/pr_7685/en/api/loaders/ip_adapter#diffusers.loaders.IPAdapterMixin.unload_ip_adapter">unload_ip_adapter()</a> on the <a href="/docs/diffusers/pr_7685/en/api/pipelines/self_attention_guidance#diffusers.StableDiffusionSAGPipeline">StableDiffusionSAGPipeline</a>, you won’t be able to use IP-Adapter with the <a href="/docs/diffusers/pr_7685/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline">StableDiffusionPipeline</a> because it’s been removed from their shared components.',sl,_e,ll,Ie,tl,Ce,yt='The memory requirement of loading multiple pipelines with <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pipe">from_pipe()</a> is determined by the pipeline with the highest memory-usage regardless of the number of pipelines you create.',il,$e,ht="<thead><tr><th>Pipeline</th> <th>Memory usage (GB)</th></tr></thead> <tbody><tr><td>StableDiffusionPipeline</td> <td>4.400</td></tr> <tr><td>StableDiffusionSAGPipeline</td> <td>4.400</td></tr> <tr><td>AnimateDiffPipeline</td> <td>15.178</td></tr></tbody>",nl,ve,Ut='The <a href="/docs/diffusers/pr_7685/en/api/pipelines/animatediff#diffusers.AnimateDiffPipeline">AnimateDiffPipeline</a> has the highest memory requirement, so the <em>total memory-usage</em> is based only on the <a href="/docs/diffusers/pr_7685/en/api/pipelines/animatediff#diffusers.AnimateDiffPipeline">AnimateDiffPipeline</a>. Your memory-usage will not increase if you create additional pipelines as long as their memory requirements doesn’t exceed that of the <a href="/docs/diffusers/pr_7685/en/api/pipelines/animatediff#diffusers.AnimateDiffPipeline">AnimateDiffPipeline</a>. Each pipeline can be used interchangeably without any additional memory overhead.',al,Ge,pl,Ve,Tt='Diffusers implements a <a href="https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/safety_checker.py" rel="nofollow">safety checker</a> for Stable Diffusion models which can generate harmful content. The safety checker screens the generated output against known hardcoded not-safe-for-work (NSFW) content. If for whatever reason you’d like to disable the safety checker, pass <code>safety_checker=None</code> to the <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained">from_pretrained()</a> method.',ol,ke,rl,We,fl,Be,Jt="A checkpoint variant is usually a checkpoint whose weights are:",ul,Re,bt='<li>Stored in a different floating point type, such as <a href="https://pytorch.org/docs/stable/tensors.html#data-types" rel="nofollow">torch.float16</a>, because it only requires half the bandwidth and storage to download. You can’t use this variant if you’re continuing training or using a CPU.</li> <li>Non-exponential mean averaged (EMA) weights which shouldn’t be used for inference. You should use this variant to continue finetuning a model.</li>',cl,Y,dl,Xe,wt='Otherwise, a variant is <strong>identical</strong> to the original checkpoint. They have exactly the same serialization format (like <a href="./using_safetensors">safetensors</a>), model structure, and their weights have identical tensor shapes.',ml,Qe,jt="<thead><tr><th><strong>checkpoint type</strong></th> <th><strong>weight name</strong></th> <th><strong>argument for loading weights</strong></th></tr></thead> <tbody><tr><td>original</td> <td>diffusion_pytorch_model.safetensors</td> <td></td></tr> <tr><td>floating point</td> <td>diffusion_pytorch_model.fp16.safetensors</td> <td><code>variant</code>, <code>torch_dtype</code></td></tr> <tr><td>non-EMA</td> <td>diffusion_pytorch_model.non_ema.safetensors</td> <td><code>variant</code></td></tr></tbody>",Ml,Ne,Zt="There are two important arguments for loading variants:",yl,Ye,gt='<li><p><code>torch_dtype</code> specifies the floating point precision of the loaded checkpoint. For example, if you want to save bandwidth by loading a fp16 variant, you should set <code>variant=&quot;fp16&quot;</code> and <code>torch_dtype=torch.float16</code> to <em>convert the weights</em> to fp16. Otherwise, the fp16 weights are converted to the default fp32 precision.</p> <p>If you only set <code>torch_dtype=torch.float16</code>, the default fp32 weights are downloaded first and then converted to fp16.</p></li> <li><p><code>variant</code> specifies which files should be loaded from the repository. For example, if you want to load a non-EMA variant of a UNet from <a href="https://hf.co/runwayml/stable-diffusion-v1-5/tree/main/unet" rel="nofollow">runwayml/stable-diffusion-v1-5</a>, set <code>variant=&quot;non_ema&quot;</code> to download the <code>non_ema</code> file.</p></li>',hl,q,Ul,qe,_t='Use the <code>variant</code> parameter in the <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline.save_pretrained">DiffusionPipeline.save_pretrained()</a> method to save a checkpoint as a different floating point type or as a non-EMA variant. You should try save a variant to the same folder as the original checkpoint, so you have the option of loading both from the same folder.',Tl,S,Jl,Se,It="If you don’t save the variant to an existing folder, you must specify the <code>variant</code> argument otherwise it’ll throw an <code>Exception</code> because it can’t find the original checkpoint.",bl,xe,wl,De,jl,Fe,Ct='As a class method, <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained">DiffusionPipeline.from_pretrained()</a> is responsible for two things:',Zl,ze,$t='<li>Download the latest version of the folder structure required for inference and cache it. If the latest folder structure is available in the local cache, <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline.from_pretrained">DiffusionPipeline.from_pretrained()</a> reuses the cache and won’t redownload the files.</li> <li>Load the cached weights into the correct pipeline <a href="../api/pipelines/overview#diffusers-summary">class</a> - retrieved from the <code>model_index.json</code> file - and return an instance of it.</li>',gl,Ae,vt='The pipelines’ underlying folder structure corresponds directly with their class instances. For example, the <a href="/docs/diffusers/pr_7685/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline">StableDiffusionPipeline</a> corresponds to the folder structure in <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5" rel="nofollow"><code>runwayml/stable-diffusion-v1-5</code></a>.',_l,He,Il,Ee,Gt='You’ll see pipeline is an instance of <a href="/docs/diffusers/pr_7685/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline">StableDiffusionPipeline</a>, which consists of seven components:',Cl,Le,Vt='<li><code>&quot;feature_extractor&quot;</code>: a <a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPImageProcessor" rel="nofollow">CLIPImageProcessor</a> from 🤗 Transformers.</li> <li><code>&quot;safety_checker&quot;</code>: a <a href="https://github.com/huggingface/diffusers/blob/e55687e1e15407f60f32242027b7bb8170e58266/src/diffusers/pipelines/stable_diffusion/safety_checker.py#L32" rel="nofollow">component</a> for screening against harmful content.</li> <li><code>&quot;scheduler&quot;</code>: an instance of <a href="/docs/diffusers/pr_7685/en/api/schedulers/pndm#diffusers.PNDMScheduler">PNDMScheduler</a>.</li> <li><code>&quot;text_encoder&quot;</code>: a <a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTextModel" rel="nofollow">CLIPTextModel</a> from 🤗 Transformers.</li> <li><code>&quot;tokenizer&quot;</code>: a <a href="https://huggingface.co/docs/transformers/main/en/model_doc/clip#transformers.CLIPTokenizer" rel="nofollow">CLIPTokenizer</a> from 🤗 Transformers.</li> <li><code>&quot;unet&quot;</code>: an instance of <a href="/docs/diffusers/pr_7685/en/api/models/unet2d-cond#diffusers.UNet2DConditionModel">UNet2DConditionModel</a>.</li> <li><code>&quot;vae&quot;</code>: an instance of <a href="/docs/diffusers/pr_7685/en/api/models/autoencoderkl#diffusers.AutoencoderKL">AutoencoderKL</a>.</li>',$l,Pe,vl,Oe,kt='Compare the components of the pipeline instance to the <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5/tree/main" rel="nofollow"><code>runwayml/stable-diffusion-v1-5</code></a> folder structure, and you’ll see there is a separate folder for each of the components in the repository:',Gl,Ke,Vl,es,Wt="You can access each of the components of the pipeline as an attribute to view its configuration:",kl,ss,Wl,ls,Bt='Every pipeline expects a <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/model_index.json" rel="nofollow"><code>model_index.json</code></a> file that tells the <a href="/docs/diffusers/pr_7685/en/api/pipelines/overview#diffusers.DiffusionPipeline">DiffusionPipeline</a>:',Bl,ts,Rt="<li>which pipeline class to load from <code>_class_name</code></li> <li>which version of 🧨 Diffusers was used to create the model in <code>_diffusers_version</code></li> <li>what components from which library are stored in the subfolders (<code>name</code> corresponds to the component and subfolder name, <code>library</code> corresponds to the name of the library to load the class from, and <code>class</code> corresponds to the class name)</li>",Rl,is,Xl,ns,Ql,os,Nl;return o=new $({props:{title:"Load pipelines",local:"load-pipelines",headingTag:"h1"}}),j=new Pt({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/loading.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/en/pytorch/loading.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/en/tensorflow/loading.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/loading.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/pytorch/loading.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/en/tensorflow/loading.ipynb"}]}}),D=new $({props:{title:"Load a pipeline",local:"load-a-pipeline",headingTag:"h2"}}),G=new Yl({props:{warning:!1,$$slots:{default:[Kt]},$$scope:{ctx:w}}}),V=new ql({props:{id:"pipelines",options:["generic pipeline","specific pipeline"],$$slots:{default:[li]},$$scope:{ctx:w}}}),H=new $({props:{title:"Local pipeline",local:"local-pipeline",headingTag:"h3"}}),L=new Z({props:{code:"Z2l0LWxmcyUyMGluc3RhbGwlMEFnaXQlMjBjbG9uZSUyMGh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZydW53YXltbCUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNQ==",highlighted:`git-lfs install
git <span class="hljs-built_in">clone</span> https://huggingface.co/runwayml/stable-diffusion-v1-5`,wrap:!1}}),O=new Z({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBc3RhYmxlX2RpZmZ1c2lvbiUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjIuJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

stable_diffusion = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;./stable-diffusion-v1-5&quot;</span>, use_safetensors=<span class="hljs-literal">True</span>)`,wrap:!1}}),ee=new $({props:{title:"Customize a pipeline",local:"customize-a-pipeline",headingTag:"h2"}}),ne=new Z({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblhMUGlwZWxpbmUlMkMlMjBIZXVuRGlzY3JldGVTY2hlZHVsZXIlMkMlMjBBdXRvZW5jb2RlcktMJTBBaW1wb3J0JTIwdG9yY2glMEElMEFzY2hlZHVsZXIlMjAlM0QlMjBIZXVuRGlzY3JldGVTY2hlZHVsZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi14bC1iYXNlLTEuMCUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMnNjaGVkdWxlciUyMiklMEF2YWUlMjAlM0QlMjBBdXRvZW5jb2RlcktMLmZyb21fcHJldHJhaW5lZCglMjJtYWRlYnlvbGxpbiUyRnNkeGwtdmFlLWZwMTYtZml4JTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2JTJDJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionXLPipeline, HeunDiscreteScheduler, AutoencoderKL
<span class="hljs-keyword">import</span> torch

scheduler = HeunDiscreteScheduler.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
vae = AutoencoderKL.from_pretrained(<span class="hljs-string">&quot;madebyollin/sdxl-vae-fp16-fix&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>)`,wrap:!1}}),pe=new Z({props:{code:"cGlwZWxpbmUlMjAlM0QlMjBTdGFibGVEaWZmdXNpb25YTFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjJzdGFiaWxpdHlhaSUyRnN0YWJsZS1kaWZmdXNpb24teGwtYmFzZS0xLjAlMjIlMkMlMjAlMEElMjAlMjBzY2hlZHVsZXIlM0RzY2hlZHVsZXIlMkMlMjAlMEElMjAlMjB2YWUlM0R2YWUlMkMlMjAlMEElMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjAlMEElMjAlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUyMCUwQSUyMCUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUlMEEpLnRvKCUyMmN1ZGElMjIp",highlighted:`pipeline = StableDiffusionXLPipeline.from_pretrained(
  <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, 
  scheduler=scheduler, 
  vae=vae, 
  torch_dtype=torch.float16, 
  variant=<span class="hljs-string">&quot;fp16&quot;</span>, 
  use_safetensors=<span class="hljs-literal">True</span>
).to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),oe=new $({props:{title:"Reuse a pipeline",local:"reuse-a-pipeline",headingTag:"h2"}}),B=new Yl({props:{warning:!1,$$slots:{default:[ti]},$$scope:{ctx:w}}}),de=new Z({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTJDJTIwU3RhYmxlRGlmZnVzaW9uU0FHUGlwZWxpbmUlMEFpbXBvcnQlMjB0b3JjaCUwQWltcG9ydCUyMGdjJTBBZnJvbSUyMGRpZmZ1c2Vycy51dGlscyUyMGltcG9ydCUyMGxvYWRfaW1hZ2UlMEFmcm9tJTIwYWNjZWxlcmF0ZS51dGlscyUyMGltcG9ydCUyMGNvbXB1dGVfbW9kdWxlX3NpemVzJTBBJTBBaW1hZ2UlMjAlM0QlMjBsb2FkX2ltYWdlKCUyMmh0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZkYXRhc2V0cyUyRmh1Z2dpbmdmYWNlJTJGZG9jdW1lbnRhdGlvbi1pbWFnZXMlMkZyZXNvbHZlJTJGbWFpbiUyRmRpZmZ1c2VycyUyRmxvYWRfbmVnX2VtYmVkLnBuZyUyMiklMEElMEFwaXBlX3NkJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMlNHMTYxMjIyJTJGUmVhbGlzdGljX1Zpc2lvbl9WNi4wX0IxX25vVkFFJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5mbG9hdDE2KSUwQXBpcGVfc2QubG9hZF9pcF9hZGFwdGVyKCUyMmg5NCUyRklQLUFkYXB0ZXIlMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJtb2RlbHMlMjIlMkMlMjB3ZWlnaHRfbmFtZSUzRCUyMmlwLWFkYXB0ZXJfc2QxNS5iaW4lMjIpJTBBcGlwZV9zZC5zZXRfaXBfYWRhcHRlcl9zY2FsZSgwLjYpJTBBcGlwZV9zZC50byglMjJjdWRhJTIyKSUwQSUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLkdlbmVyYXRvcihkZXZpY2UlM0QlMjJjcHUlMjIpLm1hbnVhbF9zZWVkKDMzKSUwQW91dF9zZCUyMCUzRCUyMHBpcGVfc2QoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEJTIyYmVhciUyMGVhdHMlMjBwaXp6YSUyMiUyQyUwQSUyMCUyMCUyMCUyMG5lZ2F0aXZlX3Byb21wdCUzRCUyMndyb25nJTIwd2hpdGUlMjBiYWxhbmNlJTJDJTIwZGFyayUyQyUyMHNrZXRjaGVzJTJDd29yc3QlMjBxdWFsaXR5JTJDbG93JTIwcXVhbGl0eSUyMiUyQyUyMCUwQSUyMCUyMCUyMCUyMGlwX2FkYXB0ZXJfaW1hZ2UlM0RpbWFnZSUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q1MCUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUyQyUwQSkuaW1hZ2VzJTVCMCU1RCUwQW91dF9zZA==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline, StableDiffusionSAGPipeline
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> gc
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> load_image
<span class="hljs-keyword">from</span> accelerate.utils <span class="hljs-keyword">import</span> compute_module_sizes

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

pipe_sd = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;SG161222/Realistic_Vision_V6.0_B1_noVAE&quot;</span>, torch_dtype=torch.float16)
pipe_sd.load_ip_adapter(<span class="hljs-string">&quot;h94/IP-Adapter&quot;</span>, subfolder=<span class="hljs-string">&quot;models&quot;</span>, weight_name=<span class="hljs-string">&quot;ip-adapter_sd15.bin&quot;</span>)
pipe_sd.set_ip_adapter_scale(<span class="hljs-number">0.6</span>)
pipe_sd.to(<span class="hljs-string">&quot;cuda&quot;</span>)

generator = torch.Generator(device=<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">33</span>)
out_sd = pipe_sd(
    prompt=<span class="hljs-string">&quot;bear eats pizza&quot;</span>,
    negative_prompt=<span class="hljs-string">&quot;wrong white balance, dark, sketches,worst quality,low quality&quot;</span>, 
    ip_adapter_image=image,
    num_inference_steps=<span class="hljs-number">50</span>,
    generator=generator,
).images[<span class="hljs-number">0</span>]
out_sd`,wrap:!1}}),Me=new Z({props:{code:"ZGVmJTIwYnl0ZXNfdG9fZ2lnYV9ieXRlcyhieXRlcyklM0ElMEElMjAlMjAlMjAlMjByZXR1cm4lMjBieXRlcyUyMCUyRiUyMDEwMjQlMjAlMkYlMjAxMDI0JTIwJTJGJTIwMTAyNCUwQXByaW50KGYlMjJNYXglMjBtZW1vcnklMjBhbGxvY2F0ZWQlM0ElMjAlN0JieXRlc190b19naWdhX2J5dGVzKHRvcmNoLmN1ZGEubWF4X21lbW9yeV9hbGxvY2F0ZWQoKSklN0QlMjBHQiUyMiklMEElMjJNYXglMjBtZW1vcnklMjBhbGxvY2F0ZWQlM0ElMjA0LjQwNjIxMzI4MzUzODgxOCUyMEdCJTIy",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">bytes_to_giga_bytes</span>(<span class="hljs-params"><span class="hljs-built_in">bytes</span></span>):
    <span class="hljs-keyword">return</span> <span class="hljs-built_in">bytes</span> / <span class="hljs-number">1024</span> / <span class="hljs-number">1024</span> / <span class="hljs-number">1024</span>
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Max memory allocated: <span class="hljs-subst">{bytes_to_giga_bytes(torch.cuda.max_memory_allocated())}</span> GB&quot;</span>)
<span class="hljs-string">&quot;Max memory allocated: 4.406213283538818 GB&quot;</span>`,wrap:!1}}),X=new Yl({props:{warning:!0,$$slots:{default:[ii]},$$scope:{ctx:w}}}),he=new Z({props:{code:"cGlwZV9zYWclMjAlM0QlMjBTdGFibGVEaWZmdXNpb25TQUdQaXBlbGluZS5mcm9tX3BpcGUoJTBBJTIwJTIwJTIwJTIwcGlwZV9zZCUwQSklMEElMEFnZW5lcmF0b3IlMjAlM0QlMjB0b3JjaC5HZW5lcmF0b3IoZGV2aWNlJTNEJTIyY3B1JTIyKS5tYW51YWxfc2VlZCgzMyklMEFvdXRfc2FnJTIwJTNEJTIwcGlwZV9zYWcoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEJTIyYmVhciUyMGVhdHMlMjBwaXp6YSUyMiUyQyUwQSUyMCUyMCUyMCUyMG5lZ2F0aXZlX3Byb21wdCUzRCUyMndyb25nJTIwd2hpdGUlMjBiYWxhbmNlJTJDJTIwZGFyayUyQyUyMHNrZXRjaGVzJTJDd29yc3QlMjBxdWFsaXR5JTJDbG93JTIwcXVhbGl0eSUyMiUyQyUwQSUyMCUyMCUyMCUyMGlwX2FkYXB0ZXJfaW1hZ2UlM0RpbWFnZSUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q1MCUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUyQyUwQSUyMCUyMCUyMCUyMGd1aWRhbmNlX3NjYWxlJTNEMS4wJTJDJTBBJTIwJTIwJTIwJTIwc2FnX3NjYWxlJTNEMC43NSUwQSkuaW1hZ2VzJTVCMCU1RCUwQW91dF9zYWc=",highlighted:`pipe_sag = StableDiffusionSAGPipeline.from_pipe(
    pipe_sd
)

generator = torch.Generator(device=<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">33</span>)
out_sag = pipe_sag(
    prompt=<span class="hljs-string">&quot;bear eats pizza&quot;</span>,
    negative_prompt=<span class="hljs-string">&quot;wrong white balance, dark, sketches,worst quality,low quality&quot;</span>,
    ip_adapter_image=image,
    num_inference_steps=<span class="hljs-number">50</span>,
    generator=generator,
    guidance_scale=<span class="hljs-number">1.0</span>,
    sag_scale=<span class="hljs-number">0.75</span>
).images[<span class="hljs-number">0</span>]
out_sag`,wrap:!1}}),Te=new Z({props:{code:"cHJpbnQoZiUyMk1heCUyMG1lbW9yeSUyMGFsbG9jYXRlZCUzQSUyMCU3QmJ5dGVzX3RvX2dpZ2FfYnl0ZXModG9yY2guY3VkYS5tYXhfbWVtb3J5X2FsbG9jYXRlZCgpKSU3RCUyMEdCJTIyKSUwQSUyMk1heCUyMG1lbW9yeSUyMGFsbG9jYXRlZCUzQSUyMDQuNDA2MjEzMjgzNTM4ODE4JTIwR0IlMjI=",highlighted:`<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Max memory allocated: <span class="hljs-subst">{bytes_to_giga_bytes(torch.cuda.max_memory_allocated())}</span> GB&quot;</span>)
<span class="hljs-string">&quot;Max memory allocated: 4.406213283538818 GB&quot;</span>`,wrap:!1}}),be=new Z({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEFuaW1hdGVEaWZmUGlwZWxpbmUlMkMlMjBNb3Rpb25BZGFwdGVyJTJDJTIwRERJTVNjaGVkdWxlciUwQWZyb20lMjBkaWZmdXNlcnMudXRpbHMlMjBpbXBvcnQlMjBleHBvcnRfdG9fZ2lmJTBBJTBBcGlwZV9zYWcudW5sb2FkX2lwX2FkYXB0ZXIoKSUwQWFkYXB0ZXIlMjAlM0QlMjBNb3Rpb25BZGFwdGVyLmZyb21fcHJldHJhaW5lZCglMjJndW95d3clMkZhbmltYXRlZGlmZi1tb3Rpb24tYWRhcHRlci12MS01LTIlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpJTBBJTBBcGlwZV9hbmltYXRlJTIwJTNEJTIwQW5pbWF0ZURpZmZQaXBlbGluZS5mcm9tX3BpcGUocGlwZV9zZCUyQyUyMG1vdGlvbl9hZGFwdGVyJTNEYWRhcHRlciklMEFwaXBlX2FuaW1hdGUuc2NoZWR1bGVyJTIwJTNEJTIwRERJTVNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlX2FuaW1hdGUuc2NoZWR1bGVyLmNvbmZpZyUyQyUyMGJldGFfc2NoZWR1bGUlM0QlMjJsaW5lYXIlMjIpJTBBJTIzJTIwbG9hZCUyMElQLUFkYXB0ZXIlMjBhbmQlMjBMb1JBJTIwd2VpZ2h0cyUyMGFnYWluJTBBcGlwZV9hbmltYXRlLmxvYWRfaXBfYWRhcHRlciglMjJoOTQlMkZJUC1BZGFwdGVyJTIyJTJDJTIwc3ViZm9sZGVyJTNEJTIybW9kZWxzJTIyJTJDJTIwd2VpZ2h0X25hbWUlM0QlMjJpcC1hZGFwdGVyX3NkMTUuYmluJTIyKSUwQXBpcGVfYW5pbWF0ZS5sb2FkX2xvcmFfd2VpZ2h0cyglMjJndW95d3clMkZhbmltYXRlZGlmZi1tb3Rpb24tbG9yYS16b29tLW91dCUyMiUyQyUyMGFkYXB0ZXJfbmFtZSUzRCUyMnpvb20tb3V0JTIyKSUwQXBpcGVfYW5pbWF0ZS50byglMjJjdWRhJTIyKSUwQSUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLkdlbmVyYXRvcihkZXZpY2UlM0QlMjJjcHUlMjIpLm1hbnVhbF9zZWVkKDMzKSUwQXBpcGVfYW5pbWF0ZS5zZXRfYWRhcHRlcnMoJTIyem9vbS1vdXQlMjIlMkMlMjBhZGFwdGVyX3dlaWdodHMlM0QwLjc1KSUwQW91dCUyMCUzRCUyMHBpcGVfYW5pbWF0ZSglMEElMjAlMjAlMjAlMjBwcm9tcHQlM0QlMjJiZWFyJTIwZWF0cyUyMHBpenphJTIyJTJDJTBBJTIwJTIwJTIwJTIwbnVtX2ZyYW1lcyUzRDE2JTJDJTBBJTIwJTIwJTIwJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDUwJTJDJTBBJTIwJTIwJTIwJTIwaXBfYWRhcHRlcl9pbWFnZSUzRGltYWdlJTJDJTBBJTIwJTIwJTIwJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yJTJDJTBBKS5mcmFtZXMlNUIwJTVEJTBBZXhwb3J0X3RvX2dpZihvdXQlMkMlMjAlMjJvdXRfYW5pbWF0ZS5naWYlMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AnimateDiffPipeline, MotionAdapter, DDIMScheduler
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_gif

pipe_sag.unload_ip_adapter()
adapter = MotionAdapter.from_pretrained(<span class="hljs-string">&quot;guoyww/animatediff-motion-adapter-v1-5-2&quot;</span>, torch_dtype=torch.float16)

pipe_animate = AnimateDiffPipeline.from_pipe(pipe_sd, motion_adapter=adapter)
pipe_animate.scheduler = DDIMScheduler.from_config(pipe_animate.scheduler.config, beta_schedule=<span class="hljs-string">&quot;linear&quot;</span>)
<span class="hljs-comment"># load IP-Adapter and LoRA weights again</span>
pipe_animate.load_ip_adapter(<span class="hljs-string">&quot;h94/IP-Adapter&quot;</span>, subfolder=<span class="hljs-string">&quot;models&quot;</span>, weight_name=<span class="hljs-string">&quot;ip-adapter_sd15.bin&quot;</span>)
pipe_animate.load_lora_weights(<span class="hljs-string">&quot;guoyww/animatediff-motion-lora-zoom-out&quot;</span>, adapter_name=<span class="hljs-string">&quot;zoom-out&quot;</span>)
pipe_animate.to(<span class="hljs-string">&quot;cuda&quot;</span>)

generator = torch.Generator(device=<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">33</span>)
pipe_animate.set_adapters(<span class="hljs-string">&quot;zoom-out&quot;</span>, adapter_weights=<span class="hljs-number">0.75</span>)
out = pipe_animate(
    prompt=<span class="hljs-string">&quot;bear eats pizza&quot;</span>,
    num_frames=<span class="hljs-number">16</span>,
    num_inference_steps=<span class="hljs-number">50</span>,
    ip_adapter_image=image,
    generator=generator,
).frames[<span class="hljs-number">0</span>]
export_to_gif(out, <span class="hljs-string">&quot;out_animate.gif&quot;</span>)`,wrap:!1}}),je=new Z({props:{code:"cHJpbnQoZiUyMk1heCUyMG1lbW9yeSUyMGFsbG9jYXRlZCUzQSUyMCU3QmJ5dGVzX3RvX2dpZ2FfYnl0ZXModG9yY2guY3VkYS5tYXhfbWVtb3J5X2FsbG9jYXRlZCgpKSU3RCUyMEdCJTIyKSUwQSUyMk1heCUyMG1lbW9yeSUyMGFsbG9jYXRlZCUzQSUyMDE1LjE3ODY2NDIwNzQ1ODQ5NiUyMEdCJTIy",highlighted:`<span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Max memory allocated: <span class="hljs-subst">{bytes_to_giga_bytes(torch.cuda.max_memory_allocated())}</span> GB&quot;</span>)
<span class="hljs-string">&quot;Max memory allocated: 15.178664207458496 GB&quot;</span>`,wrap:!1}}),Ze=new $({props:{title:"Modify from_pipe components",local:"modify-frompipe-components",headingTag:"h3"}}),_e=new Z({props:{code:"cGlwZS5zYWdfdW5sb2FkX2lwX2FkYXB0ZXIoKSUwQSUwQWdlbmVyYXRvciUyMCUzRCUyMHRvcmNoLkdlbmVyYXRvcihkZXZpY2UlM0QlMjJjcHUlMjIpLm1hbnVhbF9zZWVkKDMzKSUwQW91dF9zZCUyMCUzRCUyMHBpcGVfc2QoJTBBJTIwJTIwJTIwJTIwcHJvbXB0JTNEJTIyYmVhciUyMGVhdHMlMjBwaXp6YSUyMiUyQyUwQSUyMCUyMCUyMCUyMG5lZ2F0aXZlX3Byb21wdCUzRCUyMndyb25nJTIwd2hpdGUlMjBiYWxhbmNlJTJDJTIwZGFyayUyQyUyMHNrZXRjaGVzJTJDd29yc3QlMjBxdWFsaXR5JTJDbG93JTIwcXVhbGl0eSUyMiUyQyUyMCUwQSUyMCUyMCUyMCUyMGlwX2FkYXB0ZXJfaW1hZ2UlM0RpbWFnZSUyQyUwQSUyMCUyMCUyMCUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0Q1MCUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRvciUzRGdlbmVyYXRvciUyQyUwQSkuaW1hZ2VzJTVCMCU1RCUwQSUyMkF0dHJpYnV0ZUVycm9yJTNBJTIwJ05vbmVUeXBlJyUyMG9iamVjdCUyMGhhcyUyMG5vJTIwYXR0cmlidXRlJTIwJ2ltYWdlX3Byb2plY3Rpb25fbGF5ZXJzJyUyMg==",highlighted:`pipe.sag_unload_ip_adapter()

generator = torch.Generator(device=<span class="hljs-string">&quot;cpu&quot;</span>).manual_seed(<span class="hljs-number">33</span>)
out_sd = pipe_sd(
    prompt=<span class="hljs-string">&quot;bear eats pizza&quot;</span>,
    negative_prompt=<span class="hljs-string">&quot;wrong white balance, dark, sketches,worst quality,low quality&quot;</span>, 
    ip_adapter_image=image,
    num_inference_steps=<span class="hljs-number">50</span>,
    generator=generator,
).images[<span class="hljs-number">0</span>]
<span class="hljs-string">&quot;AttributeError: &#x27;NoneType&#x27; object has no attribute &#x27;image_projection_layers&#x27;&quot;</span>`,wrap:!1}}),Ie=new $({props:{title:"Memory usage of from_pipe",local:"memory-usage-of-frompipe",headingTag:"h3"}}),Ge=new $({props:{title:"Safety checker",local:"safety-checker",headingTag:"h2"}}),ke=new Z({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIycnVud2F5bWwlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMkMlMjBzYWZldHlfY2hlY2tlciUzRE5vbmUlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlKSUwQSUyMiUyMiUyMiUwQVlvdSUyMGhhdmUlMjBkaXNhYmxlZCUyMHRoZSUyMHNhZmV0eSUyMGNoZWNrZXIlMjBmb3IlMjAlM0NjbGFzcyUyMCdkaWZmdXNlcnMucGlwZWxpbmVzLnN0YWJsZV9kaWZmdXNpb24ucGlwZWxpbmVfc3RhYmxlX2RpZmZ1c2lvbi5TdGFibGVEaWZmdXNpb25QaXBlbGluZSclM0UlMjBieSUyMHBhc3NpbmclMjAlNjBzYWZldHlfY2hlY2tlciUzRE5vbmUlNjAuJTIwRW5zdXJlJTIwdGhhdCUyMHlvdSUyMGFiaWRlJTIwYnklMjB0aGUlMjBjb25kaXRpb25zJTIwb2YlMjB0aGUlMjBTdGFibGUlMjBEaWZmdXNpb24lMjBsaWNlbnNlJTIwYW5kJTIwZG8lMjBub3QlMjBleHBvc2UlMjB1bmZpbHRlcmVkJTIwcmVzdWx0cyUyMGluJTIwc2VydmljZXMlMjBvciUyMGFwcGxpY2F0aW9ucyUyMG9wZW4lMjB0byUyMHRoZSUyMHB1YmxpYy4lMjBCb3RoJTIwdGhlJTIwZGlmZnVzZXJzJTIwdGVhbSUyMGFuZCUyMEh1Z2dpbmclMjBGYWNlJTIwc3Ryb25nbHklMjByZWNvbW1lbmQlMjBrZWVwaW5nJTIwdGhlJTIwc2FmZXR5JTIwZmlsdGVyJTIwZW5hYmxlZCUyMGluJTIwYWxsJTIwcHVibGljLWZhY2luZyUyMGNpcmN1bXN0YW5jZXMlMkMlMjBkaXNhYmxpbmclMjBpdCUyMG9ubHklMjBmb3IlMjB1c2UlMjBjYXNlcyUyMHRoYXQlMjBpbnZvbHZlJTIwYW5hbHl6aW5nJTIwbmV0d29yayUyMGJlaGF2aW9yJTIwb3IlMjBhdWRpdGluZyUyMGl0cyUyMHJlc3VsdHMuJTIwRm9yJTIwbW9yZSUyMGluZm9ybWF0aW9uJTJDJTIwcGxlYXNlJTIwaGF2ZSUyMGElMjBsb29rJTIwYXQlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZodWdnaW5nZmFjZSUyRmRpZmZ1c2VycyUyRnB1bGwlMkYyNTQlMjAuJTBBJTIyJTIyJTIy",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

pipeline = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, safety_checker=<span class="hljs-literal">None</span>, use_safetensors=<span class="hljs-literal">True</span>)
<span class="hljs-string">&quot;&quot;&quot;
You have disabled the safety checker for &lt;class &#x27;diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline&#x27;&gt; by passing \`safety_checker=None\`. Ensure that you abide by the conditions of the Stable Diffusion license and do not expose unfiltered results in services or applications open to the public. Both the diffusers team and Hugging Face strongly recommend keeping the safety filter enabled in all public-facing circumstances, disabling it only for use cases that involve analyzing network behavior or auditing its results. For more information, please have a look at https://github.com/huggingface/diffusers/pull/254 .
&quot;&quot;&quot;</span>`,wrap:!1}}),We=new $({props:{title:"Checkpoint variants",local:"checkpoint-variants",headingTag:"h2"}}),Y=new Yl({props:{warning:!1,$$slots:{default:[ni]},$$scope:{ctx:w}}}),q=new ql({props:{id:"variants",options:["fp16","non-EMA"],$$slots:{default:[oi]},$$scope:{ctx:w}}}),S=new ql({props:{id:"save",options:["fp16","non_ema"],$$slots:{default:[ui]},$$scope:{ctx:w}}}),xe=new Z({props:{code:"JTIzJTIwJUYwJTlGJTkxJThFJTIwdGhpcyUyMHdvbid0JTIwd29yayUwQXBpcGVsaW5lJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMi4lMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlJTBBKSUwQSUyMyUyMCVGMCU5RiU5MSU4RCUyMHRoaXMlMjB3b3JrcyUwQXBpcGVsaW5lJTIwJTNEJTIwRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMi4lMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMkMlMjB2YXJpYW50JTNEJTIyZnAxNiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUlMEEp",highlighted:`<span class="hljs-comment"># 👎 this won&#x27;t work</span>
pipeline = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;./stable-diffusion-v1-5&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>
)
<span class="hljs-comment"># 👍 this works</span>
pipeline = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;./stable-diffusion-v1-5&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>
)`,wrap:!1}}),De=new $({props:{title:"DiffusionPipeline explained",local:"diffusionpipeline-explained",headingTag:"h2"}}),He=new Z({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcmVwb19pZCUyMCUzRCUyMCUyMnJ1bndheW1sJTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTBBcGlwZWxpbmUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQocmVwb19pZCUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUpJTBBcHJpbnQocGlwZWxpbmUp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

repo_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipeline = DiffusionPipeline.from_pretrained(repo_id, use_safetensors=<span class="hljs-literal">True</span>)
<span class="hljs-built_in">print</span>(pipeline)`,wrap:!1}}),Pe=new Z({props:{code:"U3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUlMjAlN0IlMEElMjAlMjAlMjJmZWF0dXJlX2V4dHJhY3RvciUyMiUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMnRyYW5zZm9ybWVycyUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMkNMSVBJbWFnZVByb2Nlc3NvciUyMiUwQSUyMCUyMCU1RCUyQyUwQSUyMCUyMCUyMnNhZmV0eV9jaGVja2VyJTIyJTNBJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmxlX2RpZmZ1c2lvbiUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMlN0YWJsZURpZmZ1c2lvblNhZmV0eUNoZWNrZXIlMjIlMEElMjAlMjAlNUQlMkMlMEElMjAlMjAlMjJzY2hlZHVsZXIlMjIlM0ElMjAlNUIlMEElMjAlMjAlMjAlMjAlMjJkaWZmdXNlcnMlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjJQTkRNU2NoZWR1bGVyJTIyJTBBJTIwJTIwJTVEJTJDJTBBJTIwJTIwJTIydGV4dF9lbmNvZGVyJTIyJTNBJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIydHJhbnNmb3JtZXJzJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyQ0xJUFRleHRNb2RlbCUyMiUwQSUyMCUyMCU1RCUyQyUwQSUyMCUyMCUyMnRva2VuaXplciUyMiUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMnRyYW5zZm9ybWVycyUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMkNMSVBUb2tlbml6ZXIlMjIlMEElMjAlMjAlNUQlMkMlMEElMjAlMjAlMjJ1bmV0JTIyJTNBJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIyZGlmZnVzZXJzJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyVU5ldDJEQ29uZGl0aW9uTW9kZWwlMjIlMEElMjAlMjAlNUQlMkMlMEElMjAlMjAlMjJ2YWUlMjIlM0ElMjAlNUIlMEElMjAlMjAlMjAlMjAlMjJkaWZmdXNlcnMlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjJBdXRvZW5jb2RlcktMJTIyJTBBJTIwJTIwJTVEJTBBJTdE",highlighted:`StableDiffusionPipeline <span class="hljs-punctuation">{</span>
  <span class="hljs-attr">&quot;feature_extractor&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
    <span class="hljs-string">&quot;transformers&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-string">&quot;CLIPImageProcessor&quot;</span>
  <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
  <span class="hljs-attr">&quot;safety_checker&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
    <span class="hljs-string">&quot;stable_diffusion&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-string">&quot;StableDiffusionSafetyChecker&quot;</span>
  <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
  <span class="hljs-attr">&quot;scheduler&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
    <span class="hljs-string">&quot;diffusers&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-string">&quot;PNDMScheduler&quot;</span>
  <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
  <span class="hljs-attr">&quot;text_encoder&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
    <span class="hljs-string">&quot;transformers&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-string">&quot;CLIPTextModel&quot;</span>
  <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
  <span class="hljs-attr">&quot;tokenizer&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
    <span class="hljs-string">&quot;transformers&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-string">&quot;CLIPTokenizer&quot;</span>
  <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
  <span class="hljs-attr">&quot;unet&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
    <span class="hljs-string">&quot;diffusers&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-string">&quot;UNet2DConditionModel&quot;</span>
  <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
  <span class="hljs-attr">&quot;vae&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
    <span class="hljs-string">&quot;diffusers&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-string">&quot;AutoencoderKL&quot;</span>
  <span class="hljs-punctuation">]</span>
<span class="hljs-punctuation">}</span>`,wrap:!1}}),Ke=new Z({props:{code:"LiUwQSVFMiU5NCU5QyVFMiU5NCU4MCVFMiU5NCU4MCUyMGZlYXR1cmVfZXh0cmFjdG9yJTBBJUUyJTk0JTgyJUMyJUEwJUMyJUEwJTIwJUUyJTk0JTk0JUUyJTk0JTgwJUUyJTk0JTgwJTIwcHJlcHJvY2Vzc29yX2NvbmZpZy5qc29uJTBBJUUyJTk0JTlDJUUyJTk0JTgwJUUyJTk0JTgwJTIwbW9kZWxfaW5kZXguanNvbiUwQSVFMiU5NCU5QyVFMiU5NCU4MCVFMiU5NCU4MCUyMHNhZmV0eV9jaGVja2VyJTBBJUUyJTk0JTgyJUMyJUEwJUMyJUEwJTIwJUUyJTk0JTlDJUUyJTk0JTgwJUUyJTk0JTgwJTIwY29uZmlnLmpzb24lMEElN0MlMjAlMjAlMjAlRTIlOTQlOUMlRTIlOTQlODAlRTIlOTQlODAlMjBtb2RlbC5mcDE2LnNhZmV0ZW5zb3JzJTBBJUUyJTk0JTgyJTIwJTIwJTIwJUUyJTk0JTlDJUUyJTk0JTgwJUUyJTk0JTgwJTIwbW9kZWwuc2FmZXRlbnNvcnMlMEElRTIlOTQlODIlMjAlMjAlMjAlRTIlOTQlOUMlRTIlOTQlODAlRTIlOTQlODAlMjBweXRvcmNoX21vZGVsLmJpbiUwQSU3QyUyMCUyMCUyMCVFMiU5NCU5NCVFMiU5NCU4MCVFMiU5NCU4MCUyMHB5dG9yY2hfbW9kZWwuZnAxNi5iaW4lMEElRTIlOTQlOUMlRTIlOTQlODAlRTIlOTQlODAlMjBzY2hlZHVsZXIlMEElRTIlOTQlODIlQzIlQTAlQzIlQTAlMjAlRTIlOTQlOTQlRTIlOTQlODAlRTIlOTQlODAlMjBzY2hlZHVsZXJfY29uZmlnLmpzb24lMEElRTIlOTQlOUMlRTIlOTQlODAlRTIlOTQlODAlMjB0ZXh0X2VuY29kZXIlMEElRTIlOTQlODIlQzIlQTAlQzIlQTAlMjAlRTIlOTQlOUMlRTIlOTQlODAlRTIlOTQlODAlMjBjb25maWcuanNvbiUwQSU3QyUyMCUyMCUyMCVFMiU5NCU5QyVFMiU5NCU4MCVFMiU5NCU4MCUyMG1vZGVsLmZwMTYuc2FmZXRlbnNvcnMlMEElRTIlOTQlODIlMjAlMjAlMjAlRTIlOTQlOUMlRTIlOTQlODAlRTIlOTQlODAlMjBtb2RlbC5zYWZldGVuc29ycyUwQSVFMiU5NCU4MiUyMCUyMCUyMCU3QyVFMiU5NCU4MCVFMiU5NCU4MCUyMHB5dG9yY2hfbW9kZWwuYmluJTBBJTdDJTIwJTIwJTIwJUUyJTk0JTk0JUUyJTk0JTgwJUUyJTk0JTgwJTIwcHl0b3JjaF9tb2RlbC5mcDE2LmJpbiUwQSVFMiU5NCU5QyVFMiU5NCU4MCVFMiU5NCU4MCUyMHRva2VuaXplciUwQSVFMiU5NCU4MiVDMiVBMCVDMiVBMCUyMCVFMiU5NCU5QyVFMiU5NCU4MCVFMiU5NCU4MCUyMG1lcmdlcy50eHQlMEElRTIlOTQlODIlQzIlQTAlQzIlQTAlMjAlRTIlOTQlOUMlRTIlOTQlODAlRTIlOTQlODAlMjBzcGVjaWFsX3Rva2Vuc19tYXAuanNvbiUwQSVFMiU5NCU4MiVDMiVBMCVDMiVBMCUyMCVFMiU5NCU5QyVFMiU5NCU4MCVFMiU5NCU4MCUyMHRva2VuaXplcl9jb25maWcuanNvbiUwQSVFMiU5NCU4MiVDMiVBMCVDMiVBMCUyMCVFMiU5NCU5NCVFMiU5NCU4MCVFMiU5NCU4MCUyMHZvY2FiLmpzb24lMEElRTIlOTQlOUMlRTIlOTQlODAlRTIlOTQlODAlMjB1bmV0JTBBJUUyJTk0JTgyJUMyJUEwJUMyJUEwJTIwJUUyJTk0JTlDJUUyJTk0JTgwJUUyJTk0JTgwJTIwY29uZmlnLmpzb24lMEElRTIlOTQlODIlQzIlQTAlQzIlQTAlMjAlRTIlOTQlOUMlRTIlOTQlODAlRTIlOTQlODAlMjBkaWZmdXNpb25fcHl0b3JjaF9tb2RlbC5iaW4lMEElN0MlMjAlMjAlMjAlN0MlRTIlOTQlODAlRTIlOTQlODAlMjBkaWZmdXNpb25fcHl0b3JjaF9tb2RlbC5mcDE2LmJpbiUwQSVFMiU5NCU4MiUyMCUyMCUyMCU3QyVFMiU5NCU4MCVFMiU5NCU4MCUyMGRpZmZ1c2lvbl9weXRvcmNoX21vZGVsLmYxNi5zYWZldGVuc29ycyUwQSVFMiU5NCU4MiUyMCUyMCUyMCU3QyVFMiU5NCU4MCVFMiU5NCU4MCUyMGRpZmZ1c2lvbl9weXRvcmNoX21vZGVsLm5vbl9lbWEuYmluJTBBJUUyJTk0JTgyJTIwJTIwJTIwJTdDJUUyJTk0JTgwJUUyJTk0JTgwJTIwZGlmZnVzaW9uX3B5dG9yY2hfbW9kZWwubm9uX2VtYS5zYWZldGVuc29ycyUwQSVFMiU5NCU4MiUyMCUyMCUyMCVFMiU5NCU5NCVFMiU5NCU4MCVFMiU5NCU4MCUyMGRpZmZ1c2lvbl9weXRvcmNoX21vZGVsLnNhZmV0ZW5zb3JzJTBBJTdDJUUyJTk0JTgwJUUyJTk0JTgwJTIwdmFlJTBBLiUyMCUyMCUyMCVFMiU5NCU5QyVFMiU5NCU4MCVFMiU5NCU4MCUyMGNvbmZpZy5qc29uJTBBLiUyMCUyMCUyMCVFMiU5NCU5QyVFMiU5NCU4MCVFMiU5NCU4MCUyMGRpZmZ1c2lvbl9weXRvcmNoX21vZGVsLmJpbiUwQSUyMCUyMCUyMCUyMCVFMiU5NCU5QyVFMiU5NCU4MCVFMiU5NCU4MCUyMGRpZmZ1c2lvbl9weXRvcmNoX21vZGVsLmZwMTYuYmluJTBBJTIwJTIwJTIwJTIwJUUyJTk0JTlDJUUyJTk0JTgwJUUyJTk0JTgwJTIwZGlmZnVzaW9uX3B5dG9yY2hfbW9kZWwuZnAxNi5zYWZldGVuc29ycyUwQSUyMCUyMCUyMCUyMCVFMiU5NCU5NCVFMiU5NCU4MCVFMiU5NCU4MCUyMGRpZmZ1c2lvbl9weXRvcmNoX21vZGVsLnNhZmV0ZW5zb3Jz",highlighted:`.
├── feature_extractor
│   └── preprocessor_config.json
├── model_index.json
├── safety_checker
│   ├── config.json
|<span class="hljs-string">   ├── model.fp16.safetensors
│   ├── model.safetensors
│   ├── pytorch_model.bin
</span>|<span class="hljs-string">   └── pytorch_model.fp16.bin
├── scheduler
│   └── scheduler_config.json
├── text_encoder
│   ├── config.json
</span>|<span class="hljs-string">   ├── model.fp16.safetensors
│   ├── model.safetensors
│   </span>|<span class="hljs-string">── pytorch_model.bin
</span>|<span class="hljs-string">   └── pytorch_model.fp16.bin
├── tokenizer
│   ├── merges.txt
│   ├── special_tokens_map.json
│   ├── tokenizer_config.json
│   └── vocab.json
├── unet
│   ├── config.json
│   ├── diffusion_pytorch_model.bin
</span>|<span class="hljs-string">   </span>|<span class="hljs-string">── diffusion_pytorch_model.fp16.bin
│   </span>|<span class="hljs-string">── diffusion_pytorch_model.f16.safetensors
│   </span>|<span class="hljs-string">── diffusion_pytorch_model.non_ema.bin
│   </span>|<span class="hljs-string">── diffusion_pytorch_model.non_ema.safetensors
│   └── diffusion_pytorch_model.safetensors
</span>|<span class="hljs-string">── vae
.   ├── config.json
.   ├── diffusion_pytorch_model.bin
    ├── diffusion_pytorch_model.fp16.bin
    ├── diffusion_pytorch_model.fp16.safetensors
    └── diffusion_pytorch_model.safetensors</span>`,wrap:!1}}),ss=new Z({props:{code:"cGlwZWxpbmUudG9rZW5pemVyJTBBQ0xJUFRva2VuaXplciglMEElMjAlMjAlMjAlMjBuYW1lX29yX3BhdGglM0QlMjIlMkZyb290JTJGLmNhY2hlJTJGaHVnZ2luZ2ZhY2UlMkZodWIlMkZtb2RlbHMtLXJ1bndheW1sLS1zdGFibGUtZGlmZnVzaW9uLXYxLTUlMkZzbmFwc2hvdHMlMkYzOTU5M2Q1NjUwMTEyYjRjYzU4MDQzM2Y2YjA0MzUzODU4ODJkODE5JTJGdG9rZW5pemVyJTIyJTJDJTBBJTIwJTIwJTIwJTIwdm9jYWJfc2l6ZSUzRDQ5NDA4JTJDJTBBJTIwJTIwJTIwJTIwbW9kZWxfbWF4X2xlbmd0aCUzRDc3JTJDJTBBJTIwJTIwJTIwJTIwaXNfZmFzdCUzREZhbHNlJTJDJTBBJTIwJTIwJTIwJTIwcGFkZGluZ19zaWRlJTNEJTIycmlnaHQlMjIlMkMlMEElMjAlMjAlMjAlMjB0cnVuY2F0aW9uX3NpZGUlM0QlMjJyaWdodCUyMiUyQyUwQSUyMCUyMCUyMCUyMHNwZWNpYWxfdG9rZW5zJTNEJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyYm9zX3Rva2VuJTIyJTNBJTIwQWRkZWRUb2tlbiglMjIlM0MlN0NzdGFydG9mdGV4dCU3QyUzRSUyMiUyQyUyMHJzdHJpcCUzREZhbHNlJTJDJTIwbHN0cmlwJTNERmFsc2UlMkMlMjBzaW5nbGVfd29yZCUzREZhbHNlJTJDJTIwbm9ybWFsaXplZCUzRFRydWUpJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyZW9zX3Rva2VuJTIyJTNBJTIwQWRkZWRUb2tlbiglMjIlM0MlN0NlbmRvZnRleHQlN0MlM0UlMjIlMkMlMjByc3RyaXAlM0RGYWxzZSUyQyUyMGxzdHJpcCUzREZhbHNlJTJDJTIwc2luZ2xlX3dvcmQlM0RGYWxzZSUyQyUyMG5vcm1hbGl6ZWQlM0RUcnVlKSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnVua190b2tlbiUyMiUzQSUyMEFkZGVkVG9rZW4oJTIyJTNDJTdDZW5kb2Z0ZXh0JTdDJTNFJTIyJTJDJTIwcnN0cmlwJTNERmFsc2UlMkMlMjBsc3RyaXAlM0RGYWxzZSUyQyUyMHNpbmdsZV93b3JkJTNERmFsc2UlMkMlMjBub3JtYWxpemVkJTNEVHJ1ZSklMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJwYWRfdG9rZW4lMjIlM0ElMjAlMjIlM0MlN0NlbmRvZnRleHQlN0MlM0UlMjIlMkMlMEElMjAlMjAlMjAlMjAlN0QlMkMlMEElMjAlMjAlMjAlMjBjbGVhbl91cF90b2tlbml6YXRpb25fc3BhY2VzJTNEVHJ1ZSUwQSk=",highlighted:`pipeline.tokenizer
CLIPTokenizer(
    name_or_path=<span class="hljs-string">&quot;/root/.cache/huggingface/hub/models--runwayml--stable-diffusion-v1-5/snapshots/39593d5650112b4cc580433f6b0435385882d819/tokenizer&quot;</span>,
    vocab_size=<span class="hljs-number">49408</span>,
    model_max_length=<span class="hljs-number">77</span>,
    is_fast=<span class="hljs-literal">False</span>,
    padding_side=<span class="hljs-string">&quot;right&quot;</span>,
    truncation_side=<span class="hljs-string">&quot;right&quot;</span>,
    special_tokens={
        <span class="hljs-string">&quot;bos_token&quot;</span>: AddedToken(<span class="hljs-string">&quot;&lt;|startoftext|&gt;&quot;</span>, rstrip=<span class="hljs-literal">False</span>, lstrip=<span class="hljs-literal">False</span>, single_word=<span class="hljs-literal">False</span>, normalized=<span class="hljs-literal">True</span>),
        <span class="hljs-string">&quot;eos_token&quot;</span>: AddedToken(<span class="hljs-string">&quot;&lt;|endoftext|&gt;&quot;</span>, rstrip=<span class="hljs-literal">False</span>, lstrip=<span class="hljs-literal">False</span>, single_word=<span class="hljs-literal">False</span>, normalized=<span class="hljs-literal">True</span>),
        <span class="hljs-string">&quot;unk_token&quot;</span>: AddedToken(<span class="hljs-string">&quot;&lt;|endoftext|&gt;&quot;</span>, rstrip=<span class="hljs-literal">False</span>, lstrip=<span class="hljs-literal">False</span>, single_word=<span class="hljs-literal">False</span>, normalized=<span class="hljs-literal">True</span>),
        <span class="hljs-string">&quot;pad_token&quot;</span>: <span class="hljs-string">&quot;&lt;|endoftext|&gt;&quot;</span>,
    },
    clean_up_tokenization_spaces=<span class="hljs-literal">True</span>
)`,wrap:!1}}),is=new Z({props:{code:"JTdCJTBBJTIwJTIwJTIyX2NsYXNzX25hbWUlMjIlM0ElMjAlMjJTdGFibGVEaWZmdXNpb25QaXBlbGluZSUyMiUyQyUwQSUyMCUyMCUyMl9kaWZmdXNlcnNfdmVyc2lvbiUyMiUzQSUyMCUyMjAuNi4wJTIyJTJDJTBBJTIwJTIwJTIyZmVhdHVyZV9leHRyYWN0b3IlMjIlM0ElMjAlNUIlMEElMjAlMjAlMjAlMjAlMjJ0cmFuc2Zvcm1lcnMlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjJDTElQSW1hZ2VQcm9jZXNzb3IlMjIlMEElMjAlMjAlNUQlMkMlMEElMjAlMjAlMjJzYWZldHlfY2hlY2tlciUyMiUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMnN0YWJsZV9kaWZmdXNpb24lMjIlMkMlMEElMjAlMjAlMjAlMjAlMjJTdGFibGVEaWZmdXNpb25TYWZldHlDaGVja2VyJTIyJTBBJTIwJTIwJTVEJTJDJTBBJTIwJTIwJTIyc2NoZWR1bGVyJTIyJTNBJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIyZGlmZnVzZXJzJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyUE5ETVNjaGVkdWxlciUyMiUwQSUyMCUyMCU1RCUyQyUwQSUyMCUyMCUyMnRleHRfZW5jb2RlciUyMiUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMnRyYW5zZm9ybWVycyUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMkNMSVBUZXh0TW9kZWwlMjIlMEElMjAlMjAlNUQlMkMlMEElMjAlMjAlMjJ0b2tlbml6ZXIlMjIlM0ElMjAlNUIlMEElMjAlMjAlMjAlMjAlMjJ0cmFuc2Zvcm1lcnMlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjJDTElQVG9rZW5pemVyJTIyJTBBJTIwJTIwJTVEJTJDJTBBJTIwJTIwJTIydW5ldCUyMiUzQSUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMmRpZmZ1c2VycyUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMlVOZXQyRENvbmRpdGlvbk1vZGVsJTIyJTBBJTIwJTIwJTVEJTJDJTBBJTIwJTIwJTIydmFlJTIyJTNBJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIyZGlmZnVzZXJzJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyQXV0b2VuY29kZXJLTCUyMiUwQSUyMCUyMCU1RCUwQSU3RA==",highlighted:`<span class="hljs-punctuation">{</span>
  <span class="hljs-attr">&quot;_class_name&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;StableDiffusionPipeline&quot;</span><span class="hljs-punctuation">,</span>
  <span class="hljs-attr">&quot;_diffusers_version&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;0.6.0&quot;</span><span class="hljs-punctuation">,</span>
  <span class="hljs-attr">&quot;feature_extractor&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
    <span class="hljs-string">&quot;transformers&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-string">&quot;CLIPImageProcessor&quot;</span>
  <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
  <span class="hljs-attr">&quot;safety_checker&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
    <span class="hljs-string">&quot;stable_diffusion&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-string">&quot;StableDiffusionSafetyChecker&quot;</span>
  <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
  <span class="hljs-attr">&quot;scheduler&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
    <span class="hljs-string">&quot;diffusers&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-string">&quot;PNDMScheduler&quot;</span>
  <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
  <span class="hljs-attr">&quot;text_encoder&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
    <span class="hljs-string">&quot;transformers&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-string">&quot;CLIPTextModel&quot;</span>
  <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
  <span class="hljs-attr">&quot;tokenizer&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
    <span class="hljs-string">&quot;transformers&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-string">&quot;CLIPTokenizer&quot;</span>
  <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
  <span class="hljs-attr">&quot;unet&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
    <span class="hljs-string">&quot;diffusers&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-string">&quot;UNet2DConditionModel&quot;</span>
  <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
  <span class="hljs-attr">&quot;vae&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
    <span class="hljs-string">&quot;diffusers&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-string">&quot;AutoencoderKL&quot;</span>
  <span class="hljs-punctuation">]</span>
<span class="hljs-punctuation">}</span>`,wrap:!1}}),ns=new Ot({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/using-diffusers/loading.md"}}),{c(){i=r("meta"),c=a(),n=r("p"),d=a(),y(o.$$.fragment),m=a(),y(j.$$.fragment),g=a(),_=r("p"),_.innerHTML=C,M=a(),I=r("p"),I.textContent=Sl,rs=a(),x=r("ul"),x.innerHTML=xl,fs=a(),y(D.$$.fragment),us=a(),y(G.$$.fragment),cs=a(),F=r("p"),F.textContent=Dl,ds=a(),z=r("ol"),z.innerHTML=Fl,ms=a(),y(V.$$.fragment),Ms=a(),A=r("p"),A.textContent=zl,ys=a(),k=r("div"),k.innerHTML=Al,hs=a(),W=r("div"),W.innerHTML=Hl,Us=a(),y(H.$$.fragment),Ts=a(),E=r("p"),E.innerHTML=El,Js=a(),y(L.$$.fragment),bs=a(),P=r("p"),P.innerHTML=Ll,ws=a(),y(O.$$.fragment),js=a(),K=r("p"),K.innerHTML=Pl,Zs=a(),y(ee.$$.fragment),gs=a(),se=r("p"),se.textContent=Ol,_s=a(),le=r("ul"),le.innerHTML=Kl,Is=a(),te=r("p"),te.innerHTML=et,Cs=a(),ie=r("ul"),ie.innerHTML=st,$s=a(),y(ne.$$.fragment),vs=a(),ae=r("p"),ae.innerHTML=lt,Gs=a(),y(pe.$$.fragment),Vs=a(),y(oe.$$.fragment),ks=a(),re=r("p"),re.textContent=tt,Ws=a(),fe=r("ol"),fe.innerHTML=it,Bs=a(),ue=r("p"),ue.innerHTML=nt,Rs=a(),y(B.$$.fragment),Xs=a(),ce=r("p"),ce.innerHTML=at,Qs=a(),y(de.$$.fragment),Ns=a(),R=r("div"),R.innerHTML=pt,Ys=a(),me=r("p"),me.textContent=ot,qs=a(),y(Me.$$.fragment),Ss=a(),ye=r("p"),ye.innerHTML=rt,xs=a(),y(X.$$.fragment),Ds=a(),y(he.$$.fragment),Fs=a(),Q=r("div"),Q.innerHTML=ft,zs=a(),Ue=r("p"),Ue.innerHTML=ut,As=a(),y(Te.$$.fragment),Hs=a(),Je=r("p"),Je.innerHTML=ct,Es=a(),y(be.$$.fragment),Ls=a(),N=r("div"),N.innerHTML=dt,Ps=a(),we=r("p"),we.innerHTML=mt,Os=a(),y(je.$$.fragment),Ks=a(),y(Ze.$$.fragment),el=a(),ge=r("p"),ge.innerHTML=Mt,sl=a(),y(_e.$$.fragment),ll=a(),y(Ie.$$.fragment),tl=a(),Ce=r("p"),Ce.innerHTML=yt,il=a(),$e=r("table"),$e.innerHTML=ht,nl=a(),ve=r("p"),ve.innerHTML=Ut,al=a(),y(Ge.$$.fragment),pl=a(),Ve=r("p"),Ve.innerHTML=Tt,ol=a(),y(ke.$$.fragment),rl=a(),y(We.$$.fragment),fl=a(),Be=r("p"),Be.textContent=Jt,ul=a(),Re=r("ul"),Re.innerHTML=bt,cl=a(),y(Y.$$.fragment),dl=a(),Xe=r("p"),Xe.innerHTML=wt,ml=a(),Qe=r("table"),Qe.innerHTML=jt,Ml=a(),Ne=r("p"),Ne.textContent=Zt,yl=a(),Ye=r("ul"),Ye.innerHTML=gt,hl=a(),y(q.$$.fragment),Ul=a(),qe=r("p"),qe.innerHTML=_t,Tl=a(),y(S.$$.fragment),Jl=a(),Se=r("p"),Se.innerHTML=It,bl=a(),y(xe.$$.fragment),wl=a(),y(De.$$.fragment),jl=a(),Fe=r("p"),Fe.innerHTML=Ct,Zl=a(),ze=r("ul"),ze.innerHTML=$t,gl=a(),Ae=r("p"),Ae.innerHTML=vt,_l=a(),y(He.$$.fragment),Il=a(),Ee=r("p"),Ee.innerHTML=Gt,Cl=a(),Le=r("ul"),Le.innerHTML=Vt,$l=a(),y(Pe.$$.fragment),vl=a(),Oe=r("p"),Oe.innerHTML=kt,Gl=a(),y(Ke.$$.fragment),Vl=a(),es=r("p"),es.textContent=Wt,kl=a(),y(ss.$$.fragment),Wl=a(),ls=r("p"),ls.innerHTML=Bt,Bl=a(),ts=r("ul"),ts.innerHTML=Rt,Rl=a(),y(is.$$.fragment),Xl=a(),y(ns.$$.fragment),Ql=a(),os=r("p"),this.h()},l(e){const s=Et("svelte-u9bgzb",document.head);i=f(s,"META",{name:!0,content:!0}),s.forEach(l),c=p(e),n=f(e,"P",{}),Dt(n).forEach(l),d=p(e),h(o.$$.fragment,e),m=p(e),h(j.$$.fragment,e),g=p(e),_=f(e,"P",{"data-svelte-h":!0}),u(_)!=="svelte-jntf1n"&&(_.innerHTML=C),M=p(e),I=f(e,"P",{"data-svelte-h":!0}),u(I)!=="svelte-b6mpdv"&&(I.textContent=Sl),rs=p(e),x=f(e,"UL",{"data-svelte-h":!0}),u(x)!=="svelte-1eibdva"&&(x.innerHTML=xl),fs=p(e),h(D.$$.fragment,e),us=p(e),h(G.$$.fragment,e),cs=p(e),F=f(e,"P",{"data-svelte-h":!0}),u(F)!=="svelte-1fp1qkh"&&(F.textContent=Dl),ds=p(e),z=f(e,"OL",{"data-svelte-h":!0}),u(z)!=="svelte-rqe1ig"&&(z.innerHTML=Fl),ms=p(e),h(V.$$.fragment,e),Ms=p(e),A=f(e,"P",{"data-svelte-h":!0}),u(A)!=="svelte-x1hybx"&&(A.textContent=zl),ys=p(e),k=f(e,"DIV",{class:!0,"data-svelte-h":!0}),u(k)!=="svelte-1eacg44"&&(k.innerHTML=Al),hs=p(e),W=f(e,"DIV",{class:!0,"data-svelte-h":!0}),u(W)!=="svelte-1scmarz"&&(W.innerHTML=Hl),Us=p(e),h(H.$$.fragment,e),Ts=p(e),E=f(e,"P",{"data-svelte-h":!0}),u(E)!=="svelte-19d3ik7"&&(E.innerHTML=El),Js=p(e),h(L.$$.fragment,e),bs=p(e),P=f(e,"P",{"data-svelte-h":!0}),u(P)!=="svelte-11nj46s"&&(P.innerHTML=Ll),ws=p(e),h(O.$$.fragment,e),js=p(e),K=f(e,"P",{"data-svelte-h":!0}),u(K)!=="svelte-b5yqh0"&&(K.innerHTML=Pl),Zs=p(e),h(ee.$$.fragment,e),gs=p(e),se=f(e,"P",{"data-svelte-h":!0}),u(se)!=="svelte-1ifrszd"&&(se.textContent=Ol),_s=p(e),le=f(e,"UL",{"data-svelte-h":!0}),u(le)!=="svelte-1ln6l0l"&&(le.innerHTML=Kl),Is=p(e),te=f(e,"P",{"data-svelte-h":!0}),u(te)!=="svelte-pkpme0"&&(te.innerHTML=et),Cs=p(e),ie=f(e,"UL",{"data-svelte-h":!0}),u(ie)!=="svelte-xyhjhs"&&(ie.innerHTML=st),$s=p(e),h(ne.$$.fragment,e),vs=p(e),ae=f(e,"P",{"data-svelte-h":!0}),u(ae)!=="svelte-tvs16l"&&(ae.innerHTML=lt),Gs=p(e),h(pe.$$.fragment,e),Vs=p(e),h(oe.$$.fragment,e),ks=p(e),re=f(e,"P",{"data-svelte-h":!0}),u(re)!=="svelte-14g5ay7"&&(re.textContent=tt),Ws=p(e),fe=f(e,"OL",{"data-svelte-h":!0}),u(fe)!=="svelte-lqu5pq"&&(fe.innerHTML=it),Bs=p(e),ue=f(e,"P",{"data-svelte-h":!0}),u(ue)!=="svelte-1hju424"&&(ue.innerHTML=nt),Rs=p(e),h(B.$$.fragment,e),Xs=p(e),ce=f(e,"P",{"data-svelte-h":!0}),u(ce)!=="svelte-qs7py0"&&(ce.innerHTML=at),Qs=p(e),h(de.$$.fragment,e),Ns=p(e),R=f(e,"DIV",{class:!0,"data-svelte-h":!0}),u(R)!=="svelte-ye42mk"&&(R.innerHTML=pt),Ys=p(e),me=f(e,"P",{"data-svelte-h":!0}),u(me)!=="svelte-1u6h93y"&&(me.textContent=ot),qs=p(e),h(Me.$$.fragment,e),Ss=p(e),ye=f(e,"P",{"data-svelte-h":!0}),u(ye)!=="svelte-9xd5y2"&&(ye.innerHTML=rt),xs=p(e),h(X.$$.fragment,e),Ds=p(e),h(he.$$.fragment,e),Fs=p(e),Q=f(e,"DIV",{class:!0,"data-svelte-h":!0}),u(Q)!=="svelte-5lltp7"&&(Q.innerHTML=ft),zs=p(e),Ue=f(e,"P",{"data-svelte-h":!0}),u(Ue)!=="svelte-zeed67"&&(Ue.innerHTML=ut),As=p(e),h(Te.$$.fragment,e),Hs=p(e),Je=f(e,"P",{"data-svelte-h":!0}),u(Je)!=="svelte-3pdk48"&&(Je.innerHTML=ct),Es=p(e),h(be.$$.fragment,e),Ls=p(e),N=f(e,"DIV",{class:!0,"data-svelte-h":!0}),u(N)!=="svelte-cbprhg"&&(N.innerHTML=dt),Ps=p(e),we=f(e,"P",{"data-svelte-h":!0}),u(we)!=="svelte-113mtyb"&&(we.innerHTML=mt),Os=p(e),h(je.$$.fragment,e),Ks=p(e),h(Ze.$$.fragment,e),el=p(e),ge=f(e,"P",{"data-svelte-h":!0}),u(ge)!=="svelte-17d8uxg"&&(ge.innerHTML=Mt),sl=p(e),h(_e.$$.fragment,e),ll=p(e),h(Ie.$$.fragment,e),tl=p(e),Ce=f(e,"P",{"data-svelte-h":!0}),u(Ce)!=="svelte-1do8m42"&&(Ce.innerHTML=yt),il=p(e),$e=f(e,"TABLE",{"data-svelte-h":!0}),u($e)!=="svelte-170u8iz"&&($e.innerHTML=ht),nl=p(e),ve=f(e,"P",{"data-svelte-h":!0}),u(ve)!=="svelte-1x8jxdt"&&(ve.innerHTML=Ut),al=p(e),h(Ge.$$.fragment,e),pl=p(e),Ve=f(e,"P",{"data-svelte-h":!0}),u(Ve)!=="svelte-nb2e7j"&&(Ve.innerHTML=Tt),ol=p(e),h(ke.$$.fragment,e),rl=p(e),h(We.$$.fragment,e),fl=p(e),Be=f(e,"P",{"data-svelte-h":!0}),u(Be)!=="svelte-144ljdh"&&(Be.textContent=Jt),ul=p(e),Re=f(e,"UL",{"data-svelte-h":!0}),u(Re)!=="svelte-86xcrp"&&(Re.innerHTML=bt),cl=p(e),h(Y.$$.fragment,e),dl=p(e),Xe=f(e,"P",{"data-svelte-h":!0}),u(Xe)!=="svelte-naaguo"&&(Xe.innerHTML=wt),ml=p(e),Qe=f(e,"TABLE",{"data-svelte-h":!0}),u(Qe)!=="svelte-1xwvx35"&&(Qe.innerHTML=jt),Ml=p(e),Ne=f(e,"P",{"data-svelte-h":!0}),u(Ne)!=="svelte-9nwb1f"&&(Ne.textContent=Zt),yl=p(e),Ye=f(e,"UL",{"data-svelte-h":!0}),u(Ye)!=="svelte-1uxhl8j"&&(Ye.innerHTML=gt),hl=p(e),h(q.$$.fragment,e),Ul=p(e),qe=f(e,"P",{"data-svelte-h":!0}),u(qe)!=="svelte-gt1y6k"&&(qe.innerHTML=_t),Tl=p(e),h(S.$$.fragment,e),Jl=p(e),Se=f(e,"P",{"data-svelte-h":!0}),u(Se)!=="svelte-s6vvaz"&&(Se.innerHTML=It),bl=p(e),h(xe.$$.fragment,e),wl=p(e),h(De.$$.fragment,e),jl=p(e),Fe=f(e,"P",{"data-svelte-h":!0}),u(Fe)!=="svelte-qelo37"&&(Fe.innerHTML=Ct),Zl=p(e),ze=f(e,"UL",{"data-svelte-h":!0}),u(ze)!=="svelte-1kua8id"&&(ze.innerHTML=$t),gl=p(e),Ae=f(e,"P",{"data-svelte-h":!0}),u(Ae)!=="svelte-uuqiaw"&&(Ae.innerHTML=vt),_l=p(e),h(He.$$.fragment,e),Il=p(e),Ee=f(e,"P",{"data-svelte-h":!0}),u(Ee)!=="svelte-lburi4"&&(Ee.innerHTML=Gt),Cl=p(e),Le=f(e,"UL",{"data-svelte-h":!0}),u(Le)!=="svelte-24lmmu"&&(Le.innerHTML=Vt),$l=p(e),h(Pe.$$.fragment,e),vl=p(e),Oe=f(e,"P",{"data-svelte-h":!0}),u(Oe)!=="svelte-173hqz7"&&(Oe.innerHTML=kt),Gl=p(e),h(Ke.$$.fragment,e),Vl=p(e),es=f(e,"P",{"data-svelte-h":!0}),u(es)!=="svelte-5jik9b"&&(es.textContent=Wt),kl=p(e),h(ss.$$.fragment,e),Wl=p(e),ls=f(e,"P",{"data-svelte-h":!0}),u(ls)!=="svelte-moepki"&&(ls.innerHTML=Bt),Bl=p(e),ts=f(e,"UL",{"data-svelte-h":!0}),u(ts)!=="svelte-hr84vt"&&(ts.innerHTML=Rt),Rl=p(e),h(is.$$.fragment,e),Xl=p(e),h(ns.$$.fragment,e),Ql=p(e),os=f(e,"P",{}),Dt(os).forEach(l),this.h()},h(){as(i,"name","hf:doc:metadata"),as(i,"content",di),as(k,"class","block dark:hidden"),as(W,"class","hidden dark:block"),as(R,"class","flex justify-center"),as(Q,"class","flex justify-center"),as(N,"class","flex justify-center")},m(e,s){Lt(document.head,i),t(e,c,s),t(e,n,s),t(e,d,s),U(o,e,s),t(e,m,s),U(j,e,s),t(e,g,s),t(e,_,s),t(e,M,s),t(e,I,s),t(e,rs,s),t(e,x,s),t(e,fs,s),U(D,e,s),t(e,us,s),U(G,e,s),t(e,cs,s),t(e,F,s),t(e,ds,s),t(e,z,s),t(e,ms,s),U(V,e,s),t(e,Ms,s),t(e,A,s),t(e,ys,s),t(e,k,s),t(e,hs,s),t(e,W,s),t(e,Us,s),U(H,e,s),t(e,Ts,s),t(e,E,s),t(e,Js,s),U(L,e,s),t(e,bs,s),t(e,P,s),t(e,ws,s),U(O,e,s),t(e,js,s),t(e,K,s),t(e,Zs,s),U(ee,e,s),t(e,gs,s),t(e,se,s),t(e,_s,s),t(e,le,s),t(e,Is,s),t(e,te,s),t(e,Cs,s),t(e,ie,s),t(e,$s,s),U(ne,e,s),t(e,vs,s),t(e,ae,s),t(e,Gs,s),U(pe,e,s),t(e,Vs,s),U(oe,e,s),t(e,ks,s),t(e,re,s),t(e,Ws,s),t(e,fe,s),t(e,Bs,s),t(e,ue,s),t(e,Rs,s),U(B,e,s),t(e,Xs,s),t(e,ce,s),t(e,Qs,s),U(de,e,s),t(e,Ns,s),t(e,R,s),t(e,Ys,s),t(e,me,s),t(e,qs,s),U(Me,e,s),t(e,Ss,s),t(e,ye,s),t(e,xs,s),U(X,e,s),t(e,Ds,s),U(he,e,s),t(e,Fs,s),t(e,Q,s),t(e,zs,s),t(e,Ue,s),t(e,As,s),U(Te,e,s),t(e,Hs,s),t(e,Je,s),t(e,Es,s),U(be,e,s),t(e,Ls,s),t(e,N,s),t(e,Ps,s),t(e,we,s),t(e,Os,s),U(je,e,s),t(e,Ks,s),U(Ze,e,s),t(e,el,s),t(e,ge,s),t(e,sl,s),U(_e,e,s),t(e,ll,s),U(Ie,e,s),t(e,tl,s),t(e,Ce,s),t(e,il,s),t(e,$e,s),t(e,nl,s),t(e,ve,s),t(e,al,s),U(Ge,e,s),t(e,pl,s),t(e,Ve,s),t(e,ol,s),U(ke,e,s),t(e,rl,s),U(We,e,s),t(e,fl,s),t(e,Be,s),t(e,ul,s),t(e,Re,s),t(e,cl,s),U(Y,e,s),t(e,dl,s),t(e,Xe,s),t(e,ml,s),t(e,Qe,s),t(e,Ml,s),t(e,Ne,s),t(e,yl,s),t(e,Ye,s),t(e,hl,s),U(q,e,s),t(e,Ul,s),t(e,qe,s),t(e,Tl,s),U(S,e,s),t(e,Jl,s),t(e,Se,s),t(e,bl,s),U(xe,e,s),t(e,wl,s),U(De,e,s),t(e,jl,s),t(e,Fe,s),t(e,Zl,s),t(e,ze,s),t(e,gl,s),t(e,Ae,s),t(e,_l,s),U(He,e,s),t(e,Il,s),t(e,Ee,s),t(e,Cl,s),t(e,Le,s),t(e,$l,s),U(Pe,e,s),t(e,vl,s),t(e,Oe,s),t(e,Gl,s),U(Ke,e,s),t(e,Vl,s),t(e,es,s),t(e,kl,s),U(ss,e,s),t(e,Wl,s),t(e,ls,s),t(e,Bl,s),t(e,ts,s),t(e,Rl,s),U(is,e,s),t(e,Xl,s),U(ns,e,s),t(e,Ql,s),t(e,os,s),Nl=!0},p(e,[s]){const Xt={};s&2&&(Xt.$$scope={dirty:s,ctx:e}),G.$set(Xt);const Qt={};s&2&&(Qt.$$scope={dirty:s,ctx:e}),V.$set(Qt);const Nt={};s&2&&(Nt.$$scope={dirty:s,ctx:e}),B.$set(Nt);const Yt={};s&2&&(Yt.$$scope={dirty:s,ctx:e}),X.$set(Yt);const qt={};s&2&&(qt.$$scope={dirty:s,ctx:e}),Y.$set(qt);const St={};s&2&&(St.$$scope={dirty:s,ctx:e}),q.$set(St);const xt={};s&2&&(xt.$$scope={dirty:s,ctx:e}),S.$set(xt)},i(e){Nl||(T(o.$$.fragment,e),T(j.$$.fragment,e),T(D.$$.fragment,e),T(G.$$.fragment,e),T(V.$$.fragment,e),T(H.$$.fragment,e),T(L.$$.fragment,e),T(O.$$.fragment,e),T(ee.$$.fragment,e),T(ne.$$.fragment,e),T(pe.$$.fragment,e),T(oe.$$.fragment,e),T(B.$$.fragment,e),T(de.$$.fragment,e),T(Me.$$.fragment,e),T(X.$$.fragment,e),T(he.$$.fragment,e),T(Te.$$.fragment,e),T(be.$$.fragment,e),T(je.$$.fragment,e),T(Ze.$$.fragment,e),T(_e.$$.fragment,e),T(Ie.$$.fragment,e),T(Ge.$$.fragment,e),T(ke.$$.fragment,e),T(We.$$.fragment,e),T(Y.$$.fragment,e),T(q.$$.fragment,e),T(S.$$.fragment,e),T(xe.$$.fragment,e),T(De.$$.fragment,e),T(He.$$.fragment,e),T(Pe.$$.fragment,e),T(Ke.$$.fragment,e),T(ss.$$.fragment,e),T(is.$$.fragment,e),T(ns.$$.fragment,e),Nl=!0)},o(e){J(o.$$.fragment,e),J(j.$$.fragment,e),J(D.$$.fragment,e),J(G.$$.fragment,e),J(V.$$.fragment,e),J(H.$$.fragment,e),J(L.$$.fragment,e),J(O.$$.fragment,e),J(ee.$$.fragment,e),J(ne.$$.fragment,e),J(pe.$$.fragment,e),J(oe.$$.fragment,e),J(B.$$.fragment,e),J(de.$$.fragment,e),J(Me.$$.fragment,e),J(X.$$.fragment,e),J(he.$$.fragment,e),J(Te.$$.fragment,e),J(be.$$.fragment,e),J(je.$$.fragment,e),J(Ze.$$.fragment,e),J(_e.$$.fragment,e),J(Ie.$$.fragment,e),J(Ge.$$.fragment,e),J(ke.$$.fragment,e),J(We.$$.fragment,e),J(Y.$$.fragment,e),J(q.$$.fragment,e),J(S.$$.fragment,e),J(xe.$$.fragment,e),J(De.$$.fragment,e),J(He.$$.fragment,e),J(Pe.$$.fragment,e),J(Ke.$$.fragment,e),J(ss.$$.fragment,e),J(is.$$.fragment,e),J(ns.$$.fragment,e),Nl=!1},d(e){e&&(l(c),l(n),l(d),l(m),l(g),l(_),l(M),l(I),l(rs),l(x),l(fs),l(us),l(cs),l(F),l(ds),l(z),l(ms),l(Ms),l(A),l(ys),l(k),l(hs),l(W),l(Us),l(Ts),l(E),l(Js),l(bs),l(P),l(ws),l(js),l(K),l(Zs),l(gs),l(se),l(_s),l(le),l(Is),l(te),l(Cs),l(ie),l($s),l(vs),l(ae),l(Gs),l(Vs),l(ks),l(re),l(Ws),l(fe),l(Bs),l(ue),l(Rs),l(Xs),l(ce),l(Qs),l(Ns),l(R),l(Ys),l(me),l(qs),l(Ss),l(ye),l(xs),l(Ds),l(Fs),l(Q),l(zs),l(Ue),l(As),l(Hs),l(Je),l(Es),l(Ls),l(N),l(Ps),l(we),l(Os),l(Ks),l(el),l(ge),l(sl),l(ll),l(tl),l(Ce),l(il),l($e),l(nl),l(ve),l(al),l(pl),l(Ve),l(ol),l(rl),l(fl),l(Be),l(ul),l(Re),l(cl),l(dl),l(Xe),l(ml),l(Qe),l(Ml),l(Ne),l(yl),l(Ye),l(hl),l(Ul),l(qe),l(Tl),l(Jl),l(Se),l(bl),l(wl),l(jl),l(Fe),l(Zl),l(ze),l(gl),l(Ae),l(_l),l(Il),l(Ee),l(Cl),l(Le),l($l),l(vl),l(Oe),l(Gl),l(Vl),l(es),l(kl),l(Wl),l(ls),l(Bl),l(ts),l(Rl),l(Xl),l(Ql),l(os)),l(i),b(o,e),b(j,e),b(D,e),b(G,e),b(V,e),b(H,e),b(L,e),b(O,e),b(ee,e),b(ne,e),b(pe,e),b(oe,e),b(B,e),b(de,e),b(Me,e),b(X,e),b(he,e),b(Te,e),b(be,e),b(je,e),b(Ze,e),b(_e,e),b(Ie,e),b(Ge,e),b(ke,e),b(We,e),b(Y,e),b(q,e),b(S,e),b(xe,e),b(De,e),b(He,e),b(Pe,e),b(Ke,e),b(ss,e),b(is,e),b(ns,e)}}}const di='{"title":"Load pipelines","local":"load-pipelines","sections":[{"title":"Load a pipeline","local":"load-a-pipeline","sections":[{"title":"Local pipeline","local":"local-pipeline","sections":[],"depth":3}],"depth":2},{"title":"Customize a pipeline","local":"customize-a-pipeline","sections":[],"depth":2},{"title":"Reuse a pipeline","local":"reuse-a-pipeline","sections":[{"title":"Modify from_pipe components","local":"modify-frompipe-components","sections":[],"depth":3},{"title":"Memory usage of from_pipe","local":"memory-usage-of-frompipe","sections":[],"depth":3}],"depth":2},{"title":"Safety checker","local":"safety-checker","sections":[],"depth":2},{"title":"Checkpoint variants","local":"checkpoint-variants","sections":[],"depth":2},{"title":"DiffusionPipeline explained","local":"diffusionpipeline-explained","sections":[],"depth":2}],"depth":1}';function mi(w){return zt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class wi extends At{constructor(i){super(),Ht(this,i,mi,ci,Ft,{})}}export{wi as component};
