Uh oh!
There was an error while loading. Please reload this page.
Cosmos - #10660
Conversation
HuggingFaceDocBuilderDev
commented
Jan 27, 2025
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. |
To match our sigmas to original exactly, without any rounding errors, I had to use Also, we only match the sigmas if we set our |
yiyixuxu
commented
Apr 26, 2025
@a-r-r-o-w |
a-r-r-o-w
commented
Apr 27, 2025
Thanks @yiyixuxu! I'll take a look and update our implementation accordingly tomorrow |
a-r-r-o-w
commented
Apr 30, 2025
@yiyixuxu I've updated the code to use the package. Could you take a look again? If everything looks good, let's try to get the 7B model weights merged and I'll open the 14B model weight PRs soon |
Uh oh!
There was an error while loading. Please reload this page.
yiyixuxu
left a comment
There was a problem hiding this comment.
thanks! I left some questions but the PR looks good to me
| noisy_samples = original_samples + noise * sigma | ||
| return noisy_samples | ||
| # Copied from diffusers.schedulers.scheduling_edm_euler.EDMEulerScheduler._get_conditioning_c_in |
There was a problem hiding this comment.
is this just to make code more organized?
| sigmas = self._compute_karras_sigmas(sigmas) | ||
| elif sigma_schedule == "exponential": | ||
| sigmas = self._compute_exponential_sigmas(sigmas) | ||
| sigmas = sigmas.to(torch.float32) |
There was a problem hiding this comment.
was this float64 before? just curious
There was a problem hiding this comment.
It was float32 before. But, to match the sigmas value from the original implementation (which is correct and ours was a little off*), you need the arange and division by num_train_timesteps to happen in float64. This was done to match the final outputs perfectly (if not, the diff is on the order of 1e-4 to 1e-6, so this change is not particularly required but I think we should keep it)
* If done in float32 (ours), the sigmas start from 79.998 IIRC due to precision issues. If done in float64 and then converted to float32 (current), the sigmas start as expected at 80.0
a-r-r-o-w
commented
May 1, 2025
@pjannaty@amolfasale@asfiyab-nvidia Hey, could you take a look at the following PRs and let me know if the changes look alright? If all looks good, I can open PRs to the other Cosmos repos with the similar README and weight updates
Additionally, in a follow up PR, we will add support for loading the original format weights directly too |
pjannaty
commented
May 1, 2025
Changes look good to me. What a major lift! Let's merge! |
a-r-r-o-w
commented
May 5, 2025
@pjannaty@asfiyab-nvidia@amolfasale Here's the list of all the weight PRs:
We should be good to merge this code PR already, but users will not be able to download or be able to use the example code snippets until the weight PRs are merged (unless they add |
pjannaty
commented
May 5, 2025
Thank you for the major lift, team! Let's merge! |
a-r-r-o-w
commented
May 7, 2025
@pjannaty The weight PRs cannot be merged by us since we don't have access to the nvidia org. If you or someone with access to the repositories could take a look and merge those, it'd be great |
a-r-r-o-w
commented
May 7, 2025
Thank you for merging the PRs @pjannaty! |

The cosmos is within us. We are made of star-stuff. We are a way for the universe to know itself.
Models
Transformer
test attention
test ff
test timesteps
test patch embed
test positional embed
test transformer block
test transformer
test transformer video
VAE
test vae attention
test vae
Text-to-World:
Video-to-World (image-conditioning):
Video-to-World (video-conditioning):
Note that the model repos are not yet compatible with Diffusers-loading. I'll open PRs for weights once nvidia team gives the thumbs up.
Inference code (old)