import{s as Tl,o as wl,n as el}from"../chunks/scheduler.5c93273d.js";import{S as $l,i as gl,g as f,s as i,r as M,A as jl,h as d,f as s,c as p,j as Zl,u as y,x as Z,k as Ae,y as Vl,a as t,v as U,d as h,t as b,w as J}from"../chunks/index.e43dd92b.js";import{C as $}from"../chunks/CodeBlock.6896320e.js";import{D as Gl}from"../chunks/DocNotebookDropdown.ea7270e6.js";import{H as de,E as vl}from"../chunks/getInferenceSnippets.bd93e167.js";import{H as Cl,a as Ke}from"../chunks/HfOption.d50154c3.js";function Sl(g){let a,T="<code>LMSDiscreteScheduler</code>通常能生成比默认调度器更高质量的图像。",u,o,c;return o=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMExNU0Rpc2NyZXRlU2NoZWR1bGVyJTBBJTBBcGlwZWxpbmUuc2NoZWR1bGVyJTIwJTNEJTIwTE1TRGlzY3JldGVTY2hlZHVsZXIuZnJvbV9jb25maWcocGlwZWxpbmUuc2NoZWR1bGVyLmNvbmZpZyklMEFpbWFnZSUyMCUzRCUyMHBpcGVsaW5lKHByb21wdCUyQyUyMGdlbmVyYXRvciUzRGdlbmVyYXRvcikuaW1hZ2VzJTVCMCU1RCUwQWltYWdl",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> LMSDiscreteScheduler

pipeline.scheduler = LMSDiscreteScheduler.from_config(pipeline.scheduler.config)
image = pipeline(prompt, generator=generator).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),{c(){a=f("p"),a.innerHTML=T,u=i(),M(o.$$.fragment)},l(n){a=d(n,"P",{"data-svelte-h":!0}),Z(a)!=="svelte-kh00s0"&&(a.innerHTML=T),u=p(n),y(o.$$.fragment,n)},m(n,m){t(n,a,m),t(n,u,m),U(o,n,m),c=!0},p:el,i(n){c||(h(o.$$.fragment,n),c=!0)},o(n){b(o.$$.fragment,n),c=!1},d(n){n&&(s(a),s(u)),J(o,n)}}}function Wl(g){let a,T="<code>EulerDiscreteScheduler</code>仅需30步即可生成高质量图像。",u,o,c;return o=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEV1bGVyRGlzY3JldGVTY2hlZHVsZXIlMEElMEFwaXBlbGluZS5zY2hlZHVsZXIlMjAlM0QlMjBFdWxlckRpc2NyZXRlU2NoZWR1bGVyLmZyb21fY29uZmlnKHBpcGVsaW5lLnNjaGVkdWxlci5jb25maWcpJTBBaW1hZ2UlMjAlM0QlMjBwaXBlbGluZShwcm9tcHQlMkMlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3IpLmltYWdlcyU1QjAlNUQlMEFpbWFnZQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> EulerDiscreteScheduler

pipeline.scheduler = EulerDiscreteScheduler.from_config(pipeline.scheduler.config)
image = pipeline(prompt, generator=generator).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),{c(){a=f("p"),a.innerHTML=T,u=i(),M(o.$$.fragment)},l(n){a=d(n,"P",{"data-svelte-h":!0}),Z(a)!=="svelte-11j82oc"&&(a.innerHTML=T),u=p(n),y(o.$$.fragment,n)},m(n,m){t(n,a,m),t(n,u,m),U(o,n,m),c=!0},p:el,i(n){c||(h(o.$$.fragment,n),c=!0)},o(n){b(o.$$.fragment,n),c=!1},d(n){n&&(s(a),s(u)),J(o,n)}}}function Rl(g){let a,T="<code>EulerAncestralDiscreteScheduler</code>同样可在30步内生成高质量图像。",u,o,c;return o=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEV1bGVyQW5jZXN0cmFsRGlzY3JldGVTY2hlZHVsZXIlMEElMEFwaXBlbGluZS5zY2hlZHVsZXIlMjAlM0QlMjBFdWxlckFuY2VzdHJhbERpc2NyZXRlU2NoZWR1bGVyLmZyb21fY29uZmlnKHBpcGVsaW5lLnNjaGVkdWxlci5jb25maWcpJTBBaW1hZ2UlMjAlM0QlMjBwaXBlbGluZShwcm9tcHQlMkMlMjBnZW5lcmF0b3IlM0RnZW5lcmF0b3IpLmltYWdlcyU1QjAlNUQlMEFpbWFnZQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> EulerAncestralDiscreteScheduler

pipeline.scheduler = EulerAncestralDiscreteScheduler.from_config(pipeline.scheduler.config)
image = pipeline(prompt, generator=generator).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),{c(){a=f("p"),a.innerHTML=T,u=i(),M(o.$$.fragment)},l(n){a=d(n,"P",{"data-svelte-h":!0}),Z(a)!=="svelte-la0mgx"&&(a.innerHTML=T),u=p(n),y(o.$$.fragment,n)},m(n,m){t(n,a,m),t(n,u,m),U(o,n,m),c=!0},p:el,i(n){c||(h(o.$$.fragment,n),c=!0)},o(n){b(o.$$.fragment,n),c=!1},d(n){n&&(s(a),s(u)),J(o,n)}}}function Bl(g){let a,T="<code>DPMSolverMultistepScheduler</code>在速度与质量间取得平衡，仅需20步即可生成优质图像。",u,o,c;return o=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERQTVNvbHZlck11bHRpc3RlcFNjaGVkdWxlciUwQSUwQXBpcGVsaW5lLnNjaGVkdWxlciUyMCUzRCUyMERQTVNvbHZlck11bHRpc3RlcFNjaGVkdWxlci5mcm9tX2NvbmZpZyhwaXBlbGluZS5zY2hlZHVsZXIuY29uZmlnKSUwQWltYWdlJTIwJTNEJTIwcGlwZWxpbmUocHJvbXB0JTJDJTIwZ2VuZXJhdG9yJTNEZ2VuZXJhdG9yKS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2U=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DPMSolverMultistepScheduler

pipeline.scheduler = DPMSolverMultistepScheduler.from_config(pipeline.scheduler.config)
image = pipeline(prompt, generator=generator).images[<span class="hljs-number">0</span>]
image`,wrap:!1}}),{c(){a=f("p"),a.innerHTML=T,u=i(),M(o.$$.fragment)},l(n){a=d(n,"P",{"data-svelte-h":!0}),Z(a)!=="svelte-1cldv6s"&&(a.innerHTML=T),u=p(n),y(o.$$.fragment,n)},m(n,m){t(n,a,m),t(n,u,m),U(o,n,m),c=!0},p:el,i(n){c||(h(o.$$.fragment,n),c=!0)},o(n){b(o.$$.fragment,n),c=!1},d(n){n&&(s(a),s(u)),J(o,n)}}}function kl(g){let a,T,u,o,c,n,m,V;return a=new Ke({props:{id:"schedulers",option:"LMSDiscreteScheduler",$$slots:{default:[Sl]},$$scope:{ctx:g}}}),u=new Ke({props:{id:"schedulers",option:"EulerDiscreteScheduler",$$slots:{default:[Wl]},$$scope:{ctx:g}}}),c=new Ke({props:{id:"schedulers",option:"EulerAncestralDiscreteScheduler",$$slots:{default:[Rl]},$$scope:{ctx:g}}}),m=new Ke({props:{id:"schedulers",option:"DPMSolverMultistepScheduler",$$slots:{default:[Bl]},$$scope:{ctx:g}}}),{c(){M(a.$$.fragment),T=i(),M(u.$$.fragment),o=i(),M(c.$$.fragment),n=i(),M(m.$$.fragment)},l(r){y(a.$$.fragment,r),T=p(r),y(u.$$.fragment,r),o=p(r),y(c.$$.fragment,r),n=p(r),y(m.$$.fragment,r)},m(r,w){U(a,r,w),t(r,T,w),U(u,r,w),t(r,o,w),U(c,r,w),t(r,n,w),U(m,r,w),V=!0},p(r,w){const S={};w&2&&(S.$$scope={dirty:w,ctx:r}),a.$set(S);const j={};w&2&&(j.$$scope={dirty:w,ctx:r}),u.$set(j);const me={};w&2&&(me.$$scope={dirty:w,ctx:r}),c.$set(me);const W={};w&2&&(W.$$scope={dirty:w,ctx:r}),m.$set(W)},i(r){V||(h(a.$$.fragment,r),h(u.$$.fragment,r),h(c.$$.fragment,r),h(m.$$.fragment,r),V=!0)},o(r){b(a.$$.fragment,r),b(u.$$.fragment,r),b(c.$$.fragment,r),b(m.$$.fragment,r),V=!1},d(r){r&&(s(T),s(o),s(n)),J(a,r),J(u,r),J(c,r),J(m,r)}}}function Fl(g){let a,T,u,o,c,n,m,V,r,w="Diffusion管道是由可互换的调度器(schedulers)和模型(models)组成的集合，可通过混合搭配来定制特定用例的流程。调度器封装了整个去噪过程（如去噪步数和寻找去噪样本的算法），其本身不包含可训练参数，因此内存占用极低。模型则主要负责从含噪输入到较纯净样本的前向传播过程。",S,j,me='本指南将展示如何加载调度器和模型来自定义流程。我们将全程使用<a href="https://hf.co/stable-diffusion-v1-5/stable-diffusion-v1-5" rel="nofollow">stable-diffusion-v1-5/stable-diffusion-v1-5</a>检查点，首先加载基础管道：',W,R,Me,B,ll="通过<code>pipeline.scheduler</code>属性可查看当前管道使用的调度器：",ye,k,Ue,F,he,_,sl="调度器通过配置文件定义，同一配置文件可被多种调度器共享。使用<code>SchedulerMixin.from_pretrained()</code>方法加载时，需指定<code>subfolder</code>参数以定位配置文件在仓库中的正确子目录。",be,N,tl="例如加载<code>DDIMScheduler</code>：",Je,x,Ze,I,nl="然后将新调度器传入管道：",Te,X,we,E,$e,Q,al="不同调度器各有优劣，难以定量评估哪个最适合您的流程。通常需要在去噪速度与质量之间权衡。我们建议尝试多种调度器以找到最佳方案。通过<code>pipeline.scheduler.compatibles</code>属性可查看兼容当前管道的所有调度器。",ge,H,il="下面我们使用相同提示词和随机种子，对比<code>LMSDiscreteScheduler</code>、<code>EulerDiscreteScheduler</code>、<code>EulerAncestralDiscreteScheduler</code>和<code>DPMSolverMultistepScheduler</code>的表现：",je,z,Ve,L,pl="使用<code>from_config()</code>方法加载不同调度器的配置来切换管道调度器：",Ge,G,ve,v,rl='<div><img class="rounded-xl" src="https://huggingface.co/datasets/patrickvonplaten/images/resolve/main/diffusers_docs/astronaut_lms.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">LMSDiscreteScheduler</figcaption></div> <div><img class="rounded-xl" src="https://huggingface.co/datasets/patrickvonplaten/images/resolve/main/diffusers_docs/astronaut_euler_discrete.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">EulerDiscreteScheduler</figcaption></div>',Ce,C,ol='<div><img class="rounded-xl" src="https://huggingface.co/datasets/patrickvonplaten/images/resolve/main/diffusers_docs/astronaut_euler_ancestral.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">EulerAncestralDiscreteScheduler</figcaption></div> <div><img class="rounded-xl" src="https://huggingface.co/datasets/patrickvonplaten/images/resolve/main/diffusers_docs/astronaut_dpm.png"/> <figcaption class="mt-2 text-center text-sm text-gray-500">DPMSolverMultistepScheduler</figcaption></div>',Se,q,cl="多数生成图像质量相近，实际选择需根据具体场景测试多种调度器进行比较。",We,D,Re,Y,ul="对比Flax调度器时，需额外将调度器状态加载到模型参数中。例如将<code>FlaxStableDiffusionPipeline</code>的默认调度器切换为超高效的<code>FlaxDPMSolverMultistepScheduler</code>：",Be,P,ml=`<p>[!警告]
<code>FlaxLMSDiscreteScheduler</code>和<code>FlaxDDPMScheduler</code>目前暂不兼容<code>FlaxStableDiffusionPipeline</code>。</p>`,ke,O,Fe,A,fl="利用Flax对TPU的兼容性实现并行图像生成。需为每个设备复制模型参数，并分配输入数据：",_e,K,Ne,ee,xe,le,dl="通过<code>ModelMixin.from_pretrained()</code>方法加载模型，该方法会下载并缓存模型权重和配置的最新版本。若本地缓存已存在最新文件，则直接复用缓存而非重复下载。",Ie,se,Ml='通过<code>subfolder</code>参数可从子目录加载模型。例如<a href="https://hf.co/stable-diffusion-v1-5/stable-diffusion-v1-5" rel="nofollow">stable-diffusion-v1-5/stable-diffusion-v1-5</a>的模型权重存储在<a href="https://hf.co/stable-diffusion-v1-5/stable-diffusion-v1-5/tree/main/unet" rel="nofollow">unet</a>子目录中：',Xe,te,Ee,ne,yl='也可直接从<a href="https://huggingface.co/google/ddpm-cifar10-32/tree/main" rel="nofollow">仓库</a>加载：',Qe,ae,He,ie,Ul="加载和保存模型变体时，需在<code>ModelMixin.from_pretrained()</code>和<code>ModelMixin.save_pretrained()</code>中指定<code>variant</code>参数：",ze,pe,Le,re,hl="使用<code>from_pretrained()</code>的<code>torch_dtype</code>参数指定模型加载精度：",qe,oe,De,ce,bl='也可使用<a href="https://docs.pytorch.org/docs/stable/generated/torch.Tensor.to.html" rel="nofollow">torch.Tensor.to</a>方法即时转换精度，但会转换所有权重（不同于<code>torch_dtype</code>参数会保留<code>_keep_in_fp32_modules</code>中的层）。这对某些必须保持fp32精度的层尤为重要（参见<a href="https://github.com/huggingface/diffusers/blob/f864a9a352fa4a220d860bfdd1782e3e5af96382/src/diffusers/models/transformers/transformer_wan.py#L374" rel="nofollow">示例</a>）。',Ye,ue,Pe,fe,Oe;return c=new de({props:{title:"加载调度器与模型",local:"加载调度器与模型",headingTag:"h1"}}),m=new Gl({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/zh/schedulers.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/zh/pytorch/schedulers.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/zh/tensorflow/schedulers.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/zh/schedulers.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/zh/pytorch/schedulers.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/diffusers_doc/zh/tensorflow/schedulers.ipynb"}]}}),R=new $({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlbGluZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFibGUtZGlmZnVzaW9uLXYxLTUlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlJTBBKS50byglMjJjdWRhJTIyKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

pipeline = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;stable-diffusion-v1-5/stable-diffusion-v1-5&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>
).to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),k=new $({props:{code:"cGlwZWxpbmUuc2NoZWR1bGVyJTBBUE5ETVNjaGVkdWxlciUyMCU3QiUwQSUyMCUyMCUyMl9jbGFzc19uYW1lJTIyJTNBJTIwJTIyUE5ETVNjaGVkdWxlciUyMiUyQyUwQSUyMCUyMCUyMl9kaWZmdXNlcnNfdmVyc2lvbiUyMiUzQSUyMCUyMjAuMjEuNCUyMiUyQyUwQSUyMCUyMCUyMmJldGFfZW5kJTIyJTNBJTIwMC4wMTIlMkMlMEElMjAlMjAlMjJiZXRhX3NjaGVkdWxlJTIyJTNBJTIwJTIyc2NhbGVkX2xpbmVhciUyMiUyQyUwQSUyMCUyMCUyMmJldGFfc3RhcnQlMjIlM0ElMjAwLjAwMDg1JTJDJTBBJTIwJTIwJTIyY2xpcF9zYW1wbGUlMjIlM0ElMjBmYWxzZSUyQyUwQSUyMCUyMCUyMm51bV90cmFpbl90aW1lc3RlcHMlMjIlM0ElMjAxMDAwJTJDJTBBJTIwJTIwJTIyc2V0X2FscGhhX3RvX29uZSUyMiUzQSUyMGZhbHNlJTJDJTBBJTIwJTIwJTIyc2tpcF9wcmtfc3RlcHMlMjIlM0ElMjB0cnVlJTJDJTBBJTIwJTIwJTIyc3RlcHNfb2Zmc2V0JTIyJTNBJTIwMSUyQyUwQSUyMCUyMCUyMnRpbWVzdGVwX3NwYWNpbmclMjIlM0ElMjAlMjJsZWFkaW5nJTIyJTJDJTBBJTIwJTIwJTIydHJhaW5lZF9iZXRhcyUyMiUzQSUyMG51bGwlMEElN0Q=",highlighted:`pipeline.scheduler
PNDMScheduler {
  <span class="hljs-string">&quot;_class_name&quot;</span>: <span class="hljs-string">&quot;PNDMScheduler&quot;</span>,
  <span class="hljs-string">&quot;_diffusers_version&quot;</span>: <span class="hljs-string">&quot;0.21.4&quot;</span>,
  <span class="hljs-string">&quot;beta_end&quot;</span>: <span class="hljs-number">0.012</span>,
  <span class="hljs-string">&quot;beta_schedule&quot;</span>: <span class="hljs-string">&quot;scaled_linear&quot;</span>,
  <span class="hljs-string">&quot;beta_start&quot;</span>: <span class="hljs-number">0.00085</span>,
  <span class="hljs-string">&quot;clip_sample&quot;</span>: false,
  <span class="hljs-string">&quot;num_train_timesteps&quot;</span>: <span class="hljs-number">1000</span>,
  <span class="hljs-string">&quot;set_alpha_to_one&quot;</span>: false,
  <span class="hljs-string">&quot;skip_prk_steps&quot;</span>: true,
  <span class="hljs-string">&quot;steps_offset&quot;</span>: <span class="hljs-number">1</span>,
  <span class="hljs-string">&quot;timestep_spacing&quot;</span>: <span class="hljs-string">&quot;leading&quot;</span>,
  <span class="hljs-string">&quot;trained_betas&quot;</span>: null
}`,wrap:!1}}),F=new de({props:{title:"加载调度器",local:"加载调度器",headingTag:"h2"}}),x=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERESU1TY2hlZHVsZXIlMkMlMjBEaWZmdXNpb25QaXBlbGluZSUwQSUwQWRkaW0lMjAlM0QlMjBERElNU2NoZWR1bGVyLmZyb21fcHJldHJhaW5lZCglMjJzdGFibGUtZGlmZnVzaW9uLXYxLTUlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJzY2hlZHVsZXIlMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DDIMScheduler, DiffusionPipeline

ddim = DDIMScheduler.from_pretrained(<span class="hljs-string">&quot;stable-diffusion-v1-5/stable-diffusion-v1-5&quot;</span>, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)`,wrap:!1}}),X=new $({props:{code:"cGlwZWxpbmUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmxlLWRpZmZ1c2lvbi12MS01JTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTIwc2NoZWR1bGVyJTNEZGRpbSUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUlMEEpLnRvKCUyMmN1ZGElMjIp",highlighted:`pipeline = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;stable-diffusion-v1-5/stable-diffusion-v1-5&quot;</span>, scheduler=ddim, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>
).to(<span class="hljs-string">&quot;cuda&quot;</span>)`,wrap:!1}}),E=new de({props:{title:"调度器对比",local:"调度器对比",headingTag:"h2"}}),z=new $({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlbGluZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFibGUtZGlmZnVzaW9uLXYxLTUlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlJTBBKS50byglMjJjdWRhJTIyKSUwQSUwQXByb21wdCUyMCUzRCUyMCUyMkElMjBwaG90b2dyYXBoJTIwb2YlMjBhbiUyMGFzdHJvbmF1dCUyMHJpZGluZyUyMGElMjBob3JzZSUyMG9uJTIwTWFycyUyQyUyMGhpZ2glMjByZXNvbHV0aW9uJTJDJTIwaGlnaCUyMGRlZmluaXRpb24uJTIyJTBBZ2VuZXJhdG9yJTIwJTNEJTIwdG9yY2guR2VuZXJhdG9yKGRldmljZSUzRCUyMmN1ZGElMjIpLm1hbnVhbF9zZWVkKDgp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

pipeline = DiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;stable-diffusion-v1-5/stable-diffusion-v1-5&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>
).to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;A photograph of an astronaut riding a horse on Mars, high resolution, high definition.&quot;</span>
generator = torch.Generator(device=<span class="hljs-string">&quot;cuda&quot;</span>).manual_seed(<span class="hljs-number">8</span>)`,wrap:!1}}),G=new Cl({props:{id:"schedulers",options:["LMSDiscreteScheduler","EulerDiscreteScheduler","EulerAncestralDiscreteScheduler","DPMSolverMultistepScheduler"],$$slots:{default:[kl]},$$scope:{ctx:g}}}),D=new de({props:{title:"Flax调度器",local:"flax调度器",headingTag:"h3"}}),O=new $({props:{code:"aW1wb3J0JTIwamF4JTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBZnJvbSUyMGZsYXguamF4X3V0aWxzJTIwaW1wb3J0JTIwcmVwbGljYXRlJTBBZnJvbSUyMGZsYXgudHJhaW5pbmcuY29tbW9uX3V0aWxzJTIwaW1wb3J0JTIwc2hhcmQlMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRmxheFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTJDJTIwRmxheERQTVNvbHZlck11bHRpc3RlcFNjaGVkdWxlciUwQSUwQXNjaGVkdWxlciUyQyUyMHNjaGVkdWxlcl9zdGF0ZSUyMCUzRCUyMEZsYXhEUE1Tb2x2ZXJNdWx0aXN0ZXBTY2hlZHVsZXIuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUyQyUwQSUyMCUyMCUyMCUyMHN1YmZvbGRlciUzRCUyMnNjaGVkdWxlciUyMiUwQSklMEFwaXBlbGluZSUyQyUyMHBhcmFtcyUyMCUzRCUyMEZsYXhTdGFibGVEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyc3RhYmxlLWRpZmZ1c2lvbi12MS01JTJGc3RhYmxlLWRpZmZ1c2lvbi12MS01JTIyJTJDJTBBJTIwJTIwJTIwJTIwc2NoZWR1bGVyJTNEc2NoZWR1bGVyJTJDJTBBJTIwJTIwJTIwJTIwdmFyaWFudCUzRCUyMmJmMTYlMjIlMkMlMEElMjAlMjAlMjAlMjBkdHlwZSUzRGpheC5udW1weS5iZmxvYXQxNiUyQyUwQSklMEFwYXJhbXMlNUIlMjJzY2hlZHVsZXIlMjIlNUQlMjAlM0QlMjBzY2hlZHVsZXJfc3RhdGU=",highlighted:`<span class="hljs-keyword">import</span> jax
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">from</span> flax.jax_utils <span class="hljs-keyword">import</span> replicate
<span class="hljs-keyword">from</span> flax.training.common_utils <span class="hljs-keyword">import</span> shard
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> FlaxStableDiffusionPipeline, FlaxDPMSolverMultistepScheduler

scheduler, scheduler_state = FlaxDPMSolverMultistepScheduler.from_pretrained(
    <span class="hljs-string">&quot;stable-diffusion-v1-5/stable-diffusion-v1-5&quot;</span>,
    subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>
)
pipeline, params = FlaxStableDiffusionPipeline.from_pretrained(
    <span class="hljs-string">&quot;stable-diffusion-v1-5/stable-diffusion-v1-5&quot;</span>,
    scheduler=scheduler,
    variant=<span class="hljs-string">&quot;bf16&quot;</span>,
    dtype=jax.numpy.bfloat16,
)
params[<span class="hljs-string">&quot;scheduler&quot;</span>] = scheduler_state`,wrap:!1}}),K=new $({props:{code:"JTIzJTIwJUU2JUFGJThGJUU0JUI4JUFBJUU1JUI5JUI2JUU4JUExJThDJUU4JUFFJUJFJUU1JUE0JTg3JUU3JTk0JTlGJUU2JTg4JTkwMSVFNSVCQyVBMCVFNSU5QiVCRSVFNSU4MyU4RiVFRiVCQyU4OFRQVXYyLTglMkZUUFV2My04JUU2JTk0JUFGJUU2JThDJTgxOCVFOCVBRSVCRSVFNSVBNCU4NyVFNSVCOSVCNiVFOCVBMSU4QyVFRiVCQyU4OSUwQXByb21wdCUyMCUzRCUyMCUyMiVFNCVCOCU4MCVFNSVCQyVBMCVFNSVBRSU4NyVFOCU4OCVBQSVFNSU5MSU5OCVFNSU5QyVBOCVFNyU4MSVBQiVFNiU5OCU5RiVFNCVCOCU4QSVFOSVBQSU5MSVFOSVBOSVBQyVFNyU5QSU4NCVFOSVBQiU5OCVFNiVCOCU4NSVFNyU4NSVBNyVFNyU4OSU4NyVFRiVCQyU4QyVFOSVBQiU5OCVFNSU4OCU4NiVFOCVCRSVBOCVFNyU4RSU4NyVFRiVCQyU4QyVFOSVBQiU5OCVFNyU5NCVCQiVFOCVCNCVBOCVFMyU4MCU4MiUyMiUwQW51bV9zYW1wbGVzJTIwJTNEJTIwamF4LmRldmljZV9jb3VudCgpJTBBcHJvbXB0X2lkcyUyMCUzRCUyMHBpcGVsaW5lLnByZXBhcmVfaW5wdXRzKCU1QnByb21wdCU1RCUyMColMjBudW1fc2FtcGxlcyklMEElMEFwcm5nX3NlZWQlMjAlM0QlMjBqYXgucmFuZG9tLlBSTkdLZXkoMCklMEFudW1faW5mZXJlbmNlX3N0ZXBzJTIwJTNEJTIwMjUlMEElMEElMjMlMjAlRTUlODglODYlRTklODUlOEQlRTglQkUlOTMlRTUlODUlQTUlRTUlOTIlOEMlRTklOUElOEYlRTYlOUMlQkElRTclQTclOEQlRTUlQUQlOTAlMEFwYXJhbXMlMjAlM0QlMjByZXBsaWNhdGUocGFyYW1zKSUwQXBybmdfc2VlZCUyMCUzRCUyMGpheC5yYW5kb20uc3BsaXQocHJuZ19zZWVkJTJDJTIwamF4LmRldmljZV9jb3VudCgpKSUwQXByb21wdF9pZHMlMjAlM0QlMjBzaGFyZChwcm9tcHRfaWRzKSUwQSUwQWltYWdlcyUyMCUzRCUyMHBpcGVsaW5lKHByb21wdF9pZHMlMkMlMjBwYXJhbXMlMkMlMjBwcm5nX3NlZWQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTJDJTIwaml0JTNEVHJ1ZSkuaW1hZ2VzJTBBaW1hZ2VzJTIwJTNEJTIwcGlwZWxpbmUubnVtcHlfdG9fcGlsKG5wLmFzYXJyYXkoaW1hZ2VzLnJlc2hhcGUoKG51bV9zYW1wbGVzJTJDKSUyMCUyQiUyMGltYWdlcy5zaGFwZSU1Qi0zJTNBJTVEKSkp",highlighted:`<span class="hljs-comment"># 每个并行设备生成1张图像（TPUv2-8/TPUv3-8支持8设备并行）</span>
prompt = <span class="hljs-string">&quot;一张宇航员在火星上骑马的高清照片，高分辨率，高画质。&quot;</span>
num_samples = jax.device_count()
prompt_ids = pipeline.prepare_inputs([prompt] * num_samples)

prng_seed = jax.random.PRNGKey(<span class="hljs-number">0</span>)
num_inference_steps = <span class="hljs-number">25</span>

<span class="hljs-comment"># 分配输入和随机种子</span>
params = replicate(params)
prng_seed = jax.random.split(prng_seed, jax.device_count())
prompt_ids = shard(prompt_ids)

images = pipeline(prompt_ids, params, prng_seed, num_inference_steps, jit=<span class="hljs-literal">True</span>).images
images = pipeline.numpy_to_pil(np.asarray(images.reshape((num_samples,) + images.shape[-<span class="hljs-number">3</span>:])))`,wrap:!1}}),ee=new de({props:{title:"模型加载",local:"模型加载",headingTag:"h2"}}),te=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsJTBBJTBBdW5ldCUyMCUzRCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJzdGFibGUtZGlmZnVzaW9uLXYxLTUlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJ1bmV0JTIyJTJDJTIwdXNlX3NhZmV0ZW5zb3JzJTNEVHJ1ZSk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UNet2DConditionModel

unet = UNet2DConditionModel.from_pretrained(<span class="hljs-string">&quot;stable-diffusion-v1-5/stable-diffusion-v1-5&quot;</span>, subfolder=<span class="hljs-string">&quot;unet&quot;</span>, use_safetensors=<span class="hljs-literal">True</span>)`,wrap:!1}}),ae=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFVOZXQyRE1vZGVsJTBBJTBBdW5ldCUyMCUzRCUyMFVOZXQyRE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZkZHBtLWNpZmFyMTAtMzIlMjIlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UNet2DModel

unet = UNet2DModel.from_pretrained(<span class="hljs-string">&quot;google/ddpm-cifar10-32&quot;</span>, use_safetensors=<span class="hljs-literal">True</span>)`,wrap:!1}}),pe=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsJTBBJTBBdW5ldCUyMCUzRCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJzdGFibGUtZGlmZnVzaW9uLXYxLTUlMkZzdGFibGUtZGlmZnVzaW9uLXYxLTUlMjIlMkMlMjBzdWJmb2xkZXIlM0QlMjJ1bmV0JTIyJTJDJTIwdmFyaWFudCUzRCUyMm5vbl9lbWElMjIlMkMlMjB1c2Vfc2FmZXRlbnNvcnMlM0RUcnVlJTBBKSUwQXVuZXQuc2F2ZV9wcmV0cmFpbmVkKCUyMi4lMkZsb2NhbC11bmV0JTIyJTJDJTIwdmFyaWFudCUzRCUyMm5vbl9lbWElMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> UNet2DConditionModel

unet = UNet2DConditionModel.from_pretrained(
    <span class="hljs-string">&quot;stable-diffusion-v1-5/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>, use_safetensors=<span class="hljs-literal">True</span>
)
unet.save_pretrained(<span class="hljs-string">&quot;./local-unet&quot;</span>, variant=<span class="hljs-string">&quot;non_ema&quot;</span>)`,wrap:!1}}),oe=new $({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMEF1dG9Nb2RlbCUwQSUwQXVuZXQlMjAlM0QlMjBBdXRvTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi14bC1iYXNlLTEuMCUyMiUyQyUyMHN1YmZvbGRlciUzRCUyMnVuZXQlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYlMEEp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> AutoModel

unet = AutoModel.from_pretrained(
    <span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>, subfolder=<span class="hljs-string">&quot;unet&quot;</span>, torch_dtype=torch.float16
)`,wrap:!1}}),ue=new vl({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/zh/using-diffusers/schedulers.md"}}),{c(){a=f("meta"),T=i(),u=f("p"),o=i(),M(c.$$.fragment),n=i(),M(m.$$.fragment),V=i(),r=f("p"),r.textContent=w,S=i(),j=f("p"),j.innerHTML=me,W=i(),M(R.$$.fragment),Me=i(),B=f("p"),B.innerHTML=ll,ye=i(),M(k.$$.fragment),Ue=i(),M(F.$$.fragment),he=i(),_=f("p"),_.innerHTML=sl,be=i(),N=f("p"),N.innerHTML=tl,Je=i(),M(x.$$.fragment),Ze=i(),I=f("p"),I.textContent=nl,Te=i(),M(X.$$.fragment),we=i(),M(E.$$.fragment),$e=i(),Q=f("p"),Q.innerHTML=al,ge=i(),H=f("p"),H.innerHTML=il,je=i(),M(z.$$.fragment),Ve=i(),L=f("p"),L.innerHTML=pl,Ge=i(),M(G.$$.fragment),ve=i(),v=f("div"),v.innerHTML=rl,Ce=i(),C=f("div"),C.innerHTML=ol,Se=i(),q=f("p"),q.textContent=cl,We=i(),M(D.$$.fragment),Re=i(),Y=f("p"),Y.innerHTML=ul,Be=i(),P=f("blockquote"),P.innerHTML=ml,ke=i(),M(O.$$.fragment),Fe=i(),A=f("p"),A.textContent=fl,_e=i(),M(K.$$.fragment),Ne=i(),M(ee.$$.fragment),xe=i(),le=f("p"),le.innerHTML=dl,Ie=i(),se=f("p"),se.innerHTML=Ml,Xe=i(),M(te.$$.fragment),Ee=i(),ne=f("p"),ne.innerHTML=yl,Qe=i(),M(ae.$$.fragment),He=i(),ie=f("p"),ie.innerHTML=Ul,ze=i(),M(pe.$$.fragment),Le=i(),re=f("p"),re.innerHTML=hl,qe=i(),M(oe.$$.fragment),De=i(),ce=f("p"),ce.innerHTML=bl,Ye=i(),M(ue.$$.fragment),Pe=i(),fe=f("p"),this.h()},l(e){const l=jl("svelte-u9bgzb",document.head);a=d(l,"META",{name:!0,content:!0}),l.forEach(s),T=p(e),u=d(e,"P",{}),Zl(u).forEach(s),o=p(e),y(c.$$.fragment,e),n=p(e),y(m.$$.fragment,e),V=p(e),r=d(e,"P",{"data-svelte-h":!0}),Z(r)!=="svelte-qqzqus"&&(r.textContent=w),S=p(e),j=d(e,"P",{"data-svelte-h":!0}),Z(j)!=="svelte-1x2hc4b"&&(j.innerHTML=me),W=p(e),y(R.$$.fragment,e),Me=p(e),B=d(e,"P",{"data-svelte-h":!0}),Z(B)!=="svelte-wbd7yp"&&(B.innerHTML=ll),ye=p(e),y(k.$$.fragment,e),Ue=p(e),y(F.$$.fragment,e),he=p(e),_=d(e,"P",{"data-svelte-h":!0}),Z(_)!=="svelte-1wo742j"&&(_.innerHTML=sl),be=p(e),N=d(e,"P",{"data-svelte-h":!0}),Z(N)!=="svelte-1shhttm"&&(N.innerHTML=tl),Je=p(e),y(x.$$.fragment,e),Ze=p(e),I=d(e,"P",{"data-svelte-h":!0}),Z(I)!=="svelte-1pu4pg4"&&(I.textContent=nl),Te=p(e),y(X.$$.fragment,e),we=p(e),y(E.$$.fragment,e),$e=p(e),Q=d(e,"P",{"data-svelte-h":!0}),Z(Q)!=="svelte-16271jk"&&(Q.innerHTML=al),ge=p(e),H=d(e,"P",{"data-svelte-h":!0}),Z(H)!=="svelte-9hd88i"&&(H.innerHTML=il),je=p(e),y(z.$$.fragment,e),Ve=p(e),L=d(e,"P",{"data-svelte-h":!0}),Z(L)!=="svelte-bkdr33"&&(L.innerHTML=pl),Ge=p(e),y(G.$$.fragment,e),ve=p(e),v=d(e,"DIV",{class:!0,"data-svelte-h":!0}),Z(v)!=="svelte-k6zsrl"&&(v.innerHTML=rl),Ce=p(e),C=d(e,"DIV",{class:!0,"data-svelte-h":!0}),Z(C)!=="svelte-8ii4fv"&&(C.innerHTML=ol),Se=p(e),q=d(e,"P",{"data-svelte-h":!0}),Z(q)!=="svelte-qgl98h"&&(q.textContent=cl),We=p(e),y(D.$$.fragment,e),Re=p(e),Y=d(e,"P",{"data-svelte-h":!0}),Z(Y)!=="svelte-1vi1bry"&&(Y.innerHTML=ul),Be=p(e),P=d(e,"BLOCKQUOTE",{"data-svelte-h":!0}),Z(P)!=="svelte-7evmht"&&(P.innerHTML=ml),ke=p(e),y(O.$$.fragment,e),Fe=p(e),A=d(e,"P",{"data-svelte-h":!0}),Z(A)!=="svelte-e7fncg"&&(A.textContent=fl),_e=p(e),y(K.$$.fragment,e),Ne=p(e),y(ee.$$.fragment,e),xe=p(e),le=d(e,"P",{"data-svelte-h":!0}),Z(le)!=="svelte-ur4w4z"&&(le.innerHTML=dl),Ie=p(e),se=d(e,"P",{"data-svelte-h":!0}),Z(se)!=="svelte-14l7nhl"&&(se.innerHTML=Ml),Xe=p(e),y(te.$$.fragment,e),Ee=p(e),ne=d(e,"P",{"data-svelte-h":!0}),Z(ne)!=="svelte-eapyly"&&(ne.innerHTML=yl),Qe=p(e),y(ae.$$.fragment,e),He=p(e),ie=d(e,"P",{"data-svelte-h":!0}),Z(ie)!=="svelte-138vbbm"&&(ie.innerHTML=Ul),ze=p(e),y(pe.$$.fragment,e),Le=p(e),re=d(e,"P",{"data-svelte-h":!0}),Z(re)!=="svelte-1q3nzb0"&&(re.innerHTML=hl),qe=p(e),y(oe.$$.fragment,e),De=p(e),ce=d(e,"P",{"data-svelte-h":!0}),Z(ce)!=="svelte-1ys84js"&&(ce.innerHTML=bl),Ye=p(e),y(ue.$$.fragment,e),Pe=p(e),fe=d(e,"P",{}),Zl(fe).forEach(s),this.h()},h(){Ae(a,"name","hf:doc:metadata"),Ae(a,"content",_l),Ae(v,"class","flex gap-4"),Ae(C,"class","flex gap-4")},m(e,l){Vl(document.head,a),t(e,T,l),t(e,u,l),t(e,o,l),U(c,e,l),t(e,n,l),U(m,e,l),t(e,V,l),t(e,r,l),t(e,S,l),t(e,j,l),t(e,W,l),U(R,e,l),t(e,Me,l),t(e,B,l),t(e,ye,l),U(k,e,l),t(e,Ue,l),U(F,e,l),t(e,he,l),t(e,_,l),t(e,be,l),t(e,N,l),t(e,Je,l),U(x,e,l),t(e,Ze,l),t(e,I,l),t(e,Te,l),U(X,e,l),t(e,we,l),U(E,e,l),t(e,$e,l),t(e,Q,l),t(e,ge,l),t(e,H,l),t(e,je,l),U(z,e,l),t(e,Ve,l),t(e,L,l),t(e,Ge,l),U(G,e,l),t(e,ve,l),t(e,v,l),t(e,Ce,l),t(e,C,l),t(e,Se,l),t(e,q,l),t(e,We,l),U(D,e,l),t(e,Re,l),t(e,Y,l),t(e,Be,l),t(e,P,l),t(e,ke,l),U(O,e,l),t(e,Fe,l),t(e,A,l),t(e,_e,l),U(K,e,l),t(e,Ne,l),U(ee,e,l),t(e,xe,l),t(e,le,l),t(e,Ie,l),t(e,se,l),t(e,Xe,l),U(te,e,l),t(e,Ee,l),t(e,ne,l),t(e,Qe,l),U(ae,e,l),t(e,He,l),t(e,ie,l),t(e,ze,l),U(pe,e,l),t(e,Le,l),t(e,re,l),t(e,qe,l),U(oe,e,l),t(e,De,l),t(e,ce,l),t(e,Ye,l),U(ue,e,l),t(e,Pe,l),t(e,fe,l),Oe=!0},p(e,[l]){const Jl={};l&2&&(Jl.$$scope={dirty:l,ctx:e}),G.$set(Jl)},i(e){Oe||(h(c.$$.fragment,e),h(m.$$.fragment,e),h(R.$$.fragment,e),h(k.$$.fragment,e),h(F.$$.fragment,e),h(x.$$.fragment,e),h(X.$$.fragment,e),h(E.$$.fragment,e),h(z.$$.fragment,e),h(G.$$.fragment,e),h(D.$$.fragment,e),h(O.$$.fragment,e),h(K.$$.fragment,e),h(ee.$$.fragment,e),h(te.$$.fragment,e),h(ae.$$.fragment,e),h(pe.$$.fragment,e),h(oe.$$.fragment,e),h(ue.$$.fragment,e),Oe=!0)},o(e){b(c.$$.fragment,e),b(m.$$.fragment,e),b(R.$$.fragment,e),b(k.$$.fragment,e),b(F.$$.fragment,e),b(x.$$.fragment,e),b(X.$$.fragment,e),b(E.$$.fragment,e),b(z.$$.fragment,e),b(G.$$.fragment,e),b(D.$$.fragment,e),b(O.$$.fragment,e),b(K.$$.fragment,e),b(ee.$$.fragment,e),b(te.$$.fragment,e),b(ae.$$.fragment,e),b(pe.$$.fragment,e),b(oe.$$.fragment,e),b(ue.$$.fragment,e),Oe=!1},d(e){e&&(s(T),s(u),s(o),s(n),s(V),s(r),s(S),s(j),s(W),s(Me),s(B),s(ye),s(Ue),s(he),s(_),s(be),s(N),s(Je),s(Ze),s(I),s(Te),s(we),s($e),s(Q),s(ge),s(H),s(je),s(Ve),s(L),s(Ge),s(ve),s(v),s(Ce),s(C),s(Se),s(q),s(We),s(Re),s(Y),s(Be),s(P),s(ke),s(Fe),s(A),s(_e),s(Ne),s(xe),s(le),s(Ie),s(se),s(Xe),s(Ee),s(ne),s(Qe),s(He),s(ie),s(ze),s(Le),s(re),s(qe),s(De),s(ce),s(Ye),s(Pe),s(fe)),s(a),J(c,e),J(m,e),J(R,e),J(k,e),J(F,e),J(x,e),J(X,e),J(E,e),J(z,e),J(G,e),J(D,e),J(O,e),J(K,e),J(ee,e),J(te,e),J(ae,e),J(pe,e),J(oe,e),J(ue,e)}}}const _l='{"title":"加载调度器与模型","local":"加载调度器与模型","sections":[{"title":"加载调度器","local":"加载调度器","sections":[],"depth":2},{"title":"调度器对比","local":"调度器对比","sections":[{"title":"Flax调度器","local":"flax调度器","sections":[],"depth":3}],"depth":2},{"title":"模型加载","local":"模型加载","sections":[],"depth":2}],"depth":1}';function Nl(g){return wl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class zl extends $l{constructor(a){super(),gl(this,a,Nl,Fl,Tl,{})}}export{zl as component};
