import{s as $l,o as gl,n as ll}from"../chunks/scheduler.e4ff9b64.js";import{S as jl,i as Vl,e as f,s as i,c as M,h as Gl,a as d,d as s,b as p,f as wl,g as y,j as Z,k as Ke,l as Cl,m as t,n as U,t as h,o as b,p as J}from"../chunks/index.09f1bca0.js";import{C as vl,H as de,E as Sl}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.2e1a29f5.js";import{C as $}from"../chunks/CodeBlock.f899176c.js";import{D as Wl}from"../chunks/DocNotebookDropdown.02241b22.js";import{H as Rl,a as el}from"../chunks/HfOption.44827c7f.js";function Bl(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:ll,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="<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:ll,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 Fl(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:ll,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 _l(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:ll,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 Nl(g){let a,T,u,o,c,n,m,G;return a=new el({props:{id:"schedulers",option:"LMSDiscreteScheduler",$$slots:{default:[Bl]},$$scope:{ctx:g}}}),u=new el({props:{id:"schedulers",option:"EulerDiscreteScheduler",$$slots:{default:[kl]},$$scope:{ctx:g}}}),c=new el({props:{id:"schedulers",option:"EulerAncestralDiscreteScheduler",$$slots:{default:[Fl]},$$scope:{ctx:g}}}),m=new el({props:{id:"schedulers",option:"DPMSolverMultistepScheduler",$$slots:{default:[_l]},$$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),G=!0},p(r,w){const j={};w&2&&(j.$$scope={dirty:w,ctx:r}),a.$set(j);const me={};w&2&&(me.$$scope={dirty:w,ctx:r}),u.$set(me);const W={};w&2&&(W.$$scope={dirty:w,ctx:r}),c.$set(W);const V={};w&2&&(V.$$scope={dirty:w,ctx:r}),m.$set(V)},i(r){G||(h(a.$$.fragment,r),h(u.$$.fragment,r),h(c.$$.fragment,r),h(m.$$.fragment,r),G=!0)},o(r){b(a.$$.fragment,r),b(u.$$.fragment,r),b(c.$$.fragment,r),b(m.$$.fragment,r),G=!1},d(r){r&&(s(T),s(o),s(n)),J(a,r),J(u,r),J(c,r),J(m,r)}}}function xl(g){let a,T,u,o,c,n,m,G,r,w,j,me="Diffusion管道是由可互换的调度器(schedulers)和模型(models)组成的集合，可通过混合搭配来定制特定用例的流程。调度器封装了整个去噪过程（如去噪步数和寻找去噪样本的算法），其本身不包含可训练参数，因此内存占用极低。模型则主要负责从含噪输入到较纯净样本的前向传播过程。",W,V,sl='本指南将展示如何加载调度器和模型来自定义流程。我们将全程使用<a href="https://hf.co/stable-diffusion-v1-5/stable-diffusion-v1-5" rel="nofollow">stable-diffusion-v1-5/stable-diffusion-v1-5</a>检查点，首先加载基础管道：',Me,R,ye,B,tl="通过<code>pipeline.scheduler</code>属性可查看当前管道使用的调度器：",Ue,k,he,F,be,_,nl="调度器通过配置文件定义，同一配置文件可被多种调度器共享。使用<code>SchedulerMixin.from_pretrained()</code>方法加载时，需指定<code>subfolder</code>参数以定位配置文件在仓库中的正确子目录。",Je,N,al="例如加载<code>DDIMScheduler</code>：",Ze,x,Te,I,il="然后将新调度器传入管道：",we,X,$e,E,ge,Q,pl="不同调度器各有优劣，难以定量评估哪个最适合您的流程。通常需要在去噪速度与质量之间权衡。我们建议尝试多种调度器以找到最佳方案。通过<code>pipeline.scheduler.compatibles</code>属性可查看兼容当前管道的所有调度器。",je,H,rl="下面我们使用相同提示词和随机种子，对比<code>LMSDiscreteScheduler</code>、<code>EulerDiscreteScheduler</code>、<code>EulerAncestralDiscreteScheduler</code>和<code>DPMSolverMultistepScheduler</code>的表现：",Ve,z,Ge,L,ol="使用<code>from_config()</code>方法加载不同调度器的配置来切换管道调度器：",Ce,C,ve,v,cl='<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>',Se,S,ul='<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>',We,q,ml="多数生成图像质量相近，实际选择需根据具体场景测试多种调度器进行比较。",Re,D,Be,Y,fl="对比Flax调度器时，需额外将调度器状态加载到模型参数中。例如将<code>FlaxStableDiffusionPipeline</code>的默认调度器切换为超高效的<code>FlaxDPMSolverMultistepScheduler</code>：",ke,P,dl=`<p>[!警告]
<code>FlaxLMSDiscreteScheduler</code>和<code>FlaxDDPMScheduler</code>目前暂不兼容<code>FlaxStableDiffusionPipeline</code>。</p>`,Fe,O,_e,A,Ml="利用Flax对TPU的兼容性实现并行图像生成。需为每个设备复制模型参数，并分配输入数据：",Ne,K,xe,ee,Ie,le,yl="通过<code>ModelMixin.from_pretrained()</code>方法加载模型，该方法会下载并缓存模型权重和配置的最新版本。若本地缓存已存在最新文件，则直接复用缓存而非重复下载。",Xe,se,Ul='通过<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>子目录中：',Ee,te,Qe,ne,hl='也可直接从<a href="https://huggingface.co/google/ddpm-cifar10-32/tree/main" rel="nofollow">仓库</a>加载：',He,ae,ze,ie,bl="加载和保存模型变体时，需在<code>ModelMixin.from_pretrained()</code>和<code>ModelMixin.save_pretrained()</code>中指定<code>variant</code>参数：",Le,pe,qe,re,Jl="使用<code>from_pretrained()</code>的<code>torch_dtype</code>参数指定模型加载精度：",De,oe,Ye,ce,Zl='也可使用<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>）。',Pe,ue,Oe,fe,Ae;return c=new vl({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),m=new Wl({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers_doc/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 de({props:{title:"加载调度器与模型",local:"加载调度器与模型",headingTag:"h1"}}),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}}),C=new Rl({props:{id:"schedulers",options:["LMSDiscreteScheduler","EulerDiscreteScheduler","EulerAncestralDiscreteScheduler","DPMSolverMultistepScheduler"],$$slots:{default:[Nl]},$$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 Sl({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),G=i(),M(r.$$.fragment),w=i(),j=f("p"),j.textContent=me,W=i(),V=f("p"),V.innerHTML=sl,Me=i(),M(R.$$.fragment),ye=i(),B=f("p"),B.innerHTML=tl,Ue=i(),M(k.$$.fragment),he=i(),M(F.$$.fragment),be=i(),_=f("p"),_.innerHTML=nl,Je=i(),N=f("p"),N.innerHTML=al,Ze=i(),M(x.$$.fragment),Te=i(),I=f("p"),I.textContent=il,we=i(),M(X.$$.fragment),$e=i(),M(E.$$.fragment),ge=i(),Q=f("p"),Q.innerHTML=pl,je=i(),H=f("p"),H.innerHTML=rl,Ve=i(),M(z.$$.fragment),Ge=i(),L=f("p"),L.innerHTML=ol,Ce=i(),M(C.$$.fragment),ve=i(),v=f("div"),v.innerHTML=cl,Se=i(),S=f("div"),S.innerHTML=ul,We=i(),q=f("p"),q.textContent=ml,Re=i(),M(D.$$.fragment),Be=i(),Y=f("p"),Y.innerHTML=fl,ke=i(),P=f("blockquote"),P.innerHTML=dl,Fe=i(),M(O.$$.fragment),_e=i(),A=f("p"),A.textContent=Ml,Ne=i(),M(K.$$.fragment),xe=i(),M(ee.$$.fragment),Ie=i(),le=f("p"),le.innerHTML=yl,Xe=i(),se=f("p"),se.innerHTML=Ul,Ee=i(),M(te.$$.fragment),Qe=i(),ne=f("p"),ne.innerHTML=hl,He=i(),M(ae.$$.fragment),ze=i(),ie=f("p"),ie.innerHTML=bl,Le=i(),M(pe.$$.fragment),qe=i(),re=f("p"),re.innerHTML=Jl,De=i(),M(oe.$$.fragment),Ye=i(),ce=f("p"),ce.innerHTML=Zl,Pe=i(),M(ue.$$.fragment),Oe=i(),fe=f("p"),this.h()},l(e){const l=Gl("svelte-u9bgzb",document.head);a=d(l,"META",{name:!0,content:!0}),l.forEach(s),T=p(e),u=d(e,"P",{}),wl(u).forEach(s),o=p(e),y(c.$$.fragment,e),n=p(e),y(m.$$.fragment,e),G=p(e),y(r.$$.fragment,e),w=p(e),j=d(e,"P",{"data-svelte-h":!0}),Z(j)!=="svelte-qqzqus"&&(j.textContent=me),W=p(e),V=d(e,"P",{"data-svelte-h":!0}),Z(V)!=="svelte-1x2hc4b"&&(V.innerHTML=sl),Me=p(e),y(R.$$.fragment,e),ye=p(e),B=d(e,"P",{"data-svelte-h":!0}),Z(B)!=="svelte-wbd7yp"&&(B.innerHTML=tl),Ue=p(e),y(k.$$.fragment,e),he=p(e),y(F.$$.fragment,e),be=p(e),_=d(e,"P",{"data-svelte-h":!0}),Z(_)!=="svelte-1wo742j"&&(_.innerHTML=nl),Je=p(e),N=d(e,"P",{"data-svelte-h":!0}),Z(N)!=="svelte-1shhttm"&&(N.innerHTML=al),Ze=p(e),y(x.$$.fragment,e),Te=p(e),I=d(e,"P",{"data-svelte-h":!0}),Z(I)!=="svelte-1pu4pg4"&&(I.textContent=il),we=p(e),y(X.$$.fragment,e),$e=p(e),y(E.$$.fragment,e),ge=p(e),Q=d(e,"P",{"data-svelte-h":!0}),Z(Q)!=="svelte-16271jk"&&(Q.innerHTML=pl),je=p(e),H=d(e,"P",{"data-svelte-h":!0}),Z(H)!=="svelte-9hd88i"&&(H.innerHTML=rl),Ve=p(e),y(z.$$.fragment,e),Ge=p(e),L=d(e,"P",{"data-svelte-h":!0}),Z(L)!=="svelte-bkdr33"&&(L.innerHTML=ol),Ce=p(e),y(C.$$.fragment,e),ve=p(e),v=d(e,"DIV",{class:!0,"data-svelte-h":!0}),Z(v)!=="svelte-k6zsrl"&&(v.innerHTML=cl),Se=p(e),S=d(e,"DIV",{class:!0,"data-svelte-h":!0}),Z(S)!=="svelte-8ii4fv"&&(S.innerHTML=ul),We=p(e),q=d(e,"P",{"data-svelte-h":!0}),Z(q)!=="svelte-qgl98h"&&(q.textContent=ml),Re=p(e),y(D.$$.fragment,e),Be=p(e),Y=d(e,"P",{"data-svelte-h":!0}),Z(Y)!=="svelte-1vi1bry"&&(Y.innerHTML=fl),ke=p(e),P=d(e,"BLOCKQUOTE",{"data-svelte-h":!0}),Z(P)!=="svelte-7evmht"&&(P.innerHTML=dl),Fe=p(e),y(O.$$.fragment,e),_e=p(e),A=d(e,"P",{"data-svelte-h":!0}),Z(A)!=="svelte-e7fncg"&&(A.textContent=Ml),Ne=p(e),y(K.$$.fragment,e),xe=p(e),y(ee.$$.fragment,e),Ie=p(e),le=d(e,"P",{"data-svelte-h":!0}),Z(le)!=="svelte-ur4w4z"&&(le.innerHTML=yl),Xe=p(e),se=d(e,"P",{"data-svelte-h":!0}),Z(se)!=="svelte-14l7nhl"&&(se.innerHTML=Ul),Ee=p(e),y(te.$$.fragment,e),Qe=p(e),ne=d(e,"P",{"data-svelte-h":!0}),Z(ne)!=="svelte-eapyly"&&(ne.innerHTML=hl),He=p(e),y(ae.$$.fragment,e),ze=p(e),ie=d(e,"P",{"data-svelte-h":!0}),Z(ie)!=="svelte-138vbbm"&&(ie.innerHTML=bl),Le=p(e),y(pe.$$.fragment,e),qe=p(e),re=d(e,"P",{"data-svelte-h":!0}),Z(re)!=="svelte-1q3nzb0"&&(re.innerHTML=Jl),De=p(e),y(oe.$$.fragment,e),Ye=p(e),ce=d(e,"P",{"data-svelte-h":!0}),Z(ce)!=="svelte-1ys84js"&&(ce.innerHTML=Zl),Pe=p(e),y(ue.$$.fragment,e),Oe=p(e),fe=d(e,"P",{}),wl(fe).forEach(s),this.h()},h(){Ke(a,"name","hf:doc:metadata"),Ke(a,"content",Il),Ke(v,"class","flex gap-4"),Ke(S,"class","flex gap-4")},m(e,l){Cl(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,G,l),U(r,e,l),t(e,w,l),t(e,j,l),t(e,W,l),t(e,V,l),t(e,Me,l),U(R,e,l),t(e,ye,l),t(e,B,l),t(e,Ue,l),U(k,e,l),t(e,he,l),U(F,e,l),t(e,be,l),t(e,_,l),t(e,Je,l),t(e,N,l),t(e,Ze,l),U(x,e,l),t(e,Te,l),t(e,I,l),t(e,we,l),U(X,e,l),t(e,$e,l),U(E,e,l),t(e,ge,l),t(e,Q,l),t(e,je,l),t(e,H,l),t(e,Ve,l),U(z,e,l),t(e,Ge,l),t(e,L,l),t(e,Ce,l),U(C,e,l),t(e,ve,l),t(e,v,l),t(e,Se,l),t(e,S,l),t(e,We,l),t(e,q,l),t(e,Re,l),U(D,e,l),t(e,Be,l),t(e,Y,l),t(e,ke,l),t(e,P,l),t(e,Fe,l),U(O,e,l),t(e,_e,l),t(e,A,l),t(e,Ne,l),U(K,e,l),t(e,xe,l),U(ee,e,l),t(e,Ie,l),t(e,le,l),t(e,Xe,l),t(e,se,l),t(e,Ee,l),U(te,e,l),t(e,Qe,l),t(e,ne,l),t(e,He,l),U(ae,e,l),t(e,ze,l),t(e,ie,l),t(e,Le,l),U(pe,e,l),t(e,qe,l),t(e,re,l),t(e,De,l),U(oe,e,l),t(e,Ye,l),t(e,ce,l),t(e,Pe,l),U(ue,e,l),t(e,Oe,l),t(e,fe,l),Ae=!0},p(e,[l]){const Tl={};l&2&&(Tl.$$scope={dirty:l,ctx:e}),C.$set(Tl)},i(e){Ae||(h(c.$$.fragment,e),h(m.$$.fragment,e),h(r.$$.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(C.$$.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),Ae=!0)},o(e){b(c.$$.fragment,e),b(m.$$.fragment,e),b(r.$$.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(C.$$.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),Ae=!1},d(e){e&&(s(T),s(u),s(o),s(n),s(G),s(w),s(j),s(W),s(V),s(Me),s(ye),s(B),s(Ue),s(he),s(be),s(_),s(Je),s(N),s(Ze),s(Te),s(I),s(we),s($e),s(ge),s(Q),s(je),s(H),s(Ve),s(Ge),s(L),s(Ce),s(ve),s(v),s(Se),s(S),s(We),s(q),s(Re),s(Be),s(Y),s(ke),s(P),s(Fe),s(_e),s(A),s(Ne),s(xe),s(Ie),s(le),s(Xe),s(se),s(Ee),s(Qe),s(ne),s(He),s(ze),s(ie),s(Le),s(qe),s(re),s(De),s(Ye),s(ce),s(Pe),s(Oe),s(fe)),s(a),J(c,e),J(m,e),J(r,e),J(R,e),J(k,e),J(F,e),J(x,e),J(X,e),J(E,e),J(z,e),J(C,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 Il='{"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 Xl(g){return gl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Dl extends jl{constructor(a){super(),Vl(this,a,Xl,xl,$l,{})}}export{Dl as component};
