/ Модель

Характеристики

Лицензия
Apache 2.0
Базовая модель
Wan2.1-T2V-1.3B-Diffusers
Библиотека
diffusers
Опубликована
6 ноя 2026

wan2.1-t2v-1.3b-phi-lattice-v2

Генерация видеоТекст → видео3 профессии
27скачиваний за 30 дней0лайковвеса обновлены12 ноя 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

4-битная сборка Wan2.1-T2V-1.3B с квантизацией phi-lattice v2 для генерации видео по текстовым запросам при меньшем расходе видеопамяти.

Это 4-битная версия модели Wan2.1-T2V-1.3B, подготовленная автором репозитория на основе Wan-AI/Wan2.1-T2V-1.3B-Diffusers. Модель использует 3D Video Diffusion Transformer и предназначена для генерации видео по текстовым запросам. В README описаны упаковка весов phi-lattice v2, варианты хранения BF16 и 4-bit, а также тестовые ролики длительностью около четырёх секунд при 16 кадрах в секунду.

Главное преимущество этой сборки — меньший размер весов и расход видеопамяти: указано около 757 МиБ для 4-битного файла и 762 МиБ выделенной VRAM для трансформера, что примерно в 3,56 раза меньше BF16 по VRAM. В приведённых тестах phi-lattice v2 показала более высокие PSNR и SSIM, чем стандартная равномерная 4-битная квантизация, однако точность и временная согласованность остаются ниже исходной BF16-модели и различаются между сценами. Репозиторий использует Diffusers и формат safetensors; лицензия — Apache-2.0.

Сценарии применения

  • генерация коротких видео по текстовому описанию
  • создание видеосцен с животными и природой
  • создание городских и уличных видеосцен
  • запуск генерации видео на GPU с ограниченной видеопамятью

Ограничения

4-битная версия уступает исходной BF16-модели по точности кадров и временной согласованности; результаты метрик заметно различаются между сценами. Видеопамять для полной генерации также зависит от пайплайна и параметров запуска.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Бенчмарки пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь рядом с другими моделями теста

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Видео» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели сгенерируют результат по каждой задаче. Опубликованный тест появится на этой странице.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

wan2.1-t2v-1.3b-phi-lattice-v2

4-bit phi-lattice v2 build of the 3D Video Diffusion Transformer (WanTransformer3DModel, 1,418,996,800 parameters across 825 tensors) from Wan-AI/Wan2.1-T2V-1.3B-Diffusers.


1. Repository Layout & Memory Footprint

wan2.1-t2v-1.3b-phi-lattice-v2/
├── transformer/
│   ├── config.json
│   ├── wan_transformer_phi_v2_packed_4bit.pt      # 757.10 MiB (793.88 MB) 4-bit packed archive
│   └── diffusion_pytorch_model.safetensors        # 2,706.60 MiB (2.84 GB) unrolled BF16 fallback
├── phi_loader.py                                  # Standalone loader (triton_4bit, low_vram_4bit, unrolled_bf16)
├── phi_lut_gemm.py                                # Fused Triton 4-bit LUT-GEMM & dequantization kernels
├── tests/
│   ├── test_archive_roundtrip.py                  # CPU audit: structure, 166,624,550 zeros, 53.79 dB round-trip
│   ├── test_sqnr_vs_upstream.py                   # CPU audit: 19.65 dB SQNR vs upstream FP32 shards
│   └── selftest_blackwell_300layers.log           # Canonical 300/300 layer GPU verification log (Blackwell)
├── assets/                                        # 65-frame (16 fps) side-by-side comparison videos
└── benchmark_results.json                         # Quantitative evaluation metrics
Checkpoint VariantDisk / Download SizeGPU VRAM Allocated (WanTransformer3DModel)Savings vs Upstream FP32
Upstream Wan2.1-T2V-1.3B-Diffusers (FP32)5,676.0 MB (5,413.0 MiB)5,416.0 MiB1.00x
transformer/diffusion_pytorch_model.safetensors (BF16 fallback)2,838.1 MB (2,706.6 MiB)2,708.0 MiB2.00x disk & VRAM
transformer/wan_transformer_phi_v2_packed_4bit.pt (low_vram_4bit / triton_4bit)793.9 MB (757.1 MiB)761.7 MiB7.15x disk / 3.56x VRAM vs BF16

2. Visual Comparisons (Baseline BF16 | Uniform 4-bit | phi-lattice v2)

All three columns are rendered at 832x480, 65 frames (4.06s @ 16 fps), 25 inference steps, guidance_scale=5.0 using identical random seeds.

Scene 1: Tokyo Neon Street Walk (seed=77)

Scene 2: Himalayan Snow Leopard (seed=202)

Scene 3: Coral Reef Sea Turtle (seed=309)


3. Quantitative Video Benchmark

Method4-bit Weight SQNRExact Sparsity (Zero Weights)Video PSNRVideo SSIMPixel MAETemporal Consistency
Baseline (BF16)Reference0.00% (0)Reference1.00000.001.0000
Standard Uniform (4-bit)19.19 dB0.00% (0)13.30 dB0.682731.090.0682
phi-lattice v2 (This Repo)19.65 dB11.97% (166,624,550)13.73 dB0.728529.350.0953
Prompt Scene (65 frames @ 16 fps)Uniform PSNR / SSIM / MAEphi-lattice v2 PSNR / SSIM / MAETemporal Consistency (Uniform vs v2)
1. Tokyo Neon Street Walk12.20 dB / 0.4873 / 30.3513.26 dB / 0.5649 / 26.510.0607 vs 0.0616
2. Himalayan Snow Leopard14.51 dB / 0.7047 / 32.6614.63 dB / 0.7610 / 31.460.0855 vs 0.1828 (2.14x)
3. Coral Reef Sea Turtle13.19 dB / 0.8561 / 30.2613.29 dB / 0.8598 / 30.080.0585 vs 0.0414

Metric Definitions:

  • Sparsity denominator: 166,624,550 exact zeros out of 1,391,984,640 quantized linear weights (11.97% of quantized weights, 11.74% of all 1,418,996,800 transformer parameters).
  • Video PSNR / SSIM / Pixel MAE: Frame-by-frame fidelity against the unquantized Baseline (BF16) rollout under the identical seed (77, 202, 309).
  • Temporal Consistency: Mean cosine similarity between frame-to-frame motion vectors $\Delta \mathbf{F}t = \mathbf{F}{t+1} - \mathbf{F}t$ of the quantized model and the Baseline (BF16) reference: $$\text{Temporal Consistency} = \frac{1}{N-1} \sum{t=1}^{N-1} \frac{\langle \Delta \mathbf{F}^{\text{quant}}_t,; \Delta \mathbf{F}^{\text{BF16}}_t \rangle}{|\Delta \mathbf{F}^{\text{quant}}_t|_2 \cdot |\Delta \mathbf{F}^{\text{BF16}}_t|_2}$$

4. Quick Start & Loading Modes

Option A: Using phi_loader.py (Downloads only 757.1 MiB, skips 2.84 GB safetensors)

import importlib.util
import torch
from diffusers import AutoencoderKLWan, WanPipeline
from huggingface_hub import hf_hub_download

repo_id = "ununununununununununununununununununun/wan2.1-t2v-1.3b-phi-lattice-v2"
base_id = "Wan-AI/Wan2.1-T2V-1.3B-Diffusers"

loader_path = hf_hub_download(repo_id=repo_id, filename="phi_loader.py")
spec = importlib.util.spec_from_file_location("phi_loader", loader_path)
phi_loader = importlib.util.module_from_spec(spec)
spec.loader.exec_module(phi_loader)

# Available modes:
# - "triton_4bit"  : 761.65 MiB VRAM (fused Triton LUT-GEMM in GPU registers, no BF16 weight materialization)
# - "low_vram_4bit": 761.65 MiB VRAM (PyTorch on-the-fly per-layer dequantization)
# - "unrolled_bf16": 2,708.02 MiB VRAM (unpacks once into standard BF16 nn.Linear on load for full cuBLAS speed)
transformer = phi_loader.load_wan_from_packed_4bit(
    repo_id=repo_id,
    mode="triton_4bit",
    device="cuda",
    dtype=torch.bfloat16,
)

vae = AutoencoderKLWan.from_pretrained(base_id, subfolder="vae", torch_dtype=torch.float32)
pipe = WanPipeline.from_pretrained(
    base_id, vae=vae, transformer=transformer, torch_dtype=torch.bfloat16
).to("cuda")

Option B: Minimal 15-Line Unpacker (torch.load(..., weights_only=True))

Archive structure of transformer/wan_transformer_phi_v2_packed_4bit.pt (sha256: fd10a4f6d25bc5391dc0b43d0141d8678dcb6dc2aaae5e98325370ebb6ea83e2):

  • codebook: torch.float16 lookup table of shape [15] (0.0 at index 7)
  • group_size: 64
  • protected_tensors: 225 tensors (norms, patch/time/text embeddings, modulation tables in bfloat16)
  • quantized_layers: 300 linear layers (shape, packed_indices in uint8 low-nibble-first, scales in float16 [N/64, 1], optional bias in float16)
import math, torch
from diffusers import WanTransformer3DModel
from huggingface_hub import hf_hub_download

REPO = "ununununununununununununununununununun/wan2.1-t2v-1.3b-phi-lattice-v2"
cfg = WanTransformer3DModel.load_config(REPO, subfolder="transformer")
transformer = WanTransformer3DModel.from_config(cfg).to(torch.bfloat16)

blob = torch.load(
    hf_hub_download(REPO, "transformer/wan_transformer_phi_v2_packed_4bit.pt"),
    map_location="cpu",
    weights_only=True,
)
cb = blob["codebook"].float()
g = int(blob["group_size"])
sd = {k: v.to(torch.bfloat16) for k, v in blob["protected_tensors"].items()}

for name, item in blob["quantized_layers"].items():
    n = math.prod(item["shape"])
    ng = math.ceil(n / g)
    p = item["packed_indices"]
    idx = torch.stack([p & 0x0F, (p >> 4) & 0x0F], dim=-1).reshape(-1)[: ng * g].long()
    w = (cb[idx].view(ng, g) * item["scales"].float()).reshape(-1)[:n]
    sd[f"{name}.weight"] = w.view(item["shape"]).to(torch.bfloat16)
    if "bias" in item:
        sd[f"{name}.bias"] = item["bias"].to(torch.bfloat16)

transformer.load_state_dict(sd, strict=True)

5. Independent Verification & Interactive ZeroGPU Lab

You can verify the archive and the fused Triton kernel either directly in your browser on a live NVIDIA RTX PRO 6000 Blackwell via our Hugging Face Space or locally from the command line.

Interactive Browser Verification: Phi Verification Lab (ZeroGPU)

The Space provides 4 interactive verification tabs:

  1. Tab 1 — Archive structure (CPU): Computes the sha256 checksum of wan_transformer_phi_v2_packed_4bit.pt (fd10a4f6...e2), inspects the 15-level codebook, and verifies that all 300 quantized layers (240 × [1536×1536], 30 × [1536×8960], 30 × [8960×1536]) satisfy K % 64 == 0.
  2. Tab 2 — Triton selftest (GPU): Runs the Triton dequantizer (phi_dequantize) and fused LUT-GEMM (phi_linear) across up to all 300 / 300 layers of the archive, checking torch.equal bit-exactness of W and relative L2 error of Y against strict fp32-accumulate cuBLAS.
  3. Tab 3 — Micro-benchmark (GPU): Benchmarks single-layer latency (M = 1024 tokens) of the fused 4-bit Triton kernel (~0.5 B/weight memory traffic) against materialized BF16 cuBLAS (2 B/weight).
  4. Tab 4 — Debug one layer (GPU): Compares both phi_linear and default/strict cuBLAS F.linear against a float64 ground-truth matrix multiplication oracle (x.double() @ W.double().T + b.double()).

Summary of Verified Results (Log: tests/selftest_blackwell_300layers.log)

Verification CheckMeasured Result
Deserialization safetytorch.load(..., weights_only=True, mmap=True) passed
Tensor & parameter count825 / 825 tensors (300 quantized weights + 300 biases + 225 protected = 1,418,996,800 params)
Weight SQNR vs upstream Wan-AI (FP32)19.65 dB across 1,391,984,640 quantized weights (54.97 dB on protected tensors due to FP32 -> BF16 cast)
Exact zeros created by optimization166,624,550 (11.97%) vs 0.0000% in upstream Wan-AI
Archive round-trip vs BF16 safetensors53.79 dB SQNR, `max
GPU VRAM allocated (A100 / Blackwell)761.65 MiB (757.10 MiB archive + 4.55 MiB RoPE buffers) vs 2,708.02 MiB BF16 (3.56x VRAM reduction)
Triton Dequant (phi_dequantize, 300/300 layers)W-bitexact = True on all 300 / 300 layers (0 / 13,762,560 mismatched elements per layer)
Fused Triton LUT-GEMM vs float64 oraclerelL2 = 1.662e-03 (`max
Fused Triton LUT-GEMM vs strict fp32-acc cuBLAS300 / 300 layers PASS: relL2 spans 8.19e-06 (blocks.0.attn1.to_out.0) to 7.17e-05 (blocks.19.ffn.net.2)
Latency vs materialized BF16 cuBLAS (M=1024)[1536×1536]: 0.105 ms vs 0.063 ms (0.59x); [1536×8960]: 0.551 ms vs 0.278 ms (0.51x); [8960×1536]: 0.405 ms vs 0.150 ms (0.37x) — trades 1.7x–2.7x GEMM time for 3.56x lower VRAM

Local CLI Verification Commands

# 1. CPU: verify archive structure, 53.79 dB round-trip vs BF16 safetensors, and 166,624,550 exact zeros
python tests/test_archive_roundtrip.py transformer/wan_transformer_phi_v2_packed_4bit.pt transformer/diffusion_pytorch_model.safetensors

# 2. CPU: verify 19.65 dB SQNR against upstream Wan-AI FP32 shards
python tests/test_sqnr_vs_upstream.py transformer/wan_transformer_phi_v2_packed_4bit.pt diffusion_pytorch_model-00001-of-00002.safetensors diffusion_pytorch_model-00002-of-00002.safetensors

# 3. GPU: run Triton LUT-GEMM bit-exact dequantization and strict fp32 oracle check
python phi_lut_gemm.py transformer/wan_transformer_phi_v2_packed_4bit.pt

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · diffusers

Можно запустить

Подбираем GPU…

Ревизия весов
a5fa54e

0 моделей