Downloads · 30 days
0
aipracticecafe/dual-stream-dit
dual-stream-dit is a text-to-image model from aipracticecafe. Use it when you need an image from a text prompt. It is set up for diffusers. The card lists the license as openrail++.
An ultra-efficient, 200M-parameter Dual-Stream Diffusion Transformer (DiT) trained from scratch on consumer hardware (1x NVIDIA RTX 4090 in ~50 hours) using Rectified Flow / Flow Matching, SPRINT token-dropping, and C…
Downloads · 30 days
0
Access
Public
Updated Oct 12, 2026
Repo size
107 GB
Likes
6
Trending 1
Click a slice to open those files.
.safetensors55.5 GB · 52%
From the Hugging Face model README
An ultra-efficient, 200M-parameter Dual-Stream Diffusion Transformer (DiT) trained from scratch on consumer hardware (1x NVIDIA RTX 4090 in ~50 hours) using Rectified Flow / Flow Matching, SPRINT token-dropping, and Continuous Aspect-Normalized RoPE.
Despite its compact size, the model generates high-fidelity anime art with accurate character reproduction, prompt alignment, and zero-shot camera control (panning and zoom) at inference time.
The base architecture is based on the results from (i1: A Simple and Fully Open Recipe for Strong Text-to-Image Models)[https://arxiv.org/abs/2606.11289]
Based on the Patch Diffusion: Faster and More Data-Efficient implementation proposed in the HDM paper. Early experiments with discrete integer position IDs caused severe multi-head replication when deviating from trained aspect ratios. We resolve this by adopting continuous aspect-normalized coordinate mapping which was the original idea proposed in HDM:
$$r_H = \sqrt{\frac{H}{W}}, \quad r_W = \sqrt{\frac{W}{H}}$$
$$y_{\text{pos}} = \left(\frac{y_{\text{center}}}{H}\right) \cdot (2 r_H) - r_H, \quad x_{\text{pos}} = \left(\frac{x_{\text{center}}}{W}\right) \cdot (2 r_W) - r_W$$
Manipulating $(x_{\text{pos}}, y_{\text{pos}})$ directly controls the visual framing at inference time:
LiquidAI/LFM2.5-230M (unidirectional causal LM hidden
states passed via a 2-layer Transformer Text Adapter).kaiyuyue/FLUX.2-dev-vae (C=32, f=8,
patch size p=2, effective image token size 16x16).The model uses progressive multi-resolution pretraining on 337,000 curated Danbooru samples with shifted square cropping and in-RAM latent caching.
bitsandbytes), $\beta=(0.9, 0.95)$, WD=0.01torch.bfloat16 with torch.compile)| Phase | Epochs | Token Drop | RoPE Mode | Description |
|---|---|---|---|---|
| 1A | 0 – 100 | 0.75 (SPRINT) | Discrete | Rapid macro semantic convergence |
| 1B | 100 – 120 | 0.75 (SPRINT) | Continuous | RoPE coordinate adaptation |
| 1C | 120 – 145 | 0.00 (Dense) | Continuous | Full-sequence detail refinement |
| 1D | 145 – 170 | 0.00 (Dense) | Continuous | WSD cosine learning rate decay |
| Phase | Epochs | Token Drop | RoPE Mode | Description |
|---|---|---|---|---|
| 2A | 170 – 194 (25 ep) | 0.75 (SPRINT) | Continuous | High-res structural adaptation |
| 2B | 194 – 204 (10 ep) | 0.00 (Dense) | Continuous | Fine-tuning with constant LR |
| 2C | 204 – 209 (5 ep) | 0.00 (Dense) | Continuous | Final cosine annealing decay |
| Checkpoint Directory | Stage | Epoch / Step | Recommended Usage |
|---|---|---|---|
epoch_169_step_229206 | Stage 1 Final | Ep 169 (Step 229k) | Final 256px decayed checkpoint |
epoch_194_step_265389 | Stage 2A Final | Ep 194 (Step 265k) | Fast 512px SPRINT-sparse checkpoint |
epoch_204_step_281281 | Stage 2B Final | Ep 204 (Step 281k) | Dense 512px pre-decay checkpoint |
epoch_209_step_290199 | Stage 2 Final | Ep 209 (Step 290k) | Recommended for 512px–768px inference |
Figure: 512px generations demonstrating improved micro-texture, eyes,
and line definition achieved in Stage 2.
The training repository has a simple Gradio UI to perform sampling with camera controls. ui_app.py
1girl/1boy, character name, series name, artists, rating, quality tags, actions/clothing
Negative prompt:
sketch, monochrome, english text, realistic, traditional media, very displeasing, displeasing, bad score, worse score, bad quality,worst quality, worst detail, watermark, signature, blurry, bad hands, bad anatomy, bad fingers, extra fingers, extra limbs, deformed limbs, comic, speech bubble, lowres
import torch
from omegaconf import OmegaConf
from src.models.factory import load_trainable_model
from src.diffusion.schedules import LinearSchedule
from src.diffusion.sampling import generate_samples
cfg = OmegaConf.load("config.yaml")
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
dtype = torch.bfloat16
unet, text_encoder, vae, tokenizer, _ = load_trainable_model(
models_path=cfg.paths.models,
device=device,
dtype=dtype,
resume_from_checkpoint="path_to_checkpoint",
model_type="sprint_dual",
model_cfg=cfg.models,
autocast_dtype=dtype,
)
schedule = LinearSchedule(device=device)
sample_configs = [
{
"prompt": "1girl, souryuu asuka langley, neon genesis evangelion, "
"masterpiece, absurdres",
"negative_prompt": "very displeasing, displeasing, bad score",
"height": 256,
"width": 384,
"sample_steps": 30,
"cfg_scale": 6.0,
"shift": 1.0,
"zoom": 1.0,
"x_shift": 0.0,
"y_shift": 0.0,
"seed": 42,
}
]
images = generate_samples(
unet=unet,
text_encoder=text_encoder,
tokenizer=tokenizer,
vae=vae,
schedule=schedule,
sample_configs=sample_configs,
global_batch_size=1,
diffusion_type="flow_matching",
device=device,
dtype=dtype,
autocast_dtype=dtype,
use_unet_mult=False,
vae_mean=cfg.models.vae_mean,
vae_std=cfg.models.vae_std,
in_channels=cfg.models.in_channels,
coord_system="aspect_norm",
)
images[0].save("output.png")
epoch_209_* are natively optimized
for 512px generation and reliably scale up to 768px/1024px with aspect-normalized
RoPE. Native 1024px fidelity will be unlocked upon completion of Stage 3.g, s, q, e ratings). Use appropriate tag filtering during training if a SFW-only model is required.This model is licensed under the CreativeML Open RAIL++-M License. You are free to use, modify, and distribute the model weights provided you include the license text and respect the behavioral use restrictions.