import{s as tl,o as ll,n as _e}from"../chunks/scheduler.182ea377.js";import{S as nl,i as al,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 as n,v as y,d as b,t as M,w as g}from"../chunks/index.abf12888.js";import{T as gt}from"../chunks/Tip.230e2334.js";import{C as U}from"../chunks/CodeBlock.57fe6e13.js";import{H as we,E as ol}from"../chunks/EditOnGithub.9b8e78e4.js";import{H as rl,a as el}from"../chunks/HfOption.fc88c804.js";function pl(_){let a,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(){a=r("p"),a.textContent=f},l(o){a=p(o,"P",{"data-svelte-h":!0}),c(a)!=="svelte-8jxpji"&&(a.textContent=f)},m(o,w){n(o,a,w)},p:_e,d(o){o&&l(a)}}}function ml(_){let a,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(){a=r("p"),a.innerHTML=f},l(o){a=p(o,"P",{"data-svelte-h":!0}),c(a)!=="svelte-1qbiqsn"&&(a.innerHTML=f)},m(o,w){n(o,a,w)},p:_e,d(o){o&&l(a)}}}function cl(_){let a,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(){a=r("p"),a.innerHTML=f},l(o){a=p(o,"P",{"data-svelte-h":!0}),c(a)!=="svelte-1gjhyr0"&&(a.innerHTML=f)},m(o,w){n(o,a,w)},p:_e,d(o){o&&l(a)}}}function fl(_){let a,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(){a=r("p"),a.innerHTML=f},l(o){a=p(o,"P",{"data-svelte-h":!0}),c(a)!=="svelte-1ki42i4"&&(a.innerHTML=f)},m(o,w){n(o,a,w)},p:_e,d(o){o&&l(a)}}}function dl(_){let a,f;return a=new U({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwaXBlbGluZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJwYXRoJTJGdG8lMkZ5b3VyJTJGbW9kZWwlMjIlMkMlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MTYpLnRvKCUyMmN1ZGElMjIpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMHBva2Vtb24lMjB3aXRoJTIwZ3JlZW4lMjBleWVzJTIwYW5kJTIwcmVkJTIwbGVncy4lMjIlMEFpbWFnZSUyMCUzRCUyMHBpcGVsaW5lKHByb21wdCUyQyUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0QzMCUyQyUyMGd1aWRhbmNlX3NjYWxlJTNENy41KS5pbWFnZXMlNUIwJTVEJTBBaW1hZ2Uuc2F2ZSglMjJwb2tlbW9uLnBuZyUyMik=",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 pokemon 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;pokemon.png&quot;</span>)`,wrap:!1}}),{c(){u(a.$$.fragment)},l(o){h(a.$$.fragment,o)},m(o,w){y(a,o,w),f=!0},p:_e,i(o){f||(b(a.$$.fragment,o),f=!0)},o(o){M(a.$$.fragment,o),f=!1},d(o){g(a,o)}}}function ul(_){let a,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 U({props:{code:"ZnJvbSUyMGRpZmZ1c2VycyUyMGltcG9ydCUyMERpZmZ1c2lvblBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjB0b3JjaF94bGEuY29yZS54bGFfbW9kZWwlMjBhcyUyMHhtJTBBJTBBZGV2aWNlJTIwJTNEJTIweG0ueGxhX2RldmljZSgpJTBBcGlwZWxpbmUlMjAlM0QlMjBEaWZmdXNpb25QaXBlbGluZS5mcm9tX3ByZXRyYWluZWQoJTIyc3RhYmlsaXR5YWklMkZzdGFibGUtZGlmZnVzaW9uLXhsLWJhc2UtMS4wJTIyKS50byhkZXZpY2UpJTBBJTBBcHJvbXB0JTIwJTNEJTIwJTIyQSUyMHBva2Vtb24lMjB3aXRoJTIwZ3JlZW4lMjBleWVzJTIwYW5kJTIwcmVkJTIwbGVncy4lMjIlMEFzdGFydCUyMCUzRCUyMHRpbWUoKSUwQWltYWdlJTIwJTNEJTIwcGlwZWxpbmUocHJvbXB0JTJDJTIwbnVtX2luZmVyZW5jZV9zdGVwcyUzRGluZmVyZW5jZV9zdGVwcykuaW1hZ2VzJTVCMCU1RCUwQXByaW50KGYnQ29tcGlsYXRpb24lMjB0aW1lJTIwaXMlMjAlN0J0aW1lKCktc3RhcnQlN0QlMjBzZWMnKSUwQWltYWdlLnNhdmUoJTIycG9rZW1vbi5wbmclMjIpJTBBJTBBc3RhcnQlMjAlM0QlMjB0aW1lKCklMEFpbWFnZSUyMCUzRCUyMHBpcGVsaW5lKHByb21wdCUyQyUyMG51bV9pbmZlcmVuY2Vfc3RlcHMlM0RpbmZlcmVuY2Vfc3RlcHMpLmltYWdlcyU1QjAlNUQlMEFwcmludChmJ0luZmVyZW5jZSUyMHRpbWUlMjBpcyUyMCU3QnRpbWUoKS1zdGFydCU3RCUyMHNlYyUyMGFmdGVyJTIwY29tcGlsYXRpb24nKQ==",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 pokemon 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;pokemon.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(){a=r("p"),a.innerHTML=f,o=i(),u(w.$$.fragment)},l(d){a=p(d,"P",{"data-svelte-h":!0}),c(a)!=="svelte-897rmr"&&(a.innerHTML=f),o=s(d),h(w.$$.fragment,d)},m(d,T){n(d,a,T),n(d,o,T),y(w,d,T),m=!0},p:_e,i(d){m||(b(w.$$.fragment,d),m=!0)},o(d){M(w.$$.fragment,d),m=!1},d(d){d&&(l(a),l(o)),g(w,d)}}}function hl(_){let a,f,o,w;return a=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(a.$$.fragment),f=i(),u(o.$$.fragment)},l(m){h(a.$$.fragment,m),f=s(m),h(o.$$.fragment,m)},m(m,d){y(a,m,d),n(m,f,d),y(o,m,d),w=!0},p(m,d){const T={};d&2&&(T.$$scope={dirty:d,ctx:m}),a.$set(T);const x={};d&2&&(x.$$scope={dirty:d,ctx:m}),o.$set(x)},i(m){w||(b(a.$$.fragment,m),b(o.$$.fragment,m),w=!0)},o(m){M(a.$$.fragment,m),M(o.$$.fragment,m),w=!1},d(m){m&&l(f),g(a,m),g(o,m)}}}function yl(_){let a,f,o,w,m,d,T,x,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.',Ue,C,_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,j,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.',Je,X,Ut="Before running the script, make sure you install the library from source:",Ze,V,ve,R,$t="Then navigate to the example folder containing the training script and install the required dependencies for the script you’re using:",xe,B,We,$,Ce,k,Jt="Initialize an 🤗 Accelerate environment:",je,G,Xe,H,Zt="To setup a default 🤗 Accelerate environment without choosing any configurations:",Ve,I,Re,N,vt="Or if your environment doesn’t support an interactive shell, like a notebook, you can use:",Be,L,ke,z,xt='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,E,He,J,Ie,Y,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.',Ne,F,Ct="For example, to speedup training with mixed precision using the bf16 format, add the <code>--mixed_precision</code> parameter to the training command:",Le,S,ze,Q,jt='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.',Ee,A,Xt='<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>',Ye,q,Fe,P,Vt='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.',Se,D,Rt="Add the <code>--snr_gamma</code> parameter and set it to the recommended value of 5.0:",Qe,K,Ae,O,qe,ee,Bt='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.',Pe,te,kt='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.',De,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,ne,Oe,ae,Ht='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,It="After calculating the embeddings, the text encoder, VAE, and tokenizer are deleted to free up some memory:",lt,oe,nt,re,Nt='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:',at,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,zt="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,Et='Let’s train on the <a href="https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions" rel="nofollow">Pokémon BLIP captions</a> dataset to generate your own Pokémon. 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,Yt="After you’ve finished training, you can use your newly trained SDXL model for inference!",ft,v,dt,ye,ut,be,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,St='<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>',yt,ge,bt,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:_}}}),V=new U({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}}),B=new U({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 U({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZw==",highlighted:"accelerate config",wrap:!1}}),I=new U({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZyUyMGRlZmF1bHQ=",highlighted:"accelerate config default",wrap:!1}}),L=new U({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}}),E=new we({props:{title:"Script parameters",local:"script-parameters",headingTag:"h2"}}),J=new gt({props:{$$slots:{default:[cl]},$$scope:{ctx:_}}}),S=new U({props:{code:"YWNjZWxlcmF0ZSUyMGxhdW5jaCUyMHRyYWluX3RleHRfdG9faW1hZ2Vfc2R4bC5weSUyMCU1QyUwQSUyMCUyMC0tbWl4ZWRfcHJlY2lzaW9uJTNEJTIyYmYxNiUyMg==",highlighted:`accelerate launch train_text_to_image_sdxl.py \\
  --mixed_precision=<span class="hljs-string">&quot;bf16&quot;</span>`,wrap:!1}}),q=new we({props:{title:"Min-SNR weighting",local:"min-snr-weighting",headingTag:"h3"}}),K=new U({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"}}),ne=new U({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 U({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 U({props:{code:"ZGVsJTIwdGV4dF9lbmNvZGVycyUyQyUyMHRva2VuaXplcnMlMkMlMjB2YWUlMEFnYy5jb2xsZWN0KCklMEF0b3JjaC5jdWRhLmVtcHR5X2NhY2hlKCk=",highlighted:`<span class="hljs-keyword">del</span> text_encoders, tokenizers, vae
gc.collect()
torch.cuda.empty_cache()`,wrap:!1}}),pe=new U({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 U({props:{code:"ZXhwb3J0JTIwTU9ERUxfTkFNRSUzRCUyMnN0YWJpbGl0eWFpJTJGc3RhYmxlLWRpZmZ1c2lvbi14bC1iYXNlLTEuMCUyMiUwQWV4cG9ydCUyMFZBRV9OQU1FJTNEJTIybWFkZWJ5b2xsaW4lMkZzZHhsLXZhZS1mcDE2LWZpeCUyMiUwQWV4cG9ydCUyMERBVEFTRVRfTkFNRSUzRCUyMmxhbWJkYWxhYnMlMkZwb2tlbW9uLWJsaXAtY2FwdGlvbnMlMjIlMEElMEFhY2NlbGVyYXRlJTIwbGF1bmNoJTIwdHJhaW5fdGV4dF90b19pbWFnZV9zZHhsLnB5JTIwJTVDJTBBJTIwJTIwLS1wcmV0cmFpbmVkX21vZGVsX25hbWVfb3JfcGF0aCUzRCUyNE1PREVMX05BTUUlMjAlNUMlMEElMjAlMjAtLXByZXRyYWluZWRfdmFlX21vZGVsX25hbWVfb3JfcGF0aCUzRCUyNFZBRV9OQU1FJTIwJTVDJTBBJTIwJTIwLS1kYXRhc2V0X25hbWUlM0QlMjREQVRBU0VUX05BTUUlMjAlNUMlMEElMjAlMjAtLWVuYWJsZV94Zm9ybWVyc19tZW1vcnlfZWZmaWNpZW50X2F0dGVudGlvbiUyMCU1QyUwQSUyMCUyMC0tcmVzb2x1dGlvbiUzRDUxMiUyMCU1QyUwQSUyMCUyMC0tY2VudGVyX2Nyb3AlMjAlNUMlMEElMjAlMjAtLXJhbmRvbV9mbGlwJTIwJTVDJTBBJTIwJTIwLS1wcm9wb3J0aW9uX2VtcHR5X3Byb21wdHMlM0QwLjIlMjAlNUMlMEElMjAlMjAtLXRyYWluX2JhdGNoX3NpemUlM0QxJTIwJTVDJTBBJTIwJTIwLS1ncmFkaWVudF9hY2N1bXVsYXRpb25fc3RlcHMlM0Q0JTIwJTVDJTBBJTIwJTIwLS1ncmFkaWVudF9jaGVja3BvaW50aW5nJTIwJTVDJTBBJTIwJTIwLS1tYXhfdHJhaW5fc3RlcHMlM0QxMDAwMCUyMCU1QyUwQSUyMCUyMC0tdXNlXzhiaXRfYWRhbSUyMCU1QyUwQSUyMCUyMC0tbGVhcm5pbmdfcmF0ZSUzRDFlLTA2JTIwJTVDJTBBJTIwJTIwLS1scl9zY2hlZHVsZXIlM0QlMjJjb25zdGFudCUyMiUyMCU1QyUwQSUyMCUyMC0tbHJfd2FybXVwX3N0ZXBzJTNEMCUyMCU1QyUwQSUyMCUyMC0tbWl4ZWRfcHJlY2lzaW9uJTNEJTIyZnAxNiUyMiUyMCU1QyUwQSUyMCUyMC0tcmVwb3J0X3RvJTNEJTIyd2FuZGIlMjIlMjAlNUMlMEElMjAlMjAtLXZhbGlkYXRpb25fcHJvbXB0JTNEJTIyYSUyMGN1dGUlMjBTdW5kYXIlMjBQaWNoYWklMjBjcmVhdHVyZSUyMiUyMCU1QyUwQSUyMCUyMC0tdmFsaWRhdGlvbl9lcG9jaHMlMjA1JTIwJTVDJTBBJTIwJTIwLS1jaGVja3BvaW50aW5nX3N0ZXBzJTNENTAwMCUyMCU1QyUwQSUyMCUyMC0tb3V0cHV0X2RpciUzRCUyMnNkeGwtcG9rZW1vbi1tb2RlbCUyMiUyMCU1QyUwQSUyMCUyMC0tcHVzaF90b19odWI=",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/pokemon-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-pokemon-model&quot;</span> \\
  --push_to_hub`,wrap:!1}}),v=new rl({props:{id:"inference",options:["PyTorch","PyTorch XLA"],$$slots:{default:[hl]},$$scope:{ctx:_}}}),ye=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(){a=r("meta"),f=i(),o=r("p"),w=i(),u(m.$$.fragment),d=i(),u(T.$$.fragment),x=i(),W=r("p"),W.innerHTML=wt,Ue=i(),C=r("p"),C.innerHTML=_t,$e=i(),j=r("p"),j.innerHTML=Tt,Je=i(),X=r("p"),X.textContent=Ut,Ze=i(),u(V.$$.fragment),ve=i(),R=r("p"),R.textContent=$t,xe=i(),u(B.$$.fragment),We=i(),u($.$$.fragment),Ce=i(),k=r("p"),k.textContent=Jt,je=i(),u(G.$$.fragment),Xe=i(),H=r("p"),H.textContent=Zt,Ve=i(),u(I.$$.fragment),Re=i(),N=r("p"),N.textContent=vt,Be=i(),u(L.$$.fragment),ke=i(),z=r("p"),z.innerHTML=xt,Ge=i(),u(E.$$.fragment),He=i(),u(J.$$.fragment),Ie=i(),Y=r("p"),Y.innerHTML=Wt,Ne=i(),F=r("p"),F.innerHTML=Ct,Le=i(),u(S.$$.fragment),ze=i(),Q=r("p"),Q.innerHTML=jt,Ee=i(),A=r("ul"),A.innerHTML=Xt,Ye=i(),u(q.$$.fragment),Fe=i(),P=r("p"),P.innerHTML=Vt,Se=i(),D=r("p"),D.innerHTML=Rt,Qe=i(),u(K.$$.fragment),Ae=i(),u(O.$$.fragment),qe=i(),ee=r("p"),ee.innerHTML=Bt,Pe=i(),te=r("p"),te.innerHTML=kt,De=i(),le=r("p"),le.innerHTML=Gt,Ke=i(),u(ne.$$.fragment),Oe=i(),ae=r("p"),ae.innerHTML=Ht,et=i(),u(ie.$$.fragment),tt=i(),se=r("p"),se.textContent=It,lt=i(),u(oe.$$.fragment),nt=i(),re=r("p"),re.innerHTML=Nt,at=i(),u(pe.$$.fragment),it=i(),me=r("p"),me.innerHTML=Lt,st=i(),u(ce.$$.fragment),ot=i(),fe=r("p"),fe.textContent=zt,rt=i(),de=r("p"),de.innerHTML=Et,pt=i(),u(Z.$$.fragment),mt=i(),u(ue.$$.fragment),ct=i(),he=r("p"),he.textContent=Yt,ft=i(),u(v.$$.fragment),dt=i(),u(ye.$$.fragment),ut=i(),be=r("p"),be.textContent=Ft,ht=i(),Me=r("ul"),Me.innerHTML=St,yt=i(),u(ge.$$.fragment),bt=i(),Te=r("p"),this.h()},l(e){const t=il("svelte-u9bgzb",document.head);a=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),x=s(e),W=p(e,"P",{"data-svelte-h":!0}),c(W)!=="svelte-1almhd5"&&(W.innerHTML=wt),Ue=s(e),C=p(e,"P",{"data-svelte-h":!0}),c(C)!=="svelte-bnjhh6"&&(C.innerHTML=_t),$e=s(e),j=p(e,"P",{"data-svelte-h":!0}),c(j)!=="svelte-1p10m2l"&&(j.innerHTML=Tt),Je=s(e),X=p(e,"P",{"data-svelte-h":!0}),c(X)!=="svelte-l7dm2q"&&(X.textContent=Ut),Ze=s(e),h(V.$$.fragment,e),ve=s(e),R=p(e,"P",{"data-svelte-h":!0}),c(R)!=="svelte-z4z0b9"&&(R.textContent=$t),xe=s(e),h(B.$$.fragment,e),We=s(e),h($.$$.fragment,e),Ce=s(e),k=p(e,"P",{"data-svelte-h":!0}),c(k)!=="svelte-60q53m"&&(k.textContent=Jt),je=s(e),h(G.$$.fragment,e),Xe=s(e),H=p(e,"P",{"data-svelte-h":!0}),c(H)!=="svelte-di6juu"&&(H.textContent=Zt),Ve=s(e),h(I.$$.fragment,e),Re=s(e),N=p(e,"P",{"data-svelte-h":!0}),c(N)!=="svelte-tsz4qp"&&(N.textContent=vt),Be=s(e),h(L.$$.fragment,e),ke=s(e),z=p(e,"P",{"data-svelte-h":!0}),c(z)!=="svelte-1fkfdql"&&(z.innerHTML=xt),Ge=s(e),h(E.$$.fragment,e),He=s(e),h(J.$$.fragment,e),Ie=s(e),Y=p(e,"P",{"data-svelte-h":!0}),c(Y)!=="svelte-1q049xx"&&(Y.innerHTML=Wt),Ne=s(e),F=p(e,"P",{"data-svelte-h":!0}),c(F)!=="svelte-9pyoon"&&(F.innerHTML=Ct),Le=s(e),h(S.$$.fragment,e),ze=s(e),Q=p(e,"P",{"data-svelte-h":!0}),c(Q)!=="svelte-156hk"&&(Q.innerHTML=jt),Ee=s(e),A=p(e,"UL",{"data-svelte-h":!0}),c(A)!=="svelte-1wjvidq"&&(A.innerHTML=Xt),Ye=s(e),h(q.$$.fragment,e),Fe=s(e),P=p(e,"P",{"data-svelte-h":!0}),c(P)!=="svelte-h8wu6q"&&(P.innerHTML=Vt),Se=s(e),D=p(e,"P",{"data-svelte-h":!0}),c(D)!=="svelte-tp3kp"&&(D.innerHTML=Rt),Qe=s(e),h(K.$$.fragment,e),Ae=s(e),h(O.$$.fragment,e),qe=s(e),ee=p(e,"P",{"data-svelte-h":!0}),c(ee)!=="svelte-1lew7ju"&&(ee.innerHTML=Bt),Pe=s(e),te=p(e,"P",{"data-svelte-h":!0}),c(te)!=="svelte-vxr0rt"&&(te.innerHTML=kt),De=s(e),le=p(e,"P",{"data-svelte-h":!0}),c(le)!=="svelte-9e3dc8"&&(le.innerHTML=Gt),Ke=s(e),h(ne.$$.fragment,e),Oe=s(e),ae=p(e,"P",{"data-svelte-h":!0}),c(ae)!=="svelte-19ae5vc"&&(ae.innerHTML=Ht),et=s(e),h(ie.$$.fragment,e),tt=s(e),se=p(e,"P",{"data-svelte-h":!0}),c(se)!=="svelte-168omb4"&&(se.textContent=It),lt=s(e),h(oe.$$.fragment,e),nt=s(e),re=p(e,"P",{"data-svelte-h":!0}),c(re)!=="svelte-15uikpu"&&(re.innerHTML=Nt),at=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=zt),rt=s(e),de=p(e,"P",{"data-svelte-h":!0}),c(de)!=="svelte-i8eyu5"&&(de.innerHTML=Et),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=Yt),ft=s(e),h(v.$$.fragment,e),dt=s(e),h(ye.$$.fragment,e),ut=s(e),be=p(e,"P",{"data-svelte-h":!0}),c(be)!=="svelte-1gdijji"&&(be.textContent=Ft),ht=s(e),Me=p(e,"UL",{"data-svelte-h":!0}),c(Me)!=="svelte-187x0qc"&&(Me.innerHTML=St),yt=s(e),h(ge.$$.fragment,e),bt=s(e),Te=p(e,"P",{}),Kt(Te).forEach(l),this.h()},h(){Ot(a,"name","hf:doc:metadata"),Ot(a,"content",bl)},m(e,t){sl(document.head,a),n(e,f,t),n(e,o,t),n(e,w,t),y(m,e,t),n(e,d,t),y(T,e,t),n(e,x,t),n(e,W,t),n(e,Ue,t),n(e,C,t),n(e,$e,t),n(e,j,t),n(e,Je,t),n(e,X,t),n(e,Ze,t),y(V,e,t),n(e,ve,t),n(e,R,t),n(e,xe,t),y(B,e,t),n(e,We,t),y($,e,t),n(e,Ce,t),n(e,k,t),n(e,je,t),y(G,e,t),n(e,Xe,t),n(e,H,t),n(e,Ve,t),y(I,e,t),n(e,Re,t),n(e,N,t),n(e,Be,t),y(L,e,t),n(e,ke,t),n(e,z,t),n(e,Ge,t),y(E,e,t),n(e,He,t),y(J,e,t),n(e,Ie,t),n(e,Y,t),n(e,Ne,t),n(e,F,t),n(e,Le,t),y(S,e,t),n(e,ze,t),n(e,Q,t),n(e,Ee,t),n(e,A,t),n(e,Ye,t),y(q,e,t),n(e,Fe,t),n(e,P,t),n(e,Se,t),n(e,D,t),n(e,Qe,t),y(K,e,t),n(e,Ae,t),y(O,e,t),n(e,qe,t),n(e,ee,t),n(e,Pe,t),n(e,te,t),n(e,De,t),n(e,le,t),n(e,Ke,t),y(ne,e,t),n(e,Oe,t),n(e,ae,t),n(e,et,t),y(ie,e,t),n(e,tt,t),n(e,se,t),n(e,lt,t),y(oe,e,t),n(e,nt,t),n(e,re,t),n(e,at,t),y(pe,e,t),n(e,it,t),n(e,me,t),n(e,st,t),y(ce,e,t),n(e,ot,t),n(e,fe,t),n(e,rt,t),n(e,de,t),n(e,pt,t),y(Z,e,t),n(e,mt,t),y(ue,e,t),n(e,ct,t),n(e,he,t),n(e,ft,t),y(v,e,t),n(e,dt,t),y(ye,e,t),n(e,ut,t),n(e,be,t),n(e,ht,t),n(e,Me,t),n(e,yt,t),y(ge,e,t),n(e,bt,t),n(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 qt={};t&2&&(qt.$$scope={dirty:t,ctx:e}),J.$set(qt);const Pt={};t&2&&(Pt.$$scope={dirty:t,ctx:e}),Z.$set(Pt);const Dt={};t&2&&(Dt.$$scope={dirty:t,ctx:e}),v.$set(Dt)},i(e){Mt||(b(m.$$.fragment,e),b(T.$$.fragment,e),b(V.$$.fragment,e),b(B.$$.fragment,e),b($.$$.fragment,e),b(G.$$.fragment,e),b(I.$$.fragment,e),b(L.$$.fragment,e),b(E.$$.fragment,e),b(J.$$.fragment,e),b(S.$$.fragment,e),b(q.$$.fragment,e),b(K.$$.fragment,e),b(O.$$.fragment,e),b(ne.$$.fragment,e),b(ie.$$.fragment,e),b(oe.$$.fragment,e),b(pe.$$.fragment,e),b(ce.$$.fragment,e),b(Z.$$.fragment,e),b(ue.$$.fragment,e),b(v.$$.fragment,e),b(ye.$$.fragment,e),b(ge.$$.fragment,e),Mt=!0)},o(e){M(m.$$.fragment,e),M(T.$$.fragment,e),M(V.$$.fragment,e),M(B.$$.fragment,e),M($.$$.fragment,e),M(G.$$.fragment,e),M(I.$$.fragment,e),M(L.$$.fragment,e),M(E.$$.fragment,e),M(J.$$.fragment,e),M(S.$$.fragment,e),M(q.$$.fragment,e),M(K.$$.fragment,e),M(O.$$.fragment,e),M(ne.$$.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(v.$$.fragment,e),M(ye.$$.fragment,e),M(ge.$$.fragment,e),Mt=!1},d(e){e&&(l(f),l(o),l(w),l(d),l(x),l(W),l(Ue),l(C),l($e),l(j),l(Je),l(X),l(Ze),l(ve),l(R),l(xe),l(We),l(Ce),l(k),l(je),l(Xe),l(H),l(Ve),l(Re),l(N),l(Be),l(ke),l(z),l(Ge),l(He),l(Ie),l(Y),l(Ne),l(F),l(Le),l(ze),l(Q),l(Ee),l(A),l(Ye),l(Fe),l(P),l(Se),l(D),l(Qe),l(Ae),l(qe),l(ee),l(Pe),l(te),l(De),l(le),l(Ke),l(Oe),l(ae),l(et),l(tt),l(se),l(lt),l(nt),l(re),l(at),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(be),l(ht),l(Me),l(yt),l(bt),l(Te)),l(a),g(m,e),g(T,e),g(V,e),g(B,e),g($,e),g(G,e),g(I,e),g(L,e),g(E,e),g(J,e),g(S,e),g(q,e),g(K,e),g(O,e),g(ne,e),g(ie,e),g(oe,e),g(pe,e),g(ce,e),g(Z,e),g(ue,e),g(v,e),g(ye,e),g(ge,e)}}}const bl='{"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 Jl extends nl{constructor(a){super(),al(this,a,Ml,yl,tl,{})}}export{Jl as component};
