Uh oh!
There was an error while loading. Please reload this page.
Add LoRA support for Cosmos Predict 2.5 and fix pipeline to match official Cosmos repo - #13664
Conversation
…ncoder attention implementation, and timestep scaling
… to device before torch.stack
yiyixuxu
left a comment
There was a problem hiding this comment.
thanks, i left a question
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
0cc6351 to
c8513c2Compare| device = sample.device | ||
| sigma_t, sigma_s0 = self.sigmas[self.step_index + 1].to(device), self.sigmas[self.step_index].to(device) | ||
| sigma_t, sigma_s0 = self.sigmas[self.step_index + 1], self.sigmas[self.step_index] |
There was a problem hiding this comment.
ohh I think the change here might not be intended, no?
it seeem to have reverted https://github.com/huggingface/diffusers/pull/13489/changes
yiyixuxu
left a comment
There was a problem hiding this comment.
thanks, looks good to me once we revert the change in scheculer
sayakpaul
left a comment
There was a problem hiding this comment.
I left some questions and suggestions. LMK if anything is unclear.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
HuggingFaceDocBuilderDev
commented
May 7, 2026
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Uh oh!
There was an error while loading. Please reload this page.
…icial Cosmos repo (huggingface#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>
What this PR does
Adds LoRA fine-tuning support for Cosmos Predict 2.5 (nvidia/Cosmos-Predict2.5-2B) and fixes the pipeline to match the official Cosmos reference implementation.
LoRA support
CosmosLoraLoaderMixininsrc/diffusers/loaders/lora_pipeline.pyfor LoRA loading/saving onCosmosTransformer3DModelexamples/cosmos/train_cosmos_predict25_lora.pyusingaccelerate+peftexamples/cosmos/eval_cosmos_predict25_lora.pyCosmosLoraLoaderMixintodocs/source/en/api/loaders/lora.mdFixes to match the official Cosmos repo
conditional_frame_timestepscaling bytimestep_scale=0.001Test plan
check_copies,check_dummies,check_support_list)