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.
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";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run twn39/lama using Replicateβs API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"twn39/lama:c5537e510ca1323c525a61ce462a32a4c5e9bdbb0d75a577fa07f06aa0b969e8",
{
input: {
mask: "https://replicate.delivery/pbxt/JvTNNI5GXp1iol2Sjf3XYfUX83Bemhx4Q5TwoAOeZJXrvc8m/image_inpainting_mask.png",
image: "https://replicate.delivery/pbxt/JvTNNPkuMNTMjetsF4LO9eKdXAPy9xkNqUcphkbFcA2WF2TH/image_inpainting.png"
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output);
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 twn39/lama using Replicateβs API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"twn39/lama:c5537e510ca1323c525a61ce462a32a4c5e9bdbb0d75a577fa07f06aa0b969e8",
input={
"mask": "https://replicate.delivery/pbxt/JvTNNI5GXp1iol2Sjf3XYfUX83Bemhx4Q5TwoAOeZJXrvc8m/image_inpainting_mask.png",
"image": "https://replicate.delivery/pbxt/JvTNNPkuMNTMjetsF4LO9eKdXAPy9xkNqUcphkbFcA2WF2TH/image_inpainting.png"
}
)
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 twn39/lama 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": "twn39/lama:c5537e510ca1323c525a61ce462a32a4c5e9bdbb0d75a577fa07f06aa0b969e8",
"input": {
"mask": "https://replicate.delivery/pbxt/JvTNNI5GXp1iol2Sjf3XYfUX83Bemhx4Q5TwoAOeZJXrvc8m/image_inpainting_mask.png",
"image": "https://replicate.delivery/pbxt/JvTNNPkuMNTMjetsF4LO9eKdXAPy9xkNqUcphkbFcA2WF2TH/image_inpainting.png"
}
}' \
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": "2023-11-26T12:34:13.515278Z",
"created_at": "2023-11-26T12:34:06.417418Z",
"data_removed": false,
"error": null,
"id": "omjan3tba7hgbgwfwrfeo6chrm",
"input": {
"mask": "https://replicate.delivery/pbxt/JvTNNI5GXp1iol2Sjf3XYfUX83Bemhx4Q5TwoAOeZJXrvc8m/image_inpainting_mask.png",
"image": "https://replicate.delivery/pbxt/JvTNNPkuMNTMjetsF4LO9eKdXAPy9xkNqUcphkbFcA2WF2TH/image_inpainting.png"
},
"logs": "Original image too large for refinement! Resizing (999, 1499) to (774, 1162)...\n 0%| | 0/15 [00:00<?, ?it/s]\n 0%| | 0/15 [00:00<?, ?it/s]\nRefining scale 2 using scale 1 ...current loss: 0.1006: 0%| | 0/15 [00:00<?, ?it/s]\nRefining scale 2 using scale 1 ...current loss: 0.1006: 7%|β | 1/15 [00:00<00:03, 3.54it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0888: 7%|β | 1/15 [00:00<00:03, 3.54it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0888: 13%|ββ | 2/15 [00:00<00:03, 3.30it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0810: 13%|ββ | 2/15 [00:00<00:03, 3.30it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0810: 20%|ββ | 3/15 [00:00<00:03, 3.23it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0761: 20%|ββ | 3/15 [00:01<00:03, 3.23it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0761: 27%|βββ | 4/15 [00:01<00:03, 3.20it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0722: 27%|βββ | 4/15 [00:01<00:03, 3.20it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0722: 33%|ββββ | 5/15 [00:01<00:03, 3.18it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0692: 33%|ββββ | 5/15 [00:01<00:03, 3.18it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0692: 40%|ββββ | 6/15 [00:01<00:02, 3.17it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0663: 40%|ββββ | 6/15 [00:02<00:02, 3.17it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0663: 47%|βββββ | 7/15 [00:02<00:02, 3.16it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0640: 47%|βββββ | 7/15 [00:02<00:02, 3.16it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0640: 53%|ββββββ | 8/15 [00:02<00:02, 3.16it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0618: 53%|ββββββ | 8/15 [00:02<00:02, 3.16it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0618: 60%|ββββββ | 9/15 [00:02<00:01, 3.15it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0600: 60%|ββββββ | 9/15 [00:02<00:01, 3.15it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0600: 67%|βββββββ | 10/15 [00:03<00:01, 3.15it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0582: 67%|βββββββ | 10/15 [00:03<00:01, 3.15it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0582: 73%|ββββββββ | 11/15 [00:03<00:01, 3.15it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0567: 73%|ββββββββ | 11/15 [00:03<00:01, 3.15it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0567: 80%|ββββββββ | 12/15 [00:03<00:00, 3.15it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0553: 80%|ββββββββ | 12/15 [00:03<00:00, 3.15it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0553: 87%|βββββββββ | 13/15 [00:04<00:00, 3.15it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0540: 87%|βββββββββ | 13/15 [00:04<00:00, 3.15it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0540: 93%|ββββββββββ| 14/15 [00:04<00:00, 3.15it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0528: 93%|ββββββββββ| 14/15 [00:04<00:00, 3.15it/s]\nRefining scale 2 using scale 1 ...current loss: 0.0528: 100%|ββββββββββ| 15/15 [00:04<00:00, 3.69it/s]",
"metrics": {
"predict_time": 7.05847,
"total_time": 7.09786
},
"output": "https://replicate.delivery/pbxt/CLgjCk74JrLXHJetAIvS6kFi6d5K4fpLl17lzK48y3BE1O8RA/output.png",
"started_at": "2023-11-26T12:34:06.456808Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/omjan3tba7hgbgwfwrfeo6chrm",
"cancel": "https://api.replicate.com/v1/predictions/omjan3tba7hgbgwfwrfeo6chrm/cancel"
},
"version": "c5537e510ca1323c525a61ce462a32a4c5e9bdbb0d75a577fa07f06aa0b969e8"
}
Original image too large for refinement! Resizing (999, 1499) to (774, 1162)...
0%| | 0/15 [00:00<?, ?it/s]
0%| | 0/15 [00:00<?, ?it/s]
Refining scale 2 using scale 1 ...current loss: 0.1006: 0%| | 0/15 [00:00<?, ?it/s]
Refining scale 2 using scale 1 ...current loss: 0.1006: 7%|β | 1/15 [00:00<00:03, 3.54it/s]
Refining scale 2 using scale 1 ...current loss: 0.0888: 7%|β | 1/15 [00:00<00:03, 3.54it/s]
Refining scale 2 using scale 1 ...current loss: 0.0888: 13%|ββ | 2/15 [00:00<00:03, 3.30it/s]
Refining scale 2 using scale 1 ...current loss: 0.0810: 13%|ββ | 2/15 [00:00<00:03, 3.30it/s]
Refining scale 2 using scale 1 ...current loss: 0.0810: 20%|ββ | 3/15 [00:00<00:03, 3.23it/s]
Refining scale 2 using scale 1 ...current loss: 0.0761: 20%|ββ | 3/15 [00:01<00:03, 3.23it/s]
Refining scale 2 using scale 1 ...current loss: 0.0761: 27%|βββ | 4/15 [00:01<00:03, 3.20it/s]
Refining scale 2 using scale 1 ...current loss: 0.0722: 27%|βββ | 4/15 [00:01<00:03, 3.20it/s]
Refining scale 2 using scale 1 ...current loss: 0.0722: 33%|ββββ | 5/15 [00:01<00:03, 3.18it/s]
Refining scale 2 using scale 1 ...current loss: 0.0692: 33%|ββββ | 5/15 [00:01<00:03, 3.18it/s]
Refining scale 2 using scale 1 ...current loss: 0.0692: 40%|ββββ | 6/15 [00:01<00:02, 3.17it/s]
Refining scale 2 using scale 1 ...current loss: 0.0663: 40%|ββββ | 6/15 [00:02<00:02, 3.17it/s]
Refining scale 2 using scale 1 ...current loss: 0.0663: 47%|βββββ | 7/15 [00:02<00:02, 3.16it/s]
Refining scale 2 using scale 1 ...current loss: 0.0640: 47%|βββββ | 7/15 [00:02<00:02, 3.16it/s]
Refining scale 2 using scale 1 ...current loss: 0.0640: 53%|ββββββ | 8/15 [00:02<00:02, 3.16it/s]
Refining scale 2 using scale 1 ...current loss: 0.0618: 53%|ββββββ | 8/15 [00:02<00:02, 3.16it/s]
Refining scale 2 using scale 1 ...current loss: 0.0618: 60%|ββββββ | 9/15 [00:02<00:01, 3.15it/s]
Refining scale 2 using scale 1 ...current loss: 0.0600: 60%|ββββββ | 9/15 [00:02<00:01, 3.15it/s]
Refining scale 2 using scale 1 ...current loss: 0.0600: 67%|βββββββ | 10/15 [00:03<00:01, 3.15it/s]
Refining scale 2 using scale 1 ...current loss: 0.0582: 67%|βββββββ | 10/15 [00:03<00:01, 3.15it/s]
Refining scale 2 using scale 1 ...current loss: 0.0582: 73%|ββββββββ | 11/15 [00:03<00:01, 3.15it/s]
Refining scale 2 using scale 1 ...current loss: 0.0567: 73%|ββββββββ | 11/15 [00:03<00:01, 3.15it/s]
Refining scale 2 using scale 1 ...current loss: 0.0567: 80%|ββββββββ | 12/15 [00:03<00:00, 3.15it/s]
Refining scale 2 using scale 1 ...current loss: 0.0553: 80%|ββββββββ | 12/15 [00:03<00:00, 3.15it/s]
Refining scale 2 using scale 1 ...current loss: 0.0553: 87%|βββββββββ | 13/15 [00:04<00:00, 3.15it/s]
Refining scale 2 using scale 1 ...current loss: 0.0540: 87%|βββββββββ | 13/15 [00:04<00:00, 3.15it/s]
Refining scale 2 using scale 1 ...current loss: 0.0540: 93%|ββββββββββ| 14/15 [00:04<00:00, 3.15it/s]
Refining scale 2 using scale 1 ...current loss: 0.0528: 93%|ββββββββββ| 14/15 [00:04<00:00, 3.15it/s]
Refining scale 2 using scale 1 ...current loss: 0.0528: 100%|ββββββββββ| 15/15 [00:04<00:00, 3.69it/s]