Marigold
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.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
marigold-depth-v1-1 | Middlebury 2014 half (994x1482) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 963 439 408 383 342 172 | 6406 / 6804 3414 / 3580 2817 / 3760 2583 / 3762 2341 / 2418 2368 (engine) |
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; alsoprocessing_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-13000x4000 (3.0 GiB peak allocated, 3.8 reserved) marigold-depth-v1-1994x1482, first call: portable + torch.compile 127 s (cold Inductor cache), TensorRT fp16 285 s (ONNX + engine).marigold-depth-v1-1original 994x1482: the authors' float16 model option; fp16 = upstream's own torch_dtype=float16 pipelinemarigold-depth-v1-1load / first call: original 1.32 s / 0.599 s, portable 8.2 s / 0.556 s, kernels 1.1† s / 0.523 s- † measured in the speed sweep after the portable load (or an earlier size) in the same process: file cache and kernels are warm, so the time is lower than a fresh start.
- Protocol, median of 5 after 3 warm-up, uint8 CUDA input (synthetic for bench_inputs sizes), card defaults; gc before each load; peak = max over the first call and the timed calls
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.
| variant | dataset | original fp32 | original fp16 | portable | kernels | note |
|---|---|---|---|---|---|---|
marigold-depth-v1-1 | NYUv2 test, AbsRel / delta1 | 0.0558 / 0.9693 | 0.0558 / 0.9694 | 0.0561 / 0.9703 | 0.0561 / 0.9703 | |
marigold-depth-v1-1 | iBims-1, AbsRel / delta1 | 0.0498 / 0.9717 | 0.0498 / 0.9717 | 0.0499 / 0.9722 | 0.0499 / 0.9721 | |
marigold-depth-v1-1 | ETH3D two-view train left, AbsRel / delta1 | 0.1075 / 0.8741 | 0.1075 / 0.8741 | 0.1141 / 0.8715 | 0.1141 / 0.8715 | possibly in the training data |
marigold-depth-v1-1 | Middlebury 2014 trainingH left, AbsRel / delta1 | 0.0409 / 0.9909 | 0.0409 / 0.9909 | 0.0413 / 0.9899 | 0.0413 / 0.9899 | possibly in the training data |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 939adfe8, 2026-11-06.
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).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
marigold-depth-v1-1 | 0.00013 / 0.00047 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_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).