1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-10-24 20:59:27 +03:00
Files
diffusers/examples/cosmos/eval_lora.sh
Ting-Yun Chang 4ca863323d Add LoRA support for Cosmos Predict 2.5 and fix pipeline to match official Cosmos repo (#13664)
* support lora for cosmos 2.5

* Fix inconsistencies with cosmos official repo in VAE encoding, text encoder attention implementation, and timestep scaling

* Support f_min and f_max in linear_scheduler warmup

* Add requirements and dataset preprocessing scripts to run examples

* Add LoRA training scripts

* Add LoRA eval scripts

* add assets for blogpost

* Fix(scheduler): device mismatch from upstream b114620 - move rk and b to device before torch.stack

* Always upcast to fp32

* Directly inhrit from LoraBaseMixin

* remove flash-attn2

* Use _keep_in_fp32_modules instead of autocast

* remove the get_latent_shape_cthw method and fix style

* simplifiy the eval script to make it more user-friendly

* overwrite scheduling_unipc_multistep.py with main's version

* remove network_alphas and add # Copied from

* remove figures and assets

* revert scheduler

* revert fp32 upcast and support bs > 1

---------

Co-authored-by: Ting-Yun Chang <tingyunc@nvidia.com>
2026-05-07 16:50:13 -10:00

16 lines
406 B
Bash

export DATA_DIR="gr1_dataset/test"
export LORA_DIR=YOUR_ADAPTER_DIR
export OUT_DIR=YOUR_EVAL_OUTPUT_DIR
revision="post-trained"
export TOKENIZERS_PARALLELISM=false
python eval_cosmos_predict25_lora.py \
--data_dir $DATA_DIR \
--output_dir $OUT_DIR \
--lora_dir $LORA_DIR \
--revision diffusers/base/$revision \
--height 432 --width 768 \
--num_output_frames 93 \
--num_steps 36 \
--seed 0