Marigold normals LCM
Marigold normals LCM from ETH Zurich (PRS): surface normals from one image in one diffusion step on a Stable Diffusion UNet. Apache-2.0 code and weights.
experimental Fork of huggingface/diffusers@086bf95 · backends: portable, kernels
- Paper Marigold: Affordable Adaptation of Diffusion-Based Image Generators for Image Analysis arXiv · first released 14 May 2025
- Authors’ code prs-eth/Marigold (PyTorch), not the code forked here: The prs-eth/marigold-normals-lcm-v0-1 weights are published as a diffusers pipeline, so fastforks follows the diffusers implementation rather than the authors' own repository.
Checkpoint marigold-normals-lcm-v0-1
Paper 2025 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("marigold-normals-lcm-v0-1") # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.normals
result.backend # what ran: mode, device, dtype, kernels fastforks bench marigold-normals-lcm-v0-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; diffusers v0.41.0 MarigoldNormalsPipeline, 1 LCM step, CPU generator seed 2024 | fp16 | 280 | – | 3,441 MiB/3,640 MiB | 1.2 | 0.82 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 272 | 1.0× | 2,792 MiB/2,960 MiB | 4.1 | 0.62 |
| Kernels | fp16 | 167 | 1.7× | 2,361 MiB/2,500 MiB | 8.2 | 0.47 |
| Portable + torch.compile | 223 | 1.3× | 2,348 MiB/2,436 MiB | 64 (build) | – | |
| TensorRT fp16 | fp16 | 109 | 2.6× | 2,320 MiBenginenot comparable | 182 (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 | 2639 | 10.1 GiB process | – | 994x1482 |
| Portable | fp16 | 1655 | 6,671 MiB process | matches | 994x1482 | |
| Portable | fp32 | 2075 | 9,727 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 LICENSELICENSE-huggingface
- Weights
- Apache-2.0 source
- Training data
- Stable Diffusion 2 (LAION-5B subsets) fine-tuned on the synthetic Hypersim, Virtual KITTI 2 and other synthetic datasets per the Marigold paper (arXiv 2505.09358), then LCM-distilled
Our reading of the licences, not legal advice.
Weights
unet/diffusion_pytorch_model.safetensors 3.5 GB· hosted on Hugging Facevae/diffusion_pytorch_model.safetensors 335 MB· hosted on Hugging Facetext_encoder/model.safetensors 1.4 GB· hosted on Hugging Facefastforks downloads and checks these files on first use (fastforks download marigold-normals-lcm-v0-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 ↑ | Δ ang_mean vs fp32 original | images | ms / image |
|---|---|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 18.45 | 10.22 | 55.53 | 80.76 | reference | 654 | 610 |
| Original fp16 | fp16 | 18.46 | 10.22 | 55.52 | 80.76 | +0.00 | 654 | 307 |
| Portable fp32 | fp32 | 18.45 | 10.22 | 55.53 | 80.76 | ±0.00 | 654 | 595 |
| Portable | fp16 | 18.46 | 10.22 | 55.52 | 80.76 | +0.00 | 654 | 299 |
| Kernels | fp16 | 18.46 | 10.22 | 55.52 | 80.76 | +0.00 | 654 | 184 |
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 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 7cecd6cb, 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 | 17.21 | 7.33 | 66.82 | 82.84 | reference | 100 | 609 |
| Original fp16 | fp16 | 17.20 | 7.33 | 66.81 | 82.85 | −0.00 | 100 | 307 |
| Portable fp32 | fp32 | 17.21 | 7.33 | 66.82 | 82.84 | −0.00 | 100 | 595 |
| Portable | fp16 | 17.21 | 7.33 | 66.81 | 82.84 | +0.00 | 100 | 299 |
| Kernels | fp16 | 17.21 | 7.33 | 66.81 | 82.84 | +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 7cecd6cb, 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.00052 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.00052 | 0.00034 |
| GPU default dtypes, p99 |diff| | ≤ 0.0022 | 0.00146 |
Recorded for marigold-normals-lcm-v0-1 on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-12, with these kernels: cudnn_hacc
Details
Marigold normals (Ke et al. 2023/2025): surface normals by diffusion; a Stable Diffusion 2 UNet fine-tuned to denoise a normals latent conditioned on the image latent, distilled to one LCM step (v0.1).
- 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
steps=11 to 50· changes the outputlong_side=768>= 0· changes the outputseed=2024· 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 and differs from a CUDA generator's for the same seed.
- A traced or exported module reuses the noise of its traced shape.
Full reference, generated from the repository
Marigold normals LCM from ETH Zurich (PRS): surface normals from one image in one diffusion step on a Stable Diffusion UNet. Apache-2.0 code and weights.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
marigold-normals-lcm-v0-1 | synthetic (994x1482) | original portable kernels portable + torch.compile TensorRT fp16 | 280 272 167 223 109 | 3441 / 3640 2792 / 2960 2361 / 2500 2348 / 2436 4220 / 4250 |
Details
- Original code: https://github.com/huggingface/diffusers at
086bf95 - Code licence: Apache-2.0 (permissive); files:
LICENSE,LICENSE-huggingface - Weights licence: Apache-2.0
- Licence evidence: https://huggingface.co/prs-eth/marigold-normals-lcm-v0-1/blob/28214f06633a6a73088b569d1d068c3e48ea7902/README.md (license: apache-2.0)
- Training data: Stable Diffusion 2 (LAION-5B subsets) fine-tuned on the synthetic Hypersim, Virtual KITTI 2 and other synthetic datasets per the Marigold paper (arXiv 2505.09358), then LCM-distilled
- Options:
steps= 1 (1 to 50),long_side= 768 (>= 0; alsoprocessing_res),seed= 2024 - Kernel libraries:
cudnn_hacc - Variants:
marigold-normals-lcm-v0-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):
marigold-normals-lcm-v0-13000x4000 (3.0 GiB peak allocated, 3.8 reserved) marigold-normals-lcm-v0-1994x1482, first call: portable + torch.compile 64 s (cold Inductor cache), TensorRT fp16 182 s (ONNX + engine).marigold-normals-lcm-v0-1original 994x1482: the authors' float16 model option; diffusers v0.41.0 MarigoldNormalsPipeline, 1 LCM step, CPU generator seed 2024marigold-normals-lcm-v0-1load / first call: original 6.02 s / 2.856 s, portable 4.11 s / 0.617 s, kernels 8.22 s / 0.468 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 |
|---|---|---|---|---|---|---|---|
marigold-normals-lcm-v0-1 | NYUv2 test normals, mean / median angle deg, % < 11.25 / < 30 deg | 18.45 / 10.22 / 55.53 / 80.76 | 18.46 / 10.22 / 55.52 / 80.76 | 18.46 / 10.22 / 55.52 / 80.76 | 18.45 / 10.22 / 55.53 / 80.76 | 18.46 / 10.22 / 55.52 / 80.76 | |
marigold-normals-lcm-v0-1 | iBims-1 normals, mean / median angle deg, % < 11.25 / < 30 deg | 17.21 / 7.33 / 66.82 / 82.84 | 17.20 / 7.33 / 66.81 / 82.85 | 17.21 / 7.33 / 66.81 / 82.84 | 17.21 / 7.33 / 66.82 / 82.84 | 17.21 / 7.33 / 66.81 / 82.84 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 7cecd6cb, 2026-11-12.
Parity
CPU, float32: max |diff| <= 1e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.00052 and p99 <= 0.0022 (absolute error of the output normals).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
marigold-normals-lcm-v0-1 | 0.00034 / 0.00146 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400 |
Limitations
- Normals only: no depth.
- Diffusion model: the seeded noise comes from a CPU generator and differs from a CUDA generator's for the same seed.
- A traced or exported module reuses the noise of its traced shape.
Example output
No example rendered for this checkpoint yet.