import{s as tl,o as ll,n as _e}from"../chunks/scheduler.8c3d61f6.js";import{S as al,i as il,g as r,s as n,r as u,A as nl,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.1d9b8c37.js";import{C as J}from"../chunks/CodeBlock.00a903b3.js";import{H as we,E as ol}from"../chunks/EditOnGithub.1e64e623.js";import{H as rl,a as el}from"../chunks/HfOption.6ab18950.js";function pl(_){let i,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(){i=r("p"),i.textContent=f},l(o){i=p(o,"P",{"data-svelte-h":!0}),c(i)!=="svelte-8jxpji"&&(i.textContent=f)},m(o,w){a(o,i,w)},p:_e,d(o){o&&l(i)}}}function ml(_){let i,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(){i=r("p"),i.innerHTML=f},l(o){i=p(o,"P",{"data-svelte-h":!0}),c(i)!=="svelte-1qbiqsn"&&(i.innerHTML=f)},m(o,w){a(o,i,w)},p:_e,d(o){o&&l(i)}}}function cl(_){let i,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(){i=r("p"),i.innerHTML=f},l(o){i=p(o,"P",{"data-svelte-h":!0}),c(i)!=="svelte-1gjhyr0"&&(i.innerHTML=f)},m(o,w){a(o,i,w)},p:_e,d(o){o&&l(i)}}}function fl(_){let i,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(){i=r("p"),i.innerHTML=f},l(o){i=p(o,"P",{"data-svelte-h":!0}),c(i)!=="svelte-1ki42i4"&&(i.innerHTML=f)},m(o,w){a(o,i,w)},p:_e,d(o){o&&l(i)}}}function dl(_){let i,f;return i=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(i.$$.fragment)},l(o){h(i.$$.fragment,o)},m(o,w){b(i,o,w),f=!0},p:_e,i(o){f||(y(i.$$.fragment,o),f=!0)},o(o){M(i.$$.fragment,o),f=!1},d(o){g(i,o)}}}function ul(_){let i,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,w,m;return w=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(){i=r("p"),i.innerHTML=f,o=n(),u(w.$$.fragment)},l(d){i=p(d,"P",{"data-svelte-h":!0}),c(i)!=="svelte-897rmr"&&(i.innerHTML=f),o=s(d),h(w.$$.fragment,d)},m(d,T){a(d,i,T),a(d,o,T),b(w,d,T),m=!0},p:_e,i(d){m||(y(w.$$.fragment,d),m=!0)},o(d){M(w.$$.fragment,d),m=!1},d(d){d&&(l(i),l(o)),g(w,d)}}}function hl(_){let i,f,o,w;return i=new el({props:{id:"inference",option:"PyTorch",$$slots:{default:[dl]},$$scope:{ctx:_}}}),o=new el({props:{id:"inference",option:"PyTorch XLA",$$slots:{default:[ul]},$$scope:{ctx:_}}}),{c(){u(i.$$.fragment),f=n(),u(o.$$.fragment)},l(m){h(i.$$.fragment,m),f=s(m),h(o.$$.fragment,m)},m(m,d){b(i,m,d),a(m,f,d),b(o,m,d),w=!0},p(m,d){const T={};d&2&&(T.$$scope={dirty:d,ctx:m}),i.$set(T);const j={};d&2&&(j.$$scope={dirty:d,ctx:m}),o.$set(j)},i(m){w||(y(i.$$.fragment,m),y(o.$$.fragment,m),w=!0)},o(m){M(i.$$.fragment,m),M(o.$$.fragment,m),w=!1},d(m){m&&l(f),g(i,m),g(o,m)}}}function bl(_){let i,f,o,w,m,d,T,j,W,wt='<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,_t='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,F,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,S,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>',Fe,D,Se,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 and is unavailable in the Flax training script.',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,ie,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,ne,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:',it,pe,nt,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,Ft="After you’ve finished training, you can use your newly trained SDXL model for inference!",ft,x,dt,be,ut,ye,St="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 we({props:{title:"Stable Diffusion XL",local:"stable-diffusion-xl",headingTag:"h1"}}),T=new gt({props:{warning:!0,$$slots:{default:[pl]},$$scope:{ctx:_}}}),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:_}}}),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 we({props:{title:"Script parameters",local:"script-parameters",headingTag:"h2"}}),U=new gt({props:{$$slots:{default:[cl]},$$scope:{ctx:_}}}),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 we({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 we({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}}),ne=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 we({props:{title:"Launch the script",local:"launch-the-script",headingTag:"h2"}}),Z=new gt({props:{$$slots:{default:[fl]},$$scope:{ctx:_}}}),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:_}}}),be=new we({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(){i=r("meta"),f=n(),o=r("p"),w=n(),u(m.$$.fragment),d=n(),u(T.$$.fragment),j=n(),W=r("p"),W.innerHTML=wt,Je=n(),X=r("p"),X.innerHTML=_t,$e=n(),v=r("p"),v.innerHTML=Tt,Ue=n(),B=r("p"),B.textContent=Jt,Ze=n(),u(C.$$.fragment),xe=n(),R=r("p"),R.textContent=$t,je=n(),u(V.$$.fragment),We=n(),u($.$$.fragment),Xe=n(),N=r("p"),N.textContent=Ut,ve=n(),u(G.$$.fragment),Be=n(),k=r("p"),k.textContent=Zt,Ce=n(),u(H.$$.fragment),Re=n(),I=r("p"),I.textContent=xt,Ve=n(),u(L.$$.fragment),Ne=n(),E=r("p"),E.innerHTML=jt,Ge=n(),u(Y.$$.fragment),ke=n(),u(U.$$.fragment),He=n(),F=r("p"),F.innerHTML=Wt,Ie=n(),S=r("p"),S.innerHTML=Xt,Le=n(),u(z.$$.fragment),Ee=n(),Q=r("p"),Q.innerHTML=vt,Ye=n(),A=r("ul"),A.innerHTML=Bt,Fe=n(),u(D.$$.fragment),Se=n(),q=r("p"),q.innerHTML=Ct,ze=n(),P=r("p"),P.innerHTML=Rt,Qe=n(),u(K.$$.fragment),Ae=n(),u(O.$$.fragment),De=n(),ee=r("p"),ee.innerHTML=Vt,qe=n(),te=r("p"),te.innerHTML=Nt,Pe=n(),le=r("p"),le.innerHTML=Gt,Ke=n(),u(ae.$$.fragment),Oe=n(),ie=r("p"),ie.innerHTML=kt,et=n(),u(ne.$$.fragment),tt=n(),se=r("p"),se.textContent=Ht,lt=n(),u(oe.$$.fragment),at=n(),re=r("p"),re.innerHTML=It,it=n(),u(pe.$$.fragment),nt=n(),me=r("p"),me.innerHTML=Lt,st=n(),u(ce.$$.fragment),ot=n(),fe=r("p"),fe.textContent=Et,rt=n(),de=r("p"),de.innerHTML=Yt,pt=n(),u(Z.$$.fragment),mt=n(),u(ue.$$.fragment),ct=n(),he=r("p"),he.textContent=Ft,ft=n(),u(x.$$.fragment),dt=n(),u(be.$$.fragment),ut=n(),ye=r("p"),ye.textContent=St,ht=n(),Me=r("ul"),Me.innerHTML=zt,bt=n(),u(ge.$$.fragment),yt=n(),Te=r("p"),this.h()},l(e){const t=nl("svelte-u9bgzb",document.head);i=p(t,"META",{name:!0,content:!0}),t.forEach(l),f=s(e),o=p(e,"P",{}),Kt(o).forEach(l),w=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=wt),Je=s(e),X=p(e,"P",{"data-svelte-h":!0}),c(X)!=="svelte-bnjhh6"&&(X.innerHTML=_t),$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),F=p(e,"P",{"data-svelte-h":!0}),c(F)!=="svelte-1q049xx"&&(F.innerHTML=Wt),Ie=s(e),S=p(e,"P",{"data-svelte-h":!0}),c(S)!=="svelte-9pyoon"&&(S.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),Fe=s(e),h(D.$$.fragment,e),Se=s(e),q=p(e,"P",{"data-svelte-h":!0}),c(q)!=="svelte-h8wu6q"&&(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),ie=p(e,"P",{"data-svelte-h":!0}),c(ie)!=="svelte-19ae5vc"&&(ie.innerHTML=kt),et=s(e),h(ne.$$.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),it=s(e),h(pe.$$.fragment,e),nt=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=Ft),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=St),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(i,"name","hf:doc:metadata"),Ot(i,"content",yl)},m(e,t){sl(document.head,i),a(e,f,t),a(e,o,t),a(e,w,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,F,t),a(e,Ie,t),a(e,S,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,Fe,t),b(D,e,t),a(e,Se,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,ie,t),a(e,et,t),b(ne,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,it,t),b(pe,e,t),a(e,nt,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(ne.$$.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(ne.$$.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(w),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(F),l(Ie),l(S),l(Le),l(Ee),l(Q),l(Ye),l(A),l(Fe),l(Se),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(ie),l(et),l(tt),l(se),l(lt),l(at),l(re),l(it),l(nt),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(i),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(ne,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(_){return ll(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ul extends al{constructor(i){super(),il(this,i,Ml,bl,tl,{})}}export{Ul as component};
