import{S as Mm,i as Tm,s as Im,e as i,k as p,w as c,t as o,M as Lm,c as n,d as t,m as d,a as l,x as h,h as a,b as u,G as s,g as f,y as m,q as _,o as v,B as w,v as Nm}from"../../chunks/vendor-hf-doc-builder.js";import{T as Cm}from"../../chunks/Tip-hf-doc-builder.js";import{I as oe}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as E}from"../../chunks/CodeBlock-hf-doc-builder.js";function Om(rt){let y,I,$,P,M,j,G,T;return{c(){y=i("p"),I=o("\u{1F4A1} Skip to the "),$=i("a"),P=o("DiffusionPipeline explained"),M=o(" section if you interested in learning in more detail about how the "),j=i("a"),G=o("DiffusionPipeline"),T=o(" class works."),this.h()},l(S){y=n(S,"P",{});var D=l(y);I=a(D,"\u{1F4A1} Skip to the "),$=n(D,"A",{href:!0});var x=l($);P=a(x,"DiffusionPipeline explained"),x.forEach(t),M=a(D," section if you interested in learning in more detail about how the "),j=n(D,"A",{href:!0});var ae=l(j);G=a(ae,"DiffusionPipeline"),ae.forEach(t),T=a(D," class works."),D.forEach(t),this.h()},h(){u($,"href","#diffusionpipeline-explained"),u(j,"href","/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline")},m(S,D){f(S,y,D),s(y,I),s(y,$),s($,P),s(y,M),s(y,j),s(j,G),s(y,T)},d(S){S&&t(y)}}}function zm(rt){let y,I,$,P,M,j,G,T;return{c(){y=i("p"),I=o("\u{1F4A1} 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 instead of variations (for example, "),$=i("code"),P=o("stable-diffusion-v1-4"),M=o(" and "),j=i("code"),G=o("stable-diffusion-v1-5"),T=o(").")},l(S){y=n(S,"P",{});var D=l(y);I=a(D,"\u{1F4A1} 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 instead of variations (for example, "),$=n(D,"CODE",{});var x=l($);P=a(x,"stable-diffusion-v1-4"),x.forEach(t),M=a(D," and "),j=n(D,"CODE",{});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ze,nu,ot,Wa,lu,ru,kn,at,Pn,Yt,fu,qn,it,Sn,se,pu,Va,du,uu,Ht,cu,hu,xn,te,Rt,mu,Ja,_u,vu,Gt,wu,Qa,yu,bu,K,gu,Xa,Eu,$u,Za,Du,ju,ei,ku,Pu,An,nt,Cn;return j=new oe({}),fs=new oe({}),Ee=new Cm({props:{$$slots:{default:[Om]},$$scope:{ctx:rt}}}),ds=new E({props:{code:`from diffusers import DiffusionPipeline

repo_id = "runwayml/stable-diffusion-v1-5"
pipe = DiffusionPipeline.from_pretrained(repo_id)`,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>
pipe = DiffusionPipeline.from_pretrained(repo_id)`}}),us=new E({props:{code:`from diffusers import StableDiffusionPipeline

repo_id = "runwayml/stable-diffusion-v1-5"
pipe = StableDiffusionPipeline.from_pretrained(repo_id)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline

repo_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipe = StableDiffusionPipeline.from_pretrained(repo_id)`}}),ms=new E({props:{code:`from diffusers import StableDiffusionImg2ImgPipeline

repo_id = "runwayml/stable-diffusion-v1-5"
pipe = StableDiffusionImg2ImgPipeline.from_pretrained(repo_id)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionImg2ImgPipeline

repo_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
pipe = StableDiffusionImg2ImgPipeline.from_pretrained(repo_id)`}}),_s=new oe({}),ys=new E({props:{code:`git lfs install
git clone https://huggingface.co/runwayml/stable-diffusion-v1-5`,highlighted:`git lfs install
git <span class="hljs-built_in">clone</span> https://huggingface.co/runwayml/stable-diffusion-v1-5`}}),bs=new E({props:{code:`from diffusers import DiffusionPipeline

repo_id = "./stable-diffusion-v1-5"
stable_diffusion = DiffusionPipeline.from_pretrained(repo_id)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

repo_id = <span class="hljs-string">&quot;./stable-diffusion-v1-5&quot;</span>
stable_diffusion = DiffusionPipeline.from_pretrained(repo_id)`}}),gs=new oe({}),Es=new E({props:{code:`from diffusers import DiffusionPipeline

repo_id = "runwayml/stable-diffusion-v1-5"
stable_diffusion = DiffusionPipeline.from_pretrained(repo_id)
stable_diffusion.scheduler.compatibles`,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>
stable_diffusion = DiffusionPipeline.from_pretrained(repo_id)
stable_diffusion.scheduler.compatibles`}}),Ds=new E({props:{code:`from diffusers import DiffusionPipeline, EulerDiscreteScheduler, DPMSolverMultistepScheduler

repo_id = "runwayml/stable-diffusion-v1-5"

scheduler = EulerDiscreteScheduler.from_pretrained(repo_id, subfolder="scheduler")

stable_diffusion = DiffusionPipeline.from_pretrained(repo_id, scheduler=scheduler)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline, EulerDiscreteScheduler, DPMSolverMultistepScheduler

repo_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>

scheduler = EulerDiscreteScheduler.from_pretrained(repo_id, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)

stable_diffusion = DiffusionPipeline.from_pretrained(repo_id, scheduler=scheduler)`}}),js=new oe({}),Ps=new E({props:{code:`from diffusers import DiffusionPipeline

repo_id = "runwayml/stable-diffusion-v1-5"
stable_diffusion = DiffusionPipeline.from_pretrained(repo_id, safety_checker=None)`,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>
stable_diffusion = DiffusionPipeline.from_pretrained(repo_id, safety_checker=<span class="hljs-literal">None</span>)`}}),qs=new oe({}),Ss=new E({props:{code:`from diffusers import StableDiffusionPipeline, StableDiffusionImg2ImgPipeline

model_id = "runwayml/stable-diffusion-v1-5"
stable_diffusion_txt2img = StableDiffusionPipeline.from_pretrained(model_id)

components = stable_diffusion_txt2img.components`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline, StableDiffusionImg2ImgPipeline

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
stable_diffusion_txt2img = StableDiffusionPipeline.from_pretrained(model_id)

components = stable_diffusion_txt2img.components`}}),xs=new E({props:{code:"stable_diffusion_img2img = StableDiffusionImg2ImgPipeline(**components)",highlighted:"stable_diffusion_img2img = StableDiffusionImg2ImgPipeline(**components)"}}),As=new E({props:{code:`from diffusers import StableDiffusionPipeline, StableDiffusionImg2ImgPipeline

model_id = "runwayml/stable-diffusion-v1-5"
stable_diffusion_txt2img = StableDiffusionPipeline.from_pretrained(model_id)
stable_diffusion_img2img = StableDiffusionImg2ImgPipeline(
    vae=stable_diffusion_txt2img.vae,
    text_encoder=stable_diffusion_txt2img.text_encoder,
    tokenizer=stable_diffusion_txt2img.tokenizer,
    unet=stable_diffusion_txt2img.unet,
    scheduler=stable_diffusion_txt2img.scheduler,
    safety_checker=None,
    feature_extractor=None,
    requires_safety_checker=False,
)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline, StableDiffusionImg2ImgPipeline

model_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
stable_diffusion_txt2img = StableDiffusionPipeline.from_pretrained(model_id)
stable_diffusion_img2img = StableDiffusionImg2ImgPipeline(
    vae=stable_diffusion_txt2img.vae,
    text_encoder=stable_diffusion_txt2img.text_encoder,
    tokenizer=stable_diffusion_txt2img.tokenizer,
    unet=stable_diffusion_txt2img.unet,
    scheduler=stable_diffusion_txt2img.scheduler,
    safety_checker=<span class="hljs-literal">None</span>,
    feature_extractor=<span class="hljs-literal">None</span>,
    requires_safety_checker=<span class="hljs-literal">False</span>,
)`}}),Cs=new oe({}),Ie=new Cm({props:{$$slots:{default:[zm]},$$scope:{ctx:rt}}}),Ns=new E({props:{code:`from diffusers import DiffusionPipeline

# load fp16 variant
stable_diffusion = DiffusionPipeline.from_pretrained(
    "runwayml/stable-diffusion-v1-5", variant="fp16", torch_dtype=torch.float16
)
# load non_ema variant
stable_diffusion = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", variant="non_ema")`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

<span class="hljs-comment"># load fp16 variant</span>
stable_diffusion = 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
)
<span class="hljs-comment"># load non_ema variant</span>
stable_diffusion = 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>)`}}),Os=new E({props:{code:`from diffusers import DiffusionPipeline

# save as fp16 variant
stable_diffusion.save_pretrained("runwayml/stable-diffusion-v1-5", variant="fp16")
# save as non-ema variant
stable_diffusion.save_pretrained("runwayml/stable-diffusion-v1-5", variant="non_ema")`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

<span class="hljs-comment"># save as fp16 variant</span>
stable_diffusion.save_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, variant=<span class="hljs-string">&quot;fp16&quot;</span>)
<span class="hljs-comment"># save as non-ema variant</span>
stable_diffusion.save_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, variant=<span class="hljs-string">&quot;non_ema&quot;</span>)`}}),zs=new E({props:{code:`# \u{1F44E} this won't work
stable_diffusion = DiffusionPipeline.from_pretrained("./stable-diffusion-v1-5", torch_dtype=torch.float16)
# \u{1F44D} this works
stable_diffusion = DiffusionPipeline.from_pretrained(
    "./stable-diffusion-v1-5", variant="fp16", torch_dtype=torch.float16
)`,highlighted:`<span class="hljs-comment"># \u{1F44E} this won&#x27;t work</span>
stable_diffusion = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;./stable-diffusion-v1-5&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-comment"># \u{1F44D} this works</span>
stable_diffusion = 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
)`}}),Fs=new oe({}),Ys=new E({props:{code:`from diffusers import UNet2DConditionModel

repo_id = "runwayml/stable-diffusion-v1-5"
model = UNet2DConditionModel.from_pretrained(repo_id, subfolder="unet")`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UNet2DConditionModel

repo_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>
model = UNet2DConditionModel.from_pretrained(repo_id, subfolder=<span class="hljs-string">&quot;unet&quot;</span>)`}}),Rs=new E({props:{code:`from diffusers import UNet2DModel

repo_id = "google/ddpm-cifar10-32"
model = UNet2DModel.from_pretrained(repo_id)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UNet2DModel

repo_id = <span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>
model = UNet2DModel.from_pretrained(repo_id)`}}),Gs=new E({props:{code:`from diffusers import UNet2DConditionModel

model = UNet2DConditionModel.from_pretrained("runwayml/stable-diffusion-v1-5", subfolder="unet", variant="non-ema")
model.save_pretrained("./local-unet", variant="non-ema")`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UNet2DConditionModel

model = UNet2DConditionModel.from_pretrained(<span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>, subfolder=<span class="hljs-string">&quot;unet&quot;</span>, variant=<span class="hljs-string">&quot;non-ema&quot;</span>)
model.save_pretrained(<span class="hljs-string">&quot;./local-unet&quot;</span>, variant=<span class="hljs-string">&quot;non-ema&quot;</span>)`}}),Ks=new oe({}),Bs=new E({props:{code:`from diffusers import StableDiffusionPipeline
from diffusers import (
    DDPMScheduler,
    DDIMScheduler,
    PNDMScheduler,
    LMSDiscreteScheduler,
    EulerDiscreteScheduler,
    EulerAncestralDiscreteScheduler,
    DPMSolverMultistepScheduler,
)

repo_id = "runwayml/stable-diffusion-v1-5"

ddpm = DDPMScheduler.from_pretrained(repo_id, subfolder="scheduler")
ddim = DDIMScheduler.from_pretrained(repo_id, subfolder="scheduler")
pndm = PNDMScheduler.from_pretrained(repo_id, subfolder="scheduler")
lms = LMSDiscreteScheduler.from_pretrained(repo_id, subfolder="scheduler")
euler_anc = EulerAncestralDiscreteScheduler.from_pretrained(repo_id, subfolder="scheduler")
euler = EulerDiscreteScheduler.from_pretrained(repo_id, subfolder="scheduler")
dpm = DPMSolverMultistepScheduler.from_pretrained(repo_id, subfolder="scheduler")

# replace \`dpm\` with any of \`ddpm\`, \`ddim\`, \`pndm\`, \`lms\`, \`euler_anc\`, \`euler\`
pipeline = StableDiffusionPipeline.from_pretrained(repo_id, scheduler=dpm)`,highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> (
    DDPMScheduler,
    DDIMScheduler,
    PNDMScheduler,
    LMSDiscreteScheduler,
    EulerDiscreteScheduler,
    EulerAncestralDiscreteScheduler,
    DPMSolverMultistepScheduler,
)

repo_id = <span class="hljs-string">&quot;runwayml/stable-diffusion-v1-5&quot;</span>

ddpm = DDPMScheduler.from_pretrained(repo_id, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
ddim = DDIMScheduler.from_pretrained(repo_id, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
pndm = PNDMScheduler.from_pretrained(repo_id, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
lms = LMSDiscreteScheduler.from_pretrained(repo_id, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
euler_anc = EulerAncestralDiscreteScheduler.from_pretrained(repo_id, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
euler = EulerDiscreteScheduler.from_pretrained(repo_id, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
dpm = DPMSolverMultistepScheduler.from_pretrained(repo_id, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)

<span class="hljs-comment"># replace \`dpm\` with any of \`ddpm\`, \`ddim\`, \`pndm\`, \`lms\`, \`euler_anc\`, \`euler\`</span>
pipeline = StableDiffusionPipeline.from_pretrained(repo_id, scheduler=dpm)`}}),Ws=new oe({}),Qs=new E({props:{code:`from diffusers import DiffusionPipeline

repo_id = "runwayml/stable-diffusion-v1-5"
pipeline = DiffusionPipeline.from_pretrained(repo_id)
print(pipeline)`,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)
<span class="hljs-built_in">print</span>(pipeline)`}}),tt=new E({props:{code:`StableDiffusionPipeline {
  "feature_extractor": [
    "transformers",
    "CLIPImageProcessor"
  ],
  "safety_checker": [
    "stable_diffusion",
    "StableDiffusionSafetyChecker"
  ],
  "scheduler": [
    "diffusers",
    "PNDMScheduler"
  ],
  "text_encoder": [
    "transformers",
    "CLIPTextModel"
  ],
  "tokenizer": [
    "transformers",
    "CLIPTokenizer"
  ],
  "unet": [
    "diffusers",
    "UNet2DConditionModel"
  ],
  "vae": [
    "diffusers",
    "AutoencoderKL"
  ]
}`,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>`}}),at=new E({props:{code:`.
\u251C\u2500\u2500 feature_extractor
\u2502\xA0\xA0 \u2514\u2500\u2500 preprocessor_config.json
\u251C\u2500\u2500 model_index.json
\u251C\u2500\u2500 safety_checker
\u2502\xA0\xA0 \u251C\u2500\u2500 config.json
\u2502\xA0\xA0 \u2514\u2500\u2500 pytorch_model.bin
\u251C\u2500\u2500 scheduler
\u2502\xA0\xA0 \u2514\u2500\u2500 scheduler_config.json
\u251C\u2500\u2500 text_encoder
\u2502\xA0\xA0 \u251C\u2500\u2500 config.json
\u2502\xA0\xA0 \u2514\u2500\u2500 pytorch_model.bin
\u251C\u2500\u2500 tokenizer
\u2502\xA0\xA0 \u251C\u2500\u2500 merges.txt
\u2502\xA0\xA0 \u251C\u2500\u2500 special_tokens_map.json
\u2502\xA0\xA0 \u251C\u2500\u2500 tokenizer_config.json
\u2502\xA0\xA0 \u2514\u2500\u2500 vocab.json
\u251C\u2500\u2500 unet
\u2502\xA0\xA0 \u251C\u2500\u2500 config.json
\u2502\xA0\xA0 \u251C\u2500\u2500 diffusion_pytorch_model.bin
\u2514\u2500\u2500 vae
    \u251C\u2500\u2500 config.json
    \u251C\u2500\u2500 diffusion_pytorch_model.bin`,highlighted:`.
\u251C\u2500\u2500 feature_extractor
\u2502\xA0\xA0 \u2514\u2500\u2500 preprocessor_config.<span class="hljs-keyword">json
</span>\u251C\u2500\u2500 model_index.<span class="hljs-keyword">json
</span>\u251C\u2500\u2500 safety_checker
\u2502\xA0\xA0 \u251C\u2500\u2500 <span class="hljs-built_in">config</span>.<span class="hljs-keyword">json
</span>\u2502\xA0\xA0 \u2514\u2500\u2500 pytorch_model.<span class="hljs-keyword">bin
</span>\u251C\u2500\u2500 <span class="hljs-keyword">scheduler
</span>\u2502\xA0\xA0 \u2514\u2500\u2500 <span class="hljs-keyword">scheduler_config.json
</span>\u251C\u2500\u2500 text_encoder
\u2502\xA0\xA0 \u251C\u2500\u2500 <span class="hljs-built_in">config</span>.<span class="hljs-keyword">json
</span>\u2502\xA0\xA0 \u2514\u2500\u2500 pytorch_model.<span class="hljs-keyword">bin
</span>\u251C\u2500\u2500 tokenizer
\u2502\xA0\xA0 \u251C\u2500\u2500 merges.txt
\u2502\xA0\xA0 \u251C\u2500\u2500 special_tokens_map.<span class="hljs-keyword">json
</span>\u2502\xA0\xA0 \u251C\u2500\u2500 tokenizer_config.<span class="hljs-keyword">json
</span>\u2502\xA0\xA0 \u2514\u2500\u2500 vocab.<span class="hljs-keyword">json
</span>\u251C\u2500\u2500 unet
\u2502\xA0\xA0 \u251C\u2500\u2500 <span class="hljs-built_in">config</span>.<span class="hljs-keyword">json
</span>\u2502\xA0\xA0 \u251C\u2500\u2500 <span class="hljs-keyword">diffusion_pytorch_model.bin
</span>\u2514\u2500\u2500 vae
    \u251C\u2500\u2500 <span class="hljs-built_in">config</span>.<span class="hljs-keyword">json
</span>    \u251C\u2500\u2500 <span class="hljs-keyword">diffusion_pytorch_model.bin</span>`}}),it=new E({props:{code:`pipeline.tokenizer
CLIPTokenizer(
    name_or_path="/root/.cache/huggingface/hub/models--runwayml--stable-diffusion-v1-5/snapshots/39593d5650112b4cc580433f6b0435385882d819/tokenizer",
    vocab_size=49408,
    model_max_length=77,
    is_fast=False,
    padding_side="right",
    truncation_side="right",
    special_tokens={
        "bos_token": AddedToken("<|startoftext|>", rstrip=False, lstrip=False, single_word=False, normalized=True),
        "eos_token": AddedToken("<|endoftext|>", rstrip=False, lstrip=False, single_word=False, normalized=True),
        "unk_token": AddedToken("<|endoftext|>", rstrip=False, lstrip=False, single_word=False, normalized=True),
        "pad_token": "<|endoftext|>",
    },
)`,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>,
    },
)`}}),nt=new E({props:{code:`{
  "_class_name": "StableDiffusionPipeline",
  "_diffusers_version": "0.6.0",
  "feature_extractor": [
    "transformers",
    "CLIPImageProcessor"
  ],
  "safety_checker": [
    "stable_diffusion",
    "StableDiffusionSafetyChecker"
  ],
  "scheduler": [
    "diffusers",
    "PNDMScheduler"
  ],
  "text_encoder": [
    "transformers",
    "CLIPTextModel"
  ],
  "tokenizer": [
    "transformers",
    "CLIPTokenizer"
  ],
  "unet": [
    "diffusers",
    "UNet2DConditionModel"
  ],
  "vae": [
    "diffusers",
    "AutoencoderKL"
  ]
}`,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>`}}),{c(){y=i("meta"),I=p(),$=i("h1"),P=i("a"),M=i("span"),c(j.$$.fragment),G=p(),T=i("span"),S=o("Load pipelines, models, and schedulers"),D=p(),x=i("p"),ae=o("Having an easy way to use a diffusion system for inference is essential to \u{1F9E8} Diffusers. Diffusion systems often consist of multiple components like parameterized models, tokenizers, and schedulers that interact in complex ways. That is why we designed the "),ft=i("a"),rl=o("DiffusionPipeline"),fl=o(" to wrap the complexity of the entire diffusion system into an easy-to-use API, while remaining flexible enough to be adapted for other use cases, such as loading each component individually as building blocks to assemble your own diffusion system."),fi=p(),be=i("p"),pl=o("Everything you need for inference or training is accessible with the "),lo=i("code"),dl=o("from_pretrained()"),ul=o(" method."),pi=p(),pt=i("p"),cl=o("This guide will show you how to load:"),di=p(),L=i("ul"),ro=i("li"),hl=o("pipelines from the Hub and locally"),ml=p(),fo=i("li"),_l=o("different components into a pipeline"),vl=p(),po=i("li"),wl=o("checkpoint variants such as different floating point types or non-exponential mean averaged (EMA) weights"),yl=p(),uo=i("li"),bl=o("models and schedulers"),ui=p(),ie=i("h2"),ge=i("a"),co=i("span"),c(fs.$$.fragment),gl=p(),ho=i("span"),El=o("Diffusion Pipeline"),ci=p(),c(Ee.$$.fragment),hi=p(),N=i("p"),$l=o("The "),dt=i("a"),Dl=o("DiffusionPipeline"),jl=o(" class is the simplest and most generic way to load any diffusion model from the "),ps=i("a"),kl=o("Hub"),Pl=o(". The "),ut=i("a"),ql=o("DiffusionPipeline.from_pretrained()"),Sl=o(" method automatically detects the correct pipeline class from the checkpoint, downloads and caches all the required configuration and weight files, and returns a pipeline instance ready for inference."),mi=p(),c(ds.$$.fragment),_i=p(),$e=i("p"),xl=o("You can also load a checkpoint with it\u2019s specific pipeline class. The example above loaded a Stable Diffusion model; to get the same result, use the "),ct=i("a"),Al=o("StableDiffusionPipeline"),Cl=o(" class:"),vi=p(),c(us.$$.fragment),wi=p(),W=i("p"),Ml=o("A checkpoint (such as "),cs=i("a"),mo=i("code"),Tl=o("CompVis/stable-diffusion-v1-4"),Il=o(" or "),hs=i("a"),_o=i("code"),Ll=o("runwayml/stable-diffusion-v1-5"),Nl=o(") may also be used for more than one task, like text-to-image or image-to-image. To differentiate what task you want to use the checkpoint for, you have to load it directly with it\u2019s corresponding task-specific pipeline class:"),yi=p(),c(ms.$$.fragment),bi=p(),ne=i("h3"),De=i("a"),vo=i("span"),c(_s.$$.fragment),Ol=p(),wo=i("span"),zl=o("Local pipeline"),gi=p(),O=i("p"),Fl=o("To load a diffusion pipeline locally, use "),vs=i("a"),yo=i("code"),Ul=o("git-lfs"),Yl=o(" to manually download the checkpoint (in this case, "),ws=i("a"),bo=i("code"),Hl=o("runwayml/stable-diffusion-v1-5"),Rl=o(") to your local disk. This creates a local folder, "),go=i("code"),Gl=o("./stable-diffusion-v1-5"),Kl=o(", on your disk:"),Ei=p(),c(ys.$$.fragment),$i=p(),je=i("p"),Bl=o("Then pass the local path to "),ht=i("a"),Wl=o("from_pretrained()"),Vl=o(":"),Di=p(),c(bs.$$.fragment),ji=p(),ke=i("p"),Jl=o("The "),mt=i("a"),Ql=o("from_pretrained()"),Xl=o(" method won\u2019t download any files from the Hub when it detects a local path, but this also means it won\u2019t download and cache the latest changes to a checkpoint."),ki=p(),le=i("h3"),Pe=i("a"),Eo=i("span"),c(gs.$$.fragment),Zl=p(),$o=i("span"),er=o("Swap components in a pipeline"),Pi=p(),_t=i("p"),sr=o("You can customize the default components of any pipeline with another compatible component. Customization is important because:"),qi=p(),V=i("ul"),Do=i("li"),tr=o("Changing the scheduler is important for exploring the trade-off between generation speed and quality."),or=p(),jo=i("li"),ar=o("Different components of a model are typically trained independently and you can swap out a component with a better-performing one."),ir=p(),ko=i("li"),nr=o("During finetuning, usually only some components - like the UNet or text encoder - are trained."),Si=p(),qe=i("p"),lr=o("To find out which schedulers are compatible for customization, you can use the "),Po=i("code"),rr=o("compatibles"),fr=o(" method:"),xi=p(),c(Es.$$.fragment),Ai=p(),q=i("p"),pr=o("Let\u2019s use the "),vt=i("a"),dr=o("SchedulerMixin.from_pretrained()"),ur=o(" method to replace the default "),wt=i("a"),cr=o("PNDMScheduler"),hr=o(" with a more performant scheduler, "),yt=i("a"),mr=o("EulerDiscreteScheduler"),_r=o(". The "),qo=i("code"),vr=o('subfolder="scheduler"'),wr=o(" argument is required to load the scheduler configuration from the correct "),$s=i("a"),yr=o("subfolder"),br=o(" of the pipeline repository."),Ci=p(),z=i("p"),gr=o("Then you can pass the new "),bt=i("a"),Er=o("EulerDiscreteScheduler"),$r=o(" instance to the "),So=i("code"),Dr=o("scheduler"),jr=o(" argument in "),gt=i("a"),kr=o("DiffusionPipeline"),Pr=o(":"),Mi=p(),c(Ds.$$.fragment),Ti=p(),re=i("h3"),Se=i("a"),xo=i("span"),c(js.$$.fragment),qr=p(),Ao=i("span"),Sr=o("Safety checker"),Ii=p(),F=i("p"),xr=o("Diffusion models like Stable Diffusion can generate harmful content, which is why \u{1F9E8} Diffusers has a "),ks=i("a"),Ar=o("safety checker"),Cr=o(" to check generated outputs against known hardcoded NSFW content. If you\u2019d like to disable the safety checker for whatever reason, pass "),Co=i("code"),Mr=o("None"),Tr=o(" to the "),Mo=i("code"),Ir=o("safety_checker"),Lr=o(" argument:"),Li=p(),c(Ps.$$.fragment),Ni=p(),fe=i("h3"),xe=i("a"),To=i("span"),c(qs.$$.fragment),Nr=p(),Io=i("span"),Or=o("Reuse components across pipelines"),Oi=p(),Ae=i("p"),zr=o("You can also reuse the same components in multiple pipelines to avoid loading the weights into RAM twice. Use the "),Et=i("a"),Fr=o("components"),Ur=o(" method to save the components:"),zi=p(),c(Ss.$$.fragment),Fi=p(),Ce=i("p"),Yr=o("Then you can pass the "),Lo=i("code"),Hr=o("components"),Rr=o(" to another pipeline without reloading the weights into RAM:"),Ui=p(),c(xs.$$.fragment),Yi=p(),$t=i("p"),Gr=o("You can also pass the components individually to the pipeline if you want more flexibility over which components to reuse or disable. For example, to reuse the same components in the text-to-image pipeline, except for the safety checker and feature extractor, in the image-to-image pipeline:"),Hi=p(),c(As.$$.fragment),Ri=p(),pe=i("h2"),Me=i("a"),No=i("span"),c(Cs.$$.fragment),Kr=p(),Oo=i("span"),Br=o("Checkpoint variants"),Gi=p(),Dt=i("p"),Wr=o("A checkpoint variant is usually a checkpoint where it\u2019s weights are:"),Ki=p(),Te=i("ul"),Ms=i("li"),Vr=o("Stored in a different floating point type for lower precision and lower storage, such as "),Ts=i("a"),zo=i("code"),Jr=o("torch.float16"),Qr=o(", because it only requires half the bandwidth and storage to download. You can\u2019t use this variant if you\u2019re continuing training or using a CPU."),Xr=p(),Fo=i("li"),Zr=o("Non-exponential mean averaged (EMA) weights which shouldn\u2019t be used for inference. You should use these to continue finetuning a model."),Bi=p(),c(Ie.$$.fragment),Wi=p(),J=i("p"),ef=o("Otherwise, a variant is "),Uo=i("strong"),sf=o("identical"),tf=o(" to the original checkpoint. They have exactly the same serialization format (like "),jt=i("a"),of=o("Safetensors"),af=o("), model structure, and weights have identical tensor shapes."),Vi=p(),Le=i("table"),Yo=i("thead"),de=i("tr"),Ho=i("th"),Ro=i("strong"),nf=o("checkpoint type"),lf=p(),Go=i("th"),Ko=i("strong"),rf=o("weight name"),ff=p(),Bo=i("th"),Wo=i("strong"),pf=o("argument for loading weights"),df=p(),ue=i("tbody"),ce=i("tr"),Vo=i("td"),uf=o("original"),cf=p(),Jo=i("td"),hf=o("diffusion_pytorch_model.bin"),mf=p(),Ji=i("td"),_f=p(),he=i("tr"),Qo=i("td"),vf=o("floating point"),wf=p(),Xo=i("td"),yf=o("diffusion_pytorch_model.fp16.bin"),bf=p(),Is=i("td"),Zo=i("code"),gf=o("variant"),Ef=o(", "),ea=i("code"),$f=o("torch_dtype"),Df=p(),me=i("tr"),sa=i("td"),jf=o("non-EMA"),kf=p(),ta=i("td"),Pf=o("diffusion_pytorch_model.non_ema.bin"),qf=p(),oa=i("td"),aa=i("code"),Sf=o("variant"),Qi=p(),kt=i("p"),xf=o("There are two important arguments to know for loading variants:"),Xi=p(),Ne=i("ul"),ia=i("li"),b=i("p"),na=i("code"),Af=o("torch_dtype"),Cf=o(" defines the floating point precision of the loaded checkpoints. For example, if you want to save bandwidth by loading a "),la=i("code"),Mf=o("fp16"),Tf=o(" variant, you should specify "),ra=i("code"),If=o("torch_dtype=torch.float16"),Lf=o(" to "),fa=i("em"),Nf=o("convert the weights"),Of=o(" to "),pa=i("code"),zf=o("fp16"),Ff=o(". Otherwise, the "),da=i("code"),Uf=o("fp16"),Yf=o(" weights are converted to the default "),ua=i("code"),Hf=o("fp32"),Rf=o(" precision. You can also load the original checkpoint without defining the "),ca=i("code"),Gf=o("variant"),Kf=o(" argument, and convert it to "),ha=i("code"),Bf=o("fp16"),Wf=o(" with "),ma=i("code"),Vf=o("torch_dtype=torch.float16"),Jf=o(". In this case, the default "),_a=i("code"),Qf=o("fp32"),Xf=o(" weights are downloaded first, and then they\u2019re converted to "),va=i("code"),Zf=o("fp16"),ep=o(" after loading."),sp=p(),wa=i("li"),A=i("p"),ya=i("code"),tp=o("variant"),op=o(" defines which files should be loaded from the repository. For example, if you want to load a "),ba=i("code"),ap=o("non_ema"),ip=o(" variant from the "),Ls=i("a"),ga=i("code"),np=o("diffusers/stable-diffusion-variants"),lp=o(" repository, you should specify "),Ea=i("code"),rp=o('variant="non_ema"'),fp=o(" to download the "),$a=i("code"),pp=o("non_ema"),dp=o(" files."),Zi=p(),c(Ns.$$.fragment),en=p(),Q=i("p"),up=o("To save a checkpoint stored in a different floating point type or as a non-EMA variant, use the "),Pt=i("a"),cp=o("DiffusionPipeline.save_pretrained()"),hp=o(" method and specify the "),Da=i("code"),mp=o("variant"),_p=o(" argument. You should try and save a variant to the same folder as the original checkpoint, so you can load both from the same folder:"),sn=p(),c(Os.$$.fragment),tn=p(),X=i("p"),vp=o("If you don\u2019t save the variant to an existing folder, you must specify the "),ja=i("code"),wp=o("variant"),yp=o(" argument otherwise it\u2019ll throw an "),ka=i("code"),bp=o("Exception"),gp=o(" because it can\u2019t find the original checkpoint:"),on=p(),c(zs.$$.fragment),an=p(),_e=i("h2"),Oe=i("a"),Pa=i("span"),c(Fs.$$.fragment),Ep=p(),qa=i("span"),$p=o("Models"),nn=p(),Z=i("p"),Dp=o("Models are loaded from the "),qt=i("a"),jp=o("ModelMixin.from_pretrained()"),kp=o(" method, which downloads and caches the latest version of the model weights and configurations. If the latest files are available in the local cache, "),St=i("a"),Pp=o("from_pretrained()"),qp=o(" reuses files in the cache instead of redownloading them."),ln=p(),U=i("p"),Sp=o("Models can be loaded from a subfolder with the "),Sa=i("code"),xp=o("subfolder"),Ap=o(" argument. For example, the model weights for "),xa=i("code"),Cp=o("runwayml/stable-diffusion-v1-5"),Mp=o(" are stored in the "),Us=i("a"),Aa=i("code"),Tp=o("unet"),Ip=o(" subfolder:"),rn=p(),c(Ys.$$.fragment),fn=p(),ze=i("p"),Lp=o("Or directly from a repository\u2019s "),Hs=i("a"),Np=o("directory"),Op=o(":"),pn=p(),c(Rs.$$.fragment),dn=p(),Y=i("p"),zp=o("You can also load and save model variants by specifying the "),Ca=i("code"),Fp=o("variant"),Up=o(" argument in "),xt=i("a"),Yp=o("ModelMixin.from_pretrained()"),Hp=o(" and "),At=i("a"),Rp=o("ModelMixin.save_pretrained()"),Gp=o(":"),un=p(),c(Gs.$$.fragment),cn=p(),ve=i("h2"),Fe=i("a"),Ma=i("span"),c(Ks.$$.fragment),Kp=p(),Ta=i("span"),Bp=o("Schedulers"),hn=p(),H=i("p"),Wp=o("Schedulers are loaded from the "),Ct=i("a"),Vp=o("SchedulerMixin.from_pretrained()"),Jp=o(" method, and unlike models, schedulers are "),Ia=i("strong"),Qp=o("not parameterized"),Xp=o(" or "),La=i("strong"),Zp=o("trained"),ed=o("; they are defined by a configuration file."),mn=p(),Ue=i("p"),sd=o(`Loading schedulers does not consume any significant amount of memory and the same configuration file can be used for a variety of different schedulers.
For example, the following schedulers are compatible with `),Mt=i("a"),td=o("StableDiffusionPipeline"),od=o(" which means you can load the same scheduler configuration file in any of these classes:"),_n=p(),c(Bs.$$.fragment),vn=p(),we=i("h2"),Ye=i("a"),Na=i("span"),c(Ws.$$.fragment),ad=p(),Oa=i("span"),id=o("DiffusionPipeline explained"),wn=p(),He=i("p"),nd=o("As a class method, "),Tt=i("a"),ld=o("DiffusionPipeline.from_pretrained()"),rd=o(" is responsible for two things:"),yn=p(),Re=i("ul"),Vs=i("li"),fd=o("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, "),It=i("a"),pd=o("DiffusionPipeline.from_pretrained()"),dd=o(" reuses the cache and won\u2019t redownload the files."),ud=p(),ye=i("li"),cd=o("Load the cached weights into the correct pipeline "),Lt=i("a"),hd=o("class"),md=o(" - retrieved from the "),za=i("code"),_d=o("model_index.json"),vd=o(" file - and return an instance of it."),bn=p(),ee=i("p"),wd=o("The pipelines underlying folder structure corresponds directly with their class instances. For example, the "),Nt=i("a"),yd=o("StableDiffusionPipeline"),bd=o(" corresponds to the folder structure in "),Js=i("a"),Fa=i("code"),gd=o("runwayml/stable-diffusion-v1-5"),Ed=o("."),gn=p(),c(Qs.$$.fragment),En=p(),Ge=i("p"),$d=o("You\u2019ll see pipeline is an instance of "),Ot=i("a"),Dd=o("StableDiffusionPipeline"),jd=o(", which consists of seven components:"),$n=p(),k=i("ul"),Ke=i("li"),Ua=i("code"),kd=o('"feature_extractor"'),Pd=o(": a "),Xs=i("a"),qd=o("CLIPFeatureExtractor"),Sd=o(" from \u{1F917} Transformers."),xd=p(),Be=i("li"),Ya=i("code"),Ad=o('"safety_checker"'),Cd=o(": a "),Zs=i("a"),Md=o("component"),Td=o(" for screening against harmful content."),Id=p(),We=i("li"),Ha=i("code"),Ld=o('"scheduler"'),Nd=o(": an instance of "),zt=i("a"),Od=o("PNDMScheduler"),zd=o("."),Fd=p(),Ve=i("li"),Ra=i("code"),Ud=o('"text_encoder"'),Yd=o(": a "),et=i("a"),Hd=o("CLIPTextModel"),Rd=o(" from \u{1F917} Transformers."),Gd=p(),Je=i("li"),Ga=i("code"),Kd=o('"tokenizer"'),Bd=o(": a "),st=i("a"),Wd=o("CLIPTokenizer"),Vd=o(" from \u{1F917} Transformers."),Jd=p(),Qe=i("li"),Ka=i("code"),Qd=o('"unet"'),Xd=o(": an instance of "),Ft=i("a"),Zd=o("UNet2DConditionModel"),eu=o("."),su=p(),Xe=i("li"),Ba=i("code"),tu=o('"vae"'),ou=o(" an instance of "),Ut=i("a"),au=o("AutoencoderKL"),iu=o("."),Dn=p(),c(tt.$$.fragment),jn=p(),Ze=i("p"),nu=o("Compare the components of the pipeline instance to the "),ot=i("a"),Wa=i("code"),lu=o("runwayml/stable-diffusion-v1-5"),ru=o(" folder structure, and you\u2019ll see there is a separate folder for each of the components in the repository:"),kn=p(),c(at.$$.fragment),Pn=p(),Yt=i("p"),fu=o("You can access each of the components of the pipeline as an attribute to view its configuration:"),qn=p(),c(it.$$.fragment),Sn=p(),se=i("p"),pu=o("Every pipeline expects a "),Va=i("code"),du=o("model_index.json"),uu=o(" file that tells the "),Ht=i("a"),cu=o("DiffusionPipeline"),hu=o(":"),xn=p(),te=i("ul"),Rt=i("li"),mu=o("which pipeline class to load from "),Ja=i("code"),_u=o("_class_name"),vu=p(),Gt=i("li"),wu=o("which version of \u{1F9E8} Diffusers was used to create the model in "),Qa=i("code"),yu=o("_diffusers_version"),bu=p(),K=i("li"),gu=o("what components from which library are stored in the subfolders ("),Xa=i("code"),Eu=o("name"),$u=o(" corresponds to the component and subfolder name, "),Za=i("code"),Du=o("library"),ju=o(" corresponds to the name of the library to load the class from, and "),ei=i("code"),ku=o("class"),Pu=o(" corresponds to the class name)"),An=p(),c(nt.$$.fragment),this.h()},l(e){const r=Lm('[data-svelte="svelte-1phssyn"]',document.head);y=n(r,"META",{name:!0,content:!0}),r.forEach(t),I=d(e),$=n(e,"H1",{class:!0});var lt=l($);P=n(lt,"A",{id:!0,class:!0,href:!0});var si=l(P);M=n(si,"SPAN",{});var xu=l(M);h(j.$$.fragment,xu),xu.forEach(t),si.forEach(t),G=d(lt),T=n(lt,"SPAN",{});var Au=l(T);S=a(Au,"Load pipelines, models, and schedulers"),Au.forEach(t),lt.forEach(t),D=d(e),x=n(e,"P",{});var Mn=l(x);ae=a(Mn,"Having an easy way to use a diffusion system for inference is essential to \u{1F9E8} Diffusers. Diffusion systems often consist of multiple components like parameterized models, tokenizers, and schedulers that interact in complex ways. That is why we designed the "),ft=n(Mn,"A",{href:!0});var Cu=l(ft);rl=a(Cu,"DiffusionPipeline"),Cu.forEach(t),fl=a(Mn," to wrap the complexity of the entire diffusion system into an easy-to-use API, while remaining flexible enough to be adapted for other use cases, such as loading each component individually as building blocks to assemble your own diffusion system."),Mn.forEach(t),fi=d(e),be=n(e,"P",{});var Tn=l(be);pl=a(Tn,"Everything you need for inference or training is accessible with the "),lo=n(Tn,"CODE",{});var Mu=l(lo);dl=a(Mu,"from_pretrained()"),Mu.forEach(t),ul=a(Tn," method."),Tn.forEach(t),pi=d(e),pt=n(e,"P",{});var Tu=l(pt);cl=a(Tu,"This guide will show you how to load:"),Tu.forEach(t),di=d(e),L=n(e,"UL",{});var es=l(L);ro=n(es,"LI",{});var Iu=l(ro);hl=a(Iu,"pipelines from the Hub and locally"),Iu.forEach(t),ml=d(es),fo=n(es,"LI",{});var Lu=l(fo);_l=a(Lu,"different components into a pipeline"),Lu.forEach(t),vl=d(es),po=n(es,"LI",{});var Nu=l(po);wl=a(Nu,"checkpoint variants such as different floating point types or non-exponential mean averaged (EMA) weights"),Nu.forEach(t),yl=d(es),uo=n(es,"LI",{});var Ou=l(uo);bl=a(Ou,"models and schedulers"),Ou.forEach(t),es.forEach(t),ui=d(e),ie=n(e,"H2",{class:!0});var In=l(ie);ge=n(In,"A",{id:!0,class:!0,href:!0});var zu=l(ge);co=n(zu,"SPAN",{});var Fu=l(co);h(fs.$$.fragment,Fu),Fu.forEach(t),zu.forEach(t),gl=d(In),ho=n(In,"SPAN",{});var Uu=l(ho);El=a(Uu,"Diffusion Pipeline"),Uu.forEach(t),In.forEach(t),ci=d(e),h(Ee.$$.fragment,e),hi=d(e),N=n(e,"P",{});var ss=l(N);$l=a(ss,"The "),dt=n(ss,"A",{href:!0});var Yu=l(dt);Dl=a(Yu,"DiffusionPipeline"),Yu.forEach(t),jl=a(ss," class is the simplest and most generic way to load any diffusion model from the "),ps=n(ss,"A",{href:!0,rel:!0});var Hu=l(ps);kl=a(Hu,"Hub"),Hu.forEach(t),Pl=a(ss,". The "),ut=n(ss,"A",{href:!0});var Ru=l(ut);ql=a(Ru,"DiffusionPipeline.from_pretrained()"),Ru.forEach(t),Sl=a(ss," method automatically detects the correct pipeline class from the checkpoint, downloads and caches all the required configuration and weight files, and returns a pipeline instance ready for inference."),ss.forEach(t),mi=d(e),h(ds.$$.fragment,e),_i=d(e),$e=n(e,"P",{});var Ln=l($e);xl=a(Ln,"You can also load a checkpoint with it\u2019s specific pipeline class. The example above loaded a Stable Diffusion model; to get the same result, use the "),ct=n(Ln,"A",{href:!0});var Gu=l(ct);Al=a(Gu,"StableDiffusionPipeline"),Gu.forEach(t),Cl=a(Ln," class:"),Ln.forEach(t),vi=d(e),h(us.$$.fragment,e),wi=d(e),W=n(e,"P",{});var Kt=l(W);Ml=a(Kt,"A checkpoint (such as "),cs=n(Kt,"A",{href:!0,rel:!0});var Ku=l(cs);mo=n(Ku,"CODE",{});var Bu=l(mo);Tl=a(Bu,"CompVis/stable-diffusion-v1-4"),Bu.forEach(t),Ku.forEach(t),Il=a(Kt," or "),hs=n(Kt,"A",{href:!0,rel:!0});var Wu=l(hs);_o=n(Wu,"CODE",{});var Vu=l(_o);Ll=a(Vu,"runwayml/stable-diffusion-v1-5"),Vu.forEach(t),Wu.forEach(t),Nl=a(Kt,") may also be used for more than one task, like text-to-image or image-to-image. To differentiate what task you want to use the checkpoint for, you have to load it directly with it\u2019s corresponding task-specific pipeline class:"),Kt.forEach(t),yi=d(e),h(ms.$$.fragment,e),bi=d(e),ne=n(e,"H3",{class:!0});var Nn=l(ne);De=n(Nn,"A",{id:!0,class:!0,href:!0});var Ju=l(De);vo=n(Ju,"SPAN",{});var Qu=l(vo);h(_s.$$.fragment,Qu),Qu.forEach(t),Ju.forEach(t),Ol=d(Nn),wo=n(Nn,"SPAN",{});var Xu=l(wo);zl=a(Xu,"Local pipeline"),Xu.forEach(t),Nn.forEach(t),gi=d(e),O=n(e,"P",{});var ts=l(O);Fl=a(ts,"To load a diffusion pipeline locally, use "),vs=n(ts,"A",{href:!0,rel:!0});var Zu=l(vs);yo=n(Zu,"CODE",{});var ec=l(yo);Ul=a(ec,"git-lfs"),ec.forEach(t),Zu.forEach(t),Yl=a(ts," to manually download the checkpoint (in this case, "),ws=n(ts,"A",{href:!0,rel:!0});var sc=l(ws);bo=n(sc,"CODE",{});var tc=l(bo);Hl=a(tc,"runwayml/stable-diffusion-v1-5"),tc.forEach(t),sc.forEach(t),Rl=a(ts,") to your local disk. This creates a local folder, "),go=n(ts,"CODE",{});var oc=l(go);Gl=a(oc,"./stable-diffusion-v1-5"),oc.forEach(t),Kl=a(ts,", on your disk:"),ts.forEach(t),Ei=d(e),h(ys.$$.fragment,e),$i=d(e),je=n(e,"P",{});var On=l(je);Bl=a(On,"Then pass the local path to "),ht=n(On,"A",{href:!0});var ac=l(ht);Wl=a(ac,"from_pretrained()"),ac.forEach(t),Vl=a(On,":"),On.forEach(t),Di=d(e),h(bs.$$.fragment,e),ji=d(e),ke=n(e,"P",{});var zn=l(ke);Jl=a(zn,"The "),mt=n(zn,"A",{href:!0});var ic=l(mt);Ql=a(ic,"from_pretrained()"),ic.forEach(t),Xl=a(zn," method won\u2019t download any files from the Hub when it detects a local path, but this also means it won\u2019t download and cache the latest changes to a checkpoint."),zn.forEach(t),ki=d(e),le=n(e,"H3",{class:!0});var Fn=l(le);Pe=n(Fn,"A",{id:!0,class:!0,href:!0});var nc=l(Pe);Eo=n(nc,"SPAN",{});var lc=l(Eo);h(gs.$$.fragment,lc),lc.forEach(t),nc.forEach(t),Zl=d(Fn),$o=n(Fn,"SPAN",{});var rc=l($o);er=a(rc,"Swap components in a pipeline"),rc.forEach(t),Fn.forEach(t),Pi=d(e),_t=n(e,"P",{});var fc=l(_t);sr=a(fc,"You can customize the default components of any pipeline with another compatible component. Customization is important because:"),fc.forEach(t),qi=d(e),V=n(e,"UL",{});var Bt=l(V);Do=n(Bt,"LI",{});var pc=l(Do);tr=a(pc,"Changing the scheduler is important for exploring the trade-off between generation speed and quality."),pc.forEach(t),or=d(Bt),jo=n(Bt,"LI",{});var dc=l(jo);ar=a(dc,"Different components of a model are typically trained independently and you can swap out a component with a better-performing one."),dc.forEach(t),ir=d(Bt),ko=n(Bt,"LI",{});var uc=l(ko);nr=a(uc,"During finetuning, usually only some components - like the UNet or text encoder - are trained."),uc.forEach(t),Bt.forEach(t),Si=d(e),qe=n(e,"P",{});var Un=l(qe);lr=a(Un,"To find out which schedulers are compatible for customization, you can use the "),Po=n(Un,"CODE",{});var cc=l(Po);rr=a(cc,"compatibles"),cc.forEach(t),fr=a(Un," method:"),Un.forEach(t),xi=d(e),h(Es.$$.fragment,e),Ai=d(e),q=n(e,"P",{});var R=l(q);pr=a(R,"Let\u2019s use the "),vt=n(R,"A",{href:!0});var hc=l(vt);dr=a(hc,"SchedulerMixin.from_pretrained()"),hc.forEach(t),ur=a(R," method to replace the default "),wt=n(R,"A",{href:!0});var mc=l(wt);cr=a(mc,"PNDMScheduler"),mc.forEach(t),hr=a(R," with a more performant scheduler, "),yt=n(R,"A",{href:!0});var _c=l(yt);mr=a(_c,"EulerDiscreteScheduler"),_c.forEach(t),_r=a(R,". The "),qo=n(R,"CODE",{});var vc=l(qo);vr=a(vc,'subfolder="scheduler"'),vc.forEach(t),wr=a(R," argument is required to load the scheduler configuration from the correct "),$s=n(R,"A",{href:!0,rel:!0});var wc=l($s);yr=a(wc,"subfolder"),wc.forEach(t),br=a(R," of the pipeline repository."),R.forEach(t),Ci=d(e),z=n(e,"P",{});var os=l(z);gr=a(os,"Then you can pass the new "),bt=n(os,"A",{href:!0});var yc=l(bt);Er=a(yc,"EulerDiscreteScheduler"),yc.forEach(t),$r=a(os," instance to the "),So=n(os,"CODE",{});var bc=l(So);Dr=a(bc,"scheduler"),bc.forEach(t),jr=a(os," argument in "),gt=n(os,"A",{href:!0});var gc=l(gt);kr=a(gc,"DiffusionPipeline"),gc.forEach(t),Pr=a(os,":"),os.forEach(t),Mi=d(e),h(Ds.$$.fragment,e),Ti=d(e),re=n(e,"H3",{class:!0});var Yn=l(re);Se=n(Yn,"A",{id:!0,class:!0,href:!0});var Ec=l(Se);xo=n(Ec,"SPAN",{});var $c=l(xo);h(js.$$.fragment,$c),$c.forEach(t),Ec.forEach(t),qr=d(Yn),Ao=n(Yn,"SPAN",{});var Dc=l(Ao);Sr=a(Dc,"Safety checker"),Dc.forEach(t),Yn.forEach(t),Ii=d(e),F=n(e,"P",{});var as=l(F);xr=a(as,"Diffusion models like Stable Diffusion can generate harmful content, which is why \u{1F9E8} Diffusers has a "),ks=n(as,"A",{href:!0,rel:!0});var jc=l(ks);Ar=a(jc,"safety checker"),jc.forEach(t),Cr=a(as," to check generated outputs against known hardcoded NSFW content. If you\u2019d like to disable the safety checker for whatever reason, pass "),Co=n(as,"CODE",{});var kc=l(Co);Mr=a(kc,"None"),kc.forEach(t),Tr=a(as," to the "),Mo=n(as,"CODE",{});var Pc=l(Mo);Ir=a(Pc,"safety_checker"),Pc.forEach(t),Lr=a(as," argument:"),as.forEach(t),Li=d(e),h(Ps.$$.fragment,e),Ni=d(e),fe=n(e,"H3",{class:!0});var Hn=l(fe);xe=n(Hn,"A",{id:!0,class:!0,href:!0});var qc=l(xe);To=n(qc,"SPAN",{});var Sc=l(To);h(qs.$$.fragment,Sc),Sc.forEach(t),qc.forEach(t),Nr=d(Hn),Io=n(Hn,"SPAN",{});var xc=l(Io);Or=a(xc,"Reuse components across pipelines"),xc.forEach(t),Hn.forEach(t),Oi=d(e),Ae=n(e,"P",{});var Rn=l(Ae);zr=a(Rn,"You can also reuse the same components in multiple pipelines to avoid loading the weights into RAM twice. Use the "),Et=n(Rn,"A",{href:!0});var Ac=l(Et);Fr=a(Ac,"components"),Ac.forEach(t),Ur=a(Rn," method to save the components:"),Rn.forEach(t),zi=d(e),h(Ss.$$.fragment,e),Fi=d(e),Ce=n(e,"P",{});var Gn=l(Ce);Yr=a(Gn,"Then you can pass the "),Lo=n(Gn,"CODE",{});var Cc=l(Lo);Hr=a(Cc,"components"),Cc.forEach(t),Rr=a(Gn," to another pipeline without reloading the weights into RAM:"),Gn.forEach(t),Ui=d(e),h(xs.$$.fragment,e),Yi=d(e),$t=n(e,"P",{});var Mc=l($t);Gr=a(Mc,"You can also pass the components individually to the pipeline if you want more flexibility over which components to reuse or disable. For example, to reuse the same components in the text-to-image pipeline, except for the safety checker and feature extractor, in the image-to-image pipeline:"),Mc.forEach(t),Hi=d(e),h(As.$$.fragment,e),Ri=d(e),pe=n(e,"H2",{class:!0});var Kn=l(pe);Me=n(Kn,"A",{id:!0,class:!0,href:!0});var Tc=l(Me);No=n(Tc,"SPAN",{});var Ic=l(No);h(Cs.$$.fragment,Ic),Ic.forEach(t),Tc.forEach(t),Kr=d(Kn),Oo=n(Kn,"SPAN",{});var Lc=l(Oo);Br=a(Lc,"Checkpoint variants"),Lc.forEach(t),Kn.forEach(t),Gi=d(e),Dt=n(e,"P",{});var Nc=l(Dt);Wr=a(Nc,"A checkpoint variant is usually a checkpoint where it\u2019s weights are:"),Nc.forEach(t),Ki=d(e),Te=n(e,"UL",{});var Bn=l(Te);Ms=n(Bn,"LI",{});var Wn=l(Ms);Vr=a(Wn,"Stored in a different floating point type for lower precision and lower storage, such as "),Ts=n(Wn,"A",{href:!0,rel:!0});var Oc=l(Ts);zo=n(Oc,"CODE",{});var zc=l(zo);Jr=a(zc,"torch.float16"),zc.forEach(t),Oc.forEach(t),Qr=a(Wn,", because it only requires half the bandwidth and storage to download. You can\u2019t use this variant if you\u2019re continuing training or using a CPU."),Wn.forEach(t),Xr=d(Bn),Fo=n(Bn,"LI",{});var Fc=l(Fo);Zr=a(Fc,"Non-exponential mean averaged (EMA) weights which shouldn\u2019t be used for inference. You should use these to continue finetuning a model."),Fc.forEach(t),Bn.forEach(t),Bi=d(e),h(Ie.$$.fragment,e),Wi=d(e),J=n(e,"P",{});var Wt=l(J);ef=a(Wt,"Otherwise, a variant is "),Uo=n(Wt,"STRONG",{});var Uc=l(Uo);sf=a(Uc,"identical"),Uc.forEach(t),tf=a(Wt," to the original checkpoint. They have exactly the same serialization format (like "),jt=n(Wt,"A",{href:!0});var Yc=l(jt);of=a(Yc,"Safetensors"),Yc.forEach(t),af=a(Wt,"), model structure, and weights have identical tensor shapes."),Wt.forEach(t),Vi=d(e),Le=n(e,"TABLE",{});var Vn=l(Le);Yo=n(Vn,"THEAD",{});var Hc=l(Yo);de=n(Hc,"TR",{});var Vt=l(de);Ho=n(Vt,"TH",{});var Rc=l(Ho);Ro=n(Rc,"STRONG",{});var Gc=l(Ro);nf=a(Gc,"checkpoint type"),Gc.forEach(t),Rc.forEach(t),lf=d(Vt),Go=n(Vt,"TH",{});var Kc=l(Go);Ko=n(Kc,"STRONG",{});var Bc=l(Ko);rf=a(Bc,"weight name"),Bc.forEach(t),Kc.forEach(t),ff=d(Vt),Bo=n(Vt,"TH",{});var Wc=l(Bo);Wo=n(Wc,"STRONG",{});var Vc=l(Wo);pf=a(Vc,"argument for loading weights"),Vc.forEach(t),Wc.forEach(t),Vt.forEach(t),Hc.forEach(t),df=d(Vn),ue=n(Vn,"TBODY",{});var Jt=l(ue);ce=n(Jt,"TR",{});var Qt=l(ce);Vo=n(Qt,"TD",{});var Jc=l(Vo);uf=a(Jc,"original"),Jc.forEach(t),cf=d(Qt),Jo=n(Qt,"TD",{});var Qc=l(Jo);hf=a(Qc,"diffusion_pytorch_model.bin"),Qc.forEach(t),mf=d(Qt),Ji=n(Qt,"TD",{}),l(Ji).forEach(t),Qt.forEach(t),_f=d(Jt),he=n(Jt,"TR",{});var Xt=l(he);Qo=n(Xt,"TD",{});var Xc=l(Qo);vf=a(Xc,"floating point"),Xc.forEach(t),wf=d(Xt),Xo=n(Xt,"TD",{});var Zc=l(Xo);yf=a(Zc,"diffusion_pytorch_model.fp16.bin"),Zc.forEach(t),bf=d(Xt),Is=n(Xt,"TD",{});var Jn=l(Is);Zo=n(Jn,"CODE",{});var eh=l(Zo);gf=a(eh,"variant"),eh.forEach(t),Ef=a(Jn,", "),ea=n(Jn,"CODE",{});var sh=l(ea);$f=a(sh,"torch_dtype"),sh.forEach(t),Jn.forEach(t),Xt.forEach(t),Df=d(Jt),me=n(Jt,"TR",{});var Zt=l(me);sa=n(Zt,"TD",{});var th=l(sa);jf=a(th,"non-EMA"),th.forEach(t),kf=d(Zt),ta=n(Zt,"TD",{});var oh=l(ta);Pf=a(oh,"diffusion_pytorch_model.non_ema.bin"),oh.forEach(t),qf=d(Zt),oa=n(Zt,"TD",{});var ah=l(oa);aa=n(ah,"CODE",{});var ih=l(aa);Sf=a(ih,"variant"),ih.forEach(t),ah.forEach(t),Zt.forEach(t),Jt.forEach(t),Vn.forEach(t),Qi=d(e),kt=n(e,"P",{});var nh=l(kt);xf=a(nh,"There are two important arguments to know for loading variants:"),nh.forEach(t),Xi=d(e),Ne=n(e,"UL",{});var Qn=l(Ne);ia=n(Qn,"LI",{});var lh=l(ia);b=n(lh,"P",{});var g=l(b);na=n(g,"CODE",{});var rh=l(na);Af=a(rh,"torch_dtype"),rh.forEach(t),Cf=a(g," defines the floating point precision of the loaded checkpoints. For example, if you want to save bandwidth by loading a "),la=n(g,"CODE",{});var fh=l(la);Mf=a(fh,"fp16"),fh.forEach(t),Tf=a(g," variant, you should specify "),ra=n(g,"CODE",{});var ph=l(ra);If=a(ph,"torch_dtype=torch.float16"),ph.forEach(t),Lf=a(g," to "),fa=n(g,"EM",{});var dh=l(fa);Nf=a(dh,"convert the weights"),dh.forEach(t),Of=a(g," to "),pa=n(g,"CODE",{});var uh=l(pa);zf=a(uh,"fp16"),uh.forEach(t),Ff=a(g,". Otherwise, the "),da=n(g,"CODE",{});var ch=l(da);Uf=a(ch,"fp16"),ch.forEach(t),Yf=a(g," weights are converted to the default "),ua=n(g,"CODE",{});var hh=l(ua);Hf=a(hh,"fp32"),hh.forEach(t),Rf=a(g," precision. You can also load the original checkpoint without defining the "),ca=n(g,"CODE",{});var mh=l(ca);Gf=a(mh,"variant"),mh.forEach(t),Kf=a(g," argument, and convert it to "),ha=n(g,"CODE",{});var _h=l(ha);Bf=a(_h,"fp16"),_h.forEach(t),Wf=a(g," with "),ma=n(g,"CODE",{});var vh=l(ma);Vf=a(vh,"torch_dtype=torch.float16"),vh.forEach(t),Jf=a(g,". In this case, the default "),_a=n(g,"CODE",{});var wh=l(_a);Qf=a(wh,"fp32"),wh.forEach(t),Xf=a(g," weights are downloaded first, and then they\u2019re converted to "),va=n(g,"CODE",{});var yh=l(va);Zf=a(yh,"fp16"),yh.forEach(t),ep=a(g," after loading."),g.forEach(t),lh.forEach(t),sp=d(Qn),wa=n(Qn,"LI",{});var bh=l(wa);A=n(bh,"P",{});var B=l(A);ya=n(B,"CODE",{});var gh=l(ya);tp=a(gh,"variant"),gh.forEach(t),op=a(B," defines which files should be loaded from the repository. For example, if you want to load a "),ba=n(B,"CODE",{});var Eh=l(ba);ap=a(Eh,"non_ema"),Eh.forEach(t),ip=a(B," variant from the "),Ls=n(B,"A",{href:!0,rel:!0});var $h=l(Ls);ga=n($h,"CODE",{});var Dh=l(ga);np=a(Dh,"diffusers/stable-diffusion-variants"),Dh.forEach(t),$h.forEach(t),lp=a(B," repository, you should specify "),Ea=n(B,"CODE",{});var jh=l(Ea);rp=a(jh,'variant="non_ema"'),jh.forEach(t),fp=a(B," to download the "),$a=n(B,"CODE",{});var kh=l($a);pp=a(kh,"non_ema"),kh.forEach(t),dp=a(B," files."),B.forEach(t),bh.forEach(t),Qn.forEach(t),Zi=d(e),h(Ns.$$.fragment,e),en=d(e),Q=n(e,"P",{});var eo=l(Q);up=a(eo,"To save a checkpoint stored in a different floating point type or as a non-EMA variant, use the "),Pt=n(eo,"A",{href:!0});var Ph=l(Pt);cp=a(Ph,"DiffusionPipeline.save_pretrained()"),Ph.forEach(t),hp=a(eo," method and specify the "),Da=n(eo,"CODE",{});var qh=l(Da);mp=a(qh,"variant"),qh.forEach(t),_p=a(eo," argument. You should try and save a variant to the same folder as the original checkpoint, so you can load both from the same folder:"),eo.forEach(t),sn=d(e),h(Os.$$.fragment,e),tn=d(e),X=n(e,"P",{});var so=l(X);vp=a(so,"If you don\u2019t save the variant to an existing folder, you must specify the "),ja=n(so,"CODE",{});var Sh=l(ja);wp=a(Sh,"variant"),Sh.forEach(t),yp=a(so," argument otherwise it\u2019ll throw an "),ka=n(so,"CODE",{});var xh=l(ka);bp=a(xh,"Exception"),xh.forEach(t),gp=a(so," because it can\u2019t find the original checkpoint:"),so.forEach(t),on=d(e),h(zs.$$.fragment,e),an=d(e),_e=n(e,"H2",{class:!0});var Xn=l(_e);Oe=n(Xn,"A",{id:!0,class:!0,href:!0});var Ah=l(Oe);Pa=n(Ah,"SPAN",{});var Ch=l(Pa);h(Fs.$$.fragment,Ch),Ch.forEach(t),Ah.forEach(t),Ep=d(Xn),qa=n(Xn,"SPAN",{});var Mh=l(qa);$p=a(Mh,"Models"),Mh.forEach(t),Xn.forEach(t),nn=d(e),Z=n(e,"P",{});var to=l(Z);Dp=a(to,"Models are loaded from the "),qt=n(to,"A",{href:!0});var Th=l(qt);jp=a(Th,"ModelMixin.from_pretrained()"),Th.forEach(t),kp=a(to," method, which downloads and caches the latest version of the model weights and configurations. If the latest files are available in the local cache, "),St=n(to,"A",{href:!0});var Ih=l(St);Pp=a(Ih,"from_pretrained()"),Ih.forEach(t),qp=a(to," reuses files in the cache instead of redownloading them."),to.forEach(t),ln=d(e),U=n(e,"P",{});var is=l(U);Sp=a(is,"Models can be loaded from a subfolder with the "),Sa=n(is,"CODE",{});var Lh=l(Sa);xp=a(Lh,"subfolder"),Lh.forEach(t),Ap=a(is," argument. For example, the model weights for "),xa=n(is,"CODE",{});var Nh=l(xa);Cp=a(Nh,"runwayml/stable-diffusion-v1-5"),Nh.forEach(t),Mp=a(is," are stored in the "),Us=n(is,"A",{href:!0,rel:!0});var Oh=l(Us);Aa=n(Oh,"CODE",{});var zh=l(Aa);Tp=a(zh,"unet"),zh.forEach(t),Oh.forEach(t),Ip=a(is," subfolder:"),is.forEach(t),rn=d(e),h(Ys.$$.fragment,e),fn=d(e),ze=n(e,"P",{});var Zn=l(ze);Lp=a(Zn,"Or directly from a repository\u2019s "),Hs=n(Zn,"A",{href:!0,rel:!0});var Fh=l(Hs);Np=a(Fh,"directory"),Fh.forEach(t),Op=a(Zn,":"),Zn.forEach(t),pn=d(e),h(Rs.$$.fragment,e),dn=d(e),Y=n(e,"P",{});var ns=l(Y);zp=a(ns,"You can also load and save model variants by specifying the "),Ca=n(ns,"CODE",{});var Uh=l(Ca);Fp=a(Uh,"variant"),Uh.forEach(t),Up=a(ns," argument in "),xt=n(ns,"A",{href:!0});var Yh=l(xt);Yp=a(Yh,"ModelMixin.from_pretrained()"),Yh.forEach(t),Hp=a(ns," and "),At=n(ns,"A",{href:!0});var Hh=l(At);Rp=a(Hh,"ModelMixin.save_pretrained()"),Hh.forEach(t),Gp=a(ns,":"),ns.forEach(t),un=d(e),h(Gs.$$.fragment,e),cn=d(e),ve=n(e,"H2",{class:!0});var el=l(ve);Fe=n(el,"A",{id:!0,class:!0,href:!0});var Rh=l(Fe);Ma=n(Rh,"SPAN",{});var Gh=l(Ma);h(Ks.$$.fragment,Gh),Gh.forEach(t),Rh.forEach(t),Kp=d(el),Ta=n(el,"SPAN",{});var Kh=l(Ta);Bp=a(Kh,"Schedulers"),Kh.forEach(t),el.forEach(t),hn=d(e),H=n(e,"P",{});var ls=l(H);Wp=a(ls,"Schedulers are loaded from the "),Ct=n(ls,"A",{href:!0});var Bh=l(Ct);Vp=a(Bh,"SchedulerMixin.from_pretrained()"),Bh.forEach(t),Jp=a(ls," method, and unlike models, schedulers are "),Ia=n(ls,"STRONG",{});var Wh=l(Ia);Qp=a(Wh,"not parameterized"),Wh.forEach(t),Xp=a(ls," or "),La=n(ls,"STRONG",{});var Vh=l(La);Zp=a(Vh,"trained"),Vh.forEach(t),ed=a(ls,"; they are defined by a configuration file."),ls.forEach(t),mn=d(e),Ue=n(e,"P",{});var sl=l(Ue);sd=a(sl,`Loading schedulers does not consume any significant amount of memory and the same configuration file can be used for a variety of different schedulers.
For example, the following schedulers are compatible with `),Mt=n(sl,"A",{href:!0});var Jh=l(Mt);td=a(Jh,"StableDiffusionPipeline"),Jh.forEach(t),od=a(sl," which means you can load the same scheduler configuration file in any of these classes:"),sl.forEach(t),_n=d(e),h(Bs.$$.fragment,e),vn=d(e),we=n(e,"H2",{class:!0});var tl=l(we);Ye=n(tl,"A",{id:!0,class:!0,href:!0});var Qh=l(Ye);Na=n(Qh,"SPAN",{});var Xh=l(Na);h(Ws.$$.fragment,Xh),Xh.forEach(t),Qh.forEach(t),ad=d(tl),Oa=n(tl,"SPAN",{});var Zh=l(Oa);id=a(Zh,"DiffusionPipeline explained"),Zh.forEach(t),tl.forEach(t),wn=d(e),He=n(e,"P",{});var ol=l(He);nd=a(ol,"As a class method, "),Tt=n(ol,"A",{href:!0});var em=l(Tt);ld=a(em,"DiffusionPipeline.from_pretrained()"),em.forEach(t),rd=a(ol," is responsible for two things:"),ol.forEach(t),yn=d(e),Re=n(e,"UL",{});var al=l(Re);Vs=n(al,"LI",{});var il=l(Vs);fd=a(il,"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, "),It=n(il,"A",{href:!0});var sm=l(It);pd=a(sm,"DiffusionPipeline.from_pretrained()"),sm.forEach(t),dd=a(il," reuses the cache and won\u2019t redownload the files."),il.forEach(t),ud=d(al),ye=n(al,"LI",{});var oo=l(ye);cd=a(oo,"Load the cached weights into the correct pipeline "),Lt=n(oo,"A",{href:!0});var tm=l(Lt);hd=a(tm,"class"),tm.forEach(t),md=a(oo," - retrieved from the "),za=n(oo,"CODE",{});var om=l(za);_d=a(om,"model_index.json"),om.forEach(t),vd=a(oo," file - and return an instance of it."),oo.forEach(t),al.forEach(t),bn=d(e),ee=n(e,"P",{});var ao=l(ee);wd=a(ao,"The pipelines underlying folder structure corresponds directly with their class instances. For example, the "),Nt=n(ao,"A",{href:!0});var am=l(Nt);yd=a(am,"StableDiffusionPipeline"),am.forEach(t),bd=a(ao," corresponds to the folder structure in "),Js=n(ao,"A",{href:!0,rel:!0});var im=l(Js);Fa=n(im,"CODE",{});var nm=l(Fa);gd=a(nm,"runwayml/stable-diffusion-v1-5"),nm.forEach(t),im.forEach(t),Ed=a(ao,"."),ao.forEach(t),gn=d(e),h(Qs.$$.fragment,e),En=d(e),Ge=n(e,"P",{});var nl=l(Ge);$d=a(nl,"You\u2019ll see pipeline is an instance of "),Ot=n(nl,"A",{href:!0});var lm=l(Ot);Dd=a(lm,"StableDiffusionPipeline"),lm.forEach(t),jd=a(nl,", which consists of seven components:"),nl.forEach(t),$n=d(e),k=n(e,"UL",{});var C=l(k);Ke=n(C,"LI",{});var ti=l(Ke);Ua=n(ti,"CODE",{});var rm=l(Ua);kd=a(rm,'"feature_extractor"'),rm.forEach(t),Pd=a(ti,": a "),Xs=n(ti,"A",{href:!0,rel:!0});var fm=l(Xs);qd=a(fm,"CLIPFeatureExtractor"),fm.forEach(t),Sd=a(ti," from \u{1F917} Transformers."),ti.forEach(t),xd=d(C),Be=n(C,"LI",{});var oi=l(Be);Ya=n(oi,"CODE",{});var pm=l(Ya);Ad=a(pm,'"safety_checker"'),pm.forEach(t),Cd=a(oi,": a "),Zs=n(oi,"A",{href:!0,rel:!0});var dm=l(Zs);Md=a(dm,"component"),dm.forEach(t),Td=a(oi," for screening against harmful content."),oi.forEach(t),Id=d(C),We=n(C,"LI",{});var ai=l(We);Ha=n(ai,"CODE",{});var um=l(Ha);Ld=a(um,'"scheduler"'),um.forEach(t),Nd=a(ai,": an instance of "),zt=n(ai,"A",{href:!0});var cm=l(zt);Od=a(cm,"PNDMScheduler"),cm.forEach(t),zd=a(ai,"."),ai.forEach(t),Fd=d(C),Ve=n(C,"LI",{});var ii=l(Ve);Ra=n(ii,"CODE",{});var hm=l(Ra);Ud=a(hm,'"text_encoder"'),hm.forEach(t),Yd=a(ii,": a "),et=n(ii,"A",{href:!0,rel:!0});var mm=l(et);Hd=a(mm,"CLIPTextModel"),mm.forEach(t),Rd=a(ii," from \u{1F917} Transformers."),ii.forEach(t),Gd=d(C),Je=n(C,"LI",{});var ni=l(Je);Ga=n(ni,"CODE",{});var _m=l(Ga);Kd=a(_m,'"tokenizer"'),_m.forEach(t),Bd=a(ni,": a "),st=n(ni,"A",{href:!0,rel:!0});var vm=l(st);Wd=a(vm,"CLIPTokenizer"),vm.forEach(t),Vd=a(ni," from \u{1F917} Transformers."),ni.forEach(t),Jd=d(C),Qe=n(C,"LI",{});var li=l(Qe);Ka=n(li,"CODE",{});var wm=l(Ka);Qd=a(wm,'"unet"'),wm.forEach(t),Xd=a(li,": an instance of "),Ft=n(li,"A",{href:!0});var ym=l(Ft);Zd=a(ym,"UNet2DConditionModel"),ym.forEach(t),eu=a(li,"."),li.forEach(t),su=d(C),Xe=n(C,"LI",{});var ri=l(Xe);Ba=n(ri,"CODE",{});var bm=l(Ba);tu=a(bm,'"vae"'),bm.forEach(t),ou=a(ri," an instance of "),Ut=n(ri,"A",{href:!0});var gm=l(Ut);au=a(gm,"AutoencoderKL"),gm.forEach(t),iu=a(ri,"."),ri.forEach(t),C.forEach(t),Dn=d(e),h(tt.$$.fragment,e),jn=d(e),Ze=n(e,"P",{});var ll=l(Ze);nu=a(ll,"Compare the components of the pipeline instance to the "),ot=n(ll,"A",{href:!0,rel:!0});var Em=l(ot);Wa=n(Em,"CODE",{});var $m=l(Wa);lu=a($m,"runwayml/stable-diffusion-v1-5"),$m.forEach(t),Em.forEach(t),ru=a(ll," folder structure, and you\u2019ll see there is a separate folder for each of the components in the repository:"),ll.forEach(t),kn=d(e),h(at.$$.fragment,e),Pn=d(e),Yt=n(e,"P",{});var Dm=l(Yt);fu=a(Dm,"You can access each of the components of the pipeline as an attribute to view its configuration:"),Dm.forEach(t),qn=d(e),h(it.$$.fragment,e),Sn=d(e),se=n(e,"P",{});var io=l(se);pu=a(io,"Every pipeline expects a "),Va=n(io,"CODE",{});var jm=l(Va);du=a(jm,"model_index.json"),jm.forEach(t),uu=a(io," file that tells the "),Ht=n(io,"A",{href:!0});var km=l(Ht);cu=a(km,"DiffusionPipeline"),km.forEach(t),hu=a(io,":"),io.forEach(t),xn=d(e),te=n(e,"UL",{});var no=l(te);Rt=n(no,"LI",{});var qu=l(Rt);mu=a(qu,"which pipeline class to load from "),Ja=n(qu,"CODE",{});var Pm=l(Ja);_u=a(Pm,"_class_name"),Pm.forEach(t),qu.forEach(t),vu=d(no),Gt=n(no,"LI",{});var Su=l(Gt);wu=a(Su,"which version of \u{1F9E8} Diffusers was used to create the model in "),Qa=n(Su,"CODE",{});var qm=l(Qa);yu=a(qm,"_diffusers_version"),qm.forEach(t),Su.forEach(t),bu=d(no),K=n(no,"LI",{});var rs=l(K);gu=a(rs,"what components from which library are stored in the subfolders ("),Xa=n(rs,"CODE",{});var Sm=l(Xa);Eu=a(Sm,"name"),Sm.forEach(t),$u=a(rs," corresponds to the component and subfolder name, "),Za=n(rs,"CODE",{});var xm=l(Za);Du=a(xm,"library"),xm.forEach(t),ju=a(rs," corresponds to the name of the library to load the class from, and "),ei=n(rs,"CODE",{});var Am=l(ei);ku=a(Am,"class"),Am.forEach(t),Pu=a(rs," corresponds to the class name)"),rs.forEach(t),no.forEach(t),An=d(e),h(nt.$$.fragment,e),this.h()},h(){u(y,"name","hf:doc:metadata"),u(y,"content",JSON.stringify(Um)),u(P,"id","load-pipelines-models-and-schedulers"),u(P,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(P,"href","#load-pipelines-models-and-schedulers"),u($,"class","relative group"),u(ft,"href","/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),u(ge,"id","diffusion-pipeline"),u(ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(ge,"href","#diffusion-pipeline"),u(ie,"class","relative group"),u(dt,"href","/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),u(ps,"href","https://huggingface.co/models?library=diffusers"),u(ps,"rel","nofollow"),u(ut,"href","/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline.from_pretrained"),u(ct,"href","/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),u(cs,"href","https://huggingface.co/CompVis/stable-diffusion-v1-4"),u(cs,"rel","nofollow"),u(hs,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5"),u(hs,"rel","nofollow"),u(De,"id","local-pipeline"),u(De,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(De,"href","#local-pipeline"),u(ne,"class","relative group"),u(vs,"href","https://git-lfs.github.com/"),u(vs,"rel","nofollow"),u(ws,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5"),u(ws,"rel","nofollow"),u(ht,"href","/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline.from_pretrained"),u(mt,"href","/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline.from_pretrained"),u(Pe,"id","swap-components-in-a-pipeline"),u(Pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(Pe,"href","#swap-components-in-a-pipeline"),u(le,"class","relative group"),u(vt,"href","/docs/diffusers/v0.16.0/en/api/schedulers/overview#diffusers.SchedulerMixin.from_pretrained"),u(wt,"href","/docs/diffusers/v0.16.0/en/api/schedulers/pndm#diffusers.PNDMScheduler"),u(yt,"href","/docs/diffusers/v0.16.0/en/api/schedulers/euler#diffusers.EulerDiscreteScheduler"),u($s,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5/tree/main/scheduler"),u($s,"rel","nofollow"),u(bt,"href","/docs/diffusers/v0.16.0/en/api/schedulers/euler#diffusers.EulerDiscreteScheduler"),u(gt,"href","/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline"),u(Se,"id","safety-checker"),u(Se,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(Se,"href","#safety-checker"),u(re,"class","relative group"),u(ks,"href","https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/safety_checker.py"),u(ks,"rel","nofollow"),u(xe,"id","reuse-components-across-pipelines"),u(xe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(xe,"href","#reuse-components-across-pipelines"),u(fe,"class","relative group"),u(Et,"href","/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline.components"),u(Me,"id","checkpoint-variants"),u(Me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(Me,"href","#checkpoint-variants"),u(pe,"class","relative group"),u(Ts,"href","https://pytorch.org/docs/stable/tensors.html#data-types"),u(Ts,"rel","nofollow"),u(jt,"href","./using-diffusers/using_safetensors"),u(Ls,"href","https://huggingface.co/diffusers/stable-diffusion-variants/tree/main/unet"),u(Ls,"rel","nofollow"),u(Pt,"href","/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline.save_pretrained"),u(Oe,"id","models"),u(Oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(Oe,"href","#models"),u(_e,"class","relative group"),u(qt,"href","/docs/diffusers/v0.16.0/en/api/models#diffusers.ModelMixin.from_pretrained"),u(St,"href","/docs/diffusers/v0.16.0/en/api/models#diffusers.ModelMixin.from_pretrained"),u(Us,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5/tree/main/unet"),u(Us,"rel","nofollow"),u(Hs,"href","https://huggingface.co/google/ddpm-cifar10-32/tree/main"),u(Hs,"rel","nofollow"),u(xt,"href","/docs/diffusers/v0.16.0/en/api/models#diffusers.ModelMixin.from_pretrained"),u(At,"href","/docs/diffusers/v0.16.0/en/api/models#diffusers.ModelMixin.save_pretrained"),u(Fe,"id","schedulers"),u(Fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(Fe,"href","#schedulers"),u(ve,"class","relative group"),u(Ct,"href","/docs/diffusers/v0.16.0/en/api/schedulers/overview#diffusers.SchedulerMixin.from_pretrained"),u(Mt,"href","/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),u(Ye,"id","diffusionpipeline-explained"),u(Ye,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(Ye,"href","#diffusionpipeline-explained"),u(we,"class","relative group"),u(Tt,"href","/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline.from_pretrained"),u(It,"href","/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline.from_pretrained"),u(Lt,"href","./api/pipelines/overview#diffusers-summary"),u(Nt,"href","/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),u(Js,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5"),u(Js,"rel","nofollow"),u(Ot,"href","/docs/diffusers/v0.16.0/en/api/pipelines/stable_diffusion/text2img#diffusers.StableDiffusionPipeline"),u(Xs,"href","https://huggingface.co/docs/transformers/v4.28.1/en/model_doc/clip#transformers.CLIPFeatureExtractor"),u(Xs,"rel","nofollow"),u(Zs,"href","https://github.com/huggingface/diffusers/blob/e55687e1e15407f60f32242027b7bb8170e58266/src/diffusers/pipelines/stable_diffusion/safety_checker.py#L32"),u(Zs,"rel","nofollow"),u(zt,"href","/docs/diffusers/v0.16.0/en/api/schedulers/pndm#diffusers.PNDMScheduler"),u(et,"href","https://huggingface.co/docs/transformers/v4.28.1/en/model_doc/clip#transformers.CLIPTextModel"),u(et,"rel","nofollow"),u(st,"href","https://huggingface.co/docs/transformers/v4.28.1/en/model_doc/clip#transformers.CLIPTokenizer"),u(st,"rel","nofollow"),u(Ft,"href","/docs/diffusers/v0.16.0/en/api/models#diffusers.UNet2DConditionModel"),u(Ut,"href","/docs/diffusers/v0.16.0/en/api/models#diffusers.AutoencoderKL"),u(ot,"href","https://huggingface.co/runwayml/stable-diffusion-v1-5"),u(ot,"rel","nofollow"),u(Ht,"href","/docs/diffusers/v0.16.0/en/api/diffusion_pipeline#diffusers.DiffusionPipeline")},m(e,r){s(document.head,y),f(e,I,r),f(e,$,r),s($,P),s(P,M),m(j,M,null),s($,G),s($,T),s(T,S),f(e,D,r),f(e,x,r),s(x,ae),s(x,ft),s(ft,rl),s(x,fl),f(e,fi,r),f(e,be,r),s(be,pl),s(be,lo),s(lo,dl),s(be,ul),f(e,pi,r),f(e,pt,r),s(pt,cl),f(e,di,r),f(e,L,r),s(L,ro),s(ro,hl),s(L,ml),s(L,fo),s(fo,_l),s(L,vl),s(L,po),s(po,wl),s(L,yl),s(L,uo),s(uo,bl),f(e,ui,r),f(e,ie,r),s(ie,ge),s(ge,co),m(fs,co,null),s(ie,gl),s(ie,ho),s(ho,El),f(e,ci,r),m(Ee,e,r),f(e,hi,r),f(e,N,r),s(N,$l),s(N,dt),s(dt,Dl),s(N,jl),s(N,ps),s(ps,kl),s(N,Pl),s(N,ut),s(ut,ql),s(N,Sl),f(e,mi,r),m(ds,e,r),f(e,_i,r),f(e,$e,r),s($e,xl),s($e,ct),s(ct,Al),s($e,Cl),f(e,vi,r),m(us,e,r),f(e,wi,r),f(e,W,r),s(W,Ml),s(W,cs),s(cs,mo),s(mo,Tl),s(W,Il),s(W,hs),s(hs,_o),s(_o,Ll),s(W,Nl),f(e,yi,r),m(ms,e,r),f(e,bi,r),f(e,ne,r),s(ne,De),s(De,vo),m(_s,vo,null),s(ne,Ol),s(ne,wo),s(wo,zl),f(e,gi,r),f(e,O,r),s(O,Fl),s(O,vs),s(vs,yo),s(yo,Ul),s(O,Yl),s(O,ws),s(ws,bo),s(bo,Hl),s(O,Rl),s(O,go),s(go,Gl),s(O,Kl),f(e,Ei,r),m(ys,e,r),f(e,$i,r),f(e,je,r),s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ot,Wa),s(Wa,lu),s(Ze,ru),f(e,kn,r),m(at,e,r),f(e,Pn,r),f(e,Yt,r),s(Yt,fu),f(e,qn,r),m(it,e,r),f(e,Sn,r),f(e,se,r),s(se,pu),s(se,Va),s(Va,du),s(se,uu),s(se,Ht),s(Ht,cu),s(se,hu),f(e,xn,r),f(e,te,r),s(te,Rt),s(Rt,mu),s(Rt,Ja),s(Ja,_u),s(te,vu),s(te,Gt),s(Gt,wu),s(Gt,Qa),s(Qa,yu),s(te,bu),s(te,K),s(K,gu),s(K,Xa),s(Xa,Eu),s(K,$u),s(K,Za),s(Za,Du),s(K,ju),s(K,ei),s(ei,ku),s(K,Pu),f(e,An,r),m(nt,e,r),Cn=!0},p(e,[r]){const lt={};r&2&&(lt.$$scope={dirty:r,ctx:e}),Ee.$set(lt);const si={};r&2&&(si.$$scope={dirty:r,ctx:e}),Ie.$set(si)},i(e){Cn||(_(j.$$.fragment,e),_(fs.$$.fragment,e),_(Ee.$$.fragment,e),_(ds.$$.fragment,e),_(us.$$.fragment,e),_(ms.$$.fragment,e),_(_s.$$.fragment,e),_(ys.$$.fragment,e),_(bs.$$.fragment,e),_(gs.$$.fragment,e),_(Es.$$.fragment,e),_(Ds.$$.fragment,e),_(js.$$.fragment,e),_(Ps.$$.fragment,e),_(qs.$$.fragment,e),_(Ss.$$.fragment,e),_(xs.$$.fragment,e),_(As.$$.fragment,e),_(Cs.$$.fragment,e),_(Ie.$$.fragment,e),_(Ns.$$.fragment,e),_(Os.$$.fragment,e),_(zs.$$.fragment,e),_(Fs.$$.fragment,e),_(Ys.$$.fragment,e),_(Rs.$$.fragment,e),_(Gs.$$.fragment,e),_(Ks.$$.fragment,e),_(Bs.$$.fragment,e),_(Ws.$$.fragment,e),_(Qs.$$.fragment,e),_(tt.$$.fragment,e),_(at.$$.fragment,e),_(it.$$.fragment,e),_(nt.$$.fragment,e),Cn=!0)},o(e){v(j.$$.fragment,e),v(fs.$$.fragment,e),v(Ee.$$.fragment,e),v(ds.$$.fragment,e),v(us.$$.fragment,e),v(ms.$$.fragment,e),v(_s.$$.fragment,e),v(ys.$$.fragment,e),v(bs.$$.fragment,e),v(gs.$$.fragment,e),v(Es.$$.fragment,e),v(Ds.$$.fragment,e),v(js.$$.fragment,e),v(Ps.$$.fragment,e),v(qs.$$.fragment,e),v(Ss.$$.fragment,e),v(xs.$$.fragment,e),v(As.$$.fragment,e),v(Cs.$$.fragment,e),v(Ie.$$.fragment,e),v(Ns.$$.fragment,e),v(Os.$$.fragment,e),v(zs.$$.fragment,e),v(Fs.$$.fragment,e),v(Ys.$$.fragment,e),v(Rs.$$.fragment,e),v(Gs.$$.fragment,e),v(Ks.$$.fragment,e),v(Bs.$$.fragment,e),v(Ws.$$.fragment,e),v(Qs.$$.fragment,e),v(tt.$$.fragment,e),v(at.$$.fragment,e),v(it.$$.fragment,e),v(nt.$$.fragment,e),Cn=!1},d(e){t(y),e&&t(I),e&&t($),w(j),e&&t(D),e&&t(x),e&&t(fi),e&&t(be),e&&t(pi),e&&t(pt),e&&t(di),e&&t(L),e&&t(ui),e&&t(ie),w(fs),e&&t(ci),w(Ee,e),e&&t(hi),e&&t(N),e&&t(mi),w(ds,e),e&&t(_i),e&&t($e),e&&t(vi),w(us,e),e&&t(wi),e&&t(W),e&&t(yi),w(ms,e),e&&t(bi),e&&t(ne),w(_s),e&&t(gi),e&&t(O),e&&t(Ei),w(ys,e),e&&t($i),e&&t(je),e&&t(Di),w(bs,e),e&&t(ji),e&&t(ke),e&&t(ki),e&&t(le),w(gs),e&&t(Pi),e&&t(_t),e&&t(qi),e&&t(V),e&&t(Si),e&&t(qe),e&&t(xi),w(Es,e),e&&t(Ai),e&&t(q),e&&t(Ci),e&&t(z),e&&t(Mi),w(Ds,e),e&&t(Ti),e&&t(re),w(js),e&&t(Ii),e&&t(F),e&&t(Li),w(Ps,e),e&&t(Ni),e&&t(fe),w(qs),e&&t(Oi),e&&t(Ae),e&&t(zi),w(Ss,e),e&&t(Fi),e&&t(Ce),e&&t(Ui),w(xs,e),e&&t(Yi),e&&t($t),e&&t(Hi),w(As,e),e&&t(Ri),e&&t(pe),w(Cs),e&&t(Gi),e&&t(Dt),e&&t(Ki),e&&t(Te),e&&t(Bi),w(Ie,e),e&&t(Wi),e&&t(J),e&&t(Vi),e&&t(Le),e&&t(Qi),e&&t(kt),e&&t(Xi),e&&t(Ne),e&&t(Zi),w(Ns,e),e&&t(en),e&&t(Q),e&&t(sn),w(Os,e),e&&t(tn),e&&t(X),e&&t(on),w(zs,e),e&&t(an),e&&t(_e),w(Fs),e&&t(nn),e&&t(Z),e&&t(ln),e&&t(U),e&&t(rn),w(Ys,e),e&&t(fn),e&&t(ze),e&&t(pn),w(Rs,e),e&&t(dn),e&&t(Y),e&&t(un),w(Gs,e),e&&t(cn),e&&t(ve),w(Ks),e&&t(hn),e&&t(H),e&&t(mn),e&&t(Ue),e&&t(_n),w(Bs,e),e&&t(vn),e&&t(we),w(Ws),e&&t(wn),e&&t(He),e&&t(yn),e&&t(Re),e&&t(bn),e&&t(ee),e&&t(gn),w(Qs,e),e&&t(En),e&&t(Ge),e&&t($n),e&&t(k),e&&t(Dn),w(tt,e),e&&t(jn),e&&t(Ze),e&&t(kn),w(at,e),e&&t(Pn),e&&t(Yt),e&&t(qn),w(it,e),e&&t(Sn),e&&t(se),e&&t(xn),e&&t(te),e&&t(An),w(nt,e)}}}const Um={local:"load-pipelines-models-and-schedulers",sections:[{local:"diffusion-pipeline",sections:[{local:"local-pipeline",title:"Local pipeline"},{local:"swap-components-in-a-pipeline",title:"Swap components in a pipeline"},{local:"safety-checker",title:"Safety checker"},{local:"reuse-components-across-pipelines",title:"Reuse components across pipelines"}],title:"Diffusion Pipeline"},{local:"checkpoint-variants",sections:[{local:"using-revision-to-load-pipeline-variants-is-deprecated",title:"Using `revision` to load pipeline variants is deprecated"}],title:"Checkpoint variants"},{local:"models",title:"Models"},{local:"schedulers",title:"Schedulers"},{local:"diffusionpipeline-explained",title:"DiffusionPipeline explained"}],title:"Load pipelines, models, and schedulers"};function Ym(rt){return Nm(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Bm extends Mm{constructor(y){super();Tm(this,y,Ym,Fm,Im,{})}}export{Bm as default,Um as metadata};
