Semantic Detour Flow, JiT-B/16, window (0.40, 0.85), 20 epochs
Class-conditional ImageNet 256×256 pixel-space diffusion model trained with Semantic Detour Flow: the noisy state passes through the image's DINOv2-B code at high noise and is handed over to pixels by a smoothstep over t ∈ [0.40, 0.85] (t = 0 is noise, t = 1 is the clean image). Sampling is a pixel ODE from Gaussian noise straight to RGB; no encoder or decoder is used at sampling time.
| Model (20 epochs, batch 1024) | FID-10k ↓ | IS ↑ |
|---|---|---|
| This checkpoint, Detour (0.40, 0.85) | 92.8 | 16.02 |
| Plain pixel JiT-B/16, same epochs | 97.2 | 12.43 |
| Detour (0.40, 0.95), same setup (not in this repo) | 72.8 | 21.07 |
All numbers: unguided (cfg 1.0), raw weights, Heun 50 steps, FID-10k against JiT's ImageNet-256 train statistics. Single runs. This is an early (20-epoch) research checkpoint, not a converged model.
Files
| File | Contents |
|---|---|
model_raw.safetensors | Raw weights after 20 epochs (the weights the numbers above come from) |
model_ema2_0.9996.safetensors | EMA with decay 0.9996 (about 2.5k-step window; usable at this stage) |
model_ema1_0.9999.safetensors | EMA with decay 0.9999 (lags too far behind at 20 epochs; not recommended yet) |
training_args.json | Full training configuration (paths and logging settings removed) |
detour_init_dinov2b_C768.pt | Per-channel normalization statistics of the DINOv2-B code, required to build the model |
Optimizer state is not included.
Model
- JiT-B/16 (Li & He, "Back to Basics: Let Denoising Generative Models Denoise") with two changes, both keeping the 16×16 patchify:
- no patch bottleneck (
--bottleneck_dim 768); - an RAE DiT^DH-style wide head: 2 blocks of width 2048, per-token adaLN from the encoder features, its own full-width
16×16 patchify of the noisy input (
--ddt_head_dim 2048).
- no patch bottleneck (
- 296.1M parameters. Outputs per token: a 16×16×3 pixel patch (x̂) and a 768-d DINOv2-B code (ĉ).
- Path: z_t = t·m_t + (1 − t)·ε, m_t = w_t·x + (1 − w_t)·Φc(x), Φ = PixelShuffle(16) of the normalized DINOv2-B code at std 0.5.
- Loss: squared error on the path velocity v = (m_t − z_t)/(1 − t) + t·ẇ_t·(x − Φc).
- Training: ImageNet-1k, 256 px, AdamW lr 2e-4 (constant after 5 warmup epochs), logit-normal t (−0.8, 0.8), 10% label dropout, bf16, 20 epochs.
Usage
The model class lives in the project code (JiT/denoiser.py, JiT/model_jit.py). Building it needs a CUDA device.
import json, sys, torch
from safetensors.torch import load_file
sys.path.insert(0, "rae_pixel/JiT") # the project code
from main_jit import get_args_parser
from denoiser import Denoiser
args = get_args_parser().parse_args([])
for k, v in json.load(open("training_args.json")).items():
setattr(args, k, v)
args.detour_init = "detour_init_dinov2b_C768.pt"
args.cfg = 1.0 # unguided; CFG also works (trained with 10% label dropout)
args.num_sampling_steps = 50 # Heun
model = Denoiser(args).cuda().eval()
model.load_state_dict(load_file("model_raw.safetensors"))
with torch.no_grad(), torch.autocast("cuda", dtype=torch.bfloat16):
images = model.generate(torch.tensor([207, 88, 279, 417], device="cuda")) # about [-1, 1], shape [4, 3, 256, 256]
images = ((images.float() + 1) / 2).clamp(0, 1)
Samplers: args.sampling_method = "heun" | "euler" | "remix" (remix is the Detour endpoint-remix step), and
args.time_grid = "uniform" | "jump".
Limitations
20-epoch research checkpoint: samples show recognisable objects but also artifacts (16-pixel seams, missing fine detail). Quality at 4 or fewer sampling steps is worse than plain JiT-B; from about 15 network evaluations it is better.