mstar.model.components.diffusion#
The DiT scaffold: shared pieces of a text -> flow-transformer loop -> VAE model.
Each module here is model-agnostic and tested against the reference library once, so a new image/video diffusion model brings only its config, its exact component ports, a weight loader and a thin graph file:
flow_matchsigma schedules (linear / dynamic / FLUX.2 empirical shift) + the Euler stepropemulti-axis rotary tables and the interleaved application FLUX-family DiTs useattentionjoint attention over packed text+image tokens: SDPA eagerly, the raggedFlashInfer resource under CUDA graphs
text_encodera native Qwen3-family encoder returning tapped hidden statesdenoise_loopthe Loop-body submodule: seeded noise, equal-shape request batching, per-stepCUDA graphs, stop at the request’s step count
image_iopixel/latent packing helpers and PNG encodinglorastatic LoRA merging at load time
Modules
Joint attention over a DiT's packed tokens. |
|
Native KL autoencoder (the SD / FLUX family VAE) for the image DiTs. |
|
The DiT scaffold's Loop body: one flow-matching denoise step per iteration. |
|
Flow-matching sigma schedules and the Euler step, as the DiT scaffold's step math. |
|
Pixel <-> latent-token layout helpers and PNG encoding shared by the image DiTs. |
|
Static LoRA merging for the DiT scaffold. |
|
Multi-axis rotary position embeddings for FLUX-family DiTs. |
|
Native Qwen3-family prompt encoder that returns tapped hidden states. |