+9








7bc1dae095
Co-authored-by: yhyang201 <yhyang201@gmail.com> Co-authored-by: yizhang2077 <1109276519@qq.com> Co-authored-by: Xinyuan Tong <xinyuantong.cs@gmail.com> Co-authored-by: ispobock <ispobaoke@gmail.com> Co-authored-by: JiLi <leege233@gmail.com> Co-authored-by: CHEN Xi <78632976+RubiaCx@users.noreply.github.com> Co-authored-by: laixin <xielx@shanghaitech.edu.cn> Co-authored-by: SolitaryThinker <wlsaidhi@gmail.com> Co-authored-by: jzhang38 <a1286225768@gmail.com> Co-authored-by: BrianChen1129 <yongqichcd@gmail.com> Co-authored-by: Kevin Lin <42618777+kevin314@users.noreply.github.com> Co-authored-by: Edenzzzz <wtan45@wisc.edu> Co-authored-by: rlsu9 <r3su@ucsd.edu> Co-authored-by: Jinzhe Pan <48981407+eigensystem@users.noreply.github.com> Co-authored-by: foreverpiano <pianoqwz@qq.com> Co-authored-by: RandNMR73 <notomatthew31@gmail.com> Co-authored-by: PorridgeSwim <yz3883@columbia.edu> Co-authored-by: Jiali Chen <90408393+gary-chenjl@users.noreply.github.com>
37 lines
1.1 KiB
Python
37 lines
1.1 KiB
Python
# Copied and adapted from: https://github.com/hao-ai-lab/FastVideo
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
from dataclasses import dataclass, field
|
|
from typing import Tuple
|
|
|
|
from sglang.multimodal_gen.configs.models.dits.base import DiTArchConfig, DiTConfig
|
|
|
|
|
|
@dataclass
|
|
class FluxArchConfig(DiTArchConfig):
|
|
patch_size: int = 1
|
|
in_channels: int = 64
|
|
out_channels: int | None = None
|
|
num_layers: int = 19
|
|
num_single_layers: int = 38
|
|
attention_head_dim: int = 128
|
|
num_attention_heads: int = 24
|
|
joint_attention_dim: int = 4096
|
|
pooled_projection_dim: int = 768
|
|
guidance_embeds: bool = False
|
|
axes_dims_rope: Tuple[int, int, int] = (16, 56, 56)
|
|
|
|
def __post_init__(self):
|
|
super().__post_init__()
|
|
self.out_channels = self.out_channels or self.in_channels
|
|
self.hidden_size = self.num_attention_heads * self.attention_head_dim
|
|
self.num_channels_latents = self.out_channels
|
|
|
|
|
|
@dataclass
|
|
class FluxConfig(DiTConfig):
|
|
|
|
arch_config: DiTArchConfig = field(default_factory=FluxArchConfig)
|
|
|
|
prefix: str = "Flux"
|