N Neurarch Architectures Models Checks Data Docs Open the app

Architectures / Generative

๐ŸŽž๏ธ Latent Video Diffusion Transformer

The shape every 2024-2025 video generator shares: a causal 3D VAE compresses the clip, the latent is patchified into space-time tokens, a DiT stack denoises them.

Layers
15
Parameters
99.31M
Input
3 ร— 16 ร— 256 ร— 256
Output
1024 ร— 64
Verifier
Clean

Every number on this page is computed from the graph by the same functions the app runs, not written by hand.

Open Latent Video Diffusion Transformer on the canvas Free, no account needed

When to pick it

Pick as the starting point for text-to-video or video-to-video work. Check the token count first: space-time patches grow with frames as well as resolution.

Structure

15 layers. Output shapes are propagated from the input shape, batch dimension excluded.

LayerTypeParametersOutput shape
1Video clip (16 frames, 256x256)Inputshape=[3, 16, 256, 256]3 ร— 16 ร— 256 ร— 256
2Causal VAE Down 128Causal Conv3DoutChannels=128, inChannels=3, kernelSize=3128 ร— 16 ร— 128 ร— 128
3Causal VAE Down 256Causal Conv3DoutChannels=256, inChannels=128, kernelSize=3256 ร— 8 ร— 64 ร— 64
4Causal VAE to latent 16Causal Conv3DoutChannels=16, inChannels=256, kernelSize=316 ร— 4 ร— 32 ร— 32
5Patchify 1x2x2Tubelet Embedding (3D Patch)embedDim=11521024 ร— 1152
6Pos EncodingPositional EncodingmaxLen=10241024 ร— 1152
7Diffusion timestepInputshape=[1]1
8Timestep EmbedTime Embedding1152
9DiT Block 1 (AdaLN-Zero)DiT Block (AdaLN-Zero)numHeads=161024 ร— 1152
10DiT Block 2 (AdaLN-Zero)DiT Block (AdaLN-Zero)numHeads=161024 ร— 1152
11DiT Block 3 (AdaLN-Zero)DiT Block (AdaLN-Zero)numHeads=161024 ร— 1152
12DiT Block 4 (AdaLN-Zero)DiT Block (AdaLN-Zero)numHeads=161024 ร— 1152
13Final LayerNormLayerNormnormalizedShape=11521024 ร— 1152
14Unpatchify to latentLinearoutFeatures=64, inFeatures=11521024 ร— 64
15predicted latent velocityOutput1024 ร— 64

What the verifier says

The same 43 structural checks that run on every edit in the app, on this graph.

No finding. Shapes propagate end to end, every divisibility condition holds, and no advisory rule fires. See the checks.

The PyTorch it exports

Generated from the graph above. First 46 lines; the app exports the whole file, plus the training loop, the data contract and a deploy bundle.

# Architecture designed with Neurarch: https://neurarch.com
# PyTorch: compatible with Python 3.8+ and torch>=1.12
# Colab: pip install torch torchvision  (usually pre-installed)

import torch
import torch.nn as nn
import torch.nn.functional as F
from typing import Tuple

class TimestepEmbedding(nn.Module):
    """Sinusoidal diffusion-timestep features, then an MLP. Takes a scalar per
    sample and returns one conditioning vector per sample."""

    def __init__(self, dim: int = 256):
        super().__init__()
        self.dim = dim
        self.mlp = nn.Sequential(nn.Linear(dim, dim), nn.SiLU(), nn.Linear(dim, dim))

    def forward(self, t: torch.Tensor) -> torch.Tensor:
        t = t.reshape(t.size(0), -1)[:, 0].float()
        half = self.dim // 2
        freqs = torch.exp(
            -torch.arange(half, device=t.device, dtype=t.dtype) * (9.2103403719762 / max(1, half - 1)))
        ang = t[:, None] * freqs[None]
        emb = torch.cat([ang.cos(), ang.sin()], dim=-1)
        if emb.size(-1) < self.dim:
            emb = F.pad(emb, (0, self.dim - emb.size(-1)))
        return self.mlp(emb)


class DiTBlock(nn.Module):
    """DiT block with adaLN-Zero: the conditioning vector produces the scale,
    shift and gate for both sublayers, and the gates start at zero so a fresh
    block is the identity."""

    def __init__(self, hidden_dim: int = 1152, num_heads: int = 16, cond_dim: int = 1152):
        super().__init__()
        self.norm1 = nn.LayerNorm(hidden_dim, elementwise_affine=False)
        self.attn = nn.MultiheadAttention(hidden_dim, num_heads, batch_first=True)
        self.norm2 = nn.LayerNorm(hidden_dim, elementwise_affine=False)
        self.mlp = nn.Sequential(
            nn.Linear(hidden_dim, 4 * hidden_dim), nn.GELU(), nn.Linear(4 * hidden_dim, hidden_dim))
        self.ada = nn.Sequential(nn.SiLU(), nn.Linear(cond_dim, 6 * hidden_dim))
        nn.init.zeros_(self.ada[1].weight)
        nn.init.zeros_(self.ada[1].bias)

For agents

This architecture is machine-readable end to end. An agent can list the set, fetch this graph, edit it, and have the edit verified before any GPU time is spent.

Also in Generative

๐ŸŽจ Diffusion UNet
Stable-Diffusion-style noise predictor โ€” latent UNet with cross-attention to a text embedding
19 layers ยท 6.69M
๐ŸŒ€ DiT-XL/2
Diffusion Transformer โ€” replaces the UNet denoiser with a ViT backbone conditioned on timestep + class via adaLN-Zero
204 layers ยท 670.68M