Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
camenduru /instantmesh:4f151757
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export 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 camenduru/instantmesh using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"camenduru/instantmesh:4f151757fd04d508b84f2192a17f58d11673971f05d9cb1fd8bd8149c6fc7cbb",
{
input: {
seed: 42,
image_path: "https://replicate.delivery/pbxt/Kkiy632mjGZRwBhjxlFIjo2tZBnioG7gKnIqID4BaaRMLHxO/hatsune_miku.png",
export_video: true,
sample_steps: 75,
export_texmap: true,
remove_background: true
}
}
);
// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output[0]);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run camenduru/instantmesh using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"camenduru/instantmesh:4f151757fd04d508b84f2192a17f58d11673971f05d9cb1fd8bd8149c6fc7cbb",
input={
"seed": 42,
"image_path": "https://replicate.delivery/pbxt/Kkiy632mjGZRwBhjxlFIjo2tZBnioG7gKnIqID4BaaRMLHxO/hatsune_miku.png",
"export_video": True,
"sample_steps": 75,
"export_texmap": True,
"remove_background": True
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run camenduru/instantmesh 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": "4f151757fd04d508b84f2192a17f58d11673971f05d9cb1fd8bd8149c6fc7cbb",
"input": {
"seed": 42,
"image_path": "https://replicate.delivery/pbxt/Kkiy632mjGZRwBhjxlFIjo2tZBnioG7gKnIqID4BaaRMLHxO/hatsune_miku.png",
"export_video": true,
"sample_steps": 75,
"export_texmap": true,
"remove_background": true
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
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-04-16T09:29:30.098892Z",
"created_at": "2024-04-16T09:24:46.668000Z",
"data_removed": false,
"error": null,
"id": "02vh42gxshrge0cewrwtdhq6yc",
"input": {
"seed": 42,
"image_path": "https://replicate.delivery/pbxt/Kkiy632mjGZRwBhjxlFIjo2tZBnioG7gKnIqID4BaaRMLHxO/hatsune_miku.png",
"export_video": true,
"sample_steps": 75,
"export_texmap": true,
"remove_background": true
},
"logs": "Downloading data from 'https://github.com/danielgatis/rembg/releases/download/v0.0.0/u2net.onnx' to file '/root/.u2net/u2net.onnx'.\n 0%| | 0.00/176M [00:00<?, ?B/s]\n 2%|▌ | 2.76M/176M [00:00<00:06, 27.6MB/s]\n 4%|█▋ | 7.79M/176M [00:00<00:04, 40.9MB/s]\n 7%|██▊ | 12.8M/176M [00:00<00:03, 45.2MB/s]\n 10%|███▊ | 17.9M/176M [00:00<00:03, 47.5MB/s]\n 13%|████▉ | 23.0M/176M [00:00<00:03, 48.7MB/s]\n 16%|██████ | 28.1M/176M [00:00<00:02, 49.4MB/s]\n 19%|███████▏ | 33.2M/176M [00:00<00:02, 50.0MB/s]\n 22%|████████▏ | 38.2M/176M [00:00<00:02, 50.0MB/s]\n 25%|█████████▎ | 43.2M/176M [00:00<00:02, 48.4MB/s]\n 27%|██████████▍ | 48.3M/176M [00:01<00:02, 49.2MB/s]\n 30%|███████████▌ | 53.3M/176M [00:01<00:02, 49.4MB/s]\n 33%|████████████▌ | 58.4M/176M [00:01<00:02, 49.9MB/s]\n 36%|█████████████▋ | 63.5M/176M [00:01<00:02, 50.2MB/s]\n 39%|██████████████▊ | 68.7M/176M [00:01<00:02, 50.6MB/s]\n 42%|███████████████▉ | 73.8M/176M [00:01<00:02, 50.7MB/s]\n 45%|█████████████████ | 78.9M/176M [00:01<00:01, 50.9MB/s]\n 48%|██████████████████▏ | 84.0M/176M [00:01<00:01, 50.9MB/s]\n 51%|███████████████████▏ | 89.1M/176M [00:01<00:01, 50.8MB/s]\n 54%|████████████████████▎ | 94.2M/176M [00:01<00:01, 50.9MB/s]\n 56%|█████████████████████▍ | 99.2M/176M [00:02<00:01, 49.2MB/s]\n 59%|███████████████████████ | 104M/176M [00:02<00:01, 49.7MB/s]\n 62%|████████████████████████▏ | 109M/176M [00:02<00:01, 50.1MB/s]\n 65%|█████████████████████████▍ | 115M/176M [00:02<00:01, 50.4MB/s]\n 68%|██████████████████████████▌ | 120M/176M [00:02<00:01, 50.6MB/s]\n 71%|███████████████████████████▋ | 125M/176M [00:02<00:01, 50.7MB/s]\n 74%|████████████████████████████▊ | 130M/176M [00:02<00:00, 50.9MB/s]\n 77%|█████████████████████████████▉ | 135M/176M [00:02<00:00, 50.9MB/s]\n 80%|███████████████████████████████ | 140M/176M [00:02<00:00, 50.6MB/s]\n 82%|████████████████████████████████▏ | 145M/176M [00:02<00:00, 50.6MB/s]\n 85%|█████████████████████████████████▎ | 150M/176M [00:03<00:00, 50.4MB/s]\n 88%|██████████████████████████████████▍ | 155M/176M [00:03<00:00, 50.3MB/s]\n 91%|███████████████████████████████████▌ | 160M/176M [00:03<00:00, 50.5MB/s]\n 94%|████████████████████████████████████▋ | 165M/176M [00:03<00:00, 50.7MB/s]\n 97%|█████████████████████████████████████▊ | 170M/176M [00:03<00:00, 50.6MB/s]\n100%|██████████████████████████████████████▉| 176M/176M [00:03<00:00, 50.9MB/s]\n0%| | 0.00/176M [00:00<?, ?B/s]\n100%|████████████████████████████████████████| 176M/176M [00:00<00:00, 828GB/s]\nSeed set to 42\n 0%| | 0/75 [00:00<?, ?it/s]\n 1%|▏ | 1/75 [00:00<00:44, 1.66it/s]\n 3%|▎ | 2/75 [00:00<00:22, 3.22it/s]\n 4%|▍ | 3/75 [00:00<00:15, 4.65it/s]\n 7%|▋ | 5/75 [00:01<00:10, 6.67it/s]\n 8%|▊ | 6/75 [00:01<00:09, 7.22it/s]\n 11%|█ | 8/75 [00:01<00:07, 8.42it/s]\n 13%|█▎ | 10/75 [00:01<00:07, 9.14it/s]\n 16%|█▌ | 12/75 [00:01<00:06, 9.59it/s]\n 19%|█▊ | 14/75 [00:01<00:06, 9.87it/s]\n 21%|██▏ | 16/75 [00:02<00:06, 9.79it/s]\n 24%|██▍ | 18/75 [00:02<00:05, 9.98it/s]\n 27%|██▋ | 20/75 [00:02<00:05, 10.11it/s]\n 29%|██▉ | 22/75 [00:02<00:05, 10.18it/s]\n 32%|███▏ | 24/75 [00:02<00:04, 10.26it/s]\n 35%|███▍ | 26/75 [00:03<00:04, 10.29it/s]\n 37%|███▋ | 28/75 [00:03<00:04, 10.02it/s]\n 40%|████ | 30/75 [00:03<00:04, 10.15it/s]\n 43%|████▎ | 32/75 [00:03<00:04, 10.22it/s]\n 45%|████▌ | 34/75 [00:03<00:04, 10.22it/s]\n 48%|████▊ | 36/75 [00:04<00:03, 10.11it/s]\n 51%|█████ | 38/75 [00:04<00:03, 10.03it/s]\n 53%|█████▎ | 40/75 [00:04<00:03, 10.16it/s]\n 56%|█████▌ | 42/75 [00:04<00:03, 10.21it/s]\n 59%|█████▊ | 44/75 [00:04<00:03, 10.22it/s]\n 61%|██████▏ | 46/75 [00:05<00:02, 10.21it/s]\n 64%|██████▍ | 48/75 [00:05<00:02, 10.00it/s]\n 67%|██████▋ | 50/75 [00:05<00:02, 10.01it/s]\n 69%|██████▉ | 52/75 [00:05<00:02, 10.09it/s]\n 72%|███████▏ | 54/75 [00:05<00:02, 10.20it/s]\n 75%|███████▍ | 56/75 [00:06<00:01, 10.21it/s]\n 77%|███████▋ | 58/75 [00:06<00:01, 9.91it/s]\n 80%|████████ | 60/75 [00:06<00:01, 10.02it/s]\n 83%|████████▎ | 62/75 [00:06<00:01, 10.06it/s]\n 85%|████████▌ | 64/75 [00:06<00:01, 10.13it/s]\n 88%|████████▊ | 66/75 [00:07<00:00, 10.13it/s]\n 91%|█████████ | 68/75 [00:07<00:00, 10.10it/s]\n 93%|█████████▎| 70/75 [00:07<00:00, 10.20it/s]\n 96%|█████████▌| 72/75 [00:07<00:00, 10.27it/s]\n 99%|█████████▊| 74/75 [00:07<00:00, 10.33it/s]\n100%|██████████| 75/75 [00:07<00:00, 9.51it/s]\n/src/predict.py:41: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:206.)\nshow_image = torch.from_numpy(show_image) # (960, 640, 3)\n/tmp/tmpkazgrgd3.obj\n 0%| | 0/6 [00:00<?, ?it/s]/content/InstantMesh/src/models/geometry/render/neural_render.py:51: UserWarning: Using torch.cross without specifying the dim arg is deprecated.\nPlease either pass the dim explicitly or simply use torch.linalg.cross.\nThe default value of dim will change to agree with that of linalg.cross in a future release. (Triggered internally at ../aten/src/ATen/native/Cross.cpp:63.)\nface_normals = torch.cross(v1 - v0, v2 - v0)\n 17%|█▋ | 1/6 [00:00<00:02, 2.14it/s]\n 33%|███▎ | 2/6 [00:00<00:01, 2.49it/s]\n 50%|█████ | 3/6 [00:01<00:01, 2.60it/s]\n 67%|██████▋ | 4/6 [00:01<00:00, 2.67it/s]\n 83%|████████▎ | 5/6 [00:01<00:00, 2.71it/s]\n100%|██████████| 6/6 [00:02<00:00, 2.73it/s]\n100%|██████████| 6/6 [00:02<00:00, 2.65it/s]\nVideo saved to /tmp/tmpkazgrgd3.mp4\nMesh with texmap saved to /tmp/tmpkazgrgd3.obj",
"metrics": {
"predict_time": 49.499111,
"total_time": 283.430892
},
"output": [
"https://replicate.delivery/pbxt/f309uxIE1MQbcCazIYuIA66VVpdKLrCOHyfccG4fUfmmv9rKB/mv_show_images.png",
"https://replicate.delivery/pbxt/Thfx1IYFayX0Aa5FdWjuIwpYxsnPr6eSvLEgfZpiRfznv9rKB/tmpkazgrgd3.mp4",
"https://replicate.delivery/pbxt/WNSvPfczP5RDTKmSsPL4x2WnYABPPDnnyMolpxHydNe5bfVlA/tmpkazgrgd3.obj",
"https://replicate.delivery/pbxt/wl1tfZK2f0sUREXGfOrrlG623ekereReIHFLuebloexHy3erKB/tmpkazgrgd3.mtl",
"https://replicate.delivery/pbxt/zKBd46VI8QYIPpbIFo5aFxpLr0Kn0SME29rwvfuSufV5bfVlA/tmpkazgrgd3.png"
],
"started_at": "2024-04-16T09:28:40.599781Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/02vh42gxshrge0cewrwtdhq6yc",
"cancel": "https://api.replicate.com/v1/predictions/02vh42gxshrge0cewrwtdhq6yc/cancel"
},
"version": "4f151757fd04d508b84f2192a17f58d11673971f05d9cb1fd8bd8149c6fc7cbb"
}
Downloading data from 'https://github.com/danielgatis/rembg/releases/download/v0.0.0/u2net.onnx' to file '/root/.u2net/u2net.onnx'.
0%| | 0.00/176M [00:00<?, ?B/s]
2%|▌ | 2.76M/176M [00:00<00:06, 27.6MB/s]
4%|█▋ | 7.79M/176M [00:00<00:04, 40.9MB/s]
7%|██▊ | 12.8M/176M [00:00<00:03, 45.2MB/s]
10%|███▊ | 17.9M/176M [00:00<00:03, 47.5MB/s]
13%|████▉ | 23.0M/176M [00:00<00:03, 48.7MB/s]
16%|██████ | 28.1M/176M [00:00<00:02, 49.4MB/s]
19%|███████▏ | 33.2M/176M [00:00<00:02, 50.0MB/s]
22%|████████▏ | 38.2M/176M [00:00<00:02, 50.0MB/s]
25%|█████████▎ | 43.2M/176M [00:00<00:02, 48.4MB/s]
27%|██████████▍ | 48.3M/176M [00:01<00:02, 49.2MB/s]
30%|███████████▌ | 53.3M/176M [00:01<00:02, 49.4MB/s]
33%|████████████▌ | 58.4M/176M [00:01<00:02, 49.9MB/s]
36%|█████████████▋ | 63.5M/176M [00:01<00:02, 50.2MB/s]
39%|██████████████▊ | 68.7M/176M [00:01<00:02, 50.6MB/s]
42%|███████████████▉ | 73.8M/176M [00:01<00:02, 50.7MB/s]
45%|█████████████████ | 78.9M/176M [00:01<00:01, 50.9MB/s]
48%|██████████████████▏ | 84.0M/176M [00:01<00:01, 50.9MB/s]
51%|███████████████████▏ | 89.1M/176M [00:01<00:01, 50.8MB/s]
54%|████████████████████▎ | 94.2M/176M [00:01<00:01, 50.9MB/s]
56%|█████████████████████▍ | 99.2M/176M [00:02<00:01, 49.2MB/s]
59%|███████████████████████ | 104M/176M [00:02<00:01, 49.7MB/s]
62%|████████████████████████▏ | 109M/176M [00:02<00:01, 50.1MB/s]
65%|█████████████████████████▍ | 115M/176M [00:02<00:01, 50.4MB/s]
68%|██████████████████████████▌ | 120M/176M [00:02<00:01, 50.6MB/s]
71%|███████████████████████████▋ | 125M/176M [00:02<00:01, 50.7MB/s]
74%|████████████████████████████▊ | 130M/176M [00:02<00:00, 50.9MB/s]
77%|█████████████████████████████▉ | 135M/176M [00:02<00:00, 50.9MB/s]
80%|███████████████████████████████ | 140M/176M [00:02<00:00, 50.6MB/s]
82%|████████████████████████████████▏ | 145M/176M [00:02<00:00, 50.6MB/s]
85%|█████████████████████████████████▎ | 150M/176M [00:03<00:00, 50.4MB/s]
88%|██████████████████████████████████▍ | 155M/176M [00:03<00:00, 50.3MB/s]
91%|███████████████████████████████████▌ | 160M/176M [00:03<00:00, 50.5MB/s]
94%|████████████████████████████████████▋ | 165M/176M [00:03<00:00, 50.7MB/s]
97%|█████████████████████████████████████▊ | 170M/176M [00:03<00:00, 50.6MB/s]
100%|██████████████████████████████████████▉| 176M/176M [00:03<00:00, 50.9MB/s]
0%| | 0.00/176M [00:00<?, ?B/s]
100%|████████████████████████████████████████| 176M/176M [00:00<00:00, 828GB/s]
Seed set to 42
0%| | 0/75 [00:00<?, ?it/s]
1%|▏ | 1/75 [00:00<00:44, 1.66it/s]
3%|▎ | 2/75 [00:00<00:22, 3.22it/s]
4%|▍ | 3/75 [00:00<00:15, 4.65it/s]
7%|▋ | 5/75 [00:01<00:10, 6.67it/s]
8%|▊ | 6/75 [00:01<00:09, 7.22it/s]
11%|█ | 8/75 [00:01<00:07, 8.42it/s]
13%|█▎ | 10/75 [00:01<00:07, 9.14it/s]
16%|█▌ | 12/75 [00:01<00:06, 9.59it/s]
19%|█▊ | 14/75 [00:01<00:06, 9.87it/s]
21%|██▏ | 16/75 [00:02<00:06, 9.79it/s]
24%|██▍ | 18/75 [00:02<00:05, 9.98it/s]
27%|██▋ | 20/75 [00:02<00:05, 10.11it/s]
29%|██▉ | 22/75 [00:02<00:05, 10.18it/s]
32%|███▏ | 24/75 [00:02<00:04, 10.26it/s]
35%|███▍ | 26/75 [00:03<00:04, 10.29it/s]
37%|███▋ | 28/75 [00:03<00:04, 10.02it/s]
40%|████ | 30/75 [00:03<00:04, 10.15it/s]
43%|████▎ | 32/75 [00:03<00:04, 10.22it/s]
45%|████▌ | 34/75 [00:03<00:04, 10.22it/s]
48%|████▊ | 36/75 [00:04<00:03, 10.11it/s]
51%|█████ | 38/75 [00:04<00:03, 10.03it/s]
53%|█████▎ | 40/75 [00:04<00:03, 10.16it/s]
56%|█████▌ | 42/75 [00:04<00:03, 10.21it/s]
59%|█████▊ | 44/75 [00:04<00:03, 10.22it/s]
61%|██████▏ | 46/75 [00:05<00:02, 10.21it/s]
64%|██████▍ | 48/75 [00:05<00:02, 10.00it/s]
67%|██████▋ | 50/75 [00:05<00:02, 10.01it/s]
69%|██████▉ | 52/75 [00:05<00:02, 10.09it/s]
72%|███████▏ | 54/75 [00:05<00:02, 10.20it/s]
75%|███████▍ | 56/75 [00:06<00:01, 10.21it/s]
77%|███████▋ | 58/75 [00:06<00:01, 9.91it/s]
80%|████████ | 60/75 [00:06<00:01, 10.02it/s]
83%|████████▎ | 62/75 [00:06<00:01, 10.06it/s]
85%|████████▌ | 64/75 [00:06<00:01, 10.13it/s]
88%|████████▊ | 66/75 [00:07<00:00, 10.13it/s]
91%|█████████ | 68/75 [00:07<00:00, 10.10it/s]
93%|█████████▎| 70/75 [00:07<00:00, 10.20it/s]
96%|█████████▌| 72/75 [00:07<00:00, 10.27it/s]
99%|█████████▊| 74/75 [00:07<00:00, 10.33it/s]
100%|██████████| 75/75 [00:07<00:00, 9.51it/s]
/src/predict.py:41: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:206.)
show_image = torch.from_numpy(show_image) # (960, 640, 3)
/tmp/tmpkazgrgd3.obj
0%| | 0/6 [00:00<?, ?it/s]/content/InstantMesh/src/models/geometry/render/neural_render.py:51: UserWarning: Using torch.cross without specifying the dim arg is deprecated.
Please either pass the dim explicitly or simply use torch.linalg.cross.
The default value of dim will change to agree with that of linalg.cross in a future release. (Triggered internally at ../aten/src/ATen/native/Cross.cpp:63.)
face_normals = torch.cross(v1 - v0, v2 - v0)
17%|█▋ | 1/6 [00:00<00:02, 2.14it/s]
33%|███▎ | 2/6 [00:00<00:01, 2.49it/s]
50%|█████ | 3/6 [00:01<00:01, 2.60it/s]
67%|██████▋ | 4/6 [00:01<00:00, 2.67it/s]
83%|████████▎ | 5/6 [00:01<00:00, 2.71it/s]
100%|██████████| 6/6 [00:02<00:00, 2.73it/s]
100%|██████████| 6/6 [00:02<00:00, 2.65it/s]
Video saved to /tmp/tmpkazgrgd3.mp4
Mesh with texmap saved to /tmp/tmpkazgrgd3.obj