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:1ae4f947fc9876534b8f680074b92274e32017bd85e1a3c1f96ae172c3c98f0e",
{
input: {
seed: 123,
image: "https://replicate.delivery/pbxt/Ia2sH4mZsg448cYoYBspSFbg5MtdDXCSBmtbQJ1sUscw0rVl/2.jpg",
prompt: "A big beautiful++ Christmas++ tree++++ in a living room--",
mask_image: "https://replicate.delivery/pbxt/Ia2sGuBRcn7Va7fcHH1IapXZgguPWEOSoqjkM6B6NxziW2YV/2_mask.jpg",
num_outputs: 3,
guidance_scale: 7.5,
negative_prompt: "",
num_inference_steps: 40
}
}
);
// 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:1ae4f947fc9876534b8f680074b92274e32017bd85e1a3c1f96ae172c3c98f0e",
input={
"seed": 123,
"image": "https://replicate.delivery/pbxt/Ia2sH4mZsg448cYoYBspSFbg5MtdDXCSBmtbQJ1sUscw0rVl/2.jpg",
"prompt": "A big beautiful++ Christmas++ tree++++ in a living room--",
"mask_image": "https://replicate.delivery/pbxt/Ia2sGuBRcn7Va7fcHH1IapXZgguPWEOSoqjkM6B6NxziW2YV/2_mask.jpg",
"num_outputs": 3,
"guidance_scale": 7.5,
"negative_prompt": "",
"num_inference_steps": 40
}
)
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:1ae4f947fc9876534b8f680074b92274e32017bd85e1a3c1f96ae172c3c98f0e",
"input": {
"seed": 123,
"image": "https://replicate.delivery/pbxt/Ia2sH4mZsg448cYoYBspSFbg5MtdDXCSBmtbQJ1sUscw0rVl/2.jpg",
"prompt": "A big beautiful++ Christmas++ tree++++ in a living room--",
"mask_image": "https://replicate.delivery/pbxt/Ia2sGuBRcn7Va7fcHH1IapXZgguPWEOSoqjkM6B6NxziW2YV/2_mask.jpg",
"num_outputs": 3,
"guidance_scale": 7.5,
"negative_prompt": "",
"num_inference_steps": 40
}
}' \
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-14T12:05:54.408925Z",
"created_at": "2023-04-14T12:05:45.000517Z",
"data_removed": false,
"error": null,
"id": "iqkruiv7vrccpbi5hnzaq7qnwy",
"input": {
"seed": 123,
"image": "https://replicate.delivery/pbxt/Ia2sH4mZsg448cYoYBspSFbg5MtdDXCSBmtbQJ1sUscw0rVl/2.jpg",
"prompt": "A big beautiful++ Christmas++ tree++++ in a living room--",
"mask_image": "https://replicate.delivery/pbxt/Ia2sGuBRcn7Va7fcHH1IapXZgguPWEOSoqjkM6B6NxziW2YV/2_mask.jpg",
"num_outputs": 3,
"guidance_scale": 7.5,
"num_inference_steps": 40
},
"logs": "2023-04-14 12:05:46,224 [INFO] :: Running pipeline using stabilityai/stable-diffusion-2-inpainting\n2023-04-14 12:05:46,224 [INFO] :: Using seed: 123\n 0%| | 0/40 [00:00<?, ?it/s]\n 2%|▎ | 1/40 [00:00<00:09, 4.09it/s]\n 8%|▊ | 3/40 [00:00<00:05, 7.35it/s]\n 12%|█▎ | 5/40 [00:00<00:04, 8.61it/s]\n 18%|█▊ | 7/40 [00:00<00:03, 9.24it/s]\n 22%|██▎ | 9/40 [00:01<00:03, 9.60it/s]\n 28%|██▊ | 11/40 [00:01<00:02, 9.82it/s]\n 32%|███▎ | 13/40 [00:01<00:02, 9.96it/s]\n 38%|███▊ | 15/40 [00:01<00:02, 10.06it/s]\n 42%|████▎ | 17/40 [00:01<00:02, 10.13it/s]\n 48%|████▊ | 19/40 [00:01<00:02, 10.17it/s]\n 52%|█████▎ | 21/40 [00:02<00:01, 10.19it/s]\n 57%|█████▊ | 23/40 [00:02<00:01, 10.20it/s]\n 62%|██████▎ | 25/40 [00:02<00:01, 10.22it/s]\n 68%|██████▊ | 27/40 [00:02<00:01, 10.23it/s]\n 72%|███████▎ | 29/40 [00:02<00:01, 10.24it/s]\n 78%|███████▊ | 31/40 [00:03<00:00, 10.25it/s]\n 82%|████████▎ | 33/40 [00:03<00:00, 10.20it/s]\n 88%|████████▊ | 35/40 [00:03<00:00, 10.22it/s]\n 92%|█████████▎| 37/40 [00:03<00:00, 10.23it/s]\n 98%|█████████▊| 39/40 [00:03<00:00, 10.23it/s]\n100%|██████████| 40/40 [00:04<00:00, 9.87it/s]",
"metrics": {
"predict_time": 9.299582,
"total_time": 9.408408
},
"output": [
"https://replicate.delivery/pbxt/CGLr7LVy6WayPdxuHgJoCaMG8Ew9t2sMonu2nSA0IKTozbME/out-0.jpeg",
"https://replicate.delivery/pbxt/NCMbRaT383bwBden1l9S98iTlfvIyC3cluwKWmPjXyGiOvxQA/out-1.jpeg",
"https://replicate.delivery/pbxt/2liMFvmZegSRB6eeEruHYKKexllY2V2oPFeQzXHIBBcQ05NGC/out-2.jpeg"
],
"started_at": "2023-04-14T12:05:45.109343Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/iqkruiv7vrccpbi5hnzaq7qnwy",
"cancel": "https://api.replicate.com/v1/predictions/iqkruiv7vrccpbi5hnzaq7qnwy/cancel"
},
"version": "1ae4f947fc9876534b8f680074b92274e32017bd85e1a3c1f96ae172c3c98f0e"
}
2023-04-14 12:05:46,224 [INFO] :: Running pipeline using stabilityai/stable-diffusion-2-inpainting
2023-04-14 12:05:46,224 [INFO] :: Using seed: 123
0%| | 0/40 [00:00<?, ?it/s]
2%|▎ | 1/40 [00:00<00:09, 4.09it/s]
8%|▊ | 3/40 [00:00<00:05, 7.35it/s]
12%|█▎ | 5/40 [00:00<00:04, 8.61it/s]
18%|█▊ | 7/40 [00:00<00:03, 9.24it/s]
22%|██▎ | 9/40 [00:01<00:03, 9.60it/s]
28%|██▊ | 11/40 [00:01<00:02, 9.82it/s]
32%|███▎ | 13/40 [00:01<00:02, 9.96it/s]
38%|███▊ | 15/40 [00:01<00:02, 10.06it/s]
42%|████▎ | 17/40 [00:01<00:02, 10.13it/s]
48%|████▊ | 19/40 [00:01<00:02, 10.17it/s]
52%|█████▎ | 21/40 [00:02<00:01, 10.19it/s]
57%|█████▊ | 23/40 [00:02<00:01, 10.20it/s]
62%|██████▎ | 25/40 [00:02<00:01, 10.22it/s]
68%|██████▊ | 27/40 [00:02<00:01, 10.23it/s]
72%|███████▎ | 29/40 [00:02<00:01, 10.24it/s]
78%|███████▊ | 31/40 [00:03<00:00, 10.25it/s]
82%|████████▎ | 33/40 [00:03<00:00, 10.20it/s]
88%|████████▊ | 35/40 [00:03<00:00, 10.22it/s]
92%|█████████▎| 37/40 [00:03<00:00, 10.23it/s]
98%|█████████▊| 39/40 [00:03<00:00, 10.23it/s]
100%|██████████| 40/40 [00:04<00:00, 9.87it/s]