How to run Depth Anything V2 on a cloud GPU
Rent a GPU on Deploy, then open a terminal in JupyterLab or over SSH. Install Depth Anything V2 from the official DepthAnything/Depth-Anything-V2 repository, download a checkpoint the README lists, and run run.py or run_video.py. Copy the PNG or MP4 off the instance before you destroy it, because destroying the instance deletes its disk.
Promptable segmentation is a different repository: How to run SAM 2 (Segment Anything 2) on a cloud GPU. ControlNet in ComfyUI is How to use ControlNet in ComfyUI on a cloud GPU. How published FLUX and SDXL weight sizes are read: How much VRAM do I need for FLUX and SDXL. If the process runs out of memory: How to fix CUDA out of memory on a cloud GPU. The tunnel for the Gradio demo is How to use SSH port forwarding on a cloud GPU.
Text-prompted detection from the Grounding DINO repository, whose README prints no GPU GB figure, is How to run Grounding DINO on a cloud GPU.
The README says Depth-Anything-V2-Small is under the Apache-2.0 license, and Depth-Anything-V2-Base, Large, and Giant are under the CC-BY-NC-4.0 license. The repository LICENSE file is the Apache License, Version 2.0, January 2004, and the appendix copyright line is still the unfilled template Copyright [yyyy] [name of copyright owner]. The GitHub license field on 2026-11-13 was Apache-2.0. The model card for depth-anything/Depth-Anything-V2-Small that day had license apache-2.0 and gated false, lastModified 2024-07-08T09:15:27.000Z. depth-anything/Depth-Anything-V2-Base had license cc-by-nc-4.0, gated false, lastModified 2024-07-08T09:15:57.000Z. depth-anything/Depth-Anything-V2-Large had license cc-by-nc-4.0, gated false, lastModified 2024-07-08T09:15:44.000Z. The README checkpoint cell for Giant says “Coming soon”. This page does not merge the repository LICENSE file with the per-size sentence. Read each file before you redistribute the code or the weights.
The commands below are copied from the upstream files named in each step. They were not run on a CloudGPU instance for this page. Anything this page adds around them is marked.
What the README says about memory
The README model table has a column headed Params. The four cells are 24.8M, 97.5M, 335.3M, and 1.3B (read 2026-11-13). The README, requirements.txt, run.py, run_video.py, and app.py print no GPU GB figure. This page does not treat Params as VRAM.
GET /v1/public/compute-capabilities does not list GPUs. It returns feature flags. The memory column is vram_gb from gpu-prices.json, updated_at 2026-11-13T06:05:49.853Z. GET /v1/public/gpu-catalog the same day (generated_at 2026-11-13T06:05:50.927Z) listed the same names and the same vram_gb values, plus Ascend 910B at 64, which is not in gpu-prices.json and is not listed here. The catalog response also includes an availability field. This page does not copy it. Every prices row has gpu_count 1. There is no upstream GPU GB figure to match these values against. This page did not run Depth Anything V2 and does not mark a row as enough. Which listing you can start is on Deploy.
The catalog template list had no Depth Anything template.
| Catalog name | vram_gb |
|---|---|
| RTX 2080 | 8 |
| RTX 3080 | 10 |
| RTX 2080 Ti | 11 |
| RTX 3080 Ti | 12 |
| V100 16G | 16 |
| A30 | 24 |
| RTX 3090 | 24 |
| RTX 4090 | 24 |
| RTX 4090D | 24 |
| RTX 4080 SUPER 32G | 32 |
| RTX 5090 | 32 |
| RTX 5090D | 32 |
| V100 32G | 32 |
| A100 40G | 40 |
| A800 40G | 40 |
| A40 | 48 |
| RTX 4090 48G | 48 |
| RTX 4090D 48G | 48 |
| RTX A6000 | 48 |
| NVIDIA RTX PRO 5000 72G | 72 |
| RTX PRO 5000 72G | 72 |
| A100 80G | 80 |
| A800 80G | 80 |
| H800 | 80 |
| RTX 6000D | 83 |
| H20 96G | 96 |
| RTX PRO 6000 96G | 96 |
| RTX PRO 6000 Max-Q | 96 |
| H20-3e 141G | 141 |
Install
On Deploy, choose Raw GPU. The README preparation block is:
git clone https://github.com/DepthAnything/Depth-Anything-V2
cd Depth-Anything-V2
pip install -r requirements.txt
requirements.txt lists gradio_imageslider, gradio, matplotlib, opencv-python, torch, and torchvision, with no version pins and no CUDA index. How to install a specific PyTorch CUDA version is the index check against the CUDA Version in the nvidia-smi header. This page did not pick a wheel. The commits API for the default branch main listed a561b849ebae10a6f5ef49e26c83cbbcd36c71bf, committed 2026-03-24T10:59:06Z. The commits API for README.md listed e5a2732d3ea2cddc081d7bfd708fc0bf09f812f1, committed 2025-01-22T07:53:27Z. requirements.txt was 13fca8d929f51d53ae3fa009c461584fdd7a1d96, committed 2026-03-24T07:43:38Z.
The main README points at metric_depth/README.md for a separate metric-depth fine-tune. This page does not copy that file’s commands.
Download the checkpoints
The README says to download the checkpoints in the model table and put them under the checkpoints directory. It does not print mkdir. The download links and filenames, copied:
| Model | Params | File |
|---|---|---|
| Depth-Anything-V2-Small | 24.8M | depth_anything_v2_vits.pth |
| Depth-Anything-V2-Base | 97.5M | depth_anything_v2_vitb.pth |
| Depth-Anything-V2-Large | 335.3M | depth_anything_v2_vitl.pth |
| Depth-Anything-V2-Giant | 1.3B | Coming soon |
The three URLs in the table are:
- https://huggingface.co/depth-anything/Depth-Anything-V2-Small/resolve/main/depth_anything_v2_vits.pth?download=true
- https://huggingface.co/depth-anything/Depth-Anything-V2-Base/resolve/main/depth_anything_v2_vitb.pth?download=true
- https://huggingface.co/depth-anything/Depth-Anything-V2-Large/resolve/main/depth_anything_v2_vitl.pth?download=true
The model API on 2026-11-13 listed depth_anything_v2_vits.pth on Small, depth_anything_v2_vitb.pth on Base, and depth_anything_v2_vitl.pth on Large. The Giant cell has no URL. run.py and run_video.py load checkpoints/depth_anything_v2_{encoder}.pth for encoder in vits, vitb, vitl, and vitg. This page did not download the files.
Image and video scripts
The README’s image command, copied. The angle brackets are the README’s placeholders.
python run.py \
--encoder <vits | vitb | vitl | vitg> \
--img-path <path> --outdir <outdir> \
[--input-size <size>] [--pred-only] [--grayscale]
The example under that block, copied:
python run.py --encoder vitl --img-path assets/examples --outdir depth_vis
The README says --img-path can be an image directory, a single image, or a text file of image paths. It says the default input size is 518. run.py defaults --input-size to 518, --outdir to ./vis_depth, and --encoder to vitl. For each file it writes {outdir}/{stem}.png. --pred-only writes the depth image alone. Without that flag it writes the source and the depth side by side. The commits API listed run.py at 2cbc36a8ce2cec41d38ee51153f112e87c8e42d8 (2024-06-13T19:44:54Z). This page did not run it.
The README’s video command, copied:
python run_video.py \
--encoder <vits | vitb | vitl | vitg> \
--video-path assets/examples_video --outdir video_depth_vis \
[--input-size <size>] [--pred-only] [--grayscale]
run_video.py defaults --outdir to ./vis_video_depth and writes {outdir}/{stem}.mp4 with fourcc mp4v. The directory and single-file branches assign filenames. The branch that reads a .txt path assigns lines and does not assign filenames. The README example passes a directory, not a txt file. The commits API listed run_video.py at 424bc41a263b6c65c840b603e45cc8278f3ff135 (2024-06-20T12:23:51Z). This page did not run it.
The README’s Python snippet sets encoder = 'vitl' # or 'vits', 'vitb', 'vitg' and loads checkpoints/depth_anything_v2_{encoder}.pth. The four config dicts in that snippet are the encoder options. infer_image returns an HxW numpy depth map. This page does not reprint the dicts. Copy them from the README.
The same README prints a Transformers pipeline with model="depth-anything/Depth-Anything-V2-Small-hf". A request for that model API on 2026-11-13 returned HTTP 200. This page did not call the pipeline. The Small model card’s install block clones https://huggingface.co/spaces/depth-anything/Depth-Anything-V2 instead of the GitHub URL above. This page follows the GitHub README clone.
Gradio demo
The README’s local demo command, copied:
python app.py
app.py sets encoder = 'vitl' and loads checkpoints/depth_anything_v2_vitl.pth. It calls demo.queue().launch() and does not pass a host or a port. The grayscale and 16-bit outputs are NamedTemporaryFile paths with suffix .png. The commits API listed app.py at b9689bbcb1d103879f92812781e551d387184b7d (2024-06-14T01:29:18Z). This page did not start the demo. Forward the local URL the process prints with how to use SSH port forwarding on a cloud GPU.
ComfyUI
The README’s Community Support list links kijai/ComfyUI-DepthAnythingV2. That README says models autodownload to ComfyUI\models\depthanything from https://huggingface.co/Kijai/DepthAnythingV2-safetensors/tree/main. It does not print a license. The commits API for that README listed 63743beea3d6f1c2dc50908611e8fc506bfb0bf5 (2024-06-14T12:58:45Z). Repository HEAD was 553187872eeb1d52e50dc53209fa57e569609a72, committed 2026-03-06T16:38:50Z. Installing ComfyUI itself is How to install ComfyUI and ComfyUI-Manager on a cloud GPU. This page did not install the node. The ComfyUI examples top-level directory list on 2026-11-13 had no directory named for this project. Examples HEAD was f9431bb000ce792094ff345446e22cac1ea6cef3, committed 2025-11-26T20:33:58Z.
When it fails
CUDA out of memory. The README and the scripts this page read print no GPU GB cutoff and no low-memory flag. If the process raises that error, use how to fix CUDA out of memory on a cloud GPU.
“CUDA error: no kernel image is available for execution on the device” on an RTX 5090. requirements.txt does not pin a torch build and does not name compute capability 12.0. The RTX 5090 guide says that card is compute capability 12.0 (sm_120) and that PyTorch 2.7 and later, on a build for CUDA 12.8 or newer, is the line that announced support. This page did not install a torch wheel and did not re-test this package on an RTX 5090. Catalog RTX 5090 and RTX 5090D are 32. That is the catalog number only.
Giant checkpoint. The README table says the Giant file is “Coming soon” and prints no URL. run.py still accepts --encoder vitg and loads checkpoints/depth_anything_v2_vitg.pth. This page did not create that file.
Video txt list. run_video.py assigns lines in the .txt branch and then iterates filenames. The README example passes the directory assets/examples_video. This page did not run a txt list.
Save the outputs, then destroy
Copy depth_vis, video_depth_vis, or the --outdir you passed, and any temporary PNG the Gradio demo wrote, before you destroy the instance. Save your work before you destroy a cloud GPU is the checklist. The terms say data on local instance storage is permanently deleted when the instance is destroyed.
The pricing page FAQ states the billing rule in these words:
Per-minute options have a 1-minute minimum; unused prepaid minutes are refunded when you destroy the instance. Some configurations use whole-hour billing with a 1-hour minimum; unused time within a charged hour is not refunded on voluntary stop. The billing period, minimum charge and initial prepayment are shown before confirmation. No subscription.
Frequently asked questions
How much VRAM does the Depth Anything V2 README publish?
The Depth Anything V2 README model table has a Params column: 24.8M, 97.5M, 335.3M, and 1.3B (read 2026-11-13). It does not print a GPU GB figure. requirements.txt, run.py, run_video.py, and app.py do not print one either. This page does not treat Params as VRAM and does not mark a catalog vram_gb as enough. Which listing you can start is on https://cloudgpu.app/deploy.
Which license applies to each model size?
The README says Depth-Anything-V2-Small is under the Apache-2.0 license and Depth-Anything-V2-Base, Large, and Giant are under the CC-BY-NC-4.0 license. The repository LICENSE file is the Apache License, Version 2.0, January 2004, and the appendix copyright line is still the unfilled template. On 2026-11-13 the model card license field was apache-2.0 for depth-anything/Depth-Anything-V2-Small, and cc-by-nc-4.0 for Depth-Anything-V2-Base and Depth-Anything-V2-Large. All three cards had gated false. The README checkpoint cell for Giant says Coming soon. This page does not merge the repository LICENSE file with the per-size sentence. Read each file before you redistribute the code or the weights.
Does the repository ship a Gradio app, and does it document ComfyUI?
The README says to run the local Gradio demo with python app.py. app.py calls demo.queue().launch() and does not pass a host or a port. It loads encoder vitl from checkpoints/depth_anything_v2_vitl.pth. This page did not start it. The README Community Support list links kijai/ComfyUI-DepthAnythingV2. That README says models autodownload to ComfyUI\models\depthanything from the Hugging Face tree Kijai/DepthAnythingV2-safetensors. The ComfyUI examples top-level directory list on 2026-11-13 had no directory named for this project.
Where do the image and video scripts write their files?
The README image example passes --outdir depth_vis. run.py’s default for --outdir is ./vis_depth. It writes a PNG named from the source file stem. The README video example passes --outdir video_depth_vis. run_video.py’s default is ./vis_video_depth, and it writes an MP4 with fourcc mp4v. app.py writes grayscale and 16-bit PNG files through NamedTemporaryFile and does not set a project output directory. Copy those files off before you destroy the instance. The terms say data on local instance storage is permanently deleted when the instance is destroyed.
Sources (read 2026-11-13, Asia/Shanghai)
- Depth Anything V2 README (clone,
requirements.txt, checkpoint table and URLs, image and video commands, Python snippet, Transformers id,python app.py, per-size license sentence, ComfyUI link): https://github.com/DepthAnything/Depth-Anything-V2/blob/main/README.md commite5a2732d3ea2cddc081d7bfd708fc0bf09f812f1. Repository HEADa561b849ebae10a6f5ef49e26c83cbbcd36c71bf, committed 2026-03-24T10:59:06Z requirements.txt(unpinned torch, gradio, gradio_imageslider): commit13fca8d929f51d53ae3fa009c461584fdd7a1d96run.py(default--outdir./vis_depth, PNG stem, encoder choices): commit2cbc36a8ce2cec41d38ee51153f112e87c8e42d8run_video.py(default--outdir./vis_video_depth, mp4v, txt branch assignslines): commit424bc41a263b6c65c840b603e45cc8278f3ff135app.py(encoder = 'vitl',demo.queue().launch(), temporary PNGs): commitb9689bbcb1d103879f92812781e551d387184b7dLICENSE(Apache License, Version 2.0, January 2004, unfilled copyright template): commit00bd582c62e7ba8feb559f57b4a3c051bb6690b5. GitHub license field Apache-2.0- Model cards
depth-anything/Depth-Anything-V2-Small(apache-2.0),Depth-Anything-V2-Base(cc-by-nc-4.0), andDepth-Anything-V2-Large(cc-by-nc-4.0), allgatedfalse, read 2026-11-13. The Small card’s install block clones the Hugging Face Space URL, not the GitHub URL - kijai/ComfyUI-DepthAnythingV2 README (autodownload path): commit
63743beea3d6f1c2dc50908611e8fc506bfb0bf5. Repository HEAD553187872eeb1d52e50dc53209fa57e569609a72 - ComfyUI examples top-level directories (no Depth Anything directory): https://github.com/comfyanonymous/ComfyUI_examples commit
f9431bb000ce792094ff345446e22cac1ea6cef3 - Public GPU memory: https://cloudgpu.app/gpu-prices.json (
updated_at2026-11-13T06:05:49.853Z) and https://cloudgpu.app/v1/public/gpu-catalog (generated_at2026-11-13T06:05:50.927Z).GET /v1/public/compute-capabilitiesreturned feature flags and no GPU list. The catalog had no Depth Anything template
Cards you can start are on the Deploy page. Prices are on https://cloudgpu.app/pricing and are not repeated here.
Last updated: 2026-11-13 (Asia/Shanghai).