Marigold normals LCM (fastforks)
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).
This repo is the model card only: it holds no weights. fastforks downloads the authors' weights from the links below and checks them against the SHA-256 in the model card. Code: https://github.com/kleinicke/fastforks. Kernels for the kernels backend: https://huggingface.co/fastforks/kernels. Original code: https://github.com/huggingface/diffusers at 086bf95.
Author weight repos: https://huggingface.co/prs-eth/marigold-normals-lcm-v0-1.
Task: depth. Tier: experimental. Outputs: normals. Backends: portable, kernels.
Input: one RGB image. Output: a depth or inverse-depth map. 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).
Variants
Weights are the authors' files (not hosted here). SHA-256 shortened to 12 hex digits; the full hashes are in card.toml.
| variant | weights (author link) | SHA-256 | weights licence | commercial use |
|---|---|---|---|---|
marigold-normals-lcm-v0-1@1 |
unet/diffusion_pytorch_model.safetensors vae/diffusion_pytorch_model.safetensors text_encoder/model.safetensors |
cce4441193eba1d9934885691e4aa519f64d |
Apache-2.0 | yes |
Licence
Original-code strings, recorded as they are (research-use package; check them before any other use). Code: Apache-2.0. Licence files: LICENSE, LICENSE-huggingface.
Derived from Stable Diffusion 2: the CreativeML OpenRAIL++-M use restrictions (Attachment A, https://huggingface.co/stabilityai/stable-diffusion-2/blob/main/LICENSE-MODEL) apply to these weights and to their redistribution, in addition to the terms above.
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.
Licence evidence: https://huggingface.co/prs-eth/marigold-normals-lcm-v0-1/blob/28214f06633a6a73088b569d1d068c3e48ea7902/README.md (license: apache-2.0)
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-1 3000x4000 (3.0 GiB peak allocated, 3.8 reserved)
Speed and memory
Depth, synthetic
| model | input | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
|---|---|---|---|---|---|---|---|---|---|---|
marigold-normals-lcm-v0-1 |
994x1482 | β | 280 | 272 | 167 | 1.7x | 1.6x | 3441 / 3640 | 2792 / 2960 | 2361 / 2500 |
Startup and first call
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
|---|---|---|---|---|---|---|
marigold-normals-lcm-v0-1 |
6.02 | 4.11 | 8.22 | 2.86 | 0.62 | 0.47 |
torch.compile and TensorRT
| model | input | time: portable | compile | TensorRT fp16 | kernels | preparation: compile (cold first call) | ONNX + engine build | peak MiB (alloc / reserved): portable | compile | kernels | TensorRT (engine + torch) |
|---|---|---|---|---|---|---|---|---|---|---|---|
marigold-normals-lcm-v0-1 |
994x1482 | 272 ms | 223 ms | 109 ms | 167 ms | 64.5 s | 182 s | 2792 / 2960 | 2348 / 2436 | 2361 / 2500 | 4220 / 4250 |
Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).
Hardware, protocol and caveats: benchmarks (RTX 5060 Ti 16 GB, sm_120). Original = the original code named above at the precision of portable (fp16, or (fp32) where fp16 is unsupported or not finite); original fp32 = its default fp32 run. Peak memory is the torch allocator's.
Accuracy
On public datasets
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 | 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.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.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 with the original code
Every variant is checked against reference outputs of the original code at its pinned commit. 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).
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.
Usage
from fastforks import depth
model = depth.load("marigold-normals-lcm-v0-1") # mode="auto": the preferred backend from recorded measurements
result = model("room.jpg")
result.normals # [H, W] float32 tensor; result.kind says what the maps mean
# models that take a camera: model("room.jpg", intrinsics=K), K [3, 3] in pixels
result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')
Install with pip install fastforks (see https://github.com/kleinicke/fastforks). Other variants: marigold-normals-lcm-v0-1.
Kernels backend
depth.load("marigold-normals-lcm-v0-1", mode="kernels") runs our CUDA kernels (cudnn_hacc). It needs a prebuilt kernel for your GPU architecture (downloaded from https://huggingface.co/fastforks/kernels on first use) and a recent NVIDIA driver; if there is none it raises BackendUnavailableError with the reason and never falls back silently. mode="auto" picks kernels when it can run and logs the choice.
Model tree for fastforks/marigold-normals
Base model
prs-eth/marigold-normals-lcm-v0-1