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/LiSsAJ4eJ9yDOGaL4E8cVVHPDb7OYMZjEGHx8a2sinMF56se/example_03.mp4",
datast: "open",
max_res: 1024,
overlap: 15,
save_npz: false,
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/LiSsAJ4eJ9yDOGaL4E8cVVHPDb7OYMZjEGHx8a2sinMF56se/example_03.mp4",
"datast": "open",
"max_res": 1024,
"overlap": 15,
"save_npz": False,
"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/LiSsAJ4eJ9yDOGaL4E8cVVHPDb7OYMZjEGHx8a2sinMF56se/example_03.mp4",
"datast": "open",
"max_res": 1024,
"overlap": 15,
"save_npz": false,
"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/LiSsAJ4eJ9yDOGaL4E8cVVHPDb7OYMZjEGHx8a2sinMF56se/example_03.mp4"' \
-i 'datast="open"' \
-i 'max_res=1024' \
-i 'overlap=15' \
-i 'save_npz=false' \
-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/LiSsAJ4eJ9yDOGaL4E8cVVHPDb7OYMZjEGHx8a2sinMF56se/example_03.mp4", "datast": "open", "max_res": 1024, "overlap": 15, "save_npz": false, "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
{
"completed_at": "2024-10-01T00:47:04.552757Z",
"created_at": "2024-10-01T00:45:27.526000Z",
"data_removed": false,
"error": null,
"id": "cdvx0rracsrgg0cj8p59vzaa2m",
"input": {
"video": "https://replicate.delivery/pbxt/LiSsAJ4eJ9yDOGaL4E8cVVHPDb7OYMZjEGHx8a2sinMF56se/example_03.mp4",
"datast": "open",
"max_res": 1024,
"overlap": 15,
"save_npz": false,
"target_fps": 15,
"window_size": 110,
"guidance_scale": 1.2,
"process_length": 60,
"num_denoising_steps": 10
},
"logs": "Using seed: 33937\n==> frames shape: (60, 576, 1024, 3)\nElapsed time for encoding video: 8600.65234375 ms\n 0%| | 0/10 [00:00<?, ?it/s]\n 10%|█ | 1/10 [00:05<00:47, 5.27s/it]\n 20%|██ | 2/10 [00:12<00:49, 6.13s/it]\n 30%|███ | 3/10 [00:18<00:44, 6.41s/it]\n 40%|████ | 4/10 [00:25<00:39, 6.55s/it]\n 50%|█████ | 5/10 [00:32<00:33, 6.63s/it]\n 60%|██████ | 6/10 [00:39<00:26, 6.68s/it]\n 70%|███████ | 7/10 [00:45<00:20, 6.71s/it]\n 80%|████████ | 8/10 [00:52<00:13, 6.73s/it]\n 90%|█████████ | 9/10 [00:59<00:06, 6.74s/it]\n100%|██████████| 10/10 [01:06<00:00, 6.76s/it]\n100%|██████████| 10/10 [01:06<00:00, 6.62s/it]\nElapsed time for denoising video: 67803.9140625 ms\nElapsed time for decoding video: 17710.439453125 ms",
"metrics": {
"predict_time": 96.927849918,
"total_time": 97.026757
},
"output": {
"npz": null,
"depth_video": "https://replicate.delivery/pbxt/p0jgRReSf8q7fJYodgJpjKrE1hDc6G2VR0fyN4C7vnEdIeRcC/out.mp4"
},
"started_at": "2024-10-01T00:45:27.624907Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/cdvx0rracsrgg0cj8p59vzaa2m",
"cancel": "https://api.replicate.com/v1/predictions/cdvx0rracsrgg0cj8p59vzaa2m/cancel"
},
"version": "1c9bfc62fd0750ddadeccf1af4cdef4d74a8a064debd8152ade87f3c9dc30d2b"
}
Using seed: 33937
==> frames shape: (60, 576, 1024, 3)
Elapsed time for encoding video: 8600.65234375 ms
0%| | 0/10 [00:00<?, ?it/s]
10%|█ | 1/10 [00:05<00:47, 5.27s/it]
20%|██ | 2/10 [00:12<00:49, 6.13s/it]
30%|███ | 3/10 [00:18<00:44, 6.41s/it]
40%|████ | 4/10 [00:25<00:39, 6.55s/it]
50%|█████ | 5/10 [00:32<00:33, 6.63s/it]
60%|██████ | 6/10 [00:39<00:26, 6.68s/it]
70%|███████ | 7/10 [00:45<00:20, 6.71s/it]
80%|████████ | 8/10 [00:52<00:13, 6.73s/it]
90%|█████████ | 9/10 [00:59<00:06, 6.74s/it]
100%|██████████| 10/10 [01:06<00:00, 6.76s/it]
100%|██████████| 10/10 [01:06<00:00, 6.62s/it]
Elapsed time for denoising video: 67803.9140625 ms
Elapsed time for decoding video: 17710.439453125 ms