Marigold (fastforks)
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).
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/prs-eth/Marigold at 2bfbdea.
Author weight repos: https://huggingface.co/prs-eth/marigold-depth-v1-1.
Task: depth. Tier: experimental. Outputs: depth. Backends: portable, kernels.
Input: one RGB image. Output: a depth or inverse-depth map (metric for the models marked metric).
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-depth-v1-1@1 |
unet/diffusion_pytorch_model.safetensors vae/diffusion_pytorch_model.safetensors text_encoder/model.safetensors |
ad9342d79bb5a1d993488569cce6febb0b6d |
LicenseRef-CreativeML-OpenRAIL-PlusPlus-M | yes |
Licence
Original-code strings, recorded as they are (research-use package; check them before any other use). Code: Apache-2.0. Files: LICENSE, LICENSE-MODEL, LICENSE-huggingface.
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.
Licence evidence: https://huggingface.co/prs-eth/marigold-depth-v1-1/blob/9571e7123e258cf052b4e54241f17971c290e9a8/README.md (License: CreativeML Open RAIL++-M)
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)
Speed and memory
Depth, Middlebury 2014 half, 994x1482
| model | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
|---|---|---|---|---|---|---|---|---|---|
marigold-depth-v1-1 |
975.6 | β | 408.07 | 383.17 | β | 1.1x | β | 2817 / 3760 | 2583 / 3762 |
Startup and first call
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
|---|---|---|---|---|---|---|
marigold-depth-v1-1 |
1.73 | 8.20 | 1.10β | 1.06 | 0.56 | 0.52 |
Fixed-size speed and peak memory, all models
| model | mode | 640x480 | 1280x720 | 1920x1080 | 12 MP 4000x3000 |
|---|---|---|---|---|---|
marigold-depth-v1-1 |
portable | 455.3 ms / 2898 / 3650 | 351.7 ms / 2648 / 3306 | 351.8 ms / 2661 / 3378 | 458.1 ms / 3033 / 3844 |
marigold-depth-v1-1 |
kernels | 433.0 ms / 2636 / 3464 | 324.3 ms / 2452 / 3070 | 324.9 ms / 2465 / 3142 | 435.6 ms / 2770 / 3552 |
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 authors' code 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. Original = the authors' code, same checkpoint and protocol.
| variant | dataset | original | portable | kernels | note |
|---|---|---|---|---|---|
marigold-depth-v1-1 |
NYUv2 test, AbsRel / delta1 | 0.0558 / 0.9693 | 0.0561 / 0.9703 | 0.0561 / 0.9703 | |
marigold-depth-v1-1 |
iBims-1, AbsRel / delta1 | 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.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.0413 / 0.9899 | 0.0413 / 0.9899 | possibly in the training data |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, 2026-10-28.
Parity with the original code
Every variant is checked against golden outputs of the original code at its pinned commit. 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|.
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).
Usage
from fastforks import depth
model = depth.load("marigold-depth-v1-1") # portable PyTorch on the GPU if there is one, else the CPU
result = model("room.jpg")
result.depth # [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-depth-v1-1.
Kernels backend
depth.load("marigold-depth-v1-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.