Lotus normals
Lotus from HKUST (Guangzhou): surface normals from one image in one step on a Stable Diffusion UNet, generative (G) or direct (D). Apache-2.0 code and weights.
experimental Fork of EnVision-Research/Lotus@b737e12 · backends: portable, kernels
- Paper Lotus: Diffusion-based Visual Foundation Model for High-quality Dense Prediction ICLR 2025 · first released 26 Sept 2024
Paper 2024 Added in 0.2.0 Evaluated with 0.2.0
Use it
pip install fastforks Lean install with only what this model needs: pip install fastforks-core
from fastforks import depth
model = depth.load("lotus-normal-g-v1-1") # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.normals
result.backend # what ran: mode, device, dtype, kernels fastforks bench lotus-normal-g-v1-1 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)
| Backend | dtype | Time per call (ms) | vs original fp16 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | not measured | – | – | – | – |
| Original fp16the authors' float16 model option; upstream Lotus-G pipeline, diffusers 0.41.0, timestep 999, seed 42 | fp16 | 344 | – | 3,836 MiB/3,898 MiB | 2.2 | 0.50 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 267 | 1.3× | 2,777 MiB/2,940 MiB | 4.4 | 0.59 |
| Kernels | fp16 | 164 | 2.1× | 2,351 MiB/2,500 MiB | 3.5 | 0.38 |
| Portable + torch.compile | 222 | 1.6× | 2,344 MiB/2,416 MiB | 63 (build) | – | |
| TensorRT fp16 | fp16 | 107 | 3.2× | 2,310 MiBenginenot comparable | 183 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-12. 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
| Device | Backend | dtype | ms / call | Peak memory | Output vs reference | Input |
|---|---|---|---|---|---|---|
| Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-12 | Original | fp32 | 39522 | 12.1 GiB process | – | 994x1482 |
| Portable | fp16 | 1553 | 6,632 MiB process | matches | 994x1482 | |
| Portable | fp32 | 2886 | 9,700 MiB process | matches | 994x1482 | |
| Kernels | fp16 | not 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 base (LAION-5B subsets) fine-tuned on the synthetic Hypersim and Virtual KITTI 2 per the Lotus paper (arXiv 2409.18124)
Our reading of the licences, not legal advice.
Weights
unet-g/diffusion_pytorch_model.safetensors 3.5 GB· hosted on Hugging Facevae/diffusion_pytorch_model.safetensors 167 MB· hosted on Hugging Facetext_encoder/model.safetensors 681 MB· hosted on Hugging Facefastforks downloads and checks these files on first use (fastforks download lotus-normal-g-v1-1).
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.
NYUv2 test normals
mean / median angle deg, % < 11.25 / < 30 deg
| Run | dtype | ang_mean ↑ | ang_median ↑ | a11.25 ↑ | a30 ↑ | images | ms / image |
|---|---|---|---|---|---|---|---|
| Original fp32 | not measured | ||||||
| Original fp16 | not measured | ||||||
| Portable fp32 | not measured | ||||||
| Portable | not measured | ||||||
| Kernels | fp16 | 16.61 | 8.98 | 59.73 | 83.32 | 654 | 185 |
The original code was not run on this dataset, so the table cannot show the distance to it.
AbsRel / delta1 after a least-squares scale + shift fit (in disparity space for inverse-depth models), mean over images. Normals: angle to the ground-truth normal over the pixels with ground truth (Marigold's evaluation sets), mean over images. Measured on RTX 5060 Ti, torch 2.14.1+cu130, fastforks 11209576, 2026-11-12.
iBims-1 normals
mean / median angle deg, % < 11.25 / < 30 deg
| Run | dtype | ang_mean ↑ | ang_median ↑ | a11.25 ↑ | a30 ↑ | Δ ang_mean vs fp32 original | images | ms / image |
|---|---|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 16.73 | 7.10 | 67.51 | 83.27 | reference | 100 | 616 |
| Original fp16 | fp16 | 16.73 | 7.10 | 67.51 | 83.28 | −0.00 | 100 | 385 |
| Portable fp32 | fp32 | 16.73 | 7.10 | 67.51 | 83.27 | ±0.00 | 100 | 594 |
| Portable | fp16 | 16.73 | 7.11 | 67.51 | 83.27 | +0.00 | 100 | 299 |
| Kernels | fp16 | 16.73 | 7.10 | 67.51 | 83.27 | +0.00 | 100 | 184 |
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-12; portable fp32, portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 11209576, 2026-11-12.
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.00053 and p99 <= 0.0022 (absolute error of the output normals).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.00001 | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.00053 | 0.0003 |
| GPU default dtypes, p99 |diff| | ≤ 0.0022 | 0.00125 |
Recorded for lotus-normal-g-v1-1 on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-12, with these kernels: cudnn_hacc
Details
Lotus (He et al., ICLR 2025): surface normals by a Stable Diffusion 2 UNet fine-tuned to predict the normals latent in one step; Lotus-G (generative: also denoises a noise latent) and Lotus-D (deterministic), v1.1 (aligned normals).
- 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) andaffine_invariant_inverseare relative (unknown scale or shift, not metres). Metric models that use the focal length takemodel(image, intrinsics=K)(K[3, 3], pixels of the input):metric3d-vit-largeandda3metric-largeneed it for correct metres (da3metric-large: metres = output x focal / 300; withoutintrinsics=a 300 px focal length is assumed, wrong for a real camera).unidepth-v2-vitl14,unik3d-vitl,depth-proand MoGe estimate the camera themselves (givenintrinsics=replacefx);zoedepth-nkand the relative models (da3mono-largetoo) take none. Normals-only models (kindnone) returnresult.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,034 MiB allocated)
- Options
long_side=768>= 0· changes the outputseed=42· changes the output
- Outputs
normals- Checkpoint
generative=true- CUDA kernels
cudnn_haccconvolutions with fp16 accumulation (cuDNN)
- Apple (MPS)
- fp32, fp16
Limitations
- Normals only: no depth.
- Lotus-G: the seeded noise comes from a CPU generator and differs from a CUDA generator's for the same seed (Lotus-D uses it only for the image latent's posterior sample).
- A traced or exported module reuses the noise of its traced shape.
Full reference, generated from the repository
Lotus from HKUST (Guangzhou): surface normals from one image in one step on a Stable Diffusion UNet, generative (G) or direct (D). Apache-2.0 code and weights.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
lotus-normal-g-v1-1 | synthetic (994x1482) | original portable kernels portable + torch.compile TensorRT fp16 | 344 267 164 222 107 | 3836 / 3898 2777 / 2940 2351 / 2500 2344 / 2416 4213 / 4240 |
lotus-normal-d-v1-1 | synthetic (994x1482) | original portable kernels portable + torch.compile TensorRT fp16 | 344 268 164 222 107 | 3835 / 3898 2777 / 2940 2351 / 2500 2344 / 2416 4215 / 4242 |
Details
- Original code: https://github.com/EnVision-Research/Lotus at
b737e12238d2 - Code licence: Apache-2.0 (permissive); files:
LICENSE - Weights licence: Apache-2.0
- Licence evidence: https://github.com/EnVision-Research/Lotus/blob/b737e12238d2a41fc582ee8c6c6b1104d318d799/LICENSE (Apache-2.0); https://huggingface.co/jingheya/lotus-normal-g-v1-1/blob/92b42fd7f5c3f97f09a2af8e96263d87ea899bf1/README.md (license: apache-2.0)
- Training data: Stable Diffusion 2 base (LAION-5B subsets) fine-tuned on the synthetic Hypersim and Virtual KITTI 2 per the Lotus paper (arXiv 2409.18124)
- Options:
long_side= 768 (>= 0; alsoprocessing_res),seed= 42 - Kernel libraries:
cudnn_hacc - Variants:
lotus-normal-g-v1-1,lotus-normal-d-v1-1 - 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):
lotus-normal-g-v1-13000x4000 (3.0 GiB peak allocated, 3.7 reserved);lotus-normal-d-v1-13000x4000 (3.0 GiB peak allocated, 3.7 reserved) lotus-normal-g-v1-1994x1482, first call: portable + torch.compile 63 s (cold Inductor cache), TensorRT fp16 183 s (ONNX + engine).lotus-normal-d-v1-1994x1482, first call: portable + torch.compile 64 s (cold Inductor cache), TensorRT fp16 183 s (ONNX + engine).lotus-normal-g-v1-1original 994x1482: the authors' float16 model option; upstream Lotus-G pipeline, diffusers 0.41.0, timestep 999, seed 42lotus-normal-d-v1-1original 994x1482: the authors' float16 model option; upstream Lotus-D pipeline, diffusers 0.41.0, timestep 999, seed 42lotus-normal-g-v1-1load / first call: original 10.43 s / 1.15 s, portable 4.37 s / 0.588 s, kernels 3.49 s / 0.384 slotus-normal-d-v1-1load / first call: original 2.1 s / 0.556 s, portable 5.48 s / 0.693 s, kernels 2.7 s / 0.317 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. Normals: angle to the ground-truth normal over the pixels with ground truth (Marigold's evaluation sets), mean over images. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp32 | original fp16 | portable | portable fp32 | kernels | note |
|---|---|---|---|---|---|---|---|
lotus-normal-g-v1-1 | NYUv2 test normals, mean / median angle deg, % < 11.25 / < 30 deg | 16.61 / 8.98 / 59.73 / 83.32 | |||||
lotus-normal-g-v1-1 | iBims-1 normals, mean / median angle deg, % < 11.25 / < 30 deg | 16.73 / 7.10 / 67.51 / 83.27 | 16.73 / 7.10 / 67.51 / 83.28 | 16.73 / 7.11 / 67.51 / 83.27 | 16.73 / 7.10 / 67.51 / 83.27 | 16.73 / 7.10 / 67.51 / 83.27 | |
lotus-normal-d-v1-1 | iBims-1 normals, mean / median angle deg, % < 11.25 / < 30 deg | 16.70 / 7.28 / 67.21 / 83.52 | 16.70 / 7.28 / 67.22 / 83.52 | 16.70 / 7.28 / 67.22 / 83.52 | 16.70 / 7.28 / 67.21 / 83.52 | 16.70 / 7.28 / 67.22 / 83.52 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 11209576, 2026-11-12.
Parity
CPU, float32: max |diff| <= 1e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.00053 and p99 <= 0.0022 (absolute error of the output normals).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
lotus-normal-g-v1-1 | 0.0003 / 0.00125 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400 |
lotus-normal-d-v1-1 | 0.00035 / 0.00144 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400 |
Limitations
- Normals only: no depth.
- Lotus-G: the seeded noise comes from a CPU generator and differs from a CUDA generator's for the same seed (Lotus-D uses it only for the image latent's posterior sample).
- A traced or exported module reuses the noise of its traced shape.
Example output
No example rendered for this checkpoint yet.