import{s as Wl,n as Bl,o as Cl}from"../chunks/scheduler.8c3d61f6.js";import{S as Vl,i as kl,g as s,s as i,r,A as _l,h as o,f as l,c as n,j as Il,u as c,x as d,k as Gl,y as Yl,a,v as m,d as p,t as M,w as y}from"../chunks/index.da70eac4.js";import{C as h}from"../chunks/CodeBlock.a9c4becf.js";import{H as ve,E as xl}from"../chunks/getInferenceSnippets.725ed3d4.js";function Xl(Ht){let u,Ge,Ze,We,f,Be,w,Ft="CogVideoX is a text-to-video generation model focused on creating more coherent videos aligned with a prompt. It achieves this using several methods.",Ce,b,Rt="<li><p>a 3D variational autoencoder that compresses videos spatially and temporally, improving compression rate and video accuracy.</p></li> <li><p>an expert transformer block to help align text and video, and a 3D full attention module for capturing and creating spatially and temporally accurate videos.</p></li>",Ve,U,$t="The actual test of the video instruction dimension found that CogVideoX has good effects on consistent theme, dynamic information, consistent background, object information, smooth motion, color, scene, appearance style, and temporal style but cannot achieve good results with human action, spatial relationship, and multiple objects.",ke,g,Lt="Finetuning with Diffusers can help make up for these poor results.",_e,T,Ye,J,St="The training scripts accepts data in two formats.",xe,j,Qt="The first format is suited for small-scale training, and the second format uses a CSV format, which is more appropriate for streaming data for large-scale training. In the future, Diffusers will support the <code>&lt;Video&gt;</code> tag.",Xe,v,Ne,Z,zt="Two files where one file contains line-separated prompts and another file contains line-separated paths to video data (the path to video files must be relative to the path you pass when specifying <code>--instance_data_root</code>). Let’s take a look at an example to understand this better!",He,I,At="Assume you’ve specified <code>--instance_data_root</code> as <code>/dataset</code>, and that this directory contains the files: <code>prompts.txt</code> and <code>videos.txt</code>.",Fe,G,Et="The <code>prompts.txt</code> file should contain line-separated prompts:",Re,W,$e,B,qt="The <code>videos.txt</code> file should contain line-separate paths to video files. Note that the path should be <em>relative</em> to the <code>--instance_data_root</code> directory.",Le,C,Se,V,Pt="Overall, this is how your dataset would look like if you ran the <code>tree</code> command on the dataset root directory:",Qe,k,ze,_,Dt="When using this format, the <code>--caption_column</code> must be <code>prompts.txt</code> and <code>--video_column</code> must be <code>videos.txt</code>.",Ae,Y,Ee,x,Ot="You could use a single CSV file. For the sake of this example, assume you have a <code>metadata.csv</code> file. The expected format is:",qe,X,Pe,N,Kt='In this case, the <code>--instance_data_root</code> should be the location where the videos are stored and <code>--dataset_name</code> should be either a path to local folder or a <a href="https://huggingface.co/docs/datasets/main/en/package_reference/loading_methods#datasets.load_dataset" rel="nofollow">load_dataset</a> compatible dataset hosted on the Hub. Assuming you have videos of Minecraft gameplay at <code>https://huggingface.co/datasets/my-awesome-username/minecraft-videos</code>, you would have to specify <code>my-awesome-username/minecraft-videos</code>.',De,H,el="When using this format, the <code>--caption_column</code> must be <code>&lt;CAPTION_COLUMN&gt;</code> and <code>--video_column</code> must be <code>&lt;PATH_TO_VIDEO_COLUMN&gt;</code>.",Oe,F,tl="You are not strictly restricted to the CSV format. Any format works as long as the <code>load_dataset</code> method supports the file format to load a basic <code>&lt;PATH_TO_VIDEO_COLUMN&gt;</code> and <code>&lt;CAPTION_COLUMN&gt;</code>. The reason for going through these dataset organization gymnastics for loading video data is because <code>load_dataset</code> does not fully support all kinds of video formats.",Ke,R,ll=`<p>[!NOTE]
CogVideoX works best with long and descriptive LLM-augmented prompts for video generation. We recommend pre-processing your videos by first generating a summary using a VLM and then augmenting the prompts with an LLM. To generate the above captions, we use <a href="https://huggingface.co/openbmb/MiniCPM-V-2_6" rel="nofollow">MiniCPM-V-26</a> and <a href="https://huggingface.co/meta-llama/Meta-Llama-3.1-8B-Instruct" rel="nofollow">Llama-3.1-8B-Instruct</a>. A very barebones and no-frills example for this is available <a href="https://gist.github.com/a-r-r-o-w/4dee20250e82f4e44690a02351324a4a" rel="nofollow">here</a>. The official recommendation for augmenting prompts is <a href="https://huggingface.co/THUDM?search_models=chatglm" rel="nofollow">ChatGLM</a> and a length of 50-100 words is considered good.</p>`,et,$,al=`<p>![NOTE]
It is expected that your dataset is already pre-processed. If not, some basic pre-processing can be done by playing with the following parameters:
<code>--height</code>, <code>--width</code>, <code>--fps</code>, <code>--max_num_frames</code>, <code>--skip_frames_start</code> and <code>--skip_frames_end</code>.
Presently, all videos in your dataset should contain the same number of video frames when using a training batch size &gt; 1.</p>`,tt,L,lt,S,il="You need to setup your development environment by installing the necessary requirements. The following packages are required:",at,Q,nl='<li>Torch 2.0 or above based on the training features you are utilizing (might require latest or nightly versions for quantized/deepspeed training)</li> <li><code>pip install diffusers transformers accelerate peft huggingface_hub</code> for all things modeling and training related</li> <li><code>pip install datasets decord</code> for loading video training data</li> <li><code>pip install bitsandbytes</code> for using 8-bit Adam or AdamW optimizers for memory-optimized training</li> <li><code>pip install wandb</code> optionally for monitoring training logs</li> <li><code>pip install deepspeed</code> optionally for <a href="https://github.com/microsoft/DeepSpeed" rel="nofollow">DeepSpeed</a> training</li> <li><code>pip install prodigyopt</code> optionally if you would like to use the Prodigy optimizer for training</li>',it,z,sl="To make sure you can successfully run the latest versions of the example scripts, we highly recommend <strong>installing from source</strong> and keeping the install up to date as we update the example scripts frequently and install some example-specific requirements. To do this, execute the following steps in a new virtual environment:",nt,A,ol="Before running the script, make sure you install the library from source:",st,E,ot,q,dl="Then navigate to the example folder containing the training script and install the required dependencies for the script you’re using:",dt,P,rl="<li>PyTorch</li>",rt,D,ct,O,cl='And initialize an <a href="https://github.com/huggingface/accelerate/" rel="nofollow">🤗 Accelerate</a> environment with:',mt,K,pt,ee,ml="Or for a default accelerate configuration without answering questions about your environment",Mt,te,yt,le,pl="Or if your environment doesn’t support an interactive shell (e.g., a notebook)",ht,ae,ut,ie,Ml="When running <code>accelerate config</code>, if you use torch.compile, there can be dramatic speedups. The PEFT library is used as a backend for LoRA training, so make sure to have <code>peft&gt;=0.6.0</code> installed in your environment.",ft,ne,yl="If you would like to push your model to the Hub after training is completed with a neat model card, make sure you’re logged in:",wt,se,bt,oe,hl='Make sure your data is prepared as described in <a href="#data-preparation">Data Preparation</a>. When ready, you can begin training!',Ut,de,ul="Assuming you are training on 50 videos of a similar concept, we have found 1500-2000 steps to work well. The official recommendation, however, is 100 videos with a total of 4000 steps. Assuming you are training on a single GPU with a <code>--train_batch_size</code> of <code>1</code>:",gt,re,fl="<li>1500 steps on 50 videos would correspond to <code>30</code> training epochs</li> <li>4000 steps on 100 videos would correspond to <code>40</code> training epochs</li>",Tt,ce,Jt,me,wl="To better track our training experiments, we’re using the following flags in the command above:",jt,pe,bl="<li><code>--report_to wandb</code> will ensure the training runs are tracked on Weights and Biases. To use it, be sure to install <code>wandb</code> with <code>pip install wandb</code>.</li> <li><code>validation_prompt</code> and <code>validation_epochs</code> to allow the script to do a few validation inference runs. This allows us to qualitatively check if the training is progressing as expected.</li>",vt,Me,Ul='Setting the <code>&lt;ID_TOKEN&gt;</code> is not necessary. From some limited experimentation, we found it works better (as it resembles <a href="https://huggingface.co/docs/diffusers/en/training/dreambooth" rel="nofollow">Dreambooth</a> training) than without. When provided, the <code>&lt;ID_TOKEN&gt;</code> is appended to the beginning of each prompt. So, if your <code>&lt;ID_TOKEN&gt;</code> was <code>&quot;DISNEY&quot;</code> and your prompt was <code>&quot;Spiderman swinging over buildings&quot;</code>, the effective prompt used in training would be <code>&quot;DISNEY Spiderman swinging over buildings&quot;</code>. When not provided, you would either be training without any additional token or could augment your dataset to apply the token where you wish before starting the training.',Zt,ye,gl=`<p>[!NOTE]
You can pass <code>--use_8bit_adam</code> to reduce the memory requirements of training.</p>`,It,he,Tl=`<p>[!IMPORTANT]
The following settings have been tested at the time of adding CogVideoX LoRA training support:</p> <ul><li>Our testing was primarily done on CogVideoX-2b. We will work on CogVideoX-5b and CogVideoX-5b-I2V soon</li> <li>One dataset comprised of 70 training videos of resolutions <code>200 x 480 x 720</code> (F x H x W). From this, by using frame skipping in data preprocessing, we created two smaller 49-frame and 16-frame datasets for faster experimentation and because the maximum limit recommended by the CogVideoX team is 49 frames. Out of the 70 videos, we created three groups of 10, 25 and 50 videos. All videos were similar in nature of the concept being trained.</li> <li>25+ videos worked best for training new concepts and styles.</li> <li>We found that it is better to train with an identifier token that can be specified as <code>--id_token</code>. This is similar to Dreambooth-like training but normal finetuning without such a token works too.</li> <li>Trained concept seemed to work decently well when combined with completely unrelated prompts. We expect even better results if CogVideoX-5B is finetuned.</li> <li>The original repository uses a <code>lora_alpha</code> of <code>1</code>. We found this not suitable in many runs, possibly due to difference in modeling backends and training settings. Our recommendation is to set to the <code>lora_alpha</code> to either <code>rank</code> or <code>rank // 2</code>.</li> <li>If you’re training on data whose captions generate bad results with the original model, a <code>rank</code> of 64 and above is good and also the recommendation by the team behind CogVideoX. If the generations are already moderately good on your training captions, a <code>rank</code> of 16/32 should work. We found that setting the rank too low, say <code>4</code>, is not ideal and doesn’t produce promising results.</li> <li>The authors of CogVideoX recommend 4000 training steps and 100 training videos overall to achieve the best result. While that might yield the best results, we found from our limited experimentation that 2000 steps and 25 videos could also be sufficient.</li> <li>When using the Prodigy optimizer for training, one can follow the recommendations from <a href="https://huggingface.co/blog/sdxl_lora_advanced_script" rel="nofollow">this</a> blog. Prodigy tends to overfit quickly. From my very limited testing, I found a learning rate of <code>0.5</code> to be suitable in addition to <code>--prodigy_use_bias_correction</code>, <code>prodigy_safeguard_warmup</code> and <code>--prodigy_decouple</code>.</li> <li>The recommended learning rate by the CogVideoX authors and from our experimentation with Adam/AdamW is between <code>1e-3</code> and <code>1e-4</code> for a dataset of 25+ videos.</li></ul> <p>Note that our testing is not exhaustive due to limited time for exploration. Our recommendation would be to play around with the different knobs and dials to find the best settings for your data.</p>`,Gt,ue,Wt,fe,Jl="Once you have trained a lora model, the inference can be done simply loading the lora weights into the <code>CogVideoXPipeline</code>.",Bt,we,Ct,be,Vt,Ue,jl=`While testing using the diffusers library, all optimizations included in the diffusers library were enabled. This
scheme has not been tested for actual memory usage on devices outside of <strong>NVIDIA A100 / H100</strong> architectures.
Generally, this scheme can be adapted to all <strong>NVIDIA Ampere architecture</strong> and above devices. If optimizations are
disabled, memory consumption will multiply, with peak memory usage being about 3 times the value in the table.
However, speed will increase by about 3-4 times. You can selectively disable some optimizations, including:`,kt,ge,_t,Te,vl=`<li>For multi-GPU inference, the <code>enable_sequential_cpu_offload()</code> optimization needs to be disabled.</li> <li>Using INT8 models will slow down inference, which is done to accommodate lower-memory GPUs while maintaining minimal
video quality loss, though inference speed will significantly decrease.</li> <li>The CogVideoX-2B model was trained in <code>FP16</code> precision, and all CogVideoX-5B models were trained in <code>BF16</code> precision.
We recommend using the precision in which the model was trained for inference.</li> <li><a href="https://github.com/pytorch/ao" rel="nofollow">PytorchAO</a> and <a href="https://github.com/huggingface/optimum-quanto/" rel="nofollow">Optimum-quanto</a> can be
used to quantize the text encoder, transformer, and VAE modules to reduce the memory requirements of CogVideoX. This
allows the model to run on free T4 Colabs or GPUs with smaller memory! Also, note that TorchAO quantization is fully
compatible with <code>torch.compile</code>, which can significantly improve inference speed. FP8 precision must be used on
devices with NVIDIA H100 and above, requiring source installation of <code>torch</code>, <code>torchao</code>, <code>diffusers</code>, and <code>accelerate</code>
Python packages. CUDA 12.4 is recommended.</li> <li>The inference speed tests also used the above memory optimization scheme. Without memory optimization, inference speed
increases by about 10%. Only the <code>diffusers</code> version of the model supports quantization.</li> <li>The model only supports English input; other languages can be translated into English for use via large model
refinement.</li> <li>The memory usage of model fine-tuning is tested in an <code>8 * H100</code> environment, and the program automatically
uses <code>Zero 2</code> optimization. If a specific number of GPUs is marked in the table, that number or more GPUs must be used
for fine-tuning.</li>`,Yt,Je,Zl="<thead><tr><th><strong>Attribute</strong></th> <th><strong>CogVideoX-2B</strong></th> <th><strong>CogVideoX-5B</strong></th></tr></thead> <tbody><tr><td><strong>Model Name</strong></td> <td>CogVideoX-2B</td> <td>CogVideoX-5B</td></tr> <tr><td><strong>Inference Precision</strong></td> <td>FP16<em>(Recommended), BF16, FP32, FP8</em>, INT8, Not supported INT4</td> <td>BF16 (Recommended), FP16, FP32, FP8*, INT8, Not supported INT4</td></tr> <tr><td><strong>Single GPU Inference VRAM</strong></td> <td>FP16: Using diffusers 12.5GB<em>INT8: Using diffusers with torchao 7.8GB</em></td> <td>BF16: Using diffusers 20.7GB<em>INT8: Using diffusers with torchao 11.4GB</em></td></tr> <tr><td><strong>Multi GPU Inference VRAM</strong></td> <td>FP16: Using diffusers 10GB*</td> <td>BF16: Using diffusers 15GB*</td></tr> <tr><td><strong>Inference Speed</strong></td> <td>Single A100: ~90 seconds, Single H100: ~45 seconds</td> <td>Single A100: ~180 seconds, Single H100: ~90 seconds</td></tr> <tr><td><strong>Fine-tuning Precision</strong></td> <td>FP16</td> <td>BF16</td></tr> <tr><td><strong>Fine-tuning VRAM Consumption</strong></td> <td>47 GB (bs=1, LORA) 61 GB (bs=2, LORA) 62GB (bs=1, SFT)</td> <td>63 GB (bs=1, LORA) 80 GB (bs=2, LORA) 75GB (bs=1, SFT)</td></tr></tbody>",xt,je,Xt,Ie,Nt;return f=new ve({props:{title:"CogVideoX",local:"cogvideox",headingTag:"h1"}}),T=new ve({props:{title:"Data Preparation",local:"data-preparation",headingTag:"h2"}}),v=new ve({props:{title:"Small format",local:"small-format",headingTag:"h3"}}),W=new h({props:{code:"QSUyMGJsYWNrJTIwYW5kJTIwd2hpdGUlMjBhbmltYXRlZCUyMHNlcXVlbmNlJTIwZmVhdHVyaW5nJTIwYSUyMHJhYmJpdCUyQyUyMG5hbWVkJTIwUmFiYml0eSUyMFJpYmZyaWVkJTJDJTIwYW5kJTIwYW4lMjBhbnRocm9wb21vcnBoaWMlMjBnb2F0JTIwaW4lMjBhJTIwbXVzaWNhbCUyQyUyMHBsYXlmdWwlMjBlbnZpcm9ubWVudCUyQyUyMHNob3djYXNpbmclMjB0aGVpciUyMGV2b2x2aW5nJTIwaW50ZXJhY3Rpb24uJTBBQSUyMGJsYWNrJTIwYW5kJTIwd2hpdGUlMjBhbmltYXRlZCUyMHNlcXVlbmNlJTIwb24lMjBhJTIwc2hpcCdzJTIwZGVjayUyMGZlYXR1cmVzJTIwYSUyMGJ1bGxkb2clMjBjaGFyYWN0ZXIlMkMlMjBuYW1lZCUyMEJ1bGx5JTIwQnVsbGRvZ2VyJTJDJTIwc2hvd2Nhc2luZyUyMGV4YWdnZXJhdGVkJTIwZmFjaWFsJTIwZXhwcmVzc2lvbnMlMjBhbmQlMjBib2R5JTIwbGFuZ3VhZ2UuJTIwVGhlJTIwY2hhcmFjdGVyJTIwcHJvZ3Jlc3NlcyUyMGZyb20lMjBjb25maWRlbnQlMjB0byUyMGZvY3VzZWQlMkMlMjB0aGVuJTIwdG8lMjBzdHJhaW5lZCUyMGFuZCUyMGRpc3RyZXNzZWQlMkMlMjBkaXNwbGF5aW5nJTIwYSUyMHJhbmdlJTIwb2YlMjBlbW90aW9ucyUyMGFzJTIwaXQlMjBuYXZpZ2F0ZXMlMjBjaGFsbGVuZ2VzLiUyMFRoZSUyMHNoaXAncyUyMGludGVyaW9yJTIwcmVtYWlucyUyMHN0YXRpYyUyMGluJTIwdGhlJTIwYmFja2dyb3VuZCUyQyUyMHdpdGglMjBtaW5pbWFsaXN0aWMlMjBkZXRhaWxzJTIwc3VjaCUyMGFzJTIwYSUyMGJlbGwlMjBhbmQlMjBvcGVuJTIwZG9vci4lMjBUaGUlMjBjaGFyYWN0ZXIncyUyMGR5bmFtaWMlMjBtb3ZlbWVudHMlMjBhbmQlMjBjaGFuZ2luZyUyMGV4cHJlc3Npb25zJTIwZHJpdmUlMjB0aGUlMjBuYXJyYXRpdmUlMkMlMjB3aXRoJTIwbm8lMjBjYW1lcmElMjBtb3ZlbWVudCUyMHRvJTIwZGlzdHJhY3QlMjBmcm9tJTIwaXRzJTIwZXZvbHZpbmclMjByZWFjdGlvbnMlMjBhbmQlMjBwaHlzaWNhbCUyMGdlc3R1cmVzLiUwQS4uLg==",highlighted:`A <span class="hljs-keyword">black </span><span class="hljs-keyword">and </span>white animated sequence featuring a rabbit, named Rabbity Ribfried, <span class="hljs-keyword">and </span>an anthropomorphic goat in a musical, playful environment, <span class="hljs-keyword">showcasing </span>their evolving interaction.
A <span class="hljs-keyword">black </span><span class="hljs-keyword">and </span>white animated sequence on a <span class="hljs-keyword">ship&#x27;s </span>deck features a <span class="hljs-keyword">bulldog </span>character, named <span class="hljs-keyword">Bully </span><span class="hljs-keyword">Bulldoger, </span><span class="hljs-keyword">showcasing </span>exaggerated facial expressions <span class="hljs-keyword">and </span><span class="hljs-keyword">body </span>language. The character progresses from confident to focused, then to strained <span class="hljs-keyword">and </span><span class="hljs-keyword">distressed, </span><span class="hljs-keyword">displaying </span>a range of emotions as it navigates challenges. The <span class="hljs-keyword">ship&#x27;s </span>interior remains static in the <span class="hljs-keyword">background, </span>with minimalistic details such as a <span class="hljs-keyword">bell </span><span class="hljs-keyword">and </span>open door. The character<span class="hljs-string">&#x27;s dynamic movements and changing expressions drive the narrative, with no camera movement to distract from its evolving reactions and physical gestures.
...</span>`,wrap:!1}}),C=new h({props:{code:"dmlkZW9zJTJGMDAwMDAubXA0JTBBdmlkZW9zJTJGMDAwMDEubXA0JTBBLi4u",highlighted:`videos/00000.mp4
videos/00001.mp4
<span class="hljs-meta prompt_">...</span>`,wrap:!1}}),k=new h({props:{code:"JTJGZGF0YXNldCUwQSVFMiU5NCU5QyVFMiU5NCU4MCVFMiU5NCU4MCUyMHByb21wdHMudHh0JTBBJUUyJTk0JTlDJUUyJTk0JTgwJUUyJTk0JTgwJTIwdmlkZW9zLnR4dCUwQSVFMiU5NCU5QyVFMiU5NCU4MCVFMiU5NCU4MCUyMHZpZGVvcyUwQSUyMCUyMCUyMCUyMCVFMiU5NCU5QyVFMiU5NCU4MCVFMiU5NCU4MCUyMHZpZGVvcyUyRjAwMDAwLm1wNCUwQSUyMCUyMCUyMCUyMCVFMiU5NCU5QyVFMiU5NCU4MCVFMiU5NCU4MCUyMHZpZGVvcyUyRjAwMDAxLm1wNCUwQSUyMCUyMCUyMCUyMCVFMiU5NCU5QyVFMiU5NCU4MCVFMiU5NCU4MCUyMC4uLg==",highlighted:`/dataset
├── prompts<span class="hljs-selector-class">.txt</span>
├── videos<span class="hljs-selector-class">.txt</span>
├── videos
    ├── videos/<span class="hljs-number">00000</span><span class="hljs-selector-class">.mp4</span>
    ├── videos/<span class="hljs-number">00001</span><span class="hljs-selector-class">.mp4</span>
    ├── ...`,wrap:!1}}),Y=new ve({props:{title:"Stream format",local:"stream-format",headingTag:"h3"}}),X=new h({props:{code:"JTNDQ0FQVElPTl9DT0xVTU4lM0UlMkMlM0NQQVRIX1RPX1ZJREVPX0NPTFVNTiUzRSUwQSUyMiUyMiUyMkElMjBibGFjayUyMGFuZCUyMHdoaXRlJTIwYW5pbWF0ZWQlMjBzZXF1ZW5jZSUyMGZlYXR1cmluZyUyMGElMjByYWJiaXQlMkMlMjBuYW1lZCUyMFJhYmJpdHklMjBSaWJmcmllZCUyQyUyMGFuZCUyMGFuJTIwYW50aHJvcG9tb3JwaGljJTIwZ29hdCUyMGluJTIwYSUyMG11c2ljYWwlMkMlMjBwbGF5ZnVsJTIwZW52aXJvbm1lbnQlMkMlMjBzaG93Y2FzaW5nJTIwdGhlaXIlMjBldm9sdmluZyUyMGludGVyYWN0aW9uLiUyMiUyMiUyMiUyQyUyMiUyMiUyMjAwMDAwLm1wNCUyMiUyMiUyMiUwQSUyMiUyMiUyMkElMjBibGFjayUyMGFuZCUyMHdoaXRlJTIwYW5pbWF0ZWQlMjBzZXF1ZW5jZSUyMG9uJTIwYSUyMHNoaXAncyUyMGRlY2slMjBmZWF0dXJlcyUyMGElMjBidWxsZG9nJTIwY2hhcmFjdGVyJTJDJTIwbmFtZWQlMjBCdWxseSUyMEJ1bGxkb2dlciUyQyUyMHNob3djYXNpbmclMjBleGFnZ2VyYXRlZCUyMGZhY2lhbCUyMGV4cHJlc3Npb25zJTIwYW5kJTIwYm9keSUyMGxhbmd1YWdlLiUyMFRoZSUyMGNoYXJhY3RlciUyMHByb2dyZXNzZXMlMjBmcm9tJTIwY29uZmlkZW50JTIwdG8lMjBmb2N1c2VkJTJDJTIwdGhlbiUyMHRvJTIwc3RyYWluZWQlMjBhbmQlMjBkaXN0cmVzc2VkJTJDJTIwZGlzcGxheWluZyUyMGElMjByYW5nZSUyMG9mJTIwZW1vdGlvbnMlMjBhcyUyMGl0JTIwbmF2aWdhdGVzJTIwY2hhbGxlbmdlcy4lMjBUaGUlMjBzaGlwJ3MlMjBpbnRlcmlvciUyMHJlbWFpbnMlMjBzdGF0aWMlMjBpbiUyMHRoZSUyMGJhY2tncm91bmQlMkMlMjB3aXRoJTIwbWluaW1hbGlzdGljJTIwZGV0YWlscyUyMHN1Y2glMjBhcyUyMGElMjBiZWxsJTIwYW5kJTIwb3BlbiUyMGRvb3IuJTIwVGhlJTIwY2hhcmFjdGVyJ3MlMjBkeW5hbWljJTIwbW92ZW1lbnRzJTIwYW5kJTIwY2hhbmdpbmclMjBleHByZXNzaW9ucyUyMGRyaXZlJTIwdGhlJTIwbmFycmF0aXZlJTJDJTIwd2l0aCUyMG5vJTIwY2FtZXJhJTIwbW92ZW1lbnQlMjB0byUyMGRpc3RyYWN0JTIwZnJvbSUyMGl0cyUyMGV2b2x2aW5nJTIwcmVhY3Rpb25zJTIwYW5kJTIwcGh5c2ljYWwlMjBnZXN0dXJlcy4lMjIlMjIlMjIlMkMlMjIlMjIlMjIwMDAwMS5tcDQlMjIlMjIlMjIlMEEuLi4=",highlighted:`&lt;CAPTION_COLUMN&gt;,&lt;PATH_TO_VIDEO_COLUMN&gt;
<span class="hljs-string">&quot;&quot;&quot;A black and white animated sequence featuring a rabbit, named Rabbity Ribfried, and an anthropomorphic goat in a musical, playful environment, showcasing their evolving interaction.&quot;&quot;&quot;</span>,<span class="hljs-string">&quot;&quot;&quot;00000.mp4&quot;&quot;&quot;</span>
<span class="hljs-string">&quot;&quot;&quot;A black and white animated sequence on a ship&#x27;s deck features a bulldog character, named Bully Bulldoger, showcasing exaggerated facial expressions and body language. The character progresses from confident to focused, then to strained and distressed, displaying a range of emotions as it navigates challenges. The ship&#x27;s interior remains static in the background, with minimalistic details such as a bell and open door. The character&#x27;s dynamic movements and changing expressions drive the narrative, with no camera movement to distract from its evolving reactions and physical gestures.&quot;&quot;&quot;</span>,<span class="hljs-string">&quot;&quot;&quot;00001.mp4&quot;&quot;&quot;</span>
...`,wrap:!1}}),L=new ve({props:{title:"Training",local:"training",headingTag:"h2"}}),E=new h({props:{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZodWdnaW5nZmFjZSUyRmRpZmZ1c2VycyUwQWNkJTIwZGlmZnVzZXJzJTBBcGlwJTIwaW5zdGFsbCUyMC1lJTIwLg==",highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/huggingface/diffusers
<span class="hljs-built_in">cd</span> diffusers
pip install -e .`,wrap:!1}}),D=new h({props:{code:"Y2QlMjBleGFtcGxlcyUyRmNvZ3ZpZGVvJTBBcGlwJTIwaW5zdGFsbCUyMC1yJTIwcmVxdWlyZW1lbnRzLnR4dA==",highlighted:`<span class="hljs-built_in">cd</span> examples/cogvideo
pip install -r requirements.txt`,wrap:!1}}),K=new h({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZw==",highlighted:"accelerate config",wrap:!1}}),te=new h({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZyUyMGRlZmF1bHQ=",highlighted:"accelerate config default",wrap:!1}}),ae=new h({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUudXRpbHMlMjBpbXBvcnQlMjB3cml0ZV9iYXNpY19jb25maWclMEF3cml0ZV9iYXNpY19jb25maWcoKQ==",highlighted:`<span class="hljs-keyword">from</span> accelerate.utils <span class="hljs-keyword">import</span> write_basic_config
write_basic_config()`,wrap:!1}}),se=new h({props:{code:"aGYlMjBhdXRoJTIwbG9naW4lMEElMEElMjMlMjBBbHRlcm5hdGl2ZWx5JTJDJTIweW91JTIwY291bGQlMjB1cGxvYWQlMjB5b3VyJTIwbW9kZWwlMjBtYW51YWxseSUyMHVzaW5nJTNBJTBBJTIzJTIwaGYlMjB1cGxvYWQlMjBteS1jb29sLWFjY291bnQtbmFtZSUyRm15LWNvb2wtbG9yYS1uYW1lJTIwJTJGcGF0aCUyRnRvJTJGYXdlc29tZSUyRmxvcmE=",highlighted:`hf auth login

<span class="hljs-comment"># Alternatively, you could upload your model manually using:</span>
<span class="hljs-comment"># hf upload my-cool-account-name/my-cool-lora-name /path/to/awesome/lora</span>`,wrap:!1}}),ce=new h({props:{code:"JTIzISUyRmJpbiUyRmJhc2glMEElMEFHUFVfSURTJTNEJTIyMCUyMiUwQSUwQWFjY2VsZXJhdGUlMjBsYXVuY2glMjAtLWdwdV9pZHMlMjAlMjRHUFVfSURTJTIwZXhhbXBsZXMlMkZjb2d2aWRlbyUyRnRyYWluX2NvZ3ZpZGVveF9sb3JhLnB5JTIwJTVDJTBBJTIwJTIwLS1wcmV0cmFpbmVkX21vZGVsX25hbWVfb3JfcGF0aCUyMFRIVURNJTJGQ29nVmlkZW9YLTJiJTIwJTVDJTBBJTIwJTIwLS1jYWNoZV9kaXIlMjAlM0NDQUNIRV9ESVIlM0UlMjAlNUMlMEElMjAlMjAtLWluc3RhbmNlX2RhdGFfcm9vdCUyMCUzQ1BBVEhfVE9fV0hFUkVfVklERU9fRklMRVNfQVJFX1NUT1JFRCUzRSUyMCU1QyUwQSUyMCUyMC0tZGF0YXNldF9uYW1lJTIwbXktYXdlc29tZS1uYW1lJTJGbXktYXdlc29tZS1kYXRhc2V0JTIwJTVDJTBBJTIwJTIwLS1jYXB0aW9uX2NvbHVtbiUyMCUzQ0NBUFRJT05fQ09MVU1OJTNFJTIwJTVDJTBBJTIwJTIwLS12aWRlb19jb2x1bW4lMjAlM0NQQVRIX1RPX1ZJREVPX0NPTFVNTiUzRSUyMCU1QyUwQSUyMCUyMC0taWRfdG9rZW4lMjAlM0NJRF9UT0tFTiUzRSUyMCU1QyUwQSUyMCUyMC0tdmFsaWRhdGlvbl9wcm9tcHQlMjAlMjIlM0NJRF9UT0tFTiUzRSUyMFNwaWRlcm1hbiUyMHN3aW5naW5nJTIwb3ZlciUyMGJ1aWxkaW5ncyUzQSUzQSUz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lMjAxJTIwJTVDJTBBJTIwJTIwLS1lbmFibGVfc2xpY2luZyUyMCU1QyUwQSUyMCUyMC0tZW5hYmxlX3RpbGluZyUyMCU1QyUwQSUyMCUyMC0tb3B0aW1pemVyJTIwQWRhbSUyMCU1QyUwQSUyMCUyMC0tYWRhbV9iZXRhMSUyMDAuOSUyMCU1QyUwQSUyMCUyMC0tYWRhbV9iZXRhMiUyMDAuOTUlMjAlNUMlMEElMjAlMjAtLW1heF9ncmFkX25vcm0lMjAxLjAlMjAlNUMlMEElMjAlMjAtLXJlcG9ydF90byUyMHdhbmRi",highlighted:`<span class="hljs-meta">#!/bin/bash</span>

GPU_IDS=<span class="hljs-string">&quot;0&quot;</span>

accelerate launch --gpu_ids <span class="hljs-variable">$GPU_IDS</span> examples/cogvideo/train_cogvideox_lora.py \\
  --pretrained_model_name_or_path THUDM/CogVideoX-2b \\
  --cache_dir &lt;CACHE_DIR&gt; \\
  --instance_data_root &lt;PATH_TO_WHERE_VIDEO_FILES_ARE_STORED&gt; \\
  --dataset_name my-awesome-name/my-awesome-dataset \\
  --caption_column &lt;CAPTION_COLUMN&gt; \\
  --video_column &lt;PATH_TO_VIDEO_COLUMN&gt; \\
  --id_token &lt;ID_TOKEN&gt; \\
  --validation_prompt <span class="hljs-string">&quot;&lt;ID_TOKEN&gt; Spiderman swinging over buildings:::A panda, dressed in a small, red jacket and a tiny hat, sits on a wooden stool in a serene bamboo forest. The panda&#x27;s fluffy paws strum a miniature acoustic guitar, producing soft, melodic tunes. Nearby, a few other pandas gather, watching curiously and some clapping in rhythm. Sunlight filters through the tall bamboo, casting a gentle glow on the scene. The panda&#x27;s face is expressive, showing concentration and joy as it plays. The background includes a small, flowing stream and vibrant green foliage, enhancing the peaceful and magical atmosphere of this unique musical performance&quot;</span> \\
  --validation_prompt_separator ::: \\
  --num_validation_videos 1 \\
  --validation_epochs 10 \\
  --seed 42 \\
  --rank 64 \\
  --lora_alpha 64 \\
  --mixed_precision fp16 \\
  --output_dir /raid/aryan/cogvideox-lora \\
  --height 480 --width 720 --fps 8 --max_num_frames 49 --skip_frames_start 0 --skip_frames_end 0 \\
  --train_batch_size 1 \\
  --num_train_epochs 30 \\
  --checkpointing_steps 1000 \\
  --gradient_accumulation_steps 1 \\
  --learning_rate 1e-3 \\
  --lr_scheduler cosine_with_restarts \\
  --lr_warmup_steps 200 \\
  --lr_num_cycles 1 \\
  --enable_slicing \\
  --enable_tiling \\
  --optimizer Adam \\
  --adam_beta1 0.9 \\
  --adam_beta2 0.95 \\
  --max_grad_norm 1.0 \\
  --report_to wandb`,wrap:!1}}),ue=new ve({props:{title:"Inference",local:"inference",headingTag:"h2"}}),we=new h({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwQ29nVmlkZW9YUGlwZWxpbmUlMEFmcm9tJTIwZGlmZnVzZXJzLnV0aWxzJTIwaW1wb3J0JTIwZXhwb3J0X3RvX3ZpZGVvJTBBJTBBcGlwZSUyMCUzRCUyMENvZ1ZpZGVvWFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJUSFVETSUyRkNvZ1ZpZGVvWC0yYiUyMiUyQyUyMHRvcmNoX2R0eXBlJTNEdG9yY2guZmxvYXQxNiklMEElMjMlMjBwaXBlLmxvYWRfbG9yYV93ZWlnaHRzKCUyMiUyRnBhdGglMkZ0byUyRmxvcmElMkZ3ZWlnaHRzJTIyJTJDJTIwYWRhcHRlcl9uYW1lJTNEJTIyY29ndmlkZW94LWxvcmElMjIpJTIwJTIzJTIwT3IlMkMlMEFwaXBlLmxvYWRfbG9yYV93ZWlnaHRzKCUyMm15LWF3ZXNvbWUtaGYtdXNlcm5hbWUlMkZteS1hd2Vzb21lLWxvcmEtbmFtZSUyMiUyQyUyMGFkYXB0ZXJfbmFtZSUzRCUyMmNvZ3ZpZGVveC1sb3JhJTIyKSUyMCUyMyUyMElmJTIwbG9hZGluZyUyMGZyb20lMjB0aGUlMjBIRiUyM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2xvc2UtdXBzJTIwcmV2ZWFsJTIwdGhlJTIwaW50cmljYXRlJTIwcGF0dGVybnMlMjBvZiUyMHRoZSUyMHdhdmVzJTJDJTIwY2FwdHVyaW5nJTIwdGhlJTIwZmx1aWRpdHklMjBhbmQlMjBkeW5hbWljJTIwYmVhdXR5JTIwb2YlMjB0aGUlMjBzZWElMjBpbiUyMG1vdGlvbi4lMjIlMEFmcmFtZXMlMjAlM0QlMjBwaXBlKHByb21wdCUyQyUyMGd1aWRhbmNlX3NjYWxlJTNENiUyQyUyMHVzZV9keW5hbWljX2NmZyUzRFRydWUpLmZyYW1lcyU1QjAlNUQlMEFleHBvcnRfdG9fdmlkZW8oZnJhbWVzJTJDJTIwJTIyb3V0cHV0Lm1wNCUyMiUyQyUyMGZwcyUzRDgp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> CogVideoXPipeline
<span class="hljs-keyword">from</span> diffusers.utils <span class="hljs-keyword">import</span> export_to_video

pipe = CogVideoXPipeline.from_pretrained(<span class="hljs-string">&quot;THUDM/CogVideoX-2b&quot;</span>, torch_dtype=torch.float16)
<span class="hljs-comment"># pipe.load_lora_weights(&quot;/path/to/lora/weights&quot;, adapter_name=&quot;cogvideox-lora&quot;) # Or,</span>
pipe.load_lora_weights(<span class="hljs-string">&quot;my-awesome-hf-username/my-awesome-lora-name&quot;</span>, adapter_name=<span class="hljs-string">&quot;cogvideox-lora&quot;</span>) <span class="hljs-comment"># If loading from the HF Hub</span>
pipe.to(<span class="hljs-string">&quot;cuda&quot;</span>)

<span class="hljs-comment"># Assuming lora_alpha=32 and rank=64 for training. If different, set accordingly</span>
pipe.set_adapters([<span class="hljs-string">&quot;cogvideox-lora&quot;</span>], [<span class="hljs-number">32</span> / <span class="hljs-number">64</span>])

prompt = <span class="hljs-string">&quot;A vast, shimmering ocean flows gracefully under a twilight sky, its waves undulating in a mesmerizing dance of blues and greens. The surface glints with the last rays of the setting sun, casting golden highlights that ripple across the water. Seagulls soar above, their cries blending with the gentle roar of the waves. The horizon stretches infinitely, where the ocean meets the sky in a seamless blend of hues. Close-ups reveal the intricate patterns of the waves, capturing the fluidity and dynamic beauty of the sea in motion.&quot;</span>
frames = pipe(prompt, guidance_scale=<span class="hljs-number">6</span>, use_dynamic_cfg=<span class="hljs-literal">True</span>).frames[<span class="hljs-number">0</span>]
export_to_video(frames, <span class="hljs-string">&quot;output.mp4&quot;</span>, fps=<span class="hljs-number">8</span>)`,wrap:!1}}),be=new ve({props:{title:"Reduce memory usage",local:"reduce-memory-usage",headingTag:"h2"}}),ge=new h({props:{code:"cGlwZS5lbmFibGVfc2VxdWVudGlhbF9jcHVfb2ZmbG9hZCgpJTBBcGlwZS52YWUuZW5hYmxlX3NsaWNpbmcoKSUwQXBpcGUudmFlLmVuYWJsZV90aWxpbmcoKQ==",highlighted:`pipe<span class="hljs-selector-class">.enable_sequential_cpu_offload</span>()
pipe<span class="hljs-selector-class">.vae</span><span class="hljs-selector-class">.enable_slicing</span>()
pipe<span class="hljs-selector-class">.vae</span><span class="hljs-selector-class">.enable_tiling</span>()`,wrap:!1}}),je=new xl({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/training/cogvideox.md"}}),{c(){u=s("meta"),Ge=i(),Ze=s("p"),We=i(),r(f.$$.fragment),Be=i(),w=s("p"),w.textContent=Ft,Ce=i(),b=s("ul"),b.innerHTML=Rt,Ve=i(),U=s("p"),U.textContent=$t,ke=i(),g=s("p"),g.textContent=Lt,_e=i(),r(T.$$.fragment),Ye=i(),J=s("p"),J.textContent=St,xe=i(),j=s("p"),j.innerHTML=Qt,Xe=i(),r(v.$$.fragment),Ne=i(),Z=s("p"),Z.innerHTML=zt,He=i(),I=s("p"),I.innerHTML=At,Fe=i(),G=s("p"),G.innerHTML=Et,Re=i(),r(W.$$.fragment),$e=i(),B=s("p"),B.innerHTML=qt,Le=i(),r(C.$$.fragment),Se=i(),V=s("p"),V.innerHTML=Pt,Qe=i(),r(k.$$.fragment),ze=i(),_=s("p"),_.innerHTML=Dt,Ae=i(),r(Y.$$.fragment),Ee=i(),x=s("p"),x.innerHTML=Ot,qe=i(),r(X.$$.fragment),Pe=i(),N=s("p"),N.innerHTML=Kt,De=i(),H=s("p"),H.innerHTML=el,Oe=i(),F=s("p"),F.innerHTML=tl,Ke=i(),R=s("blockquote"),R.innerHTML=ll,et=i(),$=s("blockquote"),$.innerHTML=al,tt=i(),r(L.$$.fragment),lt=i(),S=s("p"),S.textContent=il,at=i(),Q=s("ul"),Q.innerHTML=nl,it=i(),z=s("p"),z.innerHTML=sl,nt=i(),A=s("p"),A.textContent=ol,st=i(),r(E.$$.fragment),ot=i(),q=s("p"),q.textContent=dl,dt=i(),P=s("ul"),P.innerHTML=rl,rt=i(),r(D.$$.fragment),ct=i(),O=s("p"),O.innerHTML=cl,mt=i(),r(K.$$.fragment),pt=i(),ee=s("p"),ee.textContent=ml,Mt=i(),r(te.$$.fragment),yt=i(),le=s("p"),le.textContent=pl,ht=i(),r(ae.$$.fragment),ut=i(),ie=s("p"),ie.innerHTML=Ml,ft=i(),ne=s("p"),ne.textContent=yl,wt=i(),r(se.$$.fragment),bt=i(),oe=s("p"),oe.innerHTML=hl,Ut=i(),de=s("p"),de.innerHTML=ul,gt=i(),re=s("ul"),re.innerHTML=fl,Tt=i(),r(ce.$$.fragment),Jt=i(),me=s("p"),me.textContent=wl,jt=i(),pe=s("ul"),pe.innerHTML=bl,vt=i(),Me=s("p"),Me.innerHTML=Ul,Zt=i(),ye=s("blockquote"),ye.innerHTML=gl,It=i(),he=s("blockquote"),he.innerHTML=Tl,Gt=i(),r(ue.$$.fragment),Wt=i(),fe=s("p"),fe.innerHTML=Jl,Bt=i(),r(we.$$.fragment),Ct=i(),r(be.$$.fragment),Vt=i(),Ue=s("p"),Ue.innerHTML=jl,kt=i(),r(ge.$$.fragment),_t=i(),Te=s("ul"),Te.innerHTML=vl,Yt=i(),Je=s("table"),Je.innerHTML=Zl,xt=i(),r(je.$$.fragment),Xt=i(),Ie=s("p"),this.h()},l(e){const t=_l("svelte-u9bgzb",document.head);u=o(t,"META",{name:!0,content:!0}),t.forEach(l),Ge=n(e),Ze=o(e,"P",{}),Il(Ze).forEach(l),We=n(e),c(f.$$.fragment,e),Be=n(e),w=o(e,"P",{"data-svelte-h":!0}),d(w)!=="svelte-18y6jrj"&&(w.textContent=Ft),Ce=n(e),b=o(e,"UL",{"data-svelte-h":!0}),d(b)!=="svelte-pybda1"&&(b.innerHTML=Rt),Ve=n(e),U=o(e,"P",{"data-svelte-h":!0}),d(U)!=="svelte-l3cwo6"&&(U.textContent=$t),ke=n(e),g=o(e,"P",{"data-svelte-h":!0}),d(g)!=="svelte-1y5mgpk"&&(g.textContent=Lt),_e=n(e),c(T.$$.fragment,e),Ye=n(e),J=o(e,"P",{"data-svelte-h":!0}),d(J)!=="svelte-qgaq6v"&&(J.textContent=St),xe=n(e),j=o(e,"P",{"data-svelte-h":!0}),d(j)!=="svelte-18ujfkq"&&(j.innerHTML=Qt),Xe=n(e),c(v.$$.fragment,e),Ne=n(e),Z=o(e,"P",{"data-svelte-h":!0}),d(Z)!=="svelte-1ib20fv"&&(Z.innerHTML=zt),He=n(e),I=o(e,"P",{"data-svelte-h":!0}),d(I)!=="svelte-175s3wj"&&(I.innerHTML=At),Fe=n(e),G=o(e,"P",{"data-svelte-h":!0}),d(G)!=="svelte-fvj63x"&&(G.innerHTML=Et),Re=n(e),c(W.$$.fragment,e),$e=n(e),B=o(e,"P",{"data-svelte-h":!0}),d(B)!=="svelte-1j0mer1"&&(B.innerHTML=qt),Le=n(e),c(C.$$.fragment,e),Se=n(e),V=o(e,"P",{"data-svelte-h":!0}),d(V)!=="svelte-1stzs"&&(V.innerHTML=Pt),Qe=n(e),c(k.$$.fragment,e),ze=n(e),_=o(e,"P",{"data-svelte-h":!0}),d(_)!=="svelte-1n36hd1"&&(_.innerHTML=Dt),Ae=n(e),c(Y.$$.fragment,e),Ee=n(e),x=o(e,"P",{"data-svelte-h":!0}),d(x)!=="svelte-14lm8bz"&&(x.innerHTML=Ot),qe=n(e),c(X.$$.fragment,e),Pe=n(e),N=o(e,"P",{"data-svelte-h":!0}),d(N)!=="svelte-7lav5a"&&(N.innerHTML=Kt),De=n(e),H=o(e,"P",{"data-svelte-h":!0}),d(H)!=="svelte-1dz0bkz"&&(H.innerHTML=el),Oe=n(e),F=o(e,"P",{"data-svelte-h":!0}),d(F)!=="svelte-1kq3d6x"&&(F.innerHTML=tl),Ke=n(e),R=o(e,"BLOCKQUOTE",{"data-svelte-h":!0}),d(R)!=="svelte-1004jkj"&&(R.innerHTML=ll),et=n(e),$=o(e,"BLOCKQUOTE",{"data-svelte-h":!0}),d($)!=="svelte-d76epp"&&($.innerHTML=al),tt=n(e),c(L.$$.fragment,e),lt=n(e),S=o(e,"P",{"data-svelte-h":!0}),d(S)!=="svelte-x1qy2k"&&(S.textContent=il),at=n(e),Q=o(e,"UL",{"data-svelte-h":!0}),d(Q)!=="svelte-s7m3ul"&&(Q.innerHTML=nl),it=n(e),z=o(e,"P",{"data-svelte-h":!0}),d(z)!=="svelte-yv8b1i"&&(z.innerHTML=sl),nt=n(e),A=o(e,"P",{"data-svelte-h":!0}),d(A)!=="svelte-l7dm2q"&&(A.textContent=ol),st=n(e),c(E.$$.fragment,e),ot=n(e),q=o(e,"P",{"data-svelte-h":!0}),d(q)!=="svelte-z4z0b9"&&(q.textContent=dl),dt=n(e),P=o(e,"UL",{"data-svelte-h":!0}),d(P)!=="svelte-1bnryi2"&&(P.innerHTML=rl),rt=n(e),c(D.$$.fragment,e),ct=n(e),O=o(e,"P",{"data-svelte-h":!0}),d(O)!=="svelte-1ag5t4d"&&(O.innerHTML=cl),mt=n(e),c(K.$$.fragment,e),pt=n(e),ee=o(e,"P",{"data-svelte-h":!0}),d(ee)!=="svelte-1gl04sb"&&(ee.textContent=ml),Mt=n(e),c(te.$$.fragment,e),yt=n(e),le=o(e,"P",{"data-svelte-h":!0}),d(le)!=="svelte-1w15gal"&&(le.textContent=pl),ht=n(e),c(ae.$$.fragment,e),ut=n(e),ie=o(e,"P",{"data-svelte-h":!0}),d(ie)!=="svelte-j2i15e"&&(ie.innerHTML=Ml),ft=n(e),ne=o(e,"P",{"data-svelte-h":!0}),d(ne)!=="svelte-1jej5ss"&&(ne.textContent=yl),wt=n(e),c(se.$$.fragment,e),bt=n(e),oe=o(e,"P",{"data-svelte-h":!0}),d(oe)!=="svelte-o9e91k"&&(oe.innerHTML=hl),Ut=n(e),de=o(e,"P",{"data-svelte-h":!0}),d(de)!=="svelte-fq1c8e"&&(de.innerHTML=ul),gt=n(e),re=o(e,"UL",{"data-svelte-h":!0}),d(re)!=="svelte-1h75wv1"&&(re.innerHTML=fl),Tt=n(e),c(ce.$$.fragment,e),Jt=n(e),me=o(e,"P",{"data-svelte-h":!0}),d(me)!=="svelte-gpe60h"&&(me.textContent=wl),jt=n(e),pe=o(e,"UL",{"data-svelte-h":!0}),d(pe)!=="svelte-1j5dx8x"&&(pe.innerHTML=bl),vt=n(e),Me=o(e,"P",{"data-svelte-h":!0}),d(Me)!=="svelte-1xg14vh"&&(Me.innerHTML=Ul),Zt=n(e),ye=o(e,"BLOCKQUOTE",{"data-svelte-h":!0}),d(ye)!=="svelte-1qc35n2"&&(ye.innerHTML=gl),It=n(e),he=o(e,"BLOCKQUOTE",{"data-svelte-h":!0}),d(he)!=="svelte-18xtu69"&&(he.innerHTML=Tl),Gt=n(e),c(ue.$$.fragment,e),Wt=n(e),fe=o(e,"P",{"data-svelte-h":!0}),d(fe)!=="svelte-cvnr02"&&(fe.innerHTML=Jl),Bt=n(e),c(we.$$.fragment,e),Ct=n(e),c(be.$$.fragment,e),Vt=n(e),Ue=o(e,"P",{"data-svelte-h":!0}),d(Ue)!=="svelte-1lswm3k"&&(Ue.innerHTML=jl),kt=n(e),c(ge.$$.fragment,e),_t=n(e),Te=o(e,"UL",{"data-svelte-h":!0}),d(Te)!=="svelte-lhrfmo"&&(Te.innerHTML=vl),Yt=n(e),Je=o(e,"TABLE",{"data-svelte-h":!0}),d(Je)!=="svelte-1jblgya"&&(Je.innerHTML=Zl),xt=n(e),c(je.$$.fragment,e),Xt=n(e),Ie=o(e,"P",{}),Il(Ie).forEach(l),this.h()},h(){Gl(u,"name","hf:doc:metadata"),Gl(u,"content",Nl)},m(e,t){Yl(document.head,u),a(e,Ge,t),a(e,Ze,t),a(e,We,t),m(f,e,t),a(e,Be,t),a(e,w,t),a(e,Ce,t),a(e,b,t),a(e,Ve,t),a(e,U,t),a(e,ke,t),a(e,g,t),a(e,_e,t),m(T,e,t),a(e,Ye,t),a(e,J,t),a(e,xe,t),a(e,j,t),a(e,Xe,t),m(v,e,t),a(e,Ne,t),a(e,Z,t),a(e,He,t),a(e,I,t),a(e,Fe,t),a(e,G,t),a(e,Re,t),m(W,e,t),a(e,$e,t),a(e,B,t),a(e,Le,t),m(C,e,t),a(e,Se,t),a(e,V,t),a(e,Qe,t),m(k,e,t),a(e,ze,t),a(e,_,t),a(e,Ae,t),m(Y,e,t),a(e,Ee,t),a(e,x,t),a(e,qe,t),m(X,e,t),a(e,Pe,t),a(e,N,t),a(e,De,t),a(e,H,t),a(e,Oe,t),a(e,F,t),a(e,Ke,t),a(e,R,t),a(e,et,t),a(e,$,t),a(e,tt,t),m(L,e,t),a(e,lt,t),a(e,S,t),a(e,at,t),a(e,Q,t),a(e,it,t),a(e,z,t),a(e,nt,t),a(e,A,t),a(e,st,t),m(E,e,t),a(e,ot,t),a(e,q,t),a(e,dt,t),a(e,P,t),a(e,rt,t),m(D,e,t),a(e,ct,t),a(e,O,t),a(e,mt,t),m(K,e,t),a(e,pt,t),a(e,ee,t),a(e,Mt,t),m(te,e,t),a(e,yt,t),a(e,le,t),a(e,ht,t),m(ae,e,t),a(e,ut,t),a(e,ie,t),a(e,ft,t),a(e,ne,t),a(e,wt,t),m(se,e,t),a(e,bt,t),a(e,oe,t),a(e,Ut,t),a(e,de,t),a(e,gt,t),a(e,re,t),a(e,Tt,t),m(ce,e,t),a(e,Jt,t),a(e,me,t),a(e,jt,t),a(e,pe,t),a(e,vt,t),a(e,Me,t),a(e,Zt,t),a(e,ye,t),a(e,It,t),a(e,he,t),a(e,Gt,t),m(ue,e,t),a(e,Wt,t),a(e,fe,t),a(e,Bt,t),m(we,e,t),a(e,Ct,t),m(be,e,t),a(e,Vt,t),a(e,Ue,t),a(e,kt,t),m(ge,e,t),a(e,_t,t),a(e,Te,t),a(e,Yt,t),a(e,Je,t),a(e,xt,t),m(je,e,t),a(e,Xt,t),a(e,Ie,t),Nt=!0},p:Bl,i(e){Nt||(p(f.$$.fragment,e),p(T.$$.fragment,e),p(v.$$.fragment,e),p(W.$$.fragment,e),p(C.$$.fragment,e),p(k.$$.fragment,e),p(Y.$$.fragment,e),p(X.$$.fragment,e),p(L.$$.fragment,e),p(E.$$.fragment,e),p(D.$$.fragment,e),p(K.$$.fragment,e),p(te.$$.fragment,e),p(ae.$$.fragment,e),p(se.$$.fragment,e),p(ce.$$.fragment,e),p(ue.$$.fragment,e),p(we.$$.fragment,e),p(be.$$.fragment,e),p(ge.$$.fragment,e),p(je.$$.fragment,e),Nt=!0)},o(e){M(f.$$.fragment,e),M(T.$$.fragment,e),M(v.$$.fragment,e),M(W.$$.fragment,e),M(C.$$.fragment,e),M(k.$$.fragment,e),M(Y.$$.fragment,e),M(X.$$.fragment,e),M(L.$$.fragment,e),M(E.$$.fragment,e),M(D.$$.fragment,e),M(K.$$.fragment,e),M(te.$$.fragment,e),M(ae.$$.fragment,e),M(se.$$.fragment,e),M(ce.$$.fragment,e),M(ue.$$.fragment,e),M(we.$$.fragment,e),M(be.$$.fragment,e),M(ge.$$.fragment,e),M(je.$$.fragment,e),Nt=!1},d(e){e&&(l(Ge),l(Ze),l(We),l(Be),l(w),l(Ce),l(b),l(Ve),l(U),l(ke),l(g),l(_e),l(Ye),l(J),l(xe),l(j),l(Xe),l(Ne),l(Z),l(He),l(I),l(Fe),l(G),l(Re),l($e),l(B),l(Le),l(Se),l(V),l(Qe),l(ze),l(_),l(Ae),l(Ee),l(x),l(qe),l(Pe),l(N),l(De),l(H),l(Oe),l(F),l(Ke),l(R),l(et),l($),l(tt),l(lt),l(S),l(at),l(Q),l(it),l(z),l(nt),l(A),l(st),l(ot),l(q),l(dt),l(P),l(rt),l(ct),l(O),l(mt),l(pt),l(ee),l(Mt),l(yt),l(le),l(ht),l(ut),l(ie),l(ft),l(ne),l(wt),l(bt),l(oe),l(Ut),l(de),l(gt),l(re),l(Tt),l(Jt),l(me),l(jt),l(pe),l(vt),l(Me),l(Zt),l(ye),l(It),l(he),l(Gt),l(Wt),l(fe),l(Bt),l(Ct),l(Vt),l(Ue),l(kt),l(_t),l(Te),l(Yt),l(Je),l(xt),l(Xt),l(Ie)),l(u),y(f,e),y(T,e),y(v,e),y(W,e),y(C,e),y(k,e),y(Y,e),y(X,e),y(L,e),y(E,e),y(D,e),y(K,e),y(te,e),y(ae,e),y(se,e),y(ce,e),y(ue,e),y(we,e),y(be,e),y(ge,e),y(je,e)}}}const Nl='{"title":"CogVideoX","local":"cogvideox","sections":[{"title":"Data Preparation","local":"data-preparation","sections":[{"title":"Small format","local":"small-format","sections":[],"depth":3},{"title":"Stream format","local":"stream-format","sections":[],"depth":3}],"depth":2},{"title":"Training","local":"training","sections":[],"depth":2},{"title":"Inference","local":"inference","sections":[],"depth":2},{"title":"Reduce memory usage","local":"reduce-memory-usage","sections":[],"depth":2}],"depth":1}';function Hl(Ht){return Cl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Sl extends Vl{constructor(u){super(),kl(this,u,Hl,Xl,Wl,{})}}export{Sl as component};
