Models · Monocular depth

StableNormal turbo

StableNormal turbo from Stable-X (Ye et al., SIGGRAPH Asia 2024): surface normals from one image in one step on a Stable Diffusion UNet with a ControlNet image encoder. Apache-2.0 code and weights.

experimental Fork of Stable-X/StableNormal@594b934 · backends: portable, kernels

Checkpoint stablenormal-turbo

Paper 2024 Added in 0.2.0 Evaluated with 0.2.0

Kernels, RTX 5060 Ti 16 GB 180 ms 994x1482, fp16
vs the faster original 1.7× original fp16: 299 ms
Peak memory 3,037 MiB original: 4,156 MiB
Accuracy vs original fp32 −0.00 kernels ang_mean, iBims-1 normals (17.46 original)

Use it

pip install fastforks

Lean install with only what this model needs: pip install fastforks-core

from fastforks import depth

model = depth.load("stablenormal-turbo")  # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.normals
result.backend  # what ran: mode, device, dtype, kernels
fastforks bench stablenormal-turbo

Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.

Speed and memory

Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.

Input: synthetic, 994x1482 (the task’s standard size)

BackenddtypeTime per call (ms)vs original fp16Peak memory
allocated / reserved
Load (s)First call (s)
Original fp32fp32not measured ––––
Original fp16the authors' mixed-precision option (float16); upstream YOSONormalsPipeline (turbo, t_start 0), diffusers 0.41.0, latents seed 0fp16 299–4,156 MiB/4,374 MiB0.90.54
Portable fp32fp32not measured ––––
Portablefp16 2891.0×3,463 MiB/3,628 MiB2.90.54
Kernelsfp16 1801.7×3,037 MiB/3,172 MiB3.30.35
Portable + torch.compile 2381.3×3,019 MiB/3,106 MiB76 (build)–
TensorRT fp16fp16 1182.5×3,016 MiBenginenot comparable199 (build)–

Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-13. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.

Other devices

DeviceBackenddtypems / callPeak memoryOutput vs referenceInput
Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-13Originalfp3251987 11.2 GiB process–994x1482
Portablefp161690 8,985 MiB processmatches994x1482
Portablefp322718 10.8 GiB processmatches994x1482
Kernelsfp16not implemented–994x1482

CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.

Licence and weights

Commercial use allowed

Code
Apache-2.0 LICENSE
Weights
Apache-2.0 source
Training data
Stable Diffusion 2 (LAION-5B subsets) fine-tuned on synthetic and real normals datasets (Hypersim, Replica, ScanNet and others per the StableNormal paper, arXiv 2406.16864)

Our reading of the licences, not legal advice.

Weights

unet/diffusion_pytorch_model.fp16.safetensors 1.7 GB· hosted on Hugging Face
vae/diffusion_pytorch_model.fp16.safetensors 167 MB· hosted on Hugging Face
text_encoder/model.fp16.safetensors 681 MB· hosted on Hugging Face
controlnet/diffusion_pytorch_model.fp16.safetensors 728 MB· hosted on Hugging Face

fastforks downloads and checks these files on first use (fastforks download stablenormal-turbo).

Accuracy

The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.

iBims-1 normals

mean / median angle deg, % < 11.25 / < 30 deg

Rundtypeang_mean ↑ang_median ↑a11.25 ↑a30 ↑Δ ang_mean vs fp32 originalimagesms / image
Original fp32fp3217.468.2663.8382.71 reference 100 669
Original fp16fp1617.468.2663.8382.70 −0.00 100 328
Portable fp32fp3217.468.2663.8382.71 ±0.00 100 652
Portablefp1617.468.2663.8382.71 −0.00 100 317
Kernelsfp1617.468.2663.8382.71 −0.00 100 198

AbsRel / delta1 after a least-squares scale + shift fit (in disparity space for inverse-depth models), mean over images. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-13; portable fp32, portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks aee4b565, 2026-11-13.

Closeness to the original

Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. CPU, float32: max |diff| <= 1e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.00046 and p99 <= 0.0021 (absolute error of the output normals).

CheckToleranceMeasured
CPU fp32, max |diff|≤ 0.00001 not recorded
GPU default dtypes, mean |diff|≤ 0.00046 0.0003
GPU default dtypes, p99 |diff|≤ 0.0021 0.00138

Recorded for stablenormal-turbo on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-13, with these kernels: cudnn_hacc

Details

StableNormal turbo (Ye et al., SIGGRAPH Asia 2024): surface normals in one step (YOSO, v0.3); a Stable Diffusion 2 UNet denoises a normals latent with the image latent fed through a ControlNet encoder.

Input / output
Input: one RGB image. Output: a depth or inverse-depth map.
What the numbers mean, and which models need the camera focal length

kind (a card field, result.kind) says what the numbers mean: metric = metres; scale_invariant, affine_invariant, affine_invariant_log (log depth) and affine_invariant_inverse are relative (unknown scale or shift, not metres). Metric models that use the focal length take model(image, intrinsics=K) (K [3, 3], pixels of the input): metric3d-vit-large and da3metric-large need it for correct metres (da3metric-large: metres = output x focal / 300; without intrinsics= a 300 px focal length is assumed, wrong for a real camera). unidepth-v2-vitl14, unik3d-vitl, depth-pro and MoGe estimate the camera themselves (given intrinsics= replace fx); zoedepth-nk and the relative models (da3mono-large too) take none. Normals-only models (kind none) return result.normals [B, H, W, 3] (unit vectors, camera frame: x right, y down, z forward).

Input size
any H x W >= 1, resized or padded inside the model; tested up to 3000x4000 (3,710 MiB allocated)
Options
  • long_side=768>= 0· changes the output
  • seed=0· changes the output
Outputs
normals
CUDA kernels
  • cudnn_haccconvolutions with fp16 accumulation (cuDNN)
Apple (MPS)
fp32, fp16

Limitations

  • Normals only: no depth.
  • Diffusion model: the seeded noise comes from a CPU generator; upstream draws it from the unseeded global RNG, so its outputs vary from call to call (slightly).
  • Upstream's `Predictor` wrapper (pre-resize to a multiple of 64 near 1024 px, uint8 round trip, LANCZOS back) is not applied: the runners follow its pipeline (768 px).
  • A traced or exported module reuses the noise of its traced shape.
Full reference, generated from the repository

StableNormal turbo from Stable-X (Ye et al., SIGGRAPH Asia 2024): surface normals from one image in one step on a Stable Diffusion UNet with a ControlNet image encoder. Apache-2.0 code and weights.

Commercial use: yes.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
stablenormal-turbosynthetic (994x1482)original
portable
kernels
portable + torch.compile
TensorRT fp16
299
289
180
238
118
4156 / 4374
3463 / 3628
3037 / 3172
3019 / 3106
5587 / 5626
Details
  • Original code: https://github.com/Stable-X/StableNormal at 594b934630ab
  • Code licence: Apache-2.0 (permissive); files: LICENSE
  • Weights licence: Apache-2.0
  • Licence evidence: https://github.com/Stable-X/StableNormal/blob/594b934630ab3bc71f35c77d14ec7feb98480cd0/LICENSE.txt (Apache-2.0); https://huggingface.co/Stable-X/yoso-normal-v0-3/blob/2202fcb69960d94b437e06c19c556a12ceeb57c0/README.md (license: apache-2.0)
  • Training data: Stable Diffusion 2 (LAION-5B subsets) fine-tuned on synthetic and real normals datasets (Hypersim, Replica, ScanNet and others per the StableNormal paper, arXiv 2406.16864)
  • Options: long_side = 768 (>= 0; also processing_res), seed = 0
  • Kernel libraries: cudnn_hacc
  • Variants: stablenormal-turbo
  • Outputs: normals; kind: none
  • Input size: any H x W >= 1, resized or padded inside the model
  • Tested up to (portable, fp16, RTX 5060 Ti 16 GB): stablenormal-turbo 3000x4000 (3.6 GiB peak allocated, 4.8 reserved)
  • stablenormal-turbo 994x1482, first call: portable + torch.compile 76 s (cold Inductor cache), TensorRT fp16 198 s (ONNX + engine).
  • stablenormal-turbo original 994x1482: the authors' mixed-precision option (float16); upstream YOSONormalsPipeline (turbo, t_start 0), diffusers 0.41.0, latents seed 0
  • stablenormal-turbo load / first call: original 6.36 s / 1.128 s, portable 2.94 s / 0.544 s, kernels 3.25 s / 0.352 s
  • Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5

Measured

AbsRel / delta1 after a least-squares scale + shift fit (in disparity space for inverse-depth models), mean over images. Original = the original code named under Details, same checkpoint and protocol.

variantdatasetoriginal fp32original fp16portableportable fp32kernelsnote
stablenormal-turboiBims-1 normals, mean / median angle deg, % < 11.25 / < 30 deg17.46 / 8.26 / 63.83 / 82.7117.46 / 8.26 / 63.83 / 82.7017.46 / 8.26 / 63.83 / 82.7117.46 / 8.26 / 63.83 / 82.7117.46 / 8.26 / 63.83 / 82.71

Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks aee4b565, 2026-11-13.

Parity

CPU, float32: max |diff| <= 1e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.00046 and p99 <= 0.0021 (absolute error of the output normals).

variantkernels error vs original, mean / p99GPU, torchkernels used
stablenormal-turbo0.0003 / 0.00138RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400

Limitations

  • Normals only: no depth.
  • Diffusion model: the seeded noise comes from a CPU generator; upstream draws it from the unseeded global RNG, so its outputs vary from call to call (slightly).
  • Upstream's Predictor wrapper (pre-resize to a multiple of 64 near 1024 px, uint8 round trip, LANCZOS back) is not applied: the runners follow its pipeline (768 px).
  • A traced or exported module reuses the noise of its traced shape.

Example output

No example rendered for this checkpoint yet.