import{s as tl,o as ll,n as we}from"../chunks/scheduler.8c3d61f6.js";import{S as al,i as nl,g as r,s as i,r as u,A as il,h as p,f as l,c as s,j as Kt,u as h,x as c,k as Ot,y as sl,a,v as b,d as y,t as M,w as g}from"../chunks/index.da70eac4.js";import{T as gt}from"../chunks/Tip.6f698f24.js";import{C as J}from"../chunks/CodeBlock.a9c4becf.js";import{H as _e,E as ol}from"../chunks/getInferenceSnippets.cb466318.js";import{H as rl,a as el}from"../chunks/HfOption.6c3b4e77.js";function pl(w){let n,f="This script is experimental, and it’s easy to overfit and run into issues like catastrophic forgetting. Try exploring different hyperparameters to get the best results on your dataset.";return{c(){n=r("p"),n.textContent=f},l(o){n=p(o,"P",{"data-svelte-h":!0}),c(n)!=="svelte-8jxpji"&&(n.textContent=f)},m(o,_){a(o,n,_)},p:we,d(o){o&&l(n)}}}function ml(w){let n,f='🤗 Accelerate is a library for helping you train on multiple GPUs/TPUs or with mixed-precision. It’ll automatically configure your training setup based on your hardware and environment. Take a look at the 🤗 Accelerate <a href="https://huggingface.co/docs/accelerate/quicktour" rel="nofollow">Quick tour</a> to learn more.';return{c(){n=r("p"),n.innerHTML=f},l(o){n=p(o,"P",{"data-svelte-h":!0}),c(n)!=="svelte-1qbiqsn"&&(n.innerHTML=f)},m(o,_){a(o,n,_)},p:we,d(o){o&&l(n)}}}function cl(w){let n,f='The following sections highlight parts of the training script that are important for understanding how to modify it, but it doesn’t cover every aspect of the script in detail. If you’re interested in learning more, feel free to read through the <a href="https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image_sdxl.py" rel="nofollow">script</a> and let us know if you have any questions or concerns.';return{c(){n=r("p"),n.innerHTML=f},l(o){n=p(o,"P",{"data-svelte-h":!0}),c(n)!=="svelte-1gjhyr0"&&(n.innerHTML=f)},m(o,_){a(o,n,_)},p:we,d(o){o&&l(n)}}}function fl(w){let n,f="To monitor training progress with Weights &amp; Biases, add the <code>--report_to=wandb</code> parameter to the training command. You’ll also need to add the <code>--validation_prompt</code> and <code>--validation_epochs</code> to the training command to keep track of results. This can be really useful for debugging the model and viewing intermediate results.";return{c(){n=r("p"),n.innerHTML=f},l(o){n=p(o,"P",{"data-svelte-h":!0}),c(n)!=="svelte-1ki42i4"&&(n.innerHTML=f)},m(o,_){a(o,n,_)},p:we,d(o){o&&l(n)}}}function dl(w){let n,f;return n=new J({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlbGluZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJwYXRoJTJGdG8lMkZ5b3VyJTJGbW9kZWwlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpLnRvKCUyMmN1ZGElMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMG5hcnV0byUyMHdpdGglMjBncmVlbiUyMGV5ZXMlMjBhbmQlMjByZWQlMjBsZWdzLiUyMiUwQWltYWdlJTIwJTNEJTIwcGlwZWxpbmUocHJvbXB0JTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRDMwJTJDJTIwZ3VpZGFuY2Vfc2NhbGUlM0Q3LjUpLmltYWdlcyU1QjAlNUQlMEFpbWFnZS5zYXZlKCUyMm5hcnV0by5wbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">import</span> torch

pipeline = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;path/to/your/model&quot;</span>, torch_dtype=torch.float16).to(<span class="hljs-string">&quot;cuda&quot;</span>)

prompt = <span class="hljs-string">&quot;A naruto with green eyes and red legs.&quot;</span>
image = pipeline(prompt, num_inference_steps=<span class="hljs-number">30</span>, guidance_scale=<span class="hljs-number">7.5</span>).images[<span class="hljs-number">0</span>]
image.save(<span class="hljs-string">&quot;naruto.png&quot;</span>)`,wrap:!1}}),{c(){u(n.$$.fragment)},l(o){h(n.$$.fragment,o)},m(o,_){b(n,o,_),f=!0},p:we,i(o){f||(y(n.$$.fragment,o),f=!0)},o(o){M(n.$$.fragment,o),f=!1},d(o){g(n,o)}}}function ul(w){let n,f='<a href="https://pytorch.org/xla" rel="nofollow">PyTorch XLA</a> allows you to run PyTorch on XLA devices such as TPUs, which can be faster. The initial warmup step takes longer because the model needs to be compiled and optimized. However, subsequent calls to the pipeline on an input <strong>with the same length</strong> as the original prompt are much faster because it can reuse the optimized graph.',o,_,m;return _=new J({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjB0b3JjaF94bGEuY29yZS54bGFfbW9kZWwlMjBhcyUyMHhtJTBBJTBBZGV2aWNlJTIwJTNEJTIweG0ueGxhX2RldmljZSgpJTBBcGlwZWxpbmUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLXhsLWJhc2UtMS4wJTIyKS50byhkZXZpY2UpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMG5hcnV0byUyMHdpdGglMjBncmVlbiUyMGV5ZXMlMjBhbmQlMjByZWQlMjBsZWdzLiUyMiUwQXN0YXJ0JTIwJTNEJTIwdGltZSgpJTBBaW1hZ2UlMjAlM0QlMjBwaXBlbGluZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEaW5mZXJlbmNlX3N0ZXBzKS5pbWFnZXMlNUIwJTVEJTBBcHJpbnQoZidDb21waWxhdGlvbiUyMHRpbWUlMjBpcyUyMCU3QnRpbWUoKS1zdGFydCU3RCUyMHNlYycpJTBBaW1hZ2Uuc2F2ZSglMjJuYXJ1dG8ucG5nJTIyKSUwQSUwQXN0YXJ0JTIwJTNEJTIwdGltZSgpJTBBaW1hZ2UlMjAlM0QlMjBwaXBlbGluZShwcm9tcHQlMkMlMjBudW1faW5mZXJlbmNlX3N0ZXBzJTNEaW5mZXJlbmNlX3N0ZXBzKS5pbWFnZXMlNUIwJTVEJTBBcHJpbnQoZidJbmZlcmVuY2UlMjB0aW1lJTIwaXMlMjAlN0J0aW1lKCktc3RhcnQlN0QlMjBzZWMlMjBhZnRlciUyMGNvbXBpbGF0aW9uJyk=",highlighted:`<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> torch_xla.core.xla_model <span class="hljs-keyword">as</span> xm

device = xm.xla_device()
pipeline = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>).to(device)

prompt = <span class="hljs-string">&quot;A naruto with green eyes and red legs.&quot;</span>
start = time()
image = pipeline(prompt, num_inference_steps=inference_steps).images[<span class="hljs-number">0</span>]
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&#x27;Compilation time is <span class="hljs-subst">{time()-start}</span> sec&#x27;</span>)
image.save(<span class="hljs-string">&quot;naruto.png&quot;</span>)

start = time()
image = pipeline(prompt, num_inference_steps=inference_steps).images[<span class="hljs-number">0</span>]
<span class="hljs-built_in">print</span>(<span class="hljs-string">f&#x27;Inference time is <span class="hljs-subst">{time()-start}</span> sec after compilation&#x27;</span>)`,wrap:!1}}),{c(){n=r("p"),n.innerHTML=f,o=i(),u(_.$$.fragment)},l(d){n=p(d,"P",{"data-svelte-h":!0}),c(n)!=="svelte-897rmr"&&(n.innerHTML=f),o=s(d),h(_.$$.fragment,d)},m(d,T){a(d,n,T),a(d,o,T),b(_,d,T),m=!0},p:we,i(d){m||(y(_.$$.fragment,d),m=!0)},o(d){M(_.$$.fragment,d),m=!1},d(d){d&&(l(n),l(o)),g(_,d)}}}function hl(w){let n,f,o,_;return n=new el({props:{id:"inference",option:"PyTorch",$$slots:{default:[dl]},$$scope:{ctx:w}}}),o=new el({props:{id:"inference",option:"PyTorch XLA",$$slots:{default:[ul]},$$scope:{ctx:w}}}),{c(){u(n.$$.fragment),f=i(),u(o.$$.fragment)},l(m){h(n.$$.fragment,m),f=s(m),h(o.$$.fragment,m)},m(m,d){b(n,m,d),a(m,f,d),b(o,m,d),_=!0},p(m,d){const T={};d&2&&(T.$$scope={dirty:d,ctx:m}),n.$set(T);const j={};d&2&&(j.$$scope={dirty:d,ctx:m}),o.$set(j)},i(m){_||(y(n.$$.fragment,m),y(o.$$.fragment,m),_=!0)},o(m){M(n.$$.fragment,m),M(o.$$.fragment,m),_=!1},d(m){m&&l(f),g(n,m),g(o,m)}}}function bl(w){let n,f,o,_,m,d,T,j,W,_t='<a href="https://hf.co/papers/2307.01952" rel="nofollow">Stable Diffusion XL (SDXL)</a> is a larger and more powerful iteration of the Stable Diffusion model, capable of producing higher resolution images.',Je,X,wt='SDXL’s UNet is 3x larger and the model adds a second text encoder to the architecture. Depending on the hardware available to you, this can be very computationally intensive and it may not run on a consumer GPU like a Tesla T4. To help fit this larger model into memory and to speedup training, try enabling <code>gradient_checkpointing</code>, <code>mixed_precision</code>, and <code>gradient_accumulation_steps</code>. You can reduce your memory-usage even more by enabling memory-efficient attention with <a href="../optimization/xformers">xFormers</a> and using <a href="https://github.com/TimDettmers/bitsandbytes" rel="nofollow">bitsandbytes’</a> 8-bit optimizer.',$e,v,Tt='This guide will explore the <a href="https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image_sdxl.py" rel="nofollow">train_text_to_image_sdxl.py</a> training script to help you become more familiar with it, and how you can adapt it for your own use-case.',Ue,B,Jt="Before running the script, make sure you install the library from source:",Ze,C,xe,R,$t="Then navigate to the example folder containing the training script and install the required dependencies for the script you’re using:",je,V,We,$,Xe,N,Ut="Initialize an 🤗 Accelerate environment:",ve,G,Be,k,Zt="To setup a default 🤗 Accelerate environment without choosing any configurations:",Ce,H,Re,I,xt="Or if your environment doesn’t support an interactive shell, like a notebook, you can use:",Ve,L,Ne,E,jt='Lastly, if you want to train a model on your own dataset, take a look at the <a href="create_dataset">Create a dataset for training</a> guide to learn how to create a dataset that works with the training script.',Ge,Y,ke,U,He,S,Wt='The training script provides many parameters to help you customize your training run. All of the parameters and their descriptions are found in the <a href="https://github.com/huggingface/diffusers/blob/aab6de22c33cc01fb7bc81c0807d6109e2c998c9/examples/text_to_image/train_text_to_image_sdxl.py#L129" rel="nofollow"><code>parse_args()</code></a> function. This function provides default values for each parameter, such as the training batch size and learning rate, but you can also set your own values in the training command if you’d like.',Ie,F,Xt="For example, to speedup training with mixed precision using the bf16 format, add the <code>--mixed_precision</code> parameter to the training command:",Le,z,Ee,Q,vt='Most of the parameters are identical to the parameters in the <a href="text2image#script-parameters">Text-to-image</a> training guide, so you’ll focus on the parameters that are relevant to training SDXL in this guide.',Ye,A,Bt='<li><code>--pretrained_vae_model_name_or_path</code>: path to a pretrained VAE; the SDXL VAE is known to suffer from numerical instability, so this parameter allows you to specify a better <a href="https://huggingface.co/madebyollin/sdxl-vae-fp16-fix" rel="nofollow">VAE</a></li> <li><code>--proportion_empty_prompts</code>: the proportion of image prompts to replace with empty strings</li> <li><code>--timestep_bias_strategy</code>: where (earlier vs. later) in the timestep to apply a bias, which can encourage the model to either learn low or high frequency details</li> <li><code>--timestep_bias_multiplier</code>: the weight of the bias to apply to the timestep</li> <li><code>--timestep_bias_begin</code>: the timestep to begin applying the bias</li> <li><code>--timestep_bias_end</code>: the timestep to end applying the bias</li> <li><code>--timestep_bias_portion</code>: the proportion of timesteps to apply the bias to</li>',Se,D,Fe,q,Ct='The <a href="https://huggingface.co/papers/2303.09556" rel="nofollow">Min-SNR</a> weighting strategy can help with training by rebalancing the loss to achieve faster convergence. The training script supports predicting either <code>epsilon</code> (noise) or <code>v_prediction</code>, but Min-SNR is compatible with both prediction types. This weighting strategy is only supported by PyTorch.',ze,P,Rt="Add the <code>--snr_gamma</code> parameter and set it to the recommended value of 5.0:",Qe,K,Ae,O,De,ee,Vt='The training script is also similar to the <a href="text2image#training-script">Text-to-image</a> training guide, but it’s been modified to support SDXL training. This guide will focus on the code that is unique to the SDXL training script.',qe,te,Nt='It starts by creating functions to <a href="https://github.com/huggingface/diffusers/blob/aab6de22c33cc01fb7bc81c0807d6109e2c998c9/examples/text_to_image/train_text_to_image_sdxl.py#L478" rel="nofollow">tokenize the prompts</a> to calculate the prompt embeddings, and to compute the image embeddings with the <a href="https://github.com/huggingface/diffusers/blob/aab6de22c33cc01fb7bc81c0807d6109e2c998c9/examples/text_to_image/train_text_to_image_sdxl.py#L519" rel="nofollow">VAE</a>. Next, you’ll a function to <a href="https://github.com/huggingface/diffusers/blob/aab6de22c33cc01fb7bc81c0807d6109e2c998c9/examples/text_to_image/train_text_to_image_sdxl.py#L531" rel="nofollow">generate the timesteps weights</a> depending on the number of timesteps and the timestep bias strategy to apply.',Pe,le,Gt='Within the <a href="https://github.com/huggingface/diffusers/blob/aab6de22c33cc01fb7bc81c0807d6109e2c998c9/examples/text_to_image/train_text_to_image_sdxl.py#L572" rel="nofollow"><code>main()</code></a> function, in addition to loading a tokenizer, the script loads a second tokenizer and text encoder because the SDXL architecture uses two of each:',Ke,ae,Oe,ne,kt='The <a href="https://github.com/huggingface/diffusers/blob/aab6de22c33cc01fb7bc81c0807d6109e2c998c9/examples/text_to_image/train_text_to_image_sdxl.py#L857" rel="nofollow">prompt and image embeddings</a> are computed first and kept in memory, which isn’t typically an issue for a smaller dataset, but for larger datasets it can lead to memory problems. If this is the case, you should save the pre-computed embeddings to disk separately and load them into memory during the training process (see this <a href="https://github.com/huggingface/diffusers/pull/4505" rel="nofollow">PR</a> for more discussion about this topic).',et,ie,tt,se,Ht="After calculating the embeddings, the text encoder, VAE, and tokenizer are deleted to free up some memory:",lt,oe,at,re,It='Finally, the <a href="https://github.com/huggingface/diffusers/blob/aab6de22c33cc01fb7bc81c0807d6109e2c998c9/examples/text_to_image/train_text_to_image_sdxl.py#L943" rel="nofollow">training loop</a> takes care of the rest. If you chose to apply a timestep bias strategy, you’ll see the timestep weights are calculated and added as noise:',nt,pe,it,me,Lt='If you want to learn more about how the training loop works, check out the <a href="../using-diffusers/write_own_pipeline">Understanding pipelines, models and schedulers</a> tutorial which breaks down the basic pattern of the denoising process.',st,ce,ot,fe,Et="Once you’ve made all your changes or you’re okay with the default configuration, you’re ready to launch the training script! 🚀",rt,de,Yt='Let’s train on the <a href="https://huggingface.co/datasets/lambdalabs/naruto-blip-captions" rel="nofollow">Naruto BLIP captions</a> dataset to generate your own Naruto characters. Set the environment variables <code>MODEL_NAME</code> and <code>DATASET_NAME</code> to the model and the dataset (either from the Hub or a local path). You should also specify a VAE other than the SDXL VAE (either from the Hub or a local path) with <code>VAE_NAME</code> to avoid numerical instabilities.',pt,Z,mt,ue,ct,he,St="After you’ve finished training, you can use your newly trained SDXL model for inference!",ft,x,dt,be,ut,ye,Ft="Congratulations on training a SDXL model! To learn more about how to use your new model, the following guides may be helpful:",ht,Me,zt='<li>Read the <a href="../using-diffusers/sdxl">Stable Diffusion XL</a> guide to learn how to use it for a variety of different tasks (text-to-image, image-to-image, inpainting), how to use it’s refiner model, and the different types of micro-conditionings.</li> <li>Check out the <a href="dreambooth">DreamBooth</a> and <a href="lora">LoRA</a> training guides to learn how to train a personalized SDXL model with just a few example images. These two training techniques can even be combined!</li>',bt,ge,yt,Te,Mt;return m=new _e({props:{title:"Stable Diffusion XL",local:"stable-diffusion-xl",headingTag:"h1"}}),T=new gt({props:{warning:!0,$$slots:{default:[pl]},$$scope:{ctx:w}}}),C=new J({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}}),V=new J({props:{code:"Y2QlMjBleGFtcGxlcyUyRnRleHRfdG9faW1hZ2UlMEFwaXAlMjBpbnN0YWxsJTIwLXIlMjByZXF1aXJlbWVudHNfc2R4bC50eHQ=",highlighted:`<span class="hljs-built_in">cd</span> examples/text_to_image
pip install -r requirements_sdxl.txt`,wrap:!1}}),$=new gt({props:{$$slots:{default:[ml]},$$scope:{ctx:w}}}),G=new J({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZw==",highlighted:"accelerate config",wrap:!1}}),H=new J({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZyUyMGRlZmF1bHQ=",highlighted:"accelerate config default",wrap:!1}}),L=new J({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}}),Y=new _e({props:{title:"Script parameters",local:"script-parameters",headingTag:"h2"}}),U=new gt({props:{$$slots:{default:[cl]},$$scope:{ctx:w}}}),z=new J({props:{code:"YWNjZWxlcmF0ZSUyMGxhdW5jaCUyMHRyYWluX3RleHRfdG9faW1hZ2Vfc2R4bC5weSUyMCU1QyUwQSUyMCUyMC0tbWl4ZWRfcHJlY2lzaW9uJTNEJTIyYmYxNiUyMg==",highlighted:`accelerate launch train_text_to_image_sdxl.py \\
  --mixed_precision=<span class="hljs-string">&quot;bf16&quot;</span>`,wrap:!1}}),D=new _e({props:{title:"Min-SNR weighting",local:"min-snr-weighting",headingTag:"h3"}}),K=new J({props:{code:"YWNjZWxlcmF0ZSUyMGxhdW5jaCUyMHRyYWluX3RleHRfdG9faW1hZ2Vfc2R4bC5weSUyMCU1QyUwQSUyMCUyMC0tc25yX2dhbW1hJTNENS4w",highlighted:`accelerate launch train_text_to_image_sdxl.py \\
  --snr_gamma=5.0`,wrap:!1}}),O=new _e({props:{title:"Training script",local:"training-script",headingTag:"h2"}}),ae=new J({props:{code:"dG9rZW5pemVyX29uZSUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMGFyZ3MucHJldHJhaW5lZF9tb2RlbF9uYW1lX29yX3BhdGglMkMlMjBzdWJmb2xkZXIlM0QlMjJ0b2tlbml6ZXIlMjIlMkMlMjByZXZpc2lvbiUzRGFyZ3MucmV2aXNpb24lMkMlMjB1c2VfZmFzdCUzREZhbHNlJTBBKSUwQXRva2VuaXplcl90d28lMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjBhcmdzLnByZXRyYWluZWRfbW9kZWxfbmFtZV9vcl9wYXRoJTJDJTIwc3ViZm9sZGVyJTNEJTIydG9rZW5pemVyXzIlMjIlMkMlMjByZXZpc2lvbiUzRGFyZ3MucmV2aXNpb24lMkMlMjB1c2VfZmFzdCUzREZhbHNlJTBBKSUwQSUwQXRleHRfZW5jb2Rlcl9jbHNfb25lJTIwJTNEJTIwaW1wb3J0X21vZGVsX2NsYXNzX2Zyb21fbW9kZWxfbmFtZV9vcl9wYXRoKCUwQSUyMCUyMCUyMCUyMGFyZ3MucHJldHJhaW5lZF9tb2RlbF9uYW1lX29yX3BhdGglMkMlMjBhcmdzLnJldmlzaW9uJTBBKSUwQXRleHRfZW5jb2Rlcl9jbHNfdHdvJTIwJTNEJTIwaW1wb3J0X21vZGVsX2NsYXNzX2Zyb21fbW9kZWxfbmFtZV9vcl9wYXRoKCUwQSUyMCUyMCUyMCUyMGFyZ3MucHJldHJhaW5lZF9tb2RlbF9uYW1lX29yX3BhdGglMkMlMjBhcmdzLnJldmlzaW9uJTJDJTIwc3ViZm9sZGVyJTNEJTIydGV4dF9lbmNvZGVyXzIlMjIlMEEp",highlighted:`tokenizer_one = AutoTokenizer.from_pretrained(
    args.pretrained_model_name_or_path, subfolder=<span class="hljs-string">&quot;tokenizer&quot;</span>, revision=args.revision, use_fast=<span class="hljs-literal">False</span>
)
tokenizer_two = AutoTokenizer.from_pretrained(
    args.pretrained_model_name_or_path, subfolder=<span class="hljs-string">&quot;tokenizer_2&quot;</span>, revision=args.revision, use_fast=<span class="hljs-literal">False</span>
)

text_encoder_cls_one = import_model_class_from_model_name_or_path(
    args.pretrained_model_name_or_path, args.revision
)
text_encoder_cls_two = import_model_class_from_model_name_or_path(
    args.pretrained_model_name_or_path, args.revision, subfolder=<span class="hljs-string">&quot;text_encoder_2&quot;</span>
)`,wrap:!1}}),ie=new J({props:{code:"dGV4dF9lbmNvZGVycyUyMCUzRCUyMCU1QnRleHRfZW5jb2Rlcl9vbmUlMkMlMjB0ZXh0X2VuY29kZXJfdHdvJTVEJTBBdG9rZW5pemVycyUyMCUzRCUyMCU1QnRva2VuaXplcl9vbmUlMkMlMjB0b2tlbml6ZXJfdHdvJTVEJTBBY29tcHV0ZV9lbWJlZGRpbmdzX2ZuJTIwJTNEJTIwZnVuY3Rvb2xzLnBhcnRpYWwoJTBBJTIwJTIwJTIwJTIwZW5jb2RlX3Byb21wdCUyQyUwQSUyMCUyMCUyMCUyMHRleHRfZW5jb2RlcnMlM0R0ZXh0X2VuY29kZXJzJTJDJTBBJTIwJTIwJTIwJTIwdG9rZW5pemVycyUzRHRva2VuaXplcnMlMkMlMEElMjAlMjAlMjAlMjBwcm9wb3J0aW9uX2VtcHR5X3Byb21wdHMlM0RhcmdzLnByb3BvcnRpb25fZW1wdHlfcHJvbXB0cyUyQyUwQSUyMCUyMCUyMCUyMGNhcHRpb25fY29sdW1uJTNEYXJncy5jYXB0aW9uX2NvbHVtbiUyQyUwQSklMEElMEF0cmFpbl9kYXRhc2V0JTIwJTNEJTIwdHJhaW5fZGF0YXNldC5tYXAoY29tcHV0ZV9lbWJlZGRpbmdzX2ZuJTJDJTIwYmF0Y2hlZCUzRFRydWUlMkMlMjBuZXdfZmluZ2VycHJpbnQlM0RuZXdfZmluZ2VycHJpbnQpJTBBdHJhaW5fZGF0YXNldCUyMCUzRCUyMHRyYWluX2RhdGFzZXQubWFwKCUwQSUyMCUyMCUyMCUyMGNvbXB1dGVfdmFlX2VuY29kaW5nc19mbiUyQyUwQSUyMCUyMCUyMCUyMGJhdGNoZWQlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwYmF0Y2hfc2l6ZSUzRGFyZ3MudHJhaW5fYmF0Y2hfc2l6ZSUyMColMjBhY2NlbGVyYXRvci5udW1fcHJvY2Vzc2VzJTIwKiUyMGFyZ3MuZ3JhZGllbnRfYWNjdW11bGF0aW9uX3N0ZXBzJTJDJTBBJTIwJTIwJTIwJTIwbmV3X2ZpbmdlcnByaW50JTNEbmV3X2ZpbmdlcnByaW50X2Zvcl92YWUlMkMlMEEp",highlighted:`text_encoders = [text_encoder_one, text_encoder_two]
tokenizers = [tokenizer_one, tokenizer_two]
compute_embeddings_fn = functools.partial(
    encode_prompt,
    text_encoders=text_encoders,
    tokenizers=tokenizers,
    proportion_empty_prompts=args.proportion_empty_prompts,
    caption_column=args.caption_column,
)

train_dataset = train_dataset.<span class="hljs-built_in">map</span>(compute_embeddings_fn, batched=<span class="hljs-literal">True</span>, new_fingerprint=new_fingerprint)
train_dataset = train_dataset.<span class="hljs-built_in">map</span>(
    compute_vae_encodings_fn,
    batched=<span class="hljs-literal">True</span>,
    batch_size=args.train_batch_size * accelerator.num_processes * args.gradient_accumulation_steps,
    new_fingerprint=new_fingerprint_for_vae,
)`,wrap:!1}}),oe=new J({props:{code:"ZGVsJTIwdGV4dF9lbmNvZGVycyUyQyUyMHRva2VuaXplcnMlMkMlMjB2YWUlMEFnYy5jb2xsZWN0KCklMEF0b3JjaC5jdWRhLmVtcHR5X2NhY2hlKCk=",highlighted:`<span class="hljs-keyword">del</span> text_encoders, tokenizers, vae
gc.collect()
torch.cuda.empty_cache()`,wrap:!1}}),pe=new J({props:{code:"d2VpZ2h0cyUyMCUzRCUyMGdlbmVyYXRlX3RpbWVzdGVwX3dlaWdodHMoYXJncyUyQyUyMG5vaXNlX3NjaGVkdWxlci5jb25maWcubnVtX3RyYWluX3RpbWVzdGVwcykudG8oJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbW9kZWxfaW5wdXQuZGV2aWNlJTBBJTIwJTIwJTIwJTIwKSUwQSUyMCUyMCUyMCUyMHRpbWVzdGVwcyUyMCUzRCUyMHRvcmNoLm11bHRpbm9taWFsKHdlaWdodHMlMkMlMjBic3olMkMlMjByZXBsYWNlbWVudCUzRFRydWUpLmxvbmcoKSUwQSUwQW5vaXN5X21vZGVsX2lucHV0JTIwJTNEJTIwbm9pc2Vfc2NoZWR1bGVyLmFkZF9ub2lzZShtb2RlbF9pbnB1dCUyQyUyMG5vaXNlJTJDJTIwdGltZXN0ZXBzKQ==",highlighted:`weights = generate_timestep_weights(args, noise_scheduler.config.num_train_timesteps).to(
        model_input.device
    )
    timesteps = torch.multinomial(weights, bsz, replacement=<span class="hljs-literal">True</span>).long()

noisy_model_input = noise_scheduler.add_noise(model_input, noise, timesteps)`,wrap:!1}}),ce=new _e({props:{title:"Launch the script",local:"launch-the-script",headingTag:"h2"}}),Z=new gt({props:{$$slots:{default:[fl]},$$scope:{ctx:w}}}),ue=new J({props:{code:"ZXhwb3J0JTIwTU9ERUxfTkFNRSUzRCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi14bC1iYXNlLTEuMCUyMiUwQWV4cG9ydCUyMFZBRV9OQU1FJTNEJTIybWFkZWJ5b2xsaW4lMkZzZHhsLXZhZS1mcDE2LWZpeCUyMiUwQWV4cG9ydCUyMERBVEFTRVRfTkFNRSUzRCUyMmxhbWJkYWxhYnMlMkZuYXJ1dG8tYmxpcC1jYXB0aW9ucyUyMiUwQSUwQWFjY2VsZXJhdGUlMjBsYXVuY2glMjB0cmFpbl90ZXh0X3RvX2ltYWdlX3NkeGwucHklMjAlNUMlMEElMjAlMjAtLXByZXRyYWluZWRfbW9kZWxfbmFtZV9vcl9wYXRoJTNEJTI0TU9ERUxfTkFNRSUyMCU1QyUwQSUyMCUyMC0tcHJldHJhaW5lZF92YWVfbW9kZWxfbmFtZV9vcl9wYXRoJTNEJTI0VkFFX05BTUUlMjAlNUMlMEElMjAlMjAtLWRhdGFzZXRfbmFtZSUzRCUyNERBVEFTRVRfTkFNRSUyMCU1QyUwQSUyMCUyMC0tZW5hYmxlX3hmb3JtZXJzX21lbW9yeV9lZmZpY2llbnRfYXR0ZW50aW9uJTIwJTVDJTBBJTIwJTIwLS1yZXNvbHV0aW9uJTNENTEyJTIwJTVDJTBBJTIwJTIwLS1jZW50ZXJfY3JvcCUyMCU1QyUwQSUyMCUyMC0tcmFuZG9tX2ZsaXAlMjAlNUMlMEElMjAlMjAtLXByb3BvcnRpb25fZW1wdHlfcHJvbXB0cyUzRDAuMiUyMCU1QyUwQSUyMCUyMC0tdHJhaW5fYmF0Y2hfc2l6ZSUzRDElMjAlNUMlMEElMjAlMjAtLWdyYWRpZW50X2FjY3VtdWxhdGlvbl9zdGVwcyUzRDQlMjAlNUMlMEElMjAlMjAtLWdyYWRpZW50X2NoZWNrcG9pbnRpbmclMjAlNUMlMEElMjAlMjAtLW1heF90cmFpbl9zdGVwcyUzRDEwMDAwJTIwJTVDJTBBJTIwJTIwLS11c2VfOGJpdF9hZGFtJTIwJTVDJTBBJTIwJTIwLS1sZWFybmluZ19yYXRlJTNEMWUtMDYlMjAlNUMlMEElMjAlMjAtLWxyX3NjaGVkdWxlciUzRCUyMmNvbnN0YW50JTIyJTIwJTVDJTBBJTIwJTIwLS1scl93YXJtdXBfc3RlcHMlM0QwJTIwJTVDJTBBJTIwJTIwLS1taXhlZF9wcmVjaXNpb24lM0QlMjJmcDE2JTIyJTIwJTVDJTBBJTIwJTIwLS1yZXBvcnRfdG8lM0QlMjJ3YW5kYiUyMiUyMCU1QyUwQSUyMCUyMC0tdmFsaWRhdGlvbl9wcm9tcHQlM0QlMjJhJTIwY3V0ZSUyMFN1bmRhciUyMFBpY2hhaSUyMGNyZWF0dXJlJTIyJTIwJTVDJTBBJTIwJTIwLS12YWxpZGF0aW9uX2Vwb2NocyUyMDUlMjAlNUMlMEElMjAlMjAtLWNoZWNrcG9pbnRpbmdfc3RlcHMlM0Q1MDAwJTIwJTVDJTBBJTIwJTIwLS1vdXRwdXRfZGlyJTNEJTIyc2R4bC1uYXJ1dG8tbW9kZWwlMjIlMjAlNUMlMEElMjAlMjAtLXB1c2hfdG9faHVi",highlighted:`<span class="hljs-built_in">export</span> MODEL_NAME=<span class="hljs-string">&quot;stabilityai/stable-diffusion-xl-base-1.0&quot;</span>
<span class="hljs-built_in">export</span> VAE_NAME=<span class="hljs-string">&quot;madebyollin/sdxl-vae-fp16-fix&quot;</span>
<span class="hljs-built_in">export</span> DATASET_NAME=<span class="hljs-string">&quot;lambdalabs/naruto-blip-captions&quot;</span>

accelerate launch train_text_to_image_sdxl.py \\
  --pretrained_model_name_or_path=<span class="hljs-variable">$MODEL_NAME</span> \\
  --pretrained_vae_model_name_or_path=<span class="hljs-variable">$VAE_NAME</span> \\
  --dataset_name=<span class="hljs-variable">$DATASET_NAME</span> \\
  --enable_xformers_memory_efficient_attention \\
  --resolution=512 \\
  --center_crop \\
  --random_flip \\
  --proportion_empty_prompts=0.2 \\
  --train_batch_size=1 \\
  --gradient_accumulation_steps=4 \\
  --gradient_checkpointing \\
  --max_train_steps=10000 \\
  --use_8bit_adam \\
  --learning_rate=1e-06 \\
  --lr_scheduler=<span class="hljs-string">&quot;constant&quot;</span> \\
  --lr_warmup_steps=0 \\
  --mixed_precision=<span class="hljs-string">&quot;fp16&quot;</span> \\
  --report_to=<span class="hljs-string">&quot;wandb&quot;</span> \\
  --validation_prompt=<span class="hljs-string">&quot;a cute Sundar Pichai creature&quot;</span> \\
  --validation_epochs 5 \\
  --checkpointing_steps=5000 \\
  --output_dir=<span class="hljs-string">&quot;sdxl-naruto-model&quot;</span> \\
  --push_to_hub`,wrap:!1}}),x=new rl({props:{id:"inference",options:["PyTorch","PyTorch XLA"],$$slots:{default:[hl]},$$scope:{ctx:w}}}),be=new _e({props:{title:"Next steps",local:"next-steps",headingTag:"h2"}}),ge=new ol({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/training/sdxl.md"}}),{c(){n=r("meta"),f=i(),o=r("p"),_=i(),u(m.$$.fragment),d=i(),u(T.$$.fragment),j=i(),W=r("p"),W.innerHTML=_t,Je=i(),X=r("p"),X.innerHTML=wt,$e=i(),v=r("p"),v.innerHTML=Tt,Ue=i(),B=r("p"),B.textContent=Jt,Ze=i(),u(C.$$.fragment),xe=i(),R=r("p"),R.textContent=$t,je=i(),u(V.$$.fragment),We=i(),u($.$$.fragment),Xe=i(),N=r("p"),N.textContent=Ut,ve=i(),u(G.$$.fragment),Be=i(),k=r("p"),k.textContent=Zt,Ce=i(),u(H.$$.fragment),Re=i(),I=r("p"),I.textContent=xt,Ve=i(),u(L.$$.fragment),Ne=i(),E=r("p"),E.innerHTML=jt,Ge=i(),u(Y.$$.fragment),ke=i(),u(U.$$.fragment),He=i(),S=r("p"),S.innerHTML=Wt,Ie=i(),F=r("p"),F.innerHTML=Xt,Le=i(),u(z.$$.fragment),Ee=i(),Q=r("p"),Q.innerHTML=vt,Ye=i(),A=r("ul"),A.innerHTML=Bt,Se=i(),u(D.$$.fragment),Fe=i(),q=r("p"),q.innerHTML=Ct,ze=i(),P=r("p"),P.innerHTML=Rt,Qe=i(),u(K.$$.fragment),Ae=i(),u(O.$$.fragment),De=i(),ee=r("p"),ee.innerHTML=Vt,qe=i(),te=r("p"),te.innerHTML=Nt,Pe=i(),le=r("p"),le.innerHTML=Gt,Ke=i(),u(ae.$$.fragment),Oe=i(),ne=r("p"),ne.innerHTML=kt,et=i(),u(ie.$$.fragment),tt=i(),se=r("p"),se.textContent=Ht,lt=i(),u(oe.$$.fragment),at=i(),re=r("p"),re.innerHTML=It,nt=i(),u(pe.$$.fragment),it=i(),me=r("p"),me.innerHTML=Lt,st=i(),u(ce.$$.fragment),ot=i(),fe=r("p"),fe.textContent=Et,rt=i(),de=r("p"),de.innerHTML=Yt,pt=i(),u(Z.$$.fragment),mt=i(),u(ue.$$.fragment),ct=i(),he=r("p"),he.textContent=St,ft=i(),u(x.$$.fragment),dt=i(),u(be.$$.fragment),ut=i(),ye=r("p"),ye.textContent=Ft,ht=i(),Me=r("ul"),Me.innerHTML=zt,bt=i(),u(ge.$$.fragment),yt=i(),Te=r("p"),this.h()},l(e){const t=il("svelte-u9bgzb",document.head);n=p(t,"META",{name:!0,content:!0}),t.forEach(l),f=s(e),o=p(e,"P",{}),Kt(o).forEach(l),_=s(e),h(m.$$.fragment,e),d=s(e),h(T.$$.fragment,e),j=s(e),W=p(e,"P",{"data-svelte-h":!0}),c(W)!=="svelte-1almhd5"&&(W.innerHTML=_t),Je=s(e),X=p(e,"P",{"data-svelte-h":!0}),c(X)!=="svelte-bnjhh6"&&(X.innerHTML=wt),$e=s(e),v=p(e,"P",{"data-svelte-h":!0}),c(v)!=="svelte-1p10m2l"&&(v.innerHTML=Tt),Ue=s(e),B=p(e,"P",{"data-svelte-h":!0}),c(B)!=="svelte-l7dm2q"&&(B.textContent=Jt),Ze=s(e),h(C.$$.fragment,e),xe=s(e),R=p(e,"P",{"data-svelte-h":!0}),c(R)!=="svelte-z4z0b9"&&(R.textContent=$t),je=s(e),h(V.$$.fragment,e),We=s(e),h($.$$.fragment,e),Xe=s(e),N=p(e,"P",{"data-svelte-h":!0}),c(N)!=="svelte-60q53m"&&(N.textContent=Ut),ve=s(e),h(G.$$.fragment,e),Be=s(e),k=p(e,"P",{"data-svelte-h":!0}),c(k)!=="svelte-di6juu"&&(k.textContent=Zt),Ce=s(e),h(H.$$.fragment,e),Re=s(e),I=p(e,"P",{"data-svelte-h":!0}),c(I)!=="svelte-tsz4qp"&&(I.textContent=xt),Ve=s(e),h(L.$$.fragment,e),Ne=s(e),E=p(e,"P",{"data-svelte-h":!0}),c(E)!=="svelte-1fkfdql"&&(E.innerHTML=jt),Ge=s(e),h(Y.$$.fragment,e),ke=s(e),h(U.$$.fragment,e),He=s(e),S=p(e,"P",{"data-svelte-h":!0}),c(S)!=="svelte-1q049xx"&&(S.innerHTML=Wt),Ie=s(e),F=p(e,"P",{"data-svelte-h":!0}),c(F)!=="svelte-9pyoon"&&(F.innerHTML=Xt),Le=s(e),h(z.$$.fragment,e),Ee=s(e),Q=p(e,"P",{"data-svelte-h":!0}),c(Q)!=="svelte-156hk"&&(Q.innerHTML=vt),Ye=s(e),A=p(e,"UL",{"data-svelte-h":!0}),c(A)!=="svelte-1wjvidq"&&(A.innerHTML=Bt),Se=s(e),h(D.$$.fragment,e),Fe=s(e),q=p(e,"P",{"data-svelte-h":!0}),c(q)!=="svelte-117tmc7"&&(q.innerHTML=Ct),ze=s(e),P=p(e,"P",{"data-svelte-h":!0}),c(P)!=="svelte-tp3kp"&&(P.innerHTML=Rt),Qe=s(e),h(K.$$.fragment,e),Ae=s(e),h(O.$$.fragment,e),De=s(e),ee=p(e,"P",{"data-svelte-h":!0}),c(ee)!=="svelte-1lew7ju"&&(ee.innerHTML=Vt),qe=s(e),te=p(e,"P",{"data-svelte-h":!0}),c(te)!=="svelte-vxr0rt"&&(te.innerHTML=Nt),Pe=s(e),le=p(e,"P",{"data-svelte-h":!0}),c(le)!=="svelte-9e3dc8"&&(le.innerHTML=Gt),Ke=s(e),h(ae.$$.fragment,e),Oe=s(e),ne=p(e,"P",{"data-svelte-h":!0}),c(ne)!=="svelte-19ae5vc"&&(ne.innerHTML=kt),et=s(e),h(ie.$$.fragment,e),tt=s(e),se=p(e,"P",{"data-svelte-h":!0}),c(se)!=="svelte-168omb4"&&(se.textContent=Ht),lt=s(e),h(oe.$$.fragment,e),at=s(e),re=p(e,"P",{"data-svelte-h":!0}),c(re)!=="svelte-15uikpu"&&(re.innerHTML=It),nt=s(e),h(pe.$$.fragment,e),it=s(e),me=p(e,"P",{"data-svelte-h":!0}),c(me)!=="svelte-6gmbd2"&&(me.innerHTML=Lt),st=s(e),h(ce.$$.fragment,e),ot=s(e),fe=p(e,"P",{"data-svelte-h":!0}),c(fe)!=="svelte-9dei1q"&&(fe.textContent=Et),rt=s(e),de=p(e,"P",{"data-svelte-h":!0}),c(de)!=="svelte-1rijod9"&&(de.innerHTML=Yt),pt=s(e),h(Z.$$.fragment,e),mt=s(e),h(ue.$$.fragment,e),ct=s(e),he=p(e,"P",{"data-svelte-h":!0}),c(he)!=="svelte-ay58z1"&&(he.textContent=St),ft=s(e),h(x.$$.fragment,e),dt=s(e),h(be.$$.fragment,e),ut=s(e),ye=p(e,"P",{"data-svelte-h":!0}),c(ye)!=="svelte-1gdijji"&&(ye.textContent=Ft),ht=s(e),Me=p(e,"UL",{"data-svelte-h":!0}),c(Me)!=="svelte-187x0qc"&&(Me.innerHTML=zt),bt=s(e),h(ge.$$.fragment,e),yt=s(e),Te=p(e,"P",{}),Kt(Te).forEach(l),this.h()},h(){Ot(n,"name","hf:doc:metadata"),Ot(n,"content",yl)},m(e,t){sl(document.head,n),a(e,f,t),a(e,o,t),a(e,_,t),b(m,e,t),a(e,d,t),b(T,e,t),a(e,j,t),a(e,W,t),a(e,Je,t),a(e,X,t),a(e,$e,t),a(e,v,t),a(e,Ue,t),a(e,B,t),a(e,Ze,t),b(C,e,t),a(e,xe,t),a(e,R,t),a(e,je,t),b(V,e,t),a(e,We,t),b($,e,t),a(e,Xe,t),a(e,N,t),a(e,ve,t),b(G,e,t),a(e,Be,t),a(e,k,t),a(e,Ce,t),b(H,e,t),a(e,Re,t),a(e,I,t),a(e,Ve,t),b(L,e,t),a(e,Ne,t),a(e,E,t),a(e,Ge,t),b(Y,e,t),a(e,ke,t),b(U,e,t),a(e,He,t),a(e,S,t),a(e,Ie,t),a(e,F,t),a(e,Le,t),b(z,e,t),a(e,Ee,t),a(e,Q,t),a(e,Ye,t),a(e,A,t),a(e,Se,t),b(D,e,t),a(e,Fe,t),a(e,q,t),a(e,ze,t),a(e,P,t),a(e,Qe,t),b(K,e,t),a(e,Ae,t),b(O,e,t),a(e,De,t),a(e,ee,t),a(e,qe,t),a(e,te,t),a(e,Pe,t),a(e,le,t),a(e,Ke,t),b(ae,e,t),a(e,Oe,t),a(e,ne,t),a(e,et,t),b(ie,e,t),a(e,tt,t),a(e,se,t),a(e,lt,t),b(oe,e,t),a(e,at,t),a(e,re,t),a(e,nt,t),b(pe,e,t),a(e,it,t),a(e,me,t),a(e,st,t),b(ce,e,t),a(e,ot,t),a(e,fe,t),a(e,rt,t),a(e,de,t),a(e,pt,t),b(Z,e,t),a(e,mt,t),b(ue,e,t),a(e,ct,t),a(e,he,t),a(e,ft,t),b(x,e,t),a(e,dt,t),b(be,e,t),a(e,ut,t),a(e,ye,t),a(e,ht,t),a(e,Me,t),a(e,bt,t),b(ge,e,t),a(e,yt,t),a(e,Te,t),Mt=!0},p(e,[t]){const Qt={};t&2&&(Qt.$$scope={dirty:t,ctx:e}),T.$set(Qt);const At={};t&2&&(At.$$scope={dirty:t,ctx:e}),$.$set(At);const Dt={};t&2&&(Dt.$$scope={dirty:t,ctx:e}),U.$set(Dt);const qt={};t&2&&(qt.$$scope={dirty:t,ctx:e}),Z.$set(qt);const Pt={};t&2&&(Pt.$$scope={dirty:t,ctx:e}),x.$set(Pt)},i(e){Mt||(y(m.$$.fragment,e),y(T.$$.fragment,e),y(C.$$.fragment,e),y(V.$$.fragment,e),y($.$$.fragment,e),y(G.$$.fragment,e),y(H.$$.fragment,e),y(L.$$.fragment,e),y(Y.$$.fragment,e),y(U.$$.fragment,e),y(z.$$.fragment,e),y(D.$$.fragment,e),y(K.$$.fragment,e),y(O.$$.fragment,e),y(ae.$$.fragment,e),y(ie.$$.fragment,e),y(oe.$$.fragment,e),y(pe.$$.fragment,e),y(ce.$$.fragment,e),y(Z.$$.fragment,e),y(ue.$$.fragment,e),y(x.$$.fragment,e),y(be.$$.fragment,e),y(ge.$$.fragment,e),Mt=!0)},o(e){M(m.$$.fragment,e),M(T.$$.fragment,e),M(C.$$.fragment,e),M(V.$$.fragment,e),M($.$$.fragment,e),M(G.$$.fragment,e),M(H.$$.fragment,e),M(L.$$.fragment,e),M(Y.$$.fragment,e),M(U.$$.fragment,e),M(z.$$.fragment,e),M(D.$$.fragment,e),M(K.$$.fragment,e),M(O.$$.fragment,e),M(ae.$$.fragment,e),M(ie.$$.fragment,e),M(oe.$$.fragment,e),M(pe.$$.fragment,e),M(ce.$$.fragment,e),M(Z.$$.fragment,e),M(ue.$$.fragment,e),M(x.$$.fragment,e),M(be.$$.fragment,e),M(ge.$$.fragment,e),Mt=!1},d(e){e&&(l(f),l(o),l(_),l(d),l(j),l(W),l(Je),l(X),l($e),l(v),l(Ue),l(B),l(Ze),l(xe),l(R),l(je),l(We),l(Xe),l(N),l(ve),l(Be),l(k),l(Ce),l(Re),l(I),l(Ve),l(Ne),l(E),l(Ge),l(ke),l(He),l(S),l(Ie),l(F),l(Le),l(Ee),l(Q),l(Ye),l(A),l(Se),l(Fe),l(q),l(ze),l(P),l(Qe),l(Ae),l(De),l(ee),l(qe),l(te),l(Pe),l(le),l(Ke),l(Oe),l(ne),l(et),l(tt),l(se),l(lt),l(at),l(re),l(nt),l(it),l(me),l(st),l(ot),l(fe),l(rt),l(de),l(pt),l(mt),l(ct),l(he),l(ft),l(dt),l(ut),l(ye),l(ht),l(Me),l(bt),l(yt),l(Te)),l(n),g(m,e),g(T,e),g(C,e),g(V,e),g($,e),g(G,e),g(H,e),g(L,e),g(Y,e),g(U,e),g(z,e),g(D,e),g(K,e),g(O,e),g(ae,e),g(ie,e),g(oe,e),g(pe,e),g(ce,e),g(Z,e),g(ue,e),g(x,e),g(be,e),g(ge,e)}}}const yl='{"title":"Stable Diffusion XL","local":"stable-diffusion-xl","sections":[{"title":"Script parameters","local":"script-parameters","sections":[{"title":"Min-SNR weighting","local":"min-snr-weighting","sections":[],"depth":3}],"depth":2},{"title":"Training script","local":"training-script","sections":[],"depth":2},{"title":"Launch the script","local":"launch-the-script","sections":[],"depth":2},{"title":"Next steps","local":"next-steps","sections":[],"depth":2}],"depth":1}';function Ml(w){return ll(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ul extends al{constructor(n){super(),nl(this,n,Ml,bl,tl,{})}}export{Ul as component};
