Views
No views yet
mflux (Python MLX, actively maintained; also the parity reference these weights were validated against),seedvr2-mlx-swift (MLX-Swift; archived/read-only since Jun 2026 but functional — MIT-licensed and forkable),SeedVR2-7B-mlx · sharp checkpoint: SeedVR2-7B-sharp-mlx · 3B family: mlx-community/SeedVR2-3B-mlxtransformer.safetensors (DiT, int8, ~8.8 GB vs 16.5 GB fp16) · vae.safetensors (3D-causal-conv VAE, fp16) · pos_emb.safetensors (precomputed text embedding) · config.json.t_out cosine vs fp16 = 0.9999481; reload round-trip bit-exact (cosine 1.0). (int4 degrades this model family badly — use int8 on-device.)1import json, mlx.core as mx, mlx.nn as nn
2from mlx.utils import tree_unflatten
3from mflux.models.seedvr2.model.seedvr2_transformer.transformer import SeedVR2Transformer
4from mflux.models.seedvr2.weights.seedvr2_weight_definition import SeedVR2WeightDefinition
5
6cfg = json.load(open("config.json"))
7tx = SeedVR2Transformer(**cfg["transformer_overrides"])
8q = cfg["quantization"] # {"bits": 8, "group_size": 64}
9nn.quantize(tx, group_size=q["group_size"], bits=q["bits"],
10 class_predicate=SeedVR2WeightDefinition.quantization_predicate)
11tx.update(tree_unflatten(list(mx.load("transformer.safetensors").items())))
12mx.eval(tx.parameters())mflux-upscale-seedvr2 --model seedvr2-7b --image-path input.png --resolution 2x (note: mflux's built-in downloader fetches the PyTorch source weights and converts on the fly; loading these pre-converted files uses the snippet above).1import SeedVR2MLX // github.com/xocialize/seedvr2-mlx-swift (archived/read-only, MIT — fork to maintain)
2let upscaler = try SeedVR2Upscaler(directory: weightsDir) // detects int8 from config, applies quantize on load
3let out = upscaler.upscale(processedImage: img, seed: 42) // [-1,1], dims padded to /16mlx.utils.tree_flatten (e.g. blocks.17.attn.proj_qkv_vid.weight). Deterministic mapping back to ByteDance's original PyTorch names: mflux src/mflux/models/seedvr2/weights/seedvr2_weight_mapping.py.(O, *K, I).config.json["transformer_overrides"] carries the 7B dims (vid_dim 3072, heads 24, num_layers 36, mm_layers 36, rope_dim 64, …) and must be passed to the transformer constructor.pos_emb.safetensors (58×5120, fp16) is the precomputed embedding of the fixed prompt — the text encoder is eliminated from this port, so it is a mandatory txt input.weight (U32) + scales/biases (F16). Only Linears with in-dim divisible by 64 are quantized — vid_in.proj (in-dim 132) and the whole VAE stay fp16. Declared in config.json so loaders can rebuild the module structure before update().numz/SeedVR2_comfyUI (seedvr2_ema_7b_fp16.safetensors; independently verified bitwise against ByteDance's original fp32 seedvr2_ema_7b.pth — all 1128 tensors identical after fp32→fp16 cast) → MLX reference impl filipstrand/mflux → export + int8 conversion via xocialize/seedvr2-mlx tooling. These are format/precision-converted weight artifacts (not a new model); Apache-2.0 applies. Credit ByteDance Seed (original), cite the paper.