Diffusion Transformers: Image to Video AI Architecture 2025
How diffusion transformers power image-to-video AI models in 2025. Architecture breakdown behind Sora, Veo 3, and Kling with code examples.

The ascent to the summit of video generation has been a methodical climb, each architectural innovation building upon the last. In 2025, we've reached what feels like a new peak with diffusion transformers, an elegant fusion that's fundamentally reshaping how we think about temporal generation. Let me guide you through the technical landscape that's emerged, much like navigating the ridgelines between the Dent Blanche and the Matterhorn.
The Architectural Convergence
Traditional video generation models struggled with two fundamental challenges: maintaining temporal consistency across frames and scaling to longer sequences. The breakthrough came when researchers realized that diffusion models' probabilistic framework could be enhanced with transformers' attention mechanisms, creating what we now call latent diffusion transformers.
class DiffusionTransformer(nn.Module):
def __init__(self, latent_dim=512, num_heads=16, num_layers=24):
super().__init__()
self.patch_embed = SpacetimePatchEmbed(latent_dim)
self.transformer = nn.TransformerEncoder(
nn.TransformerEncoderLayer(
d_model=latent_dim,
nhead=num_heads,
dim_feedforward=latent_dim * 4,
norm_first=True # Pre-normalization for stability
),
num_layers=num_layers
)
self.denoise_head = nn.Linear(latent_dim, latent_dim)
def forward(self, x_t, timestep, conditioning=None):
# Extract spacetime patches - the key innovation
patches = self.patch_embed(x_t)
# Add positional and temporal embeddings
patches = patches + self.get_pos_embed(patches.shape)
patches = patches + self.get_time_embed(timestep)
# Transformer processing with QK-normalization
features = self.transformer(patches)
# Predict noise for diffusion
return self.denoise_head(features)The elegance lies in treating video not as a sequence of images, but as a unified spacetime volume. OpenAI's approach with Sora 2 processes videos across both spatial and temporal dimensions, creating what they call "spacetime patches," analogous to how Vision Transformers process images, but extended into the temporal dimension.
Mathematical Foundations: Beyond Simple Denoising
The core mathematical innovation extends the standard diffusion formulation. Instead of the traditional approach where we model p_θ(x_{t-1}|x_t), diffusion transformers operate on compressed latent representations:
Loss Function: L_DT = E[||ε - ε_θ(z_t, t, c)||²]
Where z_t represents the latent spacetime encoding, and the transformer ε_θ predicts noise conditioned on both temporal position t and optional conditioning c. The critical advancement is that Query-Key normalization stabilizes this process:
Attention: Attention(Q, K, V) = softmax(Q_norm · K_norm^T / √d_k) · V
This seemingly simple modification, normalizing Q and K before computing attention, dramatically improves training stability at scale, enabling models to train efficiently on distributed systems. The same bidirectional constraint approach powers parallelized diffusion for ultra-high resolution generation.
Multi-Stage Audio-Visual Generation: The Veo 3 Architecture
Google DeepMind's Veo 3 introduced a sophisticated multi-stage architecture: a 12-billion-parameter transformer generates keyframes at 2-second intervals, while a 28-billion-parameter U-Net interpolates intermediate frames, and a separate 9-billion-parameter audio synthesis engine produces synchronized soundtracks. Think of it like capturing both the visual beauty and the sound of an avalanche through coordinated specialized systems.
class MultiStageVideoEncoder(nn.Module):
def __init__(self):
super().__init__()
self.keyframe_generator = KeyframeTransformer() # 12B params
self.frame_interpolator = InterpolationUNet() # 28B params
self.audio_synthesizer = AudioGenerator() # 9B params
def generate(self, prompt, duration=8):
# Generate keyframes first
keyframes = self.keyframe_generator(prompt, num_frames=duration//2)
# Interpolate intermediate frames
full_video = self.frame_interpolator(keyframes)
# Generate synchronized audio
audio = self.audio_synthesizer(full_video, prompt)
return full_video, audioThe diffusion process generates both modalities with temporal synchronization, achieving lip-sync accuracy of less than 120 milliseconds for dialogue.
Current Model Landscape and Performance
The architectural differences between current models show distinct approaches to video generation:
| Model | Architecture | Resolution | Duration | Key Features |
|---|---|---|---|---|
| Sora 2 | Diffusion Transformer | 1080p | Up to 60s | Spacetime patches, remix capabilities |
| Gen-4 | Diffusion Transformer | 720p | 10s | Commercial quality, fast generation |
| Veo 3 | Multi-stage (12B+28B+9B) | 4K supported | 8s | Synchronized audio-visual generation |
| Stable Video Diffusion | Open-source SVD | 720p | 4s | Community-driven, customizable |
What's particularly interesting is how different models optimize for sequence length through various attention patterns:
def hierarchical_attention(patches, hierarchy_levels=3):
"""
Progressive attention refinement from coarse to fine
Similar to climbing: establish base camp, then push to summit
"""
attention_maps = []
for level in range(hierarchy_levels):
window_size = 2 ** (hierarchy_levels - level)
local_attn = compute_windowed_attention(patches, window_size)
attention_maps.append(local_attn)
# Combine multi-scale attention
return torch.stack(attention_maps).mean(dim=0)Motion-Aware Architecture Advances
2025 has seen the emergence of motion-aware architectures that explicitly model temporal dynamics. The Motion-Aware Generative (MoG) framework, proposed by researchers from Nanjing University and Tencent, leverages explicit motion guidance from flow-based interpolation models to enhance video generation. The framework integrates motion guidance at both latent and feature levels, significantly improving motion awareness in large-scale pre-trained video generation models.
This separation of motion and appearance processing allows for enhanced control over temporal dynamics while maintaining visual consistency. Imagine being able to adjust the speed of an avalanche while keeping every snowflake perfectly rendered.
Production Optimization: From Lab to Application
The real triumph of 2025 isn't just improved quality. It's deployment efficiency. TensorRT optimizations for transformer-based diffusion models achieve significant speedups:
# Standard generation pipeline
model = DiffusionTransformer().cuda()
frames = model.generate(prompt, num_frames=120) # 5 seconds of video
# Optimized pipeline with TensorRT
import tensorrt as trt
optimized_model = optimize_with_tensorrt(model,
batch_size=1,
precision='fp16',
use_flash_attention=True)
frames = optimized_model.generate(prompt, num_frames=120) # Significantly fasterParameter-Efficient Fine-Tuning through LoRA has democratized customization. Teams can now adapt pre-trained video models with just 1% of the original parameters:
class VideoLoRA(nn.Module):
def __init__(self, base_model, rank=16):
super().__init__()
self.base_model = base_model
# Inject low-rank adaptations
for name, module in base_model.named_modules():
if isinstance(module, nn.Linear):
# Only train these small matrices
setattr(module, 'lora_A', nn.Parameter(torch.randn(rank, module.in_features)))
setattr(module, 'lora_B', nn.Parameter(torch.randn(module.out_features, rank)))Looking Forward: The Next Ascent
The convergence toward unified architectures continues. ByteDance's BAGEL model (7B active parameters with Mixture-of-Transformers architecture) and Meta's Transfusion models pioneer single-transformer architectures handling both autoregressive and diffusion tasks. At Bonega.ai, we're particularly excited about the implications for real-time video processing. Imagine extending your existing footage seamlessly with AI-generated content that matches perfectly in style and motion.
The mathematical elegance of diffusion transformers has solved fundamental challenges in video generation: maintaining coherence across time while scaling efficiently. As someone who's implemented these architectures from scratch, I can tell you the sensation is like reaching a false summit, only to discover the true peak reveals an even grander vista ahead.
The tools and frameworks emerging around these models, from training-free adaptation methods to edge-deployment strategies, suggest we're entering an era where high-quality video generation becomes as accessible as image generation was in 2023. The climb continues, but we've established a solid base camp at an altitude previously thought unreachable.
Frequently Asked Questions
What is a diffusion transformer in AI video generation?▼
A diffusion transformer combines the probabilistic denoising process of diffusion models with the attention mechanisms of transformers. It treats video as a unified spacetime volume, processing both spatial and temporal dimensions simultaneously through spacetime patches, enabling coherent video generation across frames.
How do diffusion transformers differ from traditional video generation models?▼
Traditional models struggled with temporal consistency and scaling to longer sequences. Diffusion transformers solve both by using transformer attention across spacetime patches, allowing the model to maintain coherence between frames while scaling efficiently to longer videos.
What AI video models use diffusion transformer architecture?▼
Major models using diffusion transformer architecture include OpenAI's Sora 2, Google's Veo 3, and Runway's Gen-4.5. ByteDance's BAGEL model and Meta's Transfusion models also pioneer related approaches with single-transformer architectures handling both autoregressive and diffusion tasks.
What are spacetime patches in AI video generation?▼
Spacetime patches extend the Vision Transformer concept into the temporal dimension. Instead of treating video as a sequence of separate images, the model divides the entire video volume into patches that span both space and time, allowing unified processing of motion and appearance.
Dažnai užduodami klausimai
- What is a diffusion transformer in AI video generation?
- A diffusion transformer combines the probabilistic denoising process of diffusion models with the attention mechanisms of transformers. It treats video as a unified spacetime volume, processing both spatial and temporal dimensions simultaneously through spacetime patches, enabling coherent video generation across frames.
- How do diffusion transformers differ from traditional video generation models?
- Traditional models struggled with temporal consistency and scaling to longer sequences. Diffusion transformers solve both by using transformer attention across spacetime patches, allowing the model to maintain coherence between frames while scaling efficiently to longer videos.
- What AI video models use diffusion transformer architecture?
- Major models using diffusion transformer architecture include OpenAI's Sora 2, Google's Veo 3, and Runway's Gen-4.5. ByteDance's BAGEL model and Meta's Transfusion models also pioneer related approaches with single-transformer architectures handling both autoregressive and diffusion tasks.
- What are spacetime patches in AI video generation?
- Spacetime patches extend the Vision Transformer concept into the temporal dimension. Instead of treating video as a sequence of separate images, the model divides the entire video volume into patches that span both space and time, allowing unified processing of motion and appearance.

DI inžinierius iš Lozanos, kuris derina tyrimų gilumą su praktinėmis inovacijomis. Dalijasi laiku tarp modelių architektūrų ir Alpių kalnų.
View profile →Susiję straipsniai
Tęskite tyrinėjimą su šiais susijusiais straipsniais

AI vaizdo įrašai po Sora: 4 rinkos lygiai, kuriuos reikia žinoti 2026 m.
Sora užsidaro balandžio 26 d. AI vaizdo įrašų rinka susijungė į keturis lygius. Praktinis vadovas, kaip pasirinkti tinkamą Sora alternatyvą.

Google Veo 3.1 tampa nemokamas: 10 AI vaizdo įrašų per mėnesį kiekvienai Google paskyrai
Google atvėrė Veo 3.1 visoms asmeninėms paskyroms su 10 nemokamų vaizdo generavimų per mėnesį. Štai ką gausite, kokie apribojimai ir kodėl tai svarbu AI vaizdo kūrėjams.

Alibaba HappyHorse-1.0: paslaptingas modelis, užėmęs pirmą vietą visuose AI vaizdo įrašų reitinguose
Modelis pavadinimu HappyHorse-1.0 pasirodė Artificial Analysis platformoje be jokio priskyrimo, pakilo į pirmą vietą tiek teksto pavertimo vaizdo įrašu, tiek vaizdo pavertimo vaizdo įrašu kategorijose, o paskui paaiškėjo, kad už jo stovi Alibaba. Štai ką žinome apie architektūrą, komandą ir ką tai reiškia AI vaizdo įrašų rinkai.