You're looking at a specific version of this model. Jump to the model overview.
chenxwh /depthcrafter:1c9bfc62
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run chenxwh/depthcrafter using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"chenxwh/depthcrafter:1c9bfc62fd0750ddadeccf1af4cdef4d74a8a064debd8152ade87f3c9dc30d2b",
{
input: {
video: "https://replicate.delivery/pbxt/LiSi8OkoMdHvnAJJu2xkrie4iykABkvxUOMXQ7ehixoOPF0e/example_02.mp4",
datast: "open",
max_res: 1024,
overlap: 15,
save_npz: true,
target_fps: 15,
window_size: 110,
guidance_scale: 1.2,
process_length: 60,
num_denoising_steps: 10
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run chenxwh/depthcrafter using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"chenxwh/depthcrafter:1c9bfc62fd0750ddadeccf1af4cdef4d74a8a064debd8152ade87f3c9dc30d2b",
input={
"video": "https://replicate.delivery/pbxt/LiSi8OkoMdHvnAJJu2xkrie4iykABkvxUOMXQ7ehixoOPF0e/example_02.mp4",
"datast": "open",
"max_res": 1024,
"overlap": 15,
"save_npz": True,
"target_fps": 15,
"window_size": 110,
"guidance_scale": 1.2,
"process_length": 60,
"num_denoising_steps": 10
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run chenxwh/depthcrafter using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"version": "1c9bfc62fd0750ddadeccf1af4cdef4d74a8a064debd8152ade87f3c9dc30d2b",
"input": {
"video": "https://replicate.delivery/pbxt/LiSi8OkoMdHvnAJJu2xkrie4iykABkvxUOMXQ7ehixoOPF0e/example_02.mp4",
"datast": "open",
"max_res": 1024,
"overlap": 15,
"save_npz": true,
"target_fps": 15,
"window_size": 110,
"guidance_scale": 1.2,
"process_length": 60,
"num_denoising_steps": 10
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
brew install cog
If you don’t have Homebrew, there are other installation options available.
Pull and run chenxwh/depthcrafter using Cog (this will download the full model and run it in your local environment):
cog predict r8.im/chenxwh/depthcrafter@sha256:1c9bfc62fd0750ddadeccf1af4cdef4d74a8a064debd8152ade87f3c9dc30d2b \
-i 'video="https://replicate.delivery/pbxt/LiSi8OkoMdHvnAJJu2xkrie4iykABkvxUOMXQ7ehixoOPF0e/example_02.mp4"' \
-i 'datast="open"' \
-i 'max_res=1024' \
-i 'overlap=15' \
-i 'save_npz=true' \
-i 'target_fps=15' \
-i 'window_size=110' \
-i 'guidance_scale=1.2' \
-i 'process_length=60' \
-i 'num_denoising_steps=10'
To learn more, take a look at the Cog documentation.
Pull and run chenxwh/depthcrafter using Docker (this will download the full model and run it in your local environment):
docker run -d -p 5000:5000 --gpus=all r8.im/chenxwh/depthcrafter@sha256:1c9bfc62fd0750ddadeccf1af4cdef4d74a8a064debd8152ade87f3c9dc30d2b
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "video": "https://replicate.delivery/pbxt/LiSi8OkoMdHvnAJJu2xkrie4iykABkvxUOMXQ7ehixoOPF0e/example_02.mp4", "datast": "open", "max_res": 1024, "overlap": 15, "save_npz": true, "target_fps": 15, "window_size": 110, "guidance_scale": 1.2, "process_length": 60, "num_denoising_steps": 10 } }' \ http://localhost:5000/predictions
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
Output
npz
out.npzdepth_video
{
"completed_at": "2024-10-01T00:37:53.048401Z",
"created_at": "2024-10-01T00:34:56.416000Z",
"data_removed": false,
"error": null,
"id": "a2exdg3941rgp0cj8p0838863m",
"input": {
"video": "https://replicate.delivery/pbxt/LiSi8OkoMdHvnAJJu2xkrie4iykABkvxUOMXQ7ehixoOPF0e/example_02.mp4",
"datast": "open",
"max_res": 1024,
"overlap": 15,
"save_npz": true,
"target_fps": 15,
"window_size": 110,
"guidance_scale": 1.2,
"process_length": 60,
"num_denoising_steps": 10
},
"logs": "Using seed: 56096\n==> frames shape: (60, 576, 1024, 3)\nElapsed time for encoding video: 8618.146484375 ms\n 0%| | 0/10 [00:00<?, ?it/s]\n 10%|█ | 1/10 [00:05<00:47, 5.26s/it]\n 20%|██ | 2/10 [00:12<00:49, 6.16s/it]\n 30%|███ | 3/10 [00:18<00:45, 6.45s/it]\n 40%|████ | 4/10 [00:25<00:39, 6.59s/it]\n 50%|█████ | 5/10 [00:32<00:33, 6.67s/it]\n 60%|██████ | 6/10 [00:39<00:26, 6.72s/it]\n 70%|███████ | 7/10 [00:46<00:20, 6.76s/it]\n 80%|████████ | 8/10 [00:52<00:13, 6.78s/it]\n 90%|█████████ | 9/10 [00:59<00:06, 6.80s/it]\n100%|██████████| 10/10 [01:06<00:00, 6.81s/it]\n100%|██████████| 10/10 [01:06<00:00, 6.66s/it]\nElapsed time for denoising video: 68239.7265625 ms\nElapsed time for decoding video: 17792.451171875 ms",
"metrics": {
"predict_time": 103.510892014,
"total_time": 176.632401
},
"output": {
"npz": "https://replicate.delivery/pbxt/yceY2s25LETaGCXM0LydkrfQsTtNqO7vvXjvT9N7GVEeyeIOB/out.npz",
"depth_video": "https://replicate.delivery/pbxt/A2D6foB4Jes7jE3X5tqnWBGTZmt9wp2lVguxf4LGB8sAzeIOB/out.mp4"
},
"started_at": "2024-10-01T00:36:09.537509Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/a2exdg3941rgp0cj8p0838863m",
"cancel": "https://api.replicate.com/v1/predictions/a2exdg3941rgp0cj8p0838863m/cancel"
},
"version": "1c9bfc62fd0750ddadeccf1af4cdef4d74a8a064debd8152ade87f3c9dc30d2b"
}
Using seed: 56096
==> frames shape: (60, 576, 1024, 3)
Elapsed time for encoding video: 8618.146484375 ms
0%| | 0/10 [00:00<?, ?it/s]
10%|█ | 1/10 [00:05<00:47, 5.26s/it]
20%|██ | 2/10 [00:12<00:49, 6.16s/it]
30%|███ | 3/10 [00:18<00:45, 6.45s/it]
40%|████ | 4/10 [00:25<00:39, 6.59s/it]
50%|█████ | 5/10 [00:32<00:33, 6.67s/it]
60%|██████ | 6/10 [00:39<00:26, 6.72s/it]
70%|███████ | 7/10 [00:46<00:20, 6.76s/it]
80%|████████ | 8/10 [00:52<00:13, 6.78s/it]
90%|█████████ | 9/10 [00:59<00:06, 6.80s/it]
100%|██████████| 10/10 [01:06<00:00, 6.81s/it]
100%|██████████| 10/10 [01:06<00:00, 6.66s/it]
Elapsed time for denoising video: 68239.7265625 ms
Elapsed time for decoding video: 17792.451171875 ms