import{s as At,o as qt,n as we}from"../chunks/scheduler.e4ff9b64.js";import{S as Pt,i as Dt,e as c,s as p,c as _,h as Ot,a as u,d as l,b as m,f as zt,g as b,j as d,k as ye,l as Kt,m as s,n as h,t as y,o as U,p as g}from"../chunks/index.09f1bca0.js";import{C as el,H as Ue,E as tl}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.2e1a29f5.js";import{C as Z}from"../chunks/CodeBlock.f899176c.js";import{H as _t,a as ge}from"../chunks/HfOption.44827c7f.js";function ll(J){let n,o;return n=new Z({props:{code:"Y2QlMjBleGFtcGxlcyUyRnRleHRfdG9faW1hZ2UlMEFwaXAlMjBpbnN0YWxsJTIwLXIlMjByZXF1aXJlbWVudHMudHh0",highlighted:`<span class="hljs-built_in">cd</span> examples/text_to_image
pip install -r requirements.txt`,wrap:!1}}),{c(){_(n.$$.fragment)},l(a){b(n.$$.fragment,a)},m(a,r){h(n,a,r),o=!0},p:we,i(a){o||(y(n.$$.fragment,a),o=!0)},o(a){U(n.$$.fragment,a),o=!1},d(a){g(n,a)}}}function sl(J){let n,o;return n=new Z({props:{code:"Y2QlMjBleGFtcGxlcyUyRnRleHRfdG9faW1hZ2UlMEFwaXAlMjBpbnN0YWxsJTIwLXIlMjByZXF1aXJlbWVudHNfZmxheC50eHQ=",highlighted:`<span class="hljs-built_in">cd</span> examples/text_to_image
pip install -r requirements_flax.txt`,wrap:!1}}),{c(){_(n.$$.fragment)},l(a){b(n.$$.fragment,a)},m(a,r){h(n,a,r),o=!0},p:we,i(a){o||(y(n.$$.fragment,a),o=!0)},o(a){U(n.$$.fragment,a),o=!1},d(a){g(n,a)}}}function nl(J){let n,o,a,r;return n=new ge({props:{id:"installation",option:"PyTorch",$$slots:{default:[ll]},$$scope:{ctx:J}}}),a=new ge({props:{id:"installation",option:"Flax",$$slots:{default:[sl]},$$scope:{ctx:J}}}),{c(){_(n.$$.fragment),o=p(),_(a.$$.fragment)},l(i){b(n.$$.fragment,i),o=m(i),b(a.$$.fragment,i)},m(i,f){h(n,i,f),s(i,o,f),h(a,i,f),r=!0},p(i,f){const M={};f&2&&(M.$$scope={dirty:f,ctx:i}),n.$set(M);const T={};f&2&&(T.$$scope={dirty:f,ctx:i}),a.$set(T)},i(i){r||(y(n.$$.fragment,i),y(a.$$.fragment,i),r=!0)},o(i){U(n.$$.fragment,i),U(a.$$.fragment,i),r=!1},d(i){i&&l(o),g(n,i),g(a,i)}}}function al(J){let n,o='以 <a href="https://huggingface.co/datasets/lambdalabs/naruto-blip-captions" rel="nofollow">火影忍者BLIP标注数据集</a> 为例训练生成火影角色。设置环境变量 <code>MODEL_NAME</code> 和 <code>dataset_name</code> 指定模型和数据集（Hub或本地路径）。多GPU训练需在 <code>accelerate launch</code> 命令中添加 <code>--multi_gpu</code> 参数。',a,r,i="<p>使用本地数据集时，设置 <code>TRAIN_DIR</code> 和 <code>OUTPUT_DIR</code> 环境变量为数据集路径和模型保存路径。</p>",f,M,T;return M=new Z({props:{code:"ZXhwb3J0JTIwTU9ERUxfTkFNRSUzRCUyMnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUwQWV4cG9ydCUyMGRhdGFzZXRfbmFtZSUzRCUyMmxhbWJkYWxhYnMlMkZuYXJ1dG8tYmxpcC1jYXB0aW9ucyUyMiUwQSUwQWFjY2VsZXJhdGUlMjBsYXVuY2glMjAtLW1peGVkX3ByZWNpc2lvbiUzRCUyMmZwMTYlMjIlMjAlMjB0cmFpbl90ZXh0X3RvX2ltYWdlLnB5JTIwJTVDJTBBJTIwJTIwLS1wcmV0cmFpbmVkX21vZGVsX25hbWVfb3JfcGF0aCUzRCUyNE1PREVMX05BTUUlMjAlNUMlMEElMjAlMjAtLWRhdGFzZXRfbmFtZSUzRCUyNGRhdGFzZXRfbmFtZSUyMCU1QyUwQSUyMCUyMC0tdXNlX2VtYSUyMCU1QyUwQSUyMCUyMC0tcmVzb2x1dGlvbiUzRDUxMiUyMC0tY2VudGVyX2Nyb3AlMjAtLXJhbmRvbV9mbGlwJTIwJTVDJTBBJTIwJTIwLS10cmFpbl9iYXRjaF9zaXplJTNEMSUyMCU1QyUwQSUyMCUyMC0tZ3JhZGllbnRfYWNjdW11bGF0aW9uX3N0ZXBzJTNENCUyMCU1QyUwQSUyMCUyMC0tZ3JhZGllbnRfY2hlY2twb2ludGluZyUyMCU1QyUwQSUyMCUyMC0tbWF4X3RyYWluX3N0ZXBzJTNEMTUwMDAlMjAlNUMlMEElMjAlMjAtLWxlYXJuaW5nX3JhdGUlM0QxZS0wNSUyMCU1QyUwQSUyMCUyMC0tbWF4X2dyYWRfbm9ybSUzRDElMjAlNUMlMEElMjAlMjAtLWVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbiUyMCU1QyUwQSUyMCUyMC0tbHJfc2NoZWR1bGVyJTNEJTIyY29uc3RhbnQlMjIlMjAtLWxyX3dhcm11cF9zdGVwcyUzRDAlMjAlNUMlMEElMjAlMjAtLW91dHB1dF9kaXIlM0QlMjJzZC1uYXJ1dG8tbW9kZWwlMjIlMjAlNUMlMEElMjAlMjAtLXB1c2hfdG9faHVi",highlighted:`<span class="hljs-built_in">export</span> MODEL_NAME=<span class="hljs-string">&quot;stable-diffusion-v1-5/stable-diffusion-v1-5&quot;</span>
<span class="hljs-built_in">export</span> dataset_name=<span class="hljs-string">&quot;lambdalabs/naruto-blip-captions&quot;</span>

accelerate launch --mixed_precision=<span class="hljs-string">&quot;fp16&quot;</span>  train_text_to_image.py \\
  --pretrained_model_name_or_path=<span class="hljs-variable">$MODEL_NAME</span> \\
  --dataset_name=<span class="hljs-variable">$dataset_name</span> \\
  --use_ema \\
  --resolution=512 --center_crop --random_flip \\
  --train_batch_size=1 \\
  --gradient_accumulation_steps=4 \\
  --gradient_checkpointing \\
  --max_train_steps=15000 \\
  --learning_rate=1e-05 \\
  --max_grad_norm=1 \\
  --enable_xformers_memory_efficient_attention \\
  --lr_scheduler=<span class="hljs-string">&quot;constant&quot;</span> --lr_warmup_steps=0 \\
  --output_dir=<span class="hljs-string">&quot;sd-naruto-model&quot;</span> \\
  --push_to_hub`,wrap:!1}}),{c(){n=c("p"),n.innerHTML=o,a=p(),r=c("blockquote"),r.innerHTML=i,f=p(),_(M.$$.fragment),this.h()},l($){n=u($,"P",{"data-svelte-h":!0}),d(n)!=="svelte-tmdnu8"&&(n.innerHTML=o),a=m($),r=u($,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),d(r)!=="svelte-5nkv91"&&(r.innerHTML=i),f=m($),b(M.$$.fragment,$),this.h()},h(){ye(r,"class","tip")},m($,j){s($,n,j),s($,a,j),s($,r,j),s($,f,j),h(M,$,j),T=!0},p:we,i($){T||(y(M.$$.fragment,$),T=!0)},o($){U(M.$$.fragment,$),T=!1},d($){$&&(l(n),l(a),l(r),l(f)),g(M,$)}}}function il(J){let n,o='Flax训练方案在TPU/GPU上效率更高（由 <a href="https://github.com/duongna21" rel="nofollow">@duongna211</a> 实现），TPU性能更优但GPU表现同样出色。',a,r,i="设置环境变量 <code>MODEL_NAME</code> 和 <code>dataset_name</code> 指定模型和数据集（Hub或本地路径）。",f,M,T="<p>使用本地数据集时，设置 <code>TRAIN_DIR</code> 和 <code>OUTPUT_DIR</code> 环境变量为数据集路径和模型保存路径。</p>",$,j,W;return j=new Z({props:{code:"ZXhwb3J0JTIwTU9ERUxfTkFNRSUzRCUyMnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyRnN0YWJsZS1kaWZmdXNpb24tdjEtNSUyMiUwQWV4cG9ydCUyMGRhdGFzZXRfbmFtZSUzRCUyMmxhbWJkYWxhYnMlMkZuYXJ1dG8tYmxpcC1jYXB0aW9ucyUyMiUwQSUwQXB5dGhvbiUyMHRyYWluX3RleHRfdG9faW1hZ2VfZmxheC5weSUyMCU1QyUwQSUyMCUyMC0tcHJldHJhaW5lZF9tb2RlbF9uYW1lX29yX3BhdGglM0QlMjRNT0RFTF9OQU1FJTIwJTVDJTBBJTIwJTIwLS1kYXRhc2V0X25hbWUlM0QlMjRkYXRhc2V0X25hbWUlMjAlNUMlMEElMjAlMjAtLXJlc29sdXRpb24lM0Q1MTIlMjAtLWNlbnRlcl9jcm9wJTIwLS1yYW5kb21fZmxpcCUyMCU1QyUwQSUyMCUyMC0tdHJhaW5fYmF0Y2hfc2l6ZSUzRDElMjAlNUMlMEElMjAlMjAtLW1heF90cmFpbl9zdGVwcyUzRDE1MDAwJTIwJTVDJTBBJTIwJTIwLS1sZWFybmluZ19yYXRlJTNEMWUtMDUlMjAlNUMlMEElMjAlMjAtLW1heF9ncmFkX25vcm0lM0QxJTIwJTVDJTBBJTIwJTIwLS1vdXRwdXRfZGlyJTNEJTIyc2QtbmFydXRvLW1vZGVsJTIyJTIwJTVDJTBBJTIwJTIwLS1wdXNoX3RvX2h1Yg==",highlighted:`<span class="hljs-built_in">export</span> MODEL_NAME=<span class="hljs-string">&quot;stable-diffusion-v1-5/stable-diffusion-v1-5&quot;</span>
<span class="hljs-built_in">export</span> dataset_name=<span class="hljs-string">&quot;lambdalabs/naruto-blip-captions&quot;</span>

python train_text_to_image_flax.py \\
  --pretrained_model_name_or_path=<span class="hljs-variable">$MODEL_NAME</span> \\
  --dataset_name=<span class="hljs-variable">$dataset_name</span> \\
  --resolution=512 --center_crop --random_flip \\
  --train_batch_size=1 \\
  --max_train_steps=15000 \\
  --learning_rate=1e-05 \\
  --max_grad_norm=1 \\
  --output_dir=<span class="hljs-string">&quot;sd-naruto-model&quot;</span> \\
  --push_to_hub`,wrap:!1}}),{c(){n=c("p"),n.innerHTML=o,a=p(),r=c("p"),r.innerHTML=i,f=p(),M=c("blockquote"),M.innerHTML=T,$=p(),_(j.$$.fragment),this.h()},l(w){n=u(w,"P",{"data-svelte-h":!0}),d(n)!=="svelte-q05eox"&&(n.innerHTML=o),a=m(w),r=u(w,"P",{"data-svelte-h":!0}),d(r)!=="svelte-1ajdmne"&&(r.innerHTML=i),f=m(w),M=u(w,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),d(M)!=="svelte-5nkv91"&&(M.innerHTML=T),$=m(w),b(j.$$.fragment,w),this.h()},h(){ye(M,"class","tip")},m(w,x){s(w,n,x),s(w,a,x),s(w,r,x),s(w,f,x),s(w,M,x),s(w,$,x),h(j,w,x),W=!0},p:we,i(w){W||(y(j.$$.fragment,w),W=!0)},o(w){U(j.$$.fragment,w),W=!1},d(w){w&&(l(n),l(a),l(r),l(f),l(M),l($)),g(j,w)}}}function pl(J){let n,o,a,r;return n=new ge({props:{id:"training-inference",option:"PyTorch",$$slots:{default:[al]},$$scope:{ctx:J}}}),a=new ge({props:{id:"training-inference",option:"Flax",$$slots:{default:[il]},$$scope:{ctx:J}}}),{c(){_(n.$$.fragment),o=p(),_(a.$$.fragment)},l(i){b(n.$$.fragment,i),o=m(i),b(a.$$.fragment,i)},m(i,f){h(n,i,f),s(i,o,f),h(a,i,f),r=!0},p(i,f){const M={};f&2&&(M.$$scope={dirty:f,ctx:i}),n.$set(M);const T={};f&2&&(T.$$scope={dirty:f,ctx:i}),a.$set(T)},i(i){r||(y(n.$$.fragment,i),y(a.$$.fragment,i),r=!0)},o(i){U(n.$$.fragment,i),U(a.$$.fragment,i),r=!1},d(i){i&&l(o),g(n,i),g(a,i)}}}function ml(J){let n,o;return n=new Z({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlbGluZSUyMCUzRCUyMFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJwYXRoJTJGdG8lMkZzYXZlZF9tb2RlbCUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiUyQyUyMHVzZV9zYWZldGVuc29ycyUzRFRydWUpLnRvKCUyMmN1ZGElMjIpJTBBJTBBaW1hZ2UlMjAlM0QlMjBwaXBlbGluZShwcm9tcHQlM0QlMjJ5b2RhJTIyKS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2Uuc2F2ZSglMjJ5b2RhLW5hcnV0by5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> StableDiffusionPipeline
<span class="hljs-keyword">import</span> torch

pipeline = StableDiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;path/to/saved_model&quot;</span>, torch_dtype=torch.float16, use_safetensors=<span class="hljs-literal">True</span>).to(<span class="hljs-string">&quot;cuda&quot;</span>)

image = pipeline(prompt=<span class="hljs-string">&quot;yoda&quot;</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;yoda-naruto.png&quot;</span>)`,wrap:!1}}),{c(){_(n.$$.fragment)},l(a){b(n.$$.fragment,a)},m(a,r){h(n,a,r),o=!0},p:we,i(a){o||(y(n.$$.fragment,a),o=!0)},o(a){U(n.$$.fragment,a),o=!1},d(a){g(n,a)}}}function ol(J){let n,o;return n=new Z({props:{code:"aW1wb3J0JTIwamF4JTBBaW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBZnJvbSUyMGZsYXguamF4X3V0aWxzJTIwaW1wb3J0JTIwcmVwbGljYXRlJTBBZnJvbSUyMGZsYXgudHJhaW5pbmcuY29tbW9uX3V0aWxzJTIwaW1wb3J0JTIwc2hhcmQlMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRmxheFN0YWJsZURpZmZ1c2lvblBpcGVsaW5lJTBBJTBBcGlwZWxpbmUlMkMlMjBwYXJhbXMlMjAlM0QlMjBGbGF4U3RhYmxlRGlmZnVzaW9uUGlwZWxpbmUuZnJvbV9wcmV0cmFpbmVkKCUyMnBhdGglMkZ0byUyRnNhdmVkX21vZGVsJTIyJTJDJTIwZHR5cGUlM0RqYXgubnVtcHkuYmZsb2F0MTYpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyeW9kYSUyMG5hcnV0byUyMiUwQXBybmdfc2VlZCUyMCUzRCUyMGpheC5yYW5kb20uUFJOR0tleSgwKSUwQW51bV9pbmZlcmVuY2Vfc3RlcHMlMjAlM0QlMjA1MCUwQSUwQW51bV9zYW1wbGVzJTIwJTNEJTIwamF4LmRldmljZV9jb3VudCgpJTBBcHJvbXB0JTIwJTNEJTIwbnVtX3NhbXBsZXMlMjAqJTIwJTVCcHJvbXB0JTVEJTBBcHJvbXB0X2lkcyUyMCUzRCUyMHBpcGVsaW5lLnByZXBhcmVfaW5wdXRzKHByb21wdCklMEElMEElMjMlMjAlRTUlODglODYlRTclODklODclRTglQkUlOTMlRTUlODUlQTUlRTUlOTIlOEMlRTklOUElOEYlRTYlOUMlQkElRTYlOTUlQjAlMEFwYXJhbXMlMjAlM0QlMjByZXBsaWNhdGUocGFyYW1zKSUwQXBybmdfc2VlZCUyMCUzRCUyMGpheC5yYW5kb20uc3BsaXQocHJuZ19zZWVkJTJDJTIwamF4LmRldmljZV9jb3VudCgpKSUwQXByb21wdF9pZHMlMjAlM0QlMjBzaGFyZChwcm9tcHRfaWRzKSUwQSUwQWltYWdlcyUyMCUzRCUyMHBpcGVsaW5lKHByb21wdF9pZHMlMkMlMjBwYXJhbXMlMkMlMjBwcm5nX3NlZWQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTJDJTIwaml0JTNEVHJ1ZSkuaW1hZ2VzJTBBaW1hZ2VzJTIwJTNEJTIwcGlwZWxpbmUubnVtcHlfdG9fcGlsKG5wLmFzYXJyYXkoaW1hZ2VzLnJlc2hhcGUoKG51bV9zYW1wbGVzJTJDKSUyMCUyQiUyMGltYWdlcy5zaGFwZSU1Qi0zJTNBJTVEKSkpJTBBaW1hZ2Uuc2F2ZSglMjJ5b2RhLW5hcnV0by5wbmclMjIp",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

pipeline, params = FlaxStableDiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;path/to/saved_model&quot;</span>, dtype=jax.numpy.bfloat16)

prompt = <span class="hljs-string">&quot;yoda naruto&quot;</span>
prng_seed = jax.random.PRNGKey(<span class="hljs-number">0</span>)
num_inference_steps = <span class="hljs-number">50</span>

num_samples = jax.device_count()
prompt = num_samples * [prompt]
prompt_ids = pipeline.prepare_inputs(prompt)

<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>:])))
image.save(<span class="hljs-string">&quot;yoda-naruto.png&quot;</span>)`,wrap:!1}}),{c(){_(n.$$.fragment)},l(a){b(n.$$.fragment,a)},m(a,r){h(n,a,r),o=!0},p:we,i(a){o||(y(n.$$.fragment,a),o=!0)},o(a){U(n.$$.fragment,a),o=!1},d(a){g(n,a)}}}function rl(J){let n,o,a,r;return n=new ge({props:{id:"training-inference",option:"PyTorch",$$slots:{default:[ml]},$$scope:{ctx:J}}}),a=new ge({props:{id:"training-inference",option:"Flax",$$slots:{default:[ol]},$$scope:{ctx:J}}}),{c(){_(n.$$.fragment),o=p(),_(a.$$.fragment)},l(i){b(n.$$.fragment,i),o=m(i),b(a.$$.fragment,i)},m(i,f){h(n,i,f),s(i,o,f),h(a,i,f),r=!0},p(i,f){const M={};f&2&&(M.$$scope={dirty:f,ctx:i}),n.$set(M);const T={};f&2&&(T.$$scope={dirty:f,ctx:i}),a.$set(T)},i(i){r||(y(n.$$.fragment,i),y(a.$$.fragment,i),r=!0)},o(i){U(n.$$.fragment,i),U(a.$$.fragment,i),r=!1},d(i){i&&l(o),g(n,i),g(a,i)}}}function fl(J){let n,o,a,r,i,f,M,T,$,j="<p>文生图训练脚本目前处于实验阶段，容易出现过拟合和灾难性遗忘等问题。建议尝试不同超参数以获得最佳数据集适配效果。</p>",W,w,x="Stable Diffusion 等文生图模型能够根据文本提示生成对应图像。",Je,B,bt='模型训练对硬件要求较高，但启用 <code>gradient_checkpointing</code> 和 <code>mixed_precision</code> 后，可在单块24GB显存GPU上完成训练。如需更大批次或更快训练速度，建议使用30GB以上显存的GPU设备。通过启用 <a href="../optimization/xformers">xFormers</a> 内存高效注意力机制可降低显存占用。JAX/Flax 训练方案也支持TPU/GPU高效训练，但不支持梯度检查点、梯度累积和xFormers。使用Flax训练时建议配备30GB以上显存GPU或TPU v3。',je,k,ht='本指南将详解 <a href="https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image.py" rel="nofollow">train_text_to_image.py</a> 训练脚本，助您掌握其原理并适配自定义需求。',Ze,V,yt="运行脚本前请确保已从源码安装库：",xe,L,We,H,Ut="然后进入包含训练脚本的示例目录，安装对应依赖：",Ce,C,Re,R,gt='<p>🤗 Accelerate 是支持多GPU/TPU训练和混合精度的工具库，能根据硬件环境自动配置训练参数。参阅 🤗 Accelerate <a href="https://huggingface.co/docs/accelerate/quicktour" rel="nofollow">快速入门</a> 了解更多。</p>',Xe,Y,wt="初始化 🤗 Accelerate 环境：",Ge,N,ve,F,Tt="要创建默认配置环境（不进行交互式选择）：",Be,E,ke,I,Jt="若环境不支持交互式shell（如notebook），可使用：",Ve,Q,Le,S,jt='最后，如需在自定义数据集上训练，请参阅 <a href="create_dataset">创建训练数据集</a> 指南了解如何准备适配脚本的数据集。',He,z,Ye,X,Zt='<p>以下重点介绍脚本中影响训练效果的关键参数，如需完整参数说明可查阅 <a href="https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image.py" rel="nofollow">脚本源码</a>。如有疑问欢迎反馈。</p>',Ne,A,xt='训练脚本提供丰富参数供自定义训练流程，所有参数及说明详见 <a href="https://github.com/huggingface/diffusers/blob/8959c5b9dec1c94d6ba482c94a58d2215c5fd026/examples/text_to_image/train_text_to_image.py#L193" rel="nofollow"><code>parse_args()</code></a> 函数。该函数为每个参数提供默认值（如批次大小、学习率等），也可通过命令行参数覆盖。',Fe,q,Wt="例如使用fp16混合精度加速训练：",Ee,P,Ie,D,Ct="基础重要参数包括：",Qe,O,Rt="<li><code>--pretrained_model_name_or_path</code>: Hub模型名称或本地预训练模型路径</li> <li><code>--dataset_name</code>: Hub数据集名称或本地训练数据集路径</li> <li><code>--image_column</code>: 数据集中图像列名</li> <li><code>--caption_column</code>: 数据集中文本列名</li> <li><code>--output_dir</code>: 模型保存路径</li> <li><code>--push_to_hub</code>: 是否将训练模型推送至Hub</li> <li><code>--checkpointing_steps</code>: 模型检查点保存步数；训练中断时可添加 <code>--resume_from_checkpoint</code> 从该检查点恢复训练</li>",Se,K,ze,ee,Xt='<a href="https://huggingface.co/papers/2303.09556" rel="nofollow">Min-SNR</a> 加权策略通过重新平衡损失函数加速模型收敛。训练脚本支持预测 <code>epsilon</code>（噪声）或 <code>v_prediction</code>，而Min-SNR兼容两种预测类型。该策略仅限PyTorch版本，Flax训练脚本不支持。',Ae,te,Gt="添加 <code>--snr_gamma</code> 参数并设为推荐值5.0：",qe,le,Pe,se,vt='可通过此 <a href="https://wandb.ai/sayakpaul/text2image-finetune-minsnr" rel="nofollow">Weights and Biases</a> 报告比较不同 <code>snr_gamma</code> 值的损失曲面。小数据集上Min-SNR效果可能不如大数据集显著。',De,ne,Oe,ae,Bt='数据集预处理代码和训练循环位于 <a href="https://github.com/huggingface/diffusers/blob/8959c5b9dec1c94d6ba482c94a58d2215c5fd026/examples/text_to_image/train_text_to_image.py#L490" rel="nofollow"><code>main()</code></a> 函数，自定义修改需在此处进行。',Ke,ie,kt='<code>train_text_to_image</code> 脚本首先 <a href="https://github.com/huggingface/diffusers/blob/8959c5b9dec1c94d6ba482c94a58d2215c5fd026/examples/text_to_image/train_text_to_image.py#L543" rel="nofollow">加载调度器</a> 和分词器，此处可替换其他调度器：',et,pe,tt,me,Vt='接着 <a href="https://github.com/huggingface/diffusers/blob/8959c5b9dec1c94d6ba482c94a58d2215c5fd026/examples/text_to_image/train_text_to_image.py#L619" rel="nofollow">加载UNet模型</a>：',lt,oe,st,re,Lt='随后对数据集的文本和图像列进行预处理。<a href="https://github.com/huggingface/diffusers/blob/8959c5b9dec1c94d6ba482c94a58d2215c5fd026/examples/text_to_image/train_text_to_image.py#L724" rel="nofollow"><code>tokenize_captions</code></a> 函数处理文本分词，<a href="https://github.com/huggingface/diffusers/blob/8959c5b9dec1c94d6ba482c94a58d2215c5fd026/examples/text_to_image/train_text_to_image.py#L742" rel="nofollow"><code>train_transforms</code></a> 定义图像增强策略，二者集成于 <code>preprocess_train</code>：',nt,fe,at,ce,Ht='最后，<a href="https://github.com/huggingface/diffusers/blob/8959c5b9dec1c94d6ba482c94a58d2215c5fd026/examples/text_to_image/train_text_to_image.py#L878" rel="nofollow">训练循环</a> 处理剩余流程：图像编码为潜空间、添加噪声、计算文本嵌入条件、更新模型参数、保存并推送模型至Hub。想深入了解训练循环原理，可参阅 <a href="../using-diffusers/write_own_pipeline">理解管道、模型与调度器</a> 教程，该教程解析了去噪过程的核心逻辑。',it,ue,pt,Me,Yt="完成所有配置后，即可启动训练脚本！🚀",mt,G,ot,de,Nt="训练完成后，即可使用新模型进行推理：",rt,v,ft,$e,ct,_e,Ft="恭喜完成文生图模型训练！如需进一步使用模型，以下指南可能有所帮助：",ut,be,Et='<li>了解如何加载 <a href="../using-diffusers/loading_adapters#LoRA">LoRA权重</a> 进行推理（如果训练时使用了LoRA）</li> <li>在 <a href="../using-diffusers/conditional_image_generation">文生图</a> 任务指南中，了解引导尺度等参数或提示词加权等技术如何控制生成效果</li>',Mt,he,dt,Te,$t;return i=new el({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),M=new Ue({props:{title:"文生图",local:"文生图",headingTag:"h1"}}),L=new Z({props:{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZodWdnaW5nZmFjZSUyRmRpZmZ1c2VycyUwQWNkJTIwZGlmZnVzZXJzJTBBcGlwJTIwaW5zdGFsbCUyMC4=",highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/huggingface/diffusers
<span class="hljs-built_in">cd</span> diffusers
pip install .`,wrap:!1}}),C=new _t({props:{id:"installation",options:["PyTorch","Flax"],$$slots:{default:[nl]},$$scope:{ctx:J}}}),N=new Z({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZw==",highlighted:"accelerate config",wrap:!1}}),E=new Z({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZyUyMGRlZmF1bHQ=",highlighted:"accelerate config default",wrap:!1}}),Q=new Z({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUudXRpbHMlMjBpbXBvcnQlMjB3cml0ZV9iYXNpY19jb25maWclMEElMEF3cml0ZV9iYXNpY19jb25maWcoKQ==",highlighted:`<span class="hljs-keyword">from</span> accelerate.utils <span class="hljs-keyword">import</span> write_basic_config

write_basic_config()`,wrap:!1}}),z=new Ue({props:{title:"脚本参数",local:"脚本参数",headingTag:"h2"}}),P=new Z({props:{code:"YWNjZWxlcmF0ZSUyMGxhdW5jaCUyMHRyYWluX3RleHRfdG9faW1hZ2UucHklMjAlNUMlMEElMjAlMjAtLW1peGVkX3ByZWNpc2lvbiUzRCUyMmZwMTYlMjI=",highlighted:`accelerate launch train_text_to_image.py \\
  --mixed_precision=<span class="hljs-string">&quot;fp16&quot;</span>`,wrap:!1}}),K=new Ue({props:{title:"Min-SNR加权策略",local:"min-snr加权策略",headingTag:"h3"}}),le=new Z({props:{code:"YWNjZWxlcmF0ZSUyMGxhdW5jaCUyMHRyYWluX3RleHRfdG9faW1hZ2UucHklMjAlNUMlMEElMjAlMjAtLXNucl9nYW1tYSUzRDUuMA==",highlighted:`accelerate launch train_text_to_image.py \\
  --snr_gamma=5.0`,wrap:!1}}),ne=new Ue({props:{title:"训练脚本解析",local:"训练脚本解析",headingTag:"h2"}}),pe=new Z({props:{code:"bm9pc2Vfc2NoZWR1bGVyJTIwJTNEJTIwRERQTVNjaGVkdWxlci5mcm9tX3ByZXRyYWluZWQoYXJncy5wcmV0cmFpbmVkX21vZGVsX25hbWVfb3JfcGF0aCUyQyUyMHN1YmZvbGRlciUzRCUyMnNjaGVkdWxlciUyMiklMEF0b2tlbml6ZXIlMjAlM0QlMjBDTElQVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjBhcmdzLnByZXRyYWluZWRfbW9kZWxfbmFtZV9vcl9wYXRoJTJDJTIwc3ViZm9sZGVyJTNEJTIydG9rZW5pemVyJTIyJTJDJTIwcmV2aXNpb24lM0RhcmdzLnJldmlzaW9uJTBBKQ==",highlighted:`noise_scheduler = DDPMScheduler.from_pretrained(args.pretrained_model_name_or_path, subfolder=<span class="hljs-string">&quot;scheduler&quot;</span>)
tokenizer = CLIPTokenizer.from_pretrained(
    args.pretrained_model_name_or_path, subfolder=<span class="hljs-string">&quot;tokenizer&quot;</span>, revision=args.revision
)`,wrap:!1}}),oe=new Z({props:{code:"bG9hZF9tb2RlbCUyMCUzRCUyMFVOZXQyRENvbmRpdGlvbk1vZGVsLmZyb21fcHJldHJhaW5lZChpbnB1dF9kaXIlMkMlMjBzdWJmb2xkZXIlM0QlMjJ1bmV0JTIyKSUwQW1vZGVsLnJlZ2lzdGVyX3RvX2NvbmZpZygqKmxvYWRfbW9kZWwuY29uZmlnKSUwQSUwQW1vZGVsLmxvYWRfc3RhdGVfZGljdChsb2FkX21vZGVsLnN0YXRlX2RpY3QoKSk=",highlighted:`load_model = UNet2DConditionModel.from_pretrained(input_dir, subfolder=<span class="hljs-string">&quot;unet&quot;</span>)
model.register_to_config(**load_model.config)

model.load_state_dict(load_model.state_dict())`,wrap:!1}}),fe=new Z({props:{code:"ZGVmJTIwcHJlcHJvY2Vzc190cmFpbihleGFtcGxlcyklM0ElMEElMjAlMjAlMjAlMjBpbWFnZXMlMjAlM0QlMjAlNUJpbWFnZS5jb252ZXJ0KCUyMlJHQiUyMiklMjBmb3IlMjBpbWFnZSUyMGluJTIwZXhhbXBsZXMlNUJpbWFnZV9jb2x1bW4lNUQlNUQlMEElMjAlMjAlMjAlMjBleGFtcGxlcyU1QiUyMnBpeGVsX3ZhbHVlcyUyMiU1RCUyMCUzRCUyMCU1QnRyYWluX3RyYW5zZm9ybXMoaW1hZ2UpJTIwZm9yJTIwaW1hZ2UlMjBpbiUyMGltYWdlcyU1RCUwQSUyMCUyMCUyMCUyMGV4YW1wbGVzJTVCJTIyaW5wdXRfaWRzJTIyJTVEJTIwJTNEJTIwdG9rZW5pemVfY2FwdGlvbnMoZXhhbXBsZXMpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwZXhhbXBsZXM=",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">preprocess_train</span>(<span class="hljs-params">examples</span>):
    images = [image.convert(<span class="hljs-string">&quot;RGB&quot;</span>) <span class="hljs-keyword">for</span> image <span class="hljs-keyword">in</span> examples[image_column]]
    examples[<span class="hljs-string">&quot;pixel_values&quot;</span>] = [train_transforms(image) <span class="hljs-keyword">for</span> image <span class="hljs-keyword">in</span> images]
    examples[<span class="hljs-string">&quot;input_ids&quot;</span>] = tokenize_captions(examples)
    <span class="hljs-keyword">return</span> examples`,wrap:!1}}),ue=new Ue({props:{title:"启动脚本",local:"启动脚本",headingTag:"h2"}}),G=new _t({props:{id:"training-inference",options:["PyTorch","Flax"],$$slots:{default:[pl]},$$scope:{ctx:J}}}),v=new _t({props:{id:"training-inference",options:["PyTorch","Flax"],$$slots:{default:[rl]},$$scope:{ctx:J}}}),$e=new Ue({props:{title:"后续步骤",local:"后续步骤",headingTag:"h2"}}),he=new tl({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/zh/training/text2image.md"}}),{c(){n=c("meta"),o=p(),a=c("p"),r=p(),_(i.$$.fragment),f=p(),_(M.$$.fragment),T=p(),$=c("blockquote"),$.innerHTML=j,W=p(),w=c("p"),w.textContent=x,Je=p(),B=c("p"),B.innerHTML=bt,je=p(),k=c("p"),k.innerHTML=ht,Ze=p(),V=c("p"),V.textContent=yt,xe=p(),_(L.$$.fragment),We=p(),H=c("p"),H.textContent=Ut,Ce=p(),_(C.$$.fragment),Re=p(),R=c("blockquote"),R.innerHTML=gt,Xe=p(),Y=c("p"),Y.textContent=wt,Ge=p(),_(N.$$.fragment),ve=p(),F=c("p"),F.textContent=Tt,Be=p(),_(E.$$.fragment),ke=p(),I=c("p"),I.textContent=Jt,Ve=p(),_(Q.$$.fragment),Le=p(),S=c("p"),S.innerHTML=jt,He=p(),_(z.$$.fragment),Ye=p(),X=c("blockquote"),X.innerHTML=Zt,Ne=p(),A=c("p"),A.innerHTML=xt,Fe=p(),q=c("p"),q.textContent=Wt,Ee=p(),_(P.$$.fragment),Ie=p(),D=c("p"),D.textContent=Ct,Qe=p(),O=c("ul"),O.innerHTML=Rt,Se=p(),_(K.$$.fragment),ze=p(),ee=c("p"),ee.innerHTML=Xt,Ae=p(),te=c("p"),te.innerHTML=Gt,qe=p(),_(le.$$.fragment),Pe=p(),se=c("p"),se.innerHTML=vt,De=p(),_(ne.$$.fragment),Oe=p(),ae=c("p"),ae.innerHTML=Bt,Ke=p(),ie=c("p"),ie.innerHTML=kt,et=p(),_(pe.$$.fragment),tt=p(),me=c("p"),me.innerHTML=Vt,lt=p(),_(oe.$$.fragment),st=p(),re=c("p"),re.innerHTML=Lt,nt=p(),_(fe.$$.fragment),at=p(),ce=c("p"),ce.innerHTML=Ht,it=p(),_(ue.$$.fragment),pt=p(),Me=c("p"),Me.textContent=Yt,mt=p(),_(G.$$.fragment),ot=p(),de=c("p"),de.textContent=Nt,rt=p(),_(v.$$.fragment),ft=p(),_($e.$$.fragment),ct=p(),_e=c("p"),_e.textContent=Ft,ut=p(),be=c("ul"),be.innerHTML=Et,Mt=p(),_(he.$$.fragment),dt=p(),Te=c("p"),this.h()},l(e){const t=Ot("svelte-u9bgzb",document.head);n=u(t,"META",{name:!0,content:!0}),t.forEach(l),o=m(e),a=u(e,"P",{}),zt(a).forEach(l),r=m(e),b(i.$$.fragment,e),f=m(e),b(M.$$.fragment,e),T=m(e),$=u(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),d($)!=="svelte-14t9fto"&&($.innerHTML=j),W=m(e),w=u(e,"P",{"data-svelte-h":!0}),d(w)!=="svelte-1c3ggng"&&(w.textContent=x),Je=m(e),B=u(e,"P",{"data-svelte-h":!0}),d(B)!=="svelte-tf4mti"&&(B.innerHTML=bt),je=m(e),k=u(e,"P",{"data-svelte-h":!0}),d(k)!=="svelte-mmr0em"&&(k.innerHTML=ht),Ze=m(e),V=u(e,"P",{"data-svelte-h":!0}),d(V)!=="svelte-mwjd95"&&(V.textContent=yt),xe=m(e),b(L.$$.fragment,e),We=m(e),H=u(e,"P",{"data-svelte-h":!0}),d(H)!=="svelte-ie0m52"&&(H.textContent=Ut),Ce=m(e),b(C.$$.fragment,e),Re=m(e),R=u(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),d(R)!=="svelte-tt4yuu"&&(R.innerHTML=gt),Xe=m(e),Y=u(e,"P",{"data-svelte-h":!0}),d(Y)!=="svelte-2mxnyi"&&(Y.textContent=wt),Ge=m(e),b(N.$$.fragment,e),ve=m(e),F=u(e,"P",{"data-svelte-h":!0}),d(F)!=="svelte-8qo0b1"&&(F.textContent=Tt),Be=m(e),b(E.$$.fragment,e),ke=m(e),I=u(e,"P",{"data-svelte-h":!0}),d(I)!=="svelte-1hg4sov"&&(I.textContent=Jt),Ve=m(e),b(Q.$$.fragment,e),Le=m(e),S=u(e,"P",{"data-svelte-h":!0}),d(S)!=="svelte-1g3ykjk"&&(S.innerHTML=jt),He=m(e),b(z.$$.fragment,e),Ye=m(e),X=u(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),d(X)!=="svelte-14psxqh"&&(X.innerHTML=Zt),Ne=m(e),A=u(e,"P",{"data-svelte-h":!0}),d(A)!=="svelte-1fyn80r"&&(A.innerHTML=xt),Fe=m(e),q=u(e,"P",{"data-svelte-h":!0}),d(q)!=="svelte-je3eqx"&&(q.textContent=Wt),Ee=m(e),b(P.$$.fragment,e),Ie=m(e),D=u(e,"P",{"data-svelte-h":!0}),d(D)!=="svelte-urfoa3"&&(D.textContent=Ct),Qe=m(e),O=u(e,"UL",{"data-svelte-h":!0}),d(O)!=="svelte-vs9gl3"&&(O.innerHTML=Rt),Se=m(e),b(K.$$.fragment,e),ze=m(e),ee=u(e,"P",{"data-svelte-h":!0}),d(ee)!=="svelte-1kealoa"&&(ee.innerHTML=Xt),Ae=m(e),te=u(e,"P",{"data-svelte-h":!0}),d(te)!=="svelte-13rrc02"&&(te.innerHTML=Gt),qe=m(e),b(le.$$.fragment,e),Pe=m(e),se=u(e,"P",{"data-svelte-h":!0}),d(se)!=="svelte-p650kw"&&(se.innerHTML=vt),De=m(e),b(ne.$$.fragment,e),Oe=m(e),ae=u(e,"P",{"data-svelte-h":!0}),d(ae)!=="svelte-wh0i5"&&(ae.innerHTML=Bt),Ke=m(e),ie=u(e,"P",{"data-svelte-h":!0}),d(ie)!=="svelte-1nlf1uu"&&(ie.innerHTML=kt),et=m(e),b(pe.$$.fragment,e),tt=m(e),me=u(e,"P",{"data-svelte-h":!0}),d(me)!=="svelte-18tiko3"&&(me.innerHTML=Vt),lt=m(e),b(oe.$$.fragment,e),st=m(e),re=u(e,"P",{"data-svelte-h":!0}),d(re)!=="svelte-cpfd0u"&&(re.innerHTML=Lt),nt=m(e),b(fe.$$.fragment,e),at=m(e),ce=u(e,"P",{"data-svelte-h":!0}),d(ce)!=="svelte-2hmlty"&&(ce.innerHTML=Ht),it=m(e),b(ue.$$.fragment,e),pt=m(e),Me=u(e,"P",{"data-svelte-h":!0}),d(Me)!=="svelte-mxmxgt"&&(Me.textContent=Yt),mt=m(e),b(G.$$.fragment,e),ot=m(e),de=u(e,"P",{"data-svelte-h":!0}),d(de)!=="svelte-hxct76"&&(de.textContent=Nt),rt=m(e),b(v.$$.fragment,e),ft=m(e),b($e.$$.fragment,e),ct=m(e),_e=u(e,"P",{"data-svelte-h":!0}),d(_e)!=="svelte-19kknl"&&(_e.textContent=Ft),ut=m(e),be=u(e,"UL",{"data-svelte-h":!0}),d(be)!=="svelte-1tmdo3u"&&(be.innerHTML=Et),Mt=m(e),b(he.$$.fragment,e),dt=m(e),Te=u(e,"P",{}),zt(Te).forEach(l),this.h()},h(){ye(n,"name","hf:doc:metadata"),ye(n,"content",cl),ye($,"class","warning"),ye(R,"class","tip"),ye(X,"class","tip")},m(e,t){Kt(document.head,n),s(e,o,t),s(e,a,t),s(e,r,t),h(i,e,t),s(e,f,t),h(M,e,t),s(e,T,t),s(e,$,t),s(e,W,t),s(e,w,t),s(e,Je,t),s(e,B,t),s(e,je,t),s(e,k,t),s(e,Ze,t),s(e,V,t),s(e,xe,t),h(L,e,t),s(e,We,t),s(e,H,t),s(e,Ce,t),h(C,e,t),s(e,Re,t),s(e,R,t),s(e,Xe,t),s(e,Y,t),s(e,Ge,t),h(N,e,t),s(e,ve,t),s(e,F,t),s(e,Be,t),h(E,e,t),s(e,ke,t),s(e,I,t),s(e,Ve,t),h(Q,e,t),s(e,Le,t),s(e,S,t),s(e,He,t),h(z,e,t),s(e,Ye,t),s(e,X,t),s(e,Ne,t),s(e,A,t),s(e,Fe,t),s(e,q,t),s(e,Ee,t),h(P,e,t),s(e,Ie,t),s(e,D,t),s(e,Qe,t),s(e,O,t),s(e,Se,t),h(K,e,t),s(e,ze,t),s(e,ee,t),s(e,Ae,t),s(e,te,t),s(e,qe,t),h(le,e,t),s(e,Pe,t),s(e,se,t),s(e,De,t),h(ne,e,t),s(e,Oe,t),s(e,ae,t),s(e,Ke,t),s(e,ie,t),s(e,et,t),h(pe,e,t),s(e,tt,t),s(e,me,t),s(e,lt,t),h(oe,e,t),s(e,st,t),s(e,re,t),s(e,nt,t),h(fe,e,t),s(e,at,t),s(e,ce,t),s(e,it,t),h(ue,e,t),s(e,pt,t),s(e,Me,t),s(e,mt,t),h(G,e,t),s(e,ot,t),s(e,de,t),s(e,rt,t),h(v,e,t),s(e,ft,t),h($e,e,t),s(e,ct,t),s(e,_e,t),s(e,ut,t),s(e,be,t),s(e,Mt,t),h(he,e,t),s(e,dt,t),s(e,Te,t),$t=!0},p(e,[t]){const It={};t&2&&(It.$$scope={dirty:t,ctx:e}),C.$set(It);const Qt={};t&2&&(Qt.$$scope={dirty:t,ctx:e}),G.$set(Qt);const St={};t&2&&(St.$$scope={dirty:t,ctx:e}),v.$set(St)},i(e){$t||(y(i.$$.fragment,e),y(M.$$.fragment,e),y(L.$$.fragment,e),y(C.$$.fragment,e),y(N.$$.fragment,e),y(E.$$.fragment,e),y(Q.$$.fragment,e),y(z.$$.fragment,e),y(P.$$.fragment,e),y(K.$$.fragment,e),y(le.$$.fragment,e),y(ne.$$.fragment,e),y(pe.$$.fragment,e),y(oe.$$.fragment,e),y(fe.$$.fragment,e),y(ue.$$.fragment,e),y(G.$$.fragment,e),y(v.$$.fragment,e),y($e.$$.fragment,e),y(he.$$.fragment,e),$t=!0)},o(e){U(i.$$.fragment,e),U(M.$$.fragment,e),U(L.$$.fragment,e),U(C.$$.fragment,e),U(N.$$.fragment,e),U(E.$$.fragment,e),U(Q.$$.fragment,e),U(z.$$.fragment,e),U(P.$$.fragment,e),U(K.$$.fragment,e),U(le.$$.fragment,e),U(ne.$$.fragment,e),U(pe.$$.fragment,e),U(oe.$$.fragment,e),U(fe.$$.fragment,e),U(ue.$$.fragment,e),U(G.$$.fragment,e),U(v.$$.fragment,e),U($e.$$.fragment,e),U(he.$$.fragment,e),$t=!1},d(e){e&&(l(o),l(a),l(r),l(f),l(T),l($),l(W),l(w),l(Je),l(B),l(je),l(k),l(Ze),l(V),l(xe),l(We),l(H),l(Ce),l(Re),l(R),l(Xe),l(Y),l(Ge),l(ve),l(F),l(Be),l(ke),l(I),l(Ve),l(Le),l(S),l(He),l(Ye),l(X),l(Ne),l(A),l(Fe),l(q),l(Ee),l(Ie),l(D),l(Qe),l(O),l(Se),l(ze),l(ee),l(Ae),l(te),l(qe),l(Pe),l(se),l(De),l(Oe),l(ae),l(Ke),l(ie),l(et),l(tt),l(me),l(lt),l(st),l(re),l(nt),l(at),l(ce),l(it),l(pt),l(Me),l(mt),l(ot),l(de),l(rt),l(ft),l(ct),l(_e),l(ut),l(be),l(Mt),l(dt),l(Te)),l(n),g(i,e),g(M,e),g(L,e),g(C,e),g(N,e),g(E,e),g(Q,e),g(z,e),g(P,e),g(K,e),g(le,e),g(ne,e),g(pe,e),g(oe,e),g(fe,e),g(ue,e),g(G,e),g(v,e),g($e,e),g(he,e)}}}const cl='{"title":"文生图","local":"文生图","sections":[{"title":"脚本参数","local":"脚本参数","sections":[{"title":"Min-SNR加权策略","local":"min-snr加权策略","sections":[],"depth":3}],"depth":2},{"title":"训练脚本解析","local":"训练脚本解析","sections":[],"depth":2},{"title":"启动脚本","local":"启动脚本","sections":[],"depth":2},{"title":"后续步骤","local":"后续步骤","sections":[],"depth":2}],"depth":1}';function ul(J){return qt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class hl extends Pt{constructor(n){super(),Dt(this,n,ul,fl,At,{})}}export{hl as component};
