Models · Monocular depth

Marigold

Marigold from ETH Zurich (PRS): depth from one image by diffusion on a Stable Diffusion UNet. Commercially usable under an OpenRAIL licence.

stable Fork of prs-eth/Marigold@2bfbdea · backends: portable, kernels

Checkpoint marigold-depth-v1-1

Paper 2023 Added in 0.1.0 Evaluated with 0.2.0

Kernels, RTX 5060 Ti 16 GB 261 ms 994x1482, fp16
vs the faster original 1.7× original fp16: 439 ms
Peak memory 2,343 MiB original: 3,414 MiB
Accuracy vs original fp32 ±0.0000 kernels AbsRel, NYUv2 test (0.0561 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("marigold-depth-v1-1")  # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.depth
result.backend  # what ran: mode, device, dtype, kernels
fastforks bench marigold-depth-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.

BackenddtypeTime per call (ms)vs original fp16Peak memory
allocated / reserved
Load (s)First call (s)
Original fp32fp32 9630.46×6,406 MiB/6,804 MiB14.11.61
Original fp16the authors' float16 model option; fp16 = upstream's own torch_dtype=float16 pipelinefp16 439–3,414 MiB/3,580 MiB1.30.60
Portable fp32fp32not measured ––––
Portablefp16 4101.1×2,776 MiB/2,938 MiB11.00.41
Kernelsfp16 2611.7×2,343 MiB/2,500 MiB2.50.26
Portable + torch.compile 3421.3×2,341 MiB/2,418 MiB127 (build)–
TensorRT fp16fp16 1722.6×2,368 MiBenginenot comparable285 (build)–

Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-06 to 2026-11-15. 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-12Originalfp323237 10.2 GiB processmatches994x1482
Portablefp162498 6,640 MiB processmatches994x1482
Portablefp322970 9,709 MiB processmatches994x1482
Kernelsfp16not implemented–994x1482
NVIDIA L4 CUDA, torch 2.14.1+cu130, 2026-11-08Portablefp16457 2,756 MiB/2,920 MiB–994x1482
Kernelsfp16346 2,331 MiB/2,480 MiB–994x1482
NVIDIA L40S CUDA, torch 2.14.1+cu130, 2026-11-08Portablefp16140 2,756 MiB/2,920 MiB–994x1482
Kernelsfp16128 2,331 MiB/2,480 MiB–994x1482
NVIDIA A10 CUDA, torch 2.14.1+cu130, 2026-11-08Portablefp16341 2,756 MiB/2,920 MiB–994x1482
Kernelsfp16260 2,331 MiB/2,480 MiB–994x1482
NVIDIA A100-SXM4-40GB CUDA, torch 2.14.1+cu130, 2026-11-07Portablefp16177 2,756 MiB/2,920 MiB–994x1482
Kernelsfp16200 2,521 MiB/2,622 MiB–994x1482
NVIDIA RTX PRO 6000 CUDA, torch 2.14.1+cu130, 2026-11-08Portablefp1699.7 2,780 MiB/2,940 MiB–994x1482
Kernelsfp1674.8 2,355 MiB/2,500 MiB–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-MODELLICENSE-huggingface
Weights
LicenseRef-CreativeML-OpenRAIL-PlusPlus-M source
Training data
Stable Diffusion 2 (LAION-5B subsets) fine-tuned on the synthetic Hypersim and Virtual KITTI 2 datasets per the Marigold papers (arXiv 2312.02145, 2505.09358)
  • The weights use the OpenRAIL++-M licence: commercial use is allowed but with use restrictions that must be passed on; the training data terms are not checked.

Our reading of the licences, not legal advice.

Weights

unet/diffusion_pytorch_model.safetensors 3.5 GB· hosted on Hugging Face
vae/diffusion_pytorch_model.safetensors 335 MB· hosted on Hugging Face
text_encoder/model.safetensors 1.4 GB· hosted on Hugging Face

fastforks downloads and checks these files on first use (fastforks download marigold-depth-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

AbsRel / delta1

RundtypeAbsRel ↓δ1 ↑Δ AbsRel vs fp32 originalimagesms / image
Original fp32fp320.05610.9703 reference 654 1070
Original fp16fp160.05610.9703 ±0.0000 654 470
Portable fp32fp320.05610.9703 ±0.0000 654 1047
Portablefp160.05610.9703 ±0.0000 654 456
Kernelsfp160.05610.9703 ±0.0000 654 433

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-11; portable fp32: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 6d3bab64, 2026-11-17; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 939adfe8, 2026-11-06.

iBims-1

AbsRel / delta1

RundtypeAbsRel ↓δ1 ↑Δ AbsRel vs fp32 originalimagesms / image
Original fp32fp320.04990.9721 reference 100 1075
Original fp16fp160.04990.9721 ±0.0000 100 472
Portable fp32fp320.04990.9721 ±0.0000 100 1052
Portablefp160.04990.9722 ±0.0000 100 458
Kernelsfp160.04990.9721 ±0.0000 100 434

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-11; portable fp32: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 6d3bab64, 2026-11-17; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 939adfe8, 2026-11-06.

ETH3D two-view train left

AbsRel / delta1training data not stated: possibly seen

RundtypeAbsRel ↓δ1 ↑Δ AbsRel vs fp32 originalimagesms / image
Original fp32fp320.11410.8715 reference 27 830
Original fp16fp160.11410.8715 ±0.0000 27 379
Portable fp32not measured
Portablefp160.11410.8715 ±0.0000 27 360
Kernelsfp160.11410.8716 ±0.0000 27 228

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-11; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 491e248a, 2026-11-11.

Middlebury 2014 trainingH left

AbsRel / delta1training data not stated: possibly seen

RundtypeAbsRel ↓δ1 ↑Δ AbsRel vs fp32 originalimagesms / image
Original fp32fp320.04130.9899 reference 15 1016
Original fp16fp160.04130.9899 ±0.0000 15 466
Portable fp32not measured
Portablefp160.04130.9899 ±0.0000 15 429
Kernelsfp160.04130.9899 ±0.0000 15 275

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-11; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 491e248a, 2026-11-11.

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| <= 0.0001 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 1 % and p99 <= 3 % of the reference's median |value| (absolute error of the output depth).

CheckToleranceMeasured
CPU fp32, max |diff|≤ 0.0001 (relative)not recorded
GPU default dtypes, mean |diff|≤ 0.01 (relative)0.00013 (relative)
GPU default dtypes, p99 |diff|≤ 0.03 (relative)0.00047 (relative)

Recorded for marigold-depth-v1-1 on RTX 5060 Ti, torch 2.14.1+cu130, 2026-10-29, with these kernels: cudnn_hacc

Details

Marigold (Ke et al. 2023): affine-invariant monocular depth by diffusion; a Stable Diffusion 2 UNet fine-tuned to denoise a depth latent conditioned on the image latent (depth v1-1, few DDIM steps).

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 >= 8, resized or padded inside the model; tested up to 3000x4000 (3,033 MiB allocated)
Options
  • steps=41 to 1000· changes the output
  • long_side=768>= 0· changes the output
  • seed=2024· changes the output
Outputs
depth
CUDA kernels
  • cudnn_haccconvolutions with fp16 accumulation (cuDNN)
Apple (MPS)
fp32, fp16

Limitations

  • Diffusion model: the seeded noise comes from a CPU generator and differs from the original code's CUDA generator for the same seed.
  • A traced or exported module reuses the noise of its traced shape.
  • Kernels time is dominated by unfused elementwise kernels (GroupNorm / SiLU / adds).
Full reference, generated from the repository

Marigold from ETH Zurich (PRS): depth from one image by diffusion on a Stable Diffusion UNet. Commercially usable under an OpenRAIL licence.

Commercial use: yes.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
marigold-depth-v1-1Middlebury 2014 half (994x1482)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
963
439
410
261
342
172
6406 / 6804
3414 / 3580
2776 / 2938
2343 / 2500
2341 / 2418
4263 / 4318
Details
  • Original code: https://github.com/prs-eth/Marigold at 2bfbdea
  • Code licence: Apache-2.0 (permissive); files: LICENSE, LICENSE-MODEL, LICENSE-huggingface
  • Weights licence: LicenseRef-CreativeML-OpenRAIL-PlusPlus-M
  • Licence evidence: https://huggingface.co/prs-eth/marigold-depth-v1-1/blob/9571e7123e258cf052b4e54241f17971c290e9a8/README.md (License: CreativeML Open RAIL++-M)
  • Training data: Stable Diffusion 2 (LAION-5B subsets) fine-tuned on the synthetic Hypersim and Virtual KITTI 2 datasets per the Marigold papers (arXiv 2312.02145, 2505.09358)
  • Licence note: The weights use the OpenRAIL++-M licence: commercial use is allowed but with use restrictions that must be passed on; the training data terms are not checked.
  • Options: steps = 4 (1 to 1000), long_side = 768 (>= 0; also processing_res), seed = 2024
  • Kernel libraries: cudnn_hacc
  • Variants: marigold-depth-v1-1
  • Outputs: depth; kind: affine_invariant
  • Input size: any H x W >= 8, resized or padded inside the model
  • Tested up to (portable, fp16, RTX 5060 Ti 16 GB): marigold-depth-v1-1 3000x4000 (3.0 GiB peak allocated, 3.8 reserved)
  • marigold-depth-v1-1 994x1482, first call: portable + torch.compile 127 s (cold Inductor cache), TensorRT fp16 285 s (ONNX + engine).
  • marigold-depth-v1-1 original 994x1482: the authors' float16 model option; fp16 = upstream's own torch_dtype=float16 pipeline
  • marigold-depth-v1-1 load / first call: original 1.32 s / 0.599 s, portable 11.04 s / 0.886 s (518x770), kernels 2.49 s / 0.504 s (518x770)
  • 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
marigold-depth-v1-1NYUv2 test, AbsRel / delta10.0561 / 0.97030.0561 / 0.97030.0561 / 0.97030.0561 / 0.97030.0561 / 0.9703
marigold-depth-v1-1iBims-1, AbsRel / delta10.0499 / 0.97210.0499 / 0.97210.0499 / 0.97220.0499 / 0.97210.0499 / 0.9721
marigold-depth-v1-1ETH3D two-view train left, AbsRel / delta10.1141 / 0.87150.1141 / 0.87150.1141 / 0.87150.1141 / 0.8716possibly in the training data
marigold-depth-v1-1Middlebury 2014 trainingH left, AbsRel / delta10.0413 / 0.98990.0413 / 0.98990.0413 / 0.98990.0413 / 0.9899possibly in the training data

Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 491e248a / 939adfe8, 2026-11-06 to 2026-11-11; portable32: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 6d3bab64, 2026-11-17; kernels: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 491e248a / 939adfe8, 2026-11-06 to 2026-11-11.

Parity

CPU, float32: max |diff| <= 0.0001 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 1 % and p99 <= 3 % of the reference's median |value| (absolute error of the output depth).

variantkernels error vs original, mean / p99GPU, torchkernels used
marigold-depth-v1-10.00013 / 0.00047RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400

Limitations

  • Diffusion model: the seeded noise comes from a CPU generator and differs from the original code's CUDA generator for the same seed.
  • A traced or exported module reuses the noise of its traced shape.
  • Kernels time is dominated by unfused elementwise kernels (GroupNorm / SiLU / adds).

Example output

One fixed input through this checkpoint, the same for every model of the task (kernels · float16 · NVIDIA GeForce RTX 5060 Ti).

Input
Output
A cup of coffee, input
Input · 100%

Input: A cup of coffee, Rachel Michetti (CC0).