import{s as Ot,o as el,n as _e}from"../chunks/scheduler.182ea377.js";import{S as tl,i as ll,g as r,s as i,r as h,A as al,h as p,f as l,c as s,j as Pt,u as y,x as c,k as Dt,y as nl,a,v as b,d as M,t as g,w as _}from"../chunks/index.abf12888.js";import{T as bt}from"../chunks/Tip.230e2334.js";import{C as U}from"../chunks/CodeBlock.57fe6e13.js";import{H as ge}from"../chunks/Heading.16916d63.js";import{H as il,a as Kt}from"../chunks/HfOption.fc88c804.js";function sl(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,u){a(o,n,u)},p:_e,d(o){o&&l(n)}}}function ol(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,u){a(o,n,u)},p:_e,d(o){o&&l(n)}}}function rl(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,u){a(o,n,u)},p:_e,d(o){o&&l(n)}}}function pl(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,u){a(o,n,u)},p:_e,d(o){o&&l(n)}}}function ml(w){let n,f;return n=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(){h(n.$$.fragment)},l(o){y(n.$$.fragment,o)},m(o,u){b(n,o,u),f=!0},p:_e,i(o){f||(M(n.$$.fragment,o),f=!0)},o(o){g(n.$$.fragment,o),f=!1},d(o){_(n,o)}}}function cl(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,u,m;return u=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(){n=r("p"),n.innerHTML=f,o=i(),h(u.$$.fragment)},l(d){n=p(d,"P",{"data-svelte-h":!0}),c(n)!=="svelte-897rmr"&&(n.innerHTML=f),o=s(d),y(u.$$.fragment,d)},m(d,T){a(d,n,T),a(d,o,T),b(u,d,T),m=!0},p:_e,i(d){m||(M(u.$$.fragment,d),m=!0)},o(d){g(u.$$.fragment,d),m=!1},d(d){d&&(l(n),l(o)),_(u,d)}}}function fl(w){let n,f,o,u;return n=new Kt({props:{id:"inference",option:"PyTorch",$$slots:{default:[ml]},$$scope:{ctx:w}}}),o=new Kt({props:{id:"inference",option:"PyTorch XLA",$$slots:{default:[cl]},$$scope:{ctx:w}}}),{c(){h(n.$$.fragment),f=i(),h(o.$$.fragment)},l(m){y(n.$$.fragment,m),f=s(m),y(o.$$.fragment,m)},m(m,d){b(n,m,d),a(m,f,d),b(o,m,d),u=!0},p(m,d){const T={};d&2&&(T.$$scope={dirty:d,ctx:m}),n.$set(T);const x={};d&2&&(x.$$scope={dirty:d,ctx:m}),o.$set(x)},i(m){u||(M(n.$$.fragment,m),M(o.$$.fragment,m),u=!0)},o(m){g(n.$$.fragment,m),g(o.$$.fragment,m),u=!1},d(m){m&&l(f),_(n,m),_(o,m)}}}function dl(w){let n,f,o,u,m,d,T,x,W,Mt='<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.',Te,C,gt='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.',Ue,j,_t='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,wt="Before running the script, make sure you install the library from source:",$e,V,Ze,R,Tt="Then navigate to the example folder containing the training script and install the required dependencies for the script you’re using:",ve,B,xe,J,We,k,Ut="Initialize an 🤗 Accelerate environment:",Ce,G,je,H,Jt="To setup a default 🤗 Accelerate environment without choosing any configurations:",Xe,I,Ve,N,$t="Or if your environment doesn’t support an interactive shell, like a notebook, you can use:",Re,L,Be,z,Zt='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.',ke,E,Ge,$,He,Y,vt='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:",Ne,S,Le,Q,Wt='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.',ze,A,Ct='<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>',Ee,q,Ye,P,jt='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.',Fe,D,Xt="Add the <code>--snr_gamma</code> parameter and set it to the recommended value of 5.0:",Se,K,Qe,O,Ae,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,Rt='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,Bt='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:',De,ae,Ke,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).',Oe,ie,et,se,Gt="After calculating the embeddings, the text encoder, VAE, and tokenizer are deleted to free up some memory:",tt,oe,lt,re,Ht='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,nt,me,It='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.',it,ce,st,fe,Nt="Once you’ve made all your changes or you’re okay with the default configuration, you’re ready to launch the training script! 🚀",ot,de,Lt='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.',rt,Z,pt,ue,mt,he,zt="After you’ve finished training, you can use your newly trained SDXL model for inference!",ct,v,ft,ye,dt,be,Et="Congratulations on training a SDXL model! To learn more about how to use your new model, the following guides may be helpful:",ut,Me,Yt='<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>',ht,we,yt;return m=new ge({props:{title:"Stable Diffusion XL",local:"stable-diffusion-xl",headingTag:"h1"}}),T=new bt({props:{warning:!0,$$slots:{default:[sl]},$$scope:{ctx:w}}}),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}}),J=new bt({props:{$$slots:{default:[ol]},$$scope:{ctx:w}}}),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:`from accelerate.utils import write_basic_config

write_basic_config()`,wrap:!1}}),E=new ge({props:{title:"Script parameters",local:"script-parameters",headingTag:"h2"}}),$=new bt({props:{$$slots:{default:[rl]},$$scope:{ctx:w}}}),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 ge({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 ge({props:{title:"Training script",local:"training-script",headingTag:"h2"}}),ae=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 ge({props:{title:"Launch the script",local:"launch-the-script",headingTag:"h2"}}),Z=new bt({props:{$$slots:{default:[pl]},$$scope:{ctx:w}}}),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 il({props:{id:"inference",options:["PyTorch","PyTorch XLA"],$$slots:{default:[fl]},$$scope:{ctx:w}}}),ye=new ge({props:{title:"Next steps",local:"next-steps",headingTag:"h2"}}),{c(){n=r("meta"),f=i(),o=r("p"),u=i(),h(m.$$.fragment),d=i(),h(T.$$.fragment),x=i(),W=r("p"),W.innerHTML=Mt,Te=i(),C=r("p"),C.innerHTML=gt,Ue=i(),j=r("p"),j.innerHTML=_t,Je=i(),X=r("p"),X.textContent=wt,$e=i(),h(V.$$.fragment),Ze=i(),R=r("p"),R.textContent=Tt,ve=i(),h(B.$$.fragment),xe=i(),h(J.$$.fragment),We=i(),k=r("p"),k.textContent=Ut,Ce=i(),h(G.$$.fragment),je=i(),H=r("p"),H.textContent=Jt,Xe=i(),h(I.$$.fragment),Ve=i(),N=r("p"),N.textContent=$t,Re=i(),h(L.$$.fragment),Be=i(),z=r("p"),z.innerHTML=Zt,ke=i(),h(E.$$.fragment),Ge=i(),h($.$$.fragment),He=i(),Y=r("p"),Y.innerHTML=vt,Ie=i(),F=r("p"),F.innerHTML=xt,Ne=i(),h(S.$$.fragment),Le=i(),Q=r("p"),Q.innerHTML=Wt,ze=i(),A=r("ul"),A.innerHTML=Ct,Ee=i(),h(q.$$.fragment),Ye=i(),P=r("p"),P.innerHTML=jt,Fe=i(),D=r("p"),D.innerHTML=Xt,Se=i(),h(K.$$.fragment),Qe=i(),h(O.$$.fragment),Ae=i(),ee=r("p"),ee.innerHTML=Vt,qe=i(),te=r("p"),te.innerHTML=Rt,Pe=i(),le=r("p"),le.innerHTML=Bt,De=i(),h(ae.$$.fragment),Ke=i(),ne=r("p"),ne.innerHTML=kt,Oe=i(),h(ie.$$.fragment),et=i(),se=r("p"),se.textContent=Gt,tt=i(),h(oe.$$.fragment),lt=i(),re=r("p"),re.innerHTML=Ht,at=i(),h(pe.$$.fragment),nt=i(),me=r("p"),me.innerHTML=It,it=i(),h(ce.$$.fragment),st=i(),fe=r("p"),fe.textContent=Nt,ot=i(),de=r("p"),de.innerHTML=Lt,rt=i(),h(Z.$$.fragment),pt=i(),h(ue.$$.fragment),mt=i(),he=r("p"),he.textContent=zt,ct=i(),h(v.$$.fragment),ft=i(),h(ye.$$.fragment),dt=i(),be=r("p"),be.textContent=Et,ut=i(),Me=r("ul"),Me.innerHTML=Yt,ht=i(),we=r("p"),this.h()},l(e){const t=al("svelte-u9bgzb",document.head);n=p(t,"META",{name:!0,content:!0}),t.forEach(l),f=s(e),o=p(e,"P",{}),Pt(o).forEach(l),u=s(e),y(m.$$.fragment,e),d=s(e),y(T.$$.fragment,e),x=s(e),W=p(e,"P",{"data-svelte-h":!0}),c(W)!=="svelte-1almhd5"&&(W.innerHTML=Mt),Te=s(e),C=p(e,"P",{"data-svelte-h":!0}),c(C)!=="svelte-bnjhh6"&&(C.innerHTML=gt),Ue=s(e),j=p(e,"P",{"data-svelte-h":!0}),c(j)!=="svelte-1p10m2l"&&(j.innerHTML=_t),Je=s(e),X=p(e,"P",{"data-svelte-h":!0}),c(X)!=="svelte-l7dm2q"&&(X.textContent=wt),$e=s(e),y(V.$$.fragment,e),Ze=s(e),R=p(e,"P",{"data-svelte-h":!0}),c(R)!=="svelte-z4z0b9"&&(R.textContent=Tt),ve=s(e),y(B.$$.fragment,e),xe=s(e),y(J.$$.fragment,e),We=s(e),k=p(e,"P",{"data-svelte-h":!0}),c(k)!=="svelte-60q53m"&&(k.textContent=Ut),Ce=s(e),y(G.$$.fragment,e),je=s(e),H=p(e,"P",{"data-svelte-h":!0}),c(H)!=="svelte-di6juu"&&(H.textContent=Jt),Xe=s(e),y(I.$$.fragment,e),Ve=s(e),N=p(e,"P",{"data-svelte-h":!0}),c(N)!=="svelte-tsz4qp"&&(N.textContent=$t),Re=s(e),y(L.$$.fragment,e),Be=s(e),z=p(e,"P",{"data-svelte-h":!0}),c(z)!=="svelte-1fkfdql"&&(z.innerHTML=Zt),ke=s(e),y(E.$$.fragment,e),Ge=s(e),y($.$$.fragment,e),He=s(e),Y=p(e,"P",{"data-svelte-h":!0}),c(Y)!=="svelte-1q049xx"&&(Y.innerHTML=vt),Ie=s(e),F=p(e,"P",{"data-svelte-h":!0}),c(F)!=="svelte-9pyoon"&&(F.innerHTML=xt),Ne=s(e),y(S.$$.fragment,e),Le=s(e),Q=p(e,"P",{"data-svelte-h":!0}),c(Q)!=="svelte-156hk"&&(Q.innerHTML=Wt),ze=s(e),A=p(e,"UL",{"data-svelte-h":!0}),c(A)!=="svelte-1wjvidq"&&(A.innerHTML=Ct),Ee=s(e),y(q.$$.fragment,e),Ye=s(e),P=p(e,"P",{"data-svelte-h":!0}),c(P)!=="svelte-h8wu6q"&&(P.innerHTML=jt),Fe=s(e),D=p(e,"P",{"data-svelte-h":!0}),c(D)!=="svelte-tp3kp"&&(D.innerHTML=Xt),Se=s(e),y(K.$$.fragment,e),Qe=s(e),y(O.$$.fragment,e),Ae=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=Rt),Pe=s(e),le=p(e,"P",{"data-svelte-h":!0}),c(le)!=="svelte-9e3dc8"&&(le.innerHTML=Bt),De=s(e),y(ae.$$.fragment,e),Ke=s(e),ne=p(e,"P",{"data-svelte-h":!0}),c(ne)!=="svelte-19ae5vc"&&(ne.innerHTML=kt),Oe=s(e),y(ie.$$.fragment,e),et=s(e),se=p(e,"P",{"data-svelte-h":!0}),c(se)!=="svelte-168omb4"&&(se.textContent=Gt),tt=s(e),y(oe.$$.fragment,e),lt=s(e),re=p(e,"P",{"data-svelte-h":!0}),c(re)!=="svelte-15uikpu"&&(re.innerHTML=Ht),at=s(e),y(pe.$$.fragment,e),nt=s(e),me=p(e,"P",{"data-svelte-h":!0}),c(me)!=="svelte-6gmbd2"&&(me.innerHTML=It),it=s(e),y(ce.$$.fragment,e),st=s(e),fe=p(e,"P",{"data-svelte-h":!0}),c(fe)!=="svelte-9dei1q"&&(fe.textContent=Nt),ot=s(e),de=p(e,"P",{"data-svelte-h":!0}),c(de)!=="svelte-i8eyu5"&&(de.innerHTML=Lt),rt=s(e),y(Z.$$.fragment,e),pt=s(e),y(ue.$$.fragment,e),mt=s(e),he=p(e,"P",{"data-svelte-h":!0}),c(he)!=="svelte-ay58z1"&&(he.textContent=zt),ct=s(e),y(v.$$.fragment,e),ft=s(e),y(ye.$$.fragment,e),dt=s(e),be=p(e,"P",{"data-svelte-h":!0}),c(be)!=="svelte-1gdijji"&&(be.textContent=Et),ut=s(e),Me=p(e,"UL",{"data-svelte-h":!0}),c(Me)!=="svelte-187x0qc"&&(Me.innerHTML=Yt),ht=s(e),we=p(e,"P",{}),Pt(we).forEach(l),this.h()},h(){Dt(n,"name","hf:doc:metadata"),Dt(n,"content",ul)},m(e,t){nl(document.head,n),a(e,f,t),a(e,o,t),a(e,u,t),b(m,e,t),a(e,d,t),b(T,e,t),a(e,x,t),a(e,W,t),a(e,Te,t),a(e,C,t),a(e,Ue,t),a(e,j,t),a(e,Je,t),a(e,X,t),a(e,$e,t),b(V,e,t),a(e,Ze,t),a(e,R,t),a(e,ve,t),b(B,e,t),a(e,xe,t),b(J,e,t),a(e,We,t),a(e,k,t),a(e,Ce,t),b(G,e,t),a(e,je,t),a(e,H,t),a(e,Xe,t),b(I,e,t),a(e,Ve,t),a(e,N,t),a(e,Re,t),b(L,e,t),a(e,Be,t),a(e,z,t),a(e,ke,t),b(E,e,t),a(e,Ge,t),b($,e,t),a(e,He,t),a(e,Y,t),a(e,Ie,t),a(e,F,t),a(e,Ne,t),b(S,e,t),a(e,Le,t),a(e,Q,t),a(e,ze,t),a(e,A,t),a(e,Ee,t),b(q,e,t),a(e,Ye,t),a(e,P,t),a(e,Fe,t),a(e,D,t),a(e,Se,t),b(K,e,t),a(e,Qe,t),b(O,e,t),a(e,Ae,t),a(e,ee,t),a(e,qe,t),a(e,te,t),a(e,Pe,t),a(e,le,t),a(e,De,t),b(ae,e,t),a(e,Ke,t),a(e,ne,t),a(e,Oe,t),b(ie,e,t),a(e,et,t),a(e,se,t),a(e,tt,t),b(oe,e,t),a(e,lt,t),a(e,re,t),a(e,at,t),b(pe,e,t),a(e,nt,t),a(e,me,t),a(e,it,t),b(ce,e,t),a(e,st,t),a(e,fe,t),a(e,ot,t),a(e,de,t),a(e,rt,t),b(Z,e,t),a(e,pt,t),b(ue,e,t),a(e,mt,t),a(e,he,t),a(e,ct,t),b(v,e,t),a(e,ft,t),b(ye,e,t),a(e,dt,t),a(e,be,t),a(e,ut,t),a(e,Me,t),a(e,ht,t),a(e,we,t),yt=!0},p(e,[t]){const Ft={};t&2&&(Ft.$$scope={dirty:t,ctx:e}),T.$set(Ft);const St={};t&2&&(St.$$scope={dirty:t,ctx:e}),J.$set(St);const Qt={};t&2&&(Qt.$$scope={dirty:t,ctx:e}),$.$set(Qt);const At={};t&2&&(At.$$scope={dirty:t,ctx:e}),Z.$set(At);const qt={};t&2&&(qt.$$scope={dirty:t,ctx:e}),v.$set(qt)},i(e){yt||(M(m.$$.fragment,e),M(T.$$.fragment,e),M(V.$$.fragment,e),M(B.$$.fragment,e),M(J.$$.fragment,e),M(G.$$.fragment,e),M(I.$$.fragment,e),M(L.$$.fragment,e),M(E.$$.fragment,e),M($.$$.fragment,e),M(S.$$.fragment,e),M(q.$$.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(v.$$.fragment,e),M(ye.$$.fragment,e),yt=!0)},o(e){g(m.$$.fragment,e),g(T.$$.fragment,e),g(V.$$.fragment,e),g(B.$$.fragment,e),g(J.$$.fragment,e),g(G.$$.fragment,e),g(I.$$.fragment,e),g(L.$$.fragment,e),g(E.$$.fragment,e),g($.$$.fragment,e),g(S.$$.fragment,e),g(q.$$.fragment,e),g(K.$$.fragment,e),g(O.$$.fragment,e),g(ae.$$.fragment,e),g(ie.$$.fragment,e),g(oe.$$.fragment,e),g(pe.$$.fragment,e),g(ce.$$.fragment,e),g(Z.$$.fragment,e),g(ue.$$.fragment,e),g(v.$$.fragment,e),g(ye.$$.fragment,e),yt=!1},d(e){e&&(l(f),l(o),l(u),l(d),l(x),l(W),l(Te),l(C),l(Ue),l(j),l(Je),l(X),l($e),l(Ze),l(R),l(ve),l(xe),l(We),l(k),l(Ce),l(je),l(H),l(Xe),l(Ve),l(N),l(Re),l(Be),l(z),l(ke),l(Ge),l(He),l(Y),l(Ie),l(F),l(Ne),l(Le),l(Q),l(ze),l(A),l(Ee),l(Ye),l(P),l(Fe),l(D),l(Se),l(Qe),l(Ae),l(ee),l(qe),l(te),l(Pe),l(le),l(De),l(Ke),l(ne),l(Oe),l(et),l(se),l(tt),l(lt),l(re),l(at),l(nt),l(me),l(it),l(st),l(fe),l(ot),l(de),l(rt),l(pt),l(mt),l(he),l(ct),l(ft),l(dt),l(be),l(ut),l(Me),l(ht),l(we)),l(n),_(m,e),_(T,e),_(V,e),_(B,e),_(J,e),_(G,e),_(I,e),_(L,e),_(E,e),_($,e),_(S,e),_(q,e),_(K,e),_(O,e),_(ae,e),_(ie,e),_(oe,e),_(pe,e),_(ce,e),_(Z,e),_(ue,e),_(v,e),_(ye,e)}}}const ul='{"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 hl(w){return el(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Tl extends tl{constructor(n){super(),ll(this,n,hl,dl,Ot,{})}}export{Tl as component};
