Skip to content

Conversation

@kevin314
Copy link
Collaborator

@kevin314 kevin314 commented Oct 10, 2025

No description provided.

Comment on lines 11 to 13
_class_name: str = "AutoencoderKLWan"
_diffusers_version: str = "0.34.0.dev0"
_name_or_path: str = ""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These fields should be pop/removed in the loader so can be removed. You can refer to how wan's vae config is defined


def __post_init__(self):
self.blend_num_frames = (self.tile_sample_min_num_frames -
self.tile_sample_stride_num_frames) * 2 No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newline char



@dataclass
class CosmosVideoConfigFixed(CosmosVideoConfig):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

class CosmosVideoConfigFixed(CosmosVideoConfig):
"""Fixed Cosmos Video Config that matches original Cosmos2 Video2World configuration."""

def update_model_arch(self, config: dict) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you align against diffusers or original cosmos?



@dataclass
class CosmosTeaCacheParams(CacheParams):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed for now, but you should add a default for cosmos sampling params. Refer to wan

if self.has_weight:
self.weight = nn.Parameter(self.weight)

def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you change this to forward_diffusers?

@kevin314 kevin314 marked this pull request as ready for review October 24, 2025 02:30
@kevin314 kevin314 added the go Trigger Buildkite CI label Oct 24, 2025
return x.flatten(-2)


def apply_rotary_emb(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should consider making this cosmos2 specific?

return imgs


def get_timestep_embedding(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also make the architecture specific

bs, seq_len, _ = hidden_states.shape
num_seqs = bs
n, c = self.n_heads, self.d_model // self.total_num_heads
#n, c = self.n_heads, self.d_model // self.total_num_heads
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this

qkv, _ = self.qkv_proj(hidden_states)
# Projection of 'own' hidden state (self-attention). No GQA here.
q, k, v = qkv.split(self.inner_dim, dim=-1)
#q, k, v = qkv.split(self.inner_dim, dim=-1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this

timesteps_array = np.linspace(self._sigma_to_t(self.sigma_max),
self._sigma_to_t(self.sigma_min),
num_inference_steps)
t_max = self._sigma_to_t(self.sigma_max)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe make a separate version of this scheduler

# Peiyuan: using GPU seed will cause A100 and H100 to generate different results...
batch.generator = [
torch.Generator("cpu").manual_seed(seed) for seed in seeds
torch.Generator(device="cpu").manual_seed(seed) for seed in seeds
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert please

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe also separate these

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make arch specific

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test both

self.world_size = self.fastvideo_args.num_gpus
self.shutting_down = False

# Initialize CUDA before setting up multiprocessing to ensure
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Trigger Buildkite CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants