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 anhappdev/test using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"anhappdev/test:10ba78e98238c724dd80edabd0636066540a22df40e0e12fecdf180bdb487235",
{
input: {
seed: 123,
image: "https://replicate.delivery/pbxt/Ia2E3MUrVDVXITRVSKCHcCYi9WMYGoTpqxtqZ0PuqRoaY3FW/1.jpg",
method: "replace",
prompt: "a yellow++ leather++ couch",
mask_image: "https://replicate.delivery/pbxt/Ia2E2SDOE51oEfLeToezFAIYKw84oX0wHJYNVO5GUr6YMFMi/1_mask.jpg",
num_outputs: 3,
guidance_scale: 7.5,
negative_prompt: "",
num_inference_steps: 50
}
}
);
// 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 anhappdev/test using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"anhappdev/test:10ba78e98238c724dd80edabd0636066540a22df40e0e12fecdf180bdb487235",
input={
"seed": 123,
"image": "https://replicate.delivery/pbxt/Ia2E3MUrVDVXITRVSKCHcCYi9WMYGoTpqxtqZ0PuqRoaY3FW/1.jpg",
"method": "replace",
"prompt": "a yellow++ leather++ couch",
"mask_image": "https://replicate.delivery/pbxt/Ia2E2SDOE51oEfLeToezFAIYKw84oX0wHJYNVO5GUr6YMFMi/1_mask.jpg",
"num_outputs": 3,
"guidance_scale": 7.5,
"negative_prompt": "",
"num_inference_steps": 50
}
)
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 anhappdev/test 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": "anhappdev/test:10ba78e98238c724dd80edabd0636066540a22df40e0e12fecdf180bdb487235",
"input": {
"seed": 123,
"image": "https://replicate.delivery/pbxt/Ia2E3MUrVDVXITRVSKCHcCYi9WMYGoTpqxtqZ0PuqRoaY3FW/1.jpg",
"method": "replace",
"prompt": "a yellow++ leather++ couch",
"mask_image": "https://replicate.delivery/pbxt/Ia2E2SDOE51oEfLeToezFAIYKw84oX0wHJYNVO5GUr6YMFMi/1_mask.jpg",
"num_outputs": 3,
"guidance_scale": 7.5,
"negative_prompt": "",
"num_inference_steps": 50
}
}' \
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-04-24T12:58:53.449064Z",
"created_at": "2023-04-24T12:56:49.779116Z",
"data_removed": false,
"error": null,
"id": "b5a4pesonfgw5klij6lnxcpu5m",
"input": {
"seed": 123,
"image": "https://replicate.delivery/pbxt/Ia2E3MUrVDVXITRVSKCHcCYi9WMYGoTpqxtqZ0PuqRoaY3FW/1.jpg",
"method": "replace",
"prompt": "a yellow++ leather++ couch",
"mask_image": "https://replicate.delivery/pbxt/Ia2E2SDOE51oEfLeToezFAIYKw84oX0wHJYNVO5GUr6YMFMi/1_mask.jpg",
"num_outputs": 3,
"guidance_scale": 7.5,
"num_inference_steps": 50
},
"logs": "2023-04-24 12:58:44,617 [INFO] :: Using seed: 123\n 0%| | 0/50 [00:00<?, ?it/s]\n 2%|▏ | 1/50 [00:00<00:07, 6.98it/s]\n 6%|▌ | 3/50 [00:00<00:03, 11.91it/s]\n 10%|█ | 5/50 [00:00<00:03, 13.93it/s]\n 14%|█▍ | 7/50 [00:00<00:02, 14.82it/s]\n 18%|█▊ | 9/50 [00:00<00:02, 15.45it/s]\n 22%|██▏ | 11/50 [00:00<00:02, 15.70it/s]\n 26%|██▌ | 13/50 [00:00<00:02, 15.88it/s]\n 30%|███ | 15/50 [00:01<00:02, 15.95it/s]\n 34%|███▍ | 17/50 [00:01<00:02, 16.10it/s]\n 38%|███▊ | 19/50 [00:01<00:01, 16.32it/s]\n 42%|████▏ | 21/50 [00:01<00:01, 16.49it/s]\n 46%|████▌ | 23/50 [00:01<00:01, 16.49it/s]\n 50%|█████ | 25/50 [00:01<00:01, 16.56it/s]\n 54%|█████▍ | 27/50 [00:01<00:01, 16.52it/s]\n 58%|█████▊ | 29/50 [00:01<00:01, 16.33it/s]\n 62%|██████▏ | 31/50 [00:01<00:01, 16.27it/s]\n 66%|██████▌ | 33/50 [00:02<00:01, 16.25it/s]\n 70%|███████ | 35/50 [00:02<00:00, 16.34it/s]\n 74%|███████▍ | 37/50 [00:02<00:00, 16.37it/s]\n 78%|███████▊ | 39/50 [00:02<00:00, 16.47it/s]\n 82%|████████▏ | 41/50 [00:02<00:00, 16.54it/s]\n 86%|████████▌ | 43/50 [00:02<00:00, 16.60it/s]\n 90%|█████████ | 45/50 [00:02<00:00, 16.61it/s]\n 94%|█████████▍| 47/50 [00:02<00:00, 16.67it/s]\n 98%|█████████▊| 49/50 [00:03<00:00, 16.69it/s]\n100%|██████████| 50/50 [00:03<00:00, 16.02it/s]",
"metrics": {
"predict_time": 10.088599,
"total_time": 123.669948
},
"output": [
"https://replicate.delivery/pbxt/ejfwZwb8cOqSH0kJQLzDaoKfXJqJHyeqw0GimaXssggvwLUDB/out-0.jpg",
"https://replicate.delivery/pbxt/jE8uTi45GMp2OFqZ8JGWIWw8aJKE0PeeTqqQcnPmECCM8C1QA/out-1.jpg",
"https://replicate.delivery/pbxt/5NEneufID7gLa0WWTeq1URlMSYgvC9RcQHgNGOvajULZ4FqhA/out-2.jpg"
],
"started_at": "2023-04-24T12:58:43.360465Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/b5a4pesonfgw5klij6lnxcpu5m",
"cancel": "https://api.replicate.com/v1/predictions/b5a4pesonfgw5klij6lnxcpu5m/cancel"
},
"version": "10ba78e98238c724dd80edabd0636066540a22df40e0e12fecdf180bdb487235"
}
2023-04-24 12:58:44,617 [INFO] :: Using seed: 123
0%| | 0/50 [00:00<?, ?it/s]
2%|▏ | 1/50 [00:00<00:07, 6.98it/s]
6%|▌ | 3/50 [00:00<00:03, 11.91it/s]
10%|█ | 5/50 [00:00<00:03, 13.93it/s]
14%|█▍ | 7/50 [00:00<00:02, 14.82it/s]
18%|█▊ | 9/50 [00:00<00:02, 15.45it/s]
22%|██▏ | 11/50 [00:00<00:02, 15.70it/s]
26%|██▌ | 13/50 [00:00<00:02, 15.88it/s]
30%|███ | 15/50 [00:01<00:02, 15.95it/s]
34%|███▍ | 17/50 [00:01<00:02, 16.10it/s]
38%|███▊ | 19/50 [00:01<00:01, 16.32it/s]
42%|████▏ | 21/50 [00:01<00:01, 16.49it/s]
46%|████▌ | 23/50 [00:01<00:01, 16.49it/s]
50%|█████ | 25/50 [00:01<00:01, 16.56it/s]
54%|█████▍ | 27/50 [00:01<00:01, 16.52it/s]
58%|█████▊ | 29/50 [00:01<00:01, 16.33it/s]
62%|██████▏ | 31/50 [00:01<00:01, 16.27it/s]
66%|██████▌ | 33/50 [00:02<00:01, 16.25it/s]
70%|███████ | 35/50 [00:02<00:00, 16.34it/s]
74%|███████▍ | 37/50 [00:02<00:00, 16.37it/s]
78%|███████▊ | 39/50 [00:02<00:00, 16.47it/s]
82%|████████▏ | 41/50 [00:02<00:00, 16.54it/s]
86%|████████▌ | 43/50 [00:02<00:00, 16.60it/s]
90%|█████████ | 45/50 [00:02<00:00, 16.61it/s]
94%|█████████▍| 47/50 [00:02<00:00, 16.67it/s]
98%|█████████▊| 49/50 [00:03<00:00, 16.69it/s]
100%|██████████| 50/50 [00:03<00:00, 16.02it/s]