Instructions to use batteryphil/TripoSG-PRIME-Quant with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use batteryphil/TripoSG-PRIME-Quant with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("batteryphil/TripoSG-PRIME-Quant", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("batteryphil/TripoSG-PRIME-Quant", dtype=torch.bfloat16, device_map="cuda")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]
TripoSG (1.5B 3D Flow DiT + DINOv2-Large) β PRIME-Quant (100% V3_P4_0)
A 100% 4-bit Prime-Harmonic (V3_P4_0) quantization of VAST-AI/TripoSG (1.5B 3D Rectified-Flow DiT + DINOv2-Large image encoder, upstream MIT license) built with PRIME-Quant (@batteryphil).
Compresses the 6.98 GB FP32 (3.49 GB BF16) DINOv2-Large + 1.5B 3D DiT weights down to 0.98 GB on disk (7.1Γ vs FP32 / 3.55Γ vs BF16) β running 100% GPU-resident in 1.48 GB VRAM (2.66 GB peak including 256Β³ SDF marching cubes) on 4 GB+ AMD ROCm or NVIDIA CUDA GPUs, with zero CUDA-only extensions (diso/spconv/nvdiffrast not required).
Verified Benchmark Results (AMD RX 9060 XT 16 GB, ROCm 7.2)
All measurements freshly executed end-to-end (FLUX.1-schnell PRIME-Quant β TripoSG 3D .glb, 30 steps, CFG 7.0, 256Β³ hierarchical marching cubes, benchmarks/triposg_bf16_vs_prime_benchmark.json):
| Metric | BF16 Teacher | PRIME-Quant (100% V3_P4_0, Zero CPU Offload) |
|---|---|---|
Disk Weights (DINOv2 + 1.5B DiT) |
6.98 GB FP32 / 3.49 GB BF16 |
0.98 GB (174.7 MB DINOv2 + 810.8 MB DiT β 7.1Γ / 3.55Γ) |
| Quantized Linear Coverage | 0 / 368 |
368 / 368 (100% V3_P4_0) |
| Total GPU-Resident VRAM (incl. SDF VAE) | 3,865.3 MB |
1,478.7 MB (1.48 GB) |
Peak PyTorch VRAM (256Β³ SDF Decode) |
5,047.8 MB |
2,661.4 MB (2.66 GB) (fits 4 GB GPUs!) |
Mean Time / Watertight 3D .glb Mesh |
18.72 s |
18.96 s (~1.0Γ parity) |
Per-Asset 3D Geometry Parity (20,000 Sampled Surface Points vs. BF16 Teacher)
3D Asset (Input from FLUX.1-schnell PRIME-Quant) |
Chamfer-L1 | F-Score @0.02 | F-Score @0.05 | Normal Consistency | Watertight |
|---|---|---|---|---|---|
01_knight_helmet (268K verts / 536K faces) |
0.00869 |
92.35% |
99.28% |
0.8334 |
Yes |
02_scifi_mech (302K verts / 605K faces) |
0.01235 |
86.66% |
100.00% |
0.7798 |
Yes |
03_treasure_chest (145K verts / 290K faces)* |
0.04488* |
27.45%* |
57.02%* |
0.7026 |
Yes |
*On 03_treasure_chest, BF16 extruded a stray floor-shadow skirt beside the base whereas PRIME-Quant produced a cleaner shadow-free chest β shifting raw Chamfer distance against BF16's stray geometry.
Visual 4-View Studio Clay Parity (Top = BF16 Teacher, Bottom = 100% PRIME-Quant V3_P4_0)
(Full watertight .glb pairs for all assets are included in benchmarks/.)
Quantization Architecture Highlights
- Exact Interleaved-QKV/KV
H_128Walsh-Hadamard Rotation:TripoSGAttnProcessor2_0packsQ/K/Vinterleaved per head acrossto_q/to_k/to_v. Rotating the true per-headVslices againstto_out.0achieves52.5 dBverified BF16 invariance (22.55 dBmean /21.44 dBfloor across all 21 DiT blocks). DINOv2-LargeExactH_64Rotation: Verified67.1 dBBF16 invariance (174.7 MB,0.9849end-to-end embedding cosine similarity vs. BF16).- 4,096-Timestep
time_projPRIMAL: Calibrated across[0, 1000]to55.17 dBvalidation SNR. - Pure-PyTorch ROCm &
diffusers>=0.38Ready: Bundled patchedtriposg/replaces CUDA-onlydisowithskimage.measure.marching_cubesand addstorch.nn.LayerNormcompatibility.
Quickstart (Standalone β Zero Extra Repos or C++ Compiles Required)
pip install -r requirements.txt
TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1 \
python run_triposg_prime.py \
--image benchmarks/01_knight_helmet_input.png \
--steps 30 --octree-depth 8 --seed 101 \
--output knight_helmet_prime.glb
Licensing & Attribution
- PRIME-Quant checkpoints & standalone runtime (
prime_infer_runtime.py,run_triposg_prime.py): Copyright (c) 2026 Philip Bartsch (@batteryphil), licensed under the Bartsch Personal-Free & 5% Commercial Profit-Share License v1.0 (free for personal, research, academic, and non-profit use). - Upstream Base Model & Bundled
triposg/Pipeline (VAST-AI/TripoSG): MIT License by VAST-AI Research β see NOTICE.
- Downloads last month
- -
Model tree for batteryphil/TripoSG-PRIME-Quant
Base model
VAST-AI/TripoSG

