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:1e4a05970ece5b18cf3670cf2b5fe4a97bd595853ec19abced65d8fe9c98def9",
{
input: {
image: "https://replicate.delivery/pbxt/Ia2E3MUrVDVXITRVSKCHcCYi9WMYGoTpqxtqZ0PuqRoaY3FW/1.jpg",
prompt: "a black++ leather++ couch in a living room-- in front of wall--",
mask_image: "https://replicate.delivery/pbxt/Ia2E2SDOE51oEfLeToezFAIYKw84oX0wHJYNVO5GUr6YMFMi/1_mask.jpg",
num_outputs: 3,
preprocessing: "pad",
guidance_scale: 7.5,
negative_prompt: "",
num_inference_steps: 30
}
}
);
// 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:1e4a05970ece5b18cf3670cf2b5fe4a97bd595853ec19abced65d8fe9c98def9",
input={
"image": "https://replicate.delivery/pbxt/Ia2E3MUrVDVXITRVSKCHcCYi9WMYGoTpqxtqZ0PuqRoaY3FW/1.jpg",
"prompt": "a black++ leather++ couch in a living room-- in front of wall--",
"mask_image": "https://replicate.delivery/pbxt/Ia2E2SDOE51oEfLeToezFAIYKw84oX0wHJYNVO5GUr6YMFMi/1_mask.jpg",
"num_outputs": 3,
"preprocessing": "pad",
"guidance_scale": 7.5,
"negative_prompt": "",
"num_inference_steps": 30
}
)
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:1e4a05970ece5b18cf3670cf2b5fe4a97bd595853ec19abced65d8fe9c98def9",
"input": {
"image": "https://replicate.delivery/pbxt/Ia2E3MUrVDVXITRVSKCHcCYi9WMYGoTpqxtqZ0PuqRoaY3FW/1.jpg",
"prompt": "a black++ leather++ couch in a living room-- in front of wall--",
"mask_image": "https://replicate.delivery/pbxt/Ia2E2SDOE51oEfLeToezFAIYKw84oX0wHJYNVO5GUr6YMFMi/1_mask.jpg",
"num_outputs": 3,
"preprocessing": "pad",
"guidance_scale": 7.5,
"negative_prompt": "",
"num_inference_steps": 30
}
}' \
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-02T07:54:29.142719Z",
"created_at": "2023-04-02T07:54:02.912224Z",
"data_removed": false,
"error": null,
"id": "oyj2r4rnfbhlrnecq2vlo22s3q",
"input": {
"image": "https://replicate.delivery/pbxt/Ia2E3MUrVDVXITRVSKCHcCYi9WMYGoTpqxtqZ0PuqRoaY3FW/1.jpg",
"prompt": "a black++ leather++ couch in a living room-- in front of wall--",
"mask_image": "https://replicate.delivery/pbxt/Ia2E2SDOE51oEfLeToezFAIYKw84oX0wHJYNVO5GUr6YMFMi/1_mask.jpg",
"num_outputs": 3,
"preprocessing": "pad",
"guidance_scale": 7.5,
"num_inference_steps": 30
},
"logs": "2023-04-02 07:54:03,638 [DEBUG] main.py.predict():162 :: Running pipeline using stabilityai/stable-diffusion-2-inpainting\n2023-04-02 07:54:03,639 [INFO] main.py.predict():163 :: Using seed: 5245\n2023-04-02 07:54:03,639 [DEBUG] main.py.predict():164 :: Using preprocessing_choice: pad\n2023-04-02 07:54:03,908 [DEBUG] TiffImagePlugin.py.load():856 :: tag: Orientation (274) - type: short (3) - value: b'\\x00\\x01'\n2023-04-02 07:54:03,908 [DEBUG] TiffImagePlugin.py.load():856 :: tag: ExifIFD (34665) - type: long (4) - value: b'\\x00\\x00\\x00&'\n2023-04-02 07:54:05,398 [DEBUG] main.py.predict():178 :: Using prompt: RAW photo, a black++ leather++ couch in a living room-- in front of wall--, 8k uhd, dslr, high quality, high resolution\n2023-04-02 07:54:05,398 [DEBUG] main.py.predict():179 :: Using negative_prompt: , sketch, cartoon, drawing, anime, deformed, distorted, disfigured\n 0%| | 0/30 [00:00<?, ?it/s]\n 3%|▎ | 1/30 [00:01<00:40, 1.39s/it]\n 7%|▋ | 2/30 [00:01<00:25, 1.08it/s]\n 10%|█ | 3/30 [00:02<00:21, 1.27it/s]\n 13%|█▎ | 4/30 [00:03<00:18, 1.38it/s]\n 17%|█▋ | 5/30 [00:03<00:17, 1.46it/s]\n 20%|██ | 6/30 [00:04<00:15, 1.50it/s]\n 23%|██▎ | 7/30 [00:05<00:15, 1.53it/s]\n 27%|██▋ | 8/30 [00:05<00:14, 1.55it/s]\n 30%|███ | 9/30 [00:06<00:13, 1.55it/s]\n 33%|███▎ | 10/30 [00:07<00:12, 1.57it/s]\n 37%|███▋ | 11/30 [00:07<00:12, 1.57it/s]\n 40%|████ | 12/30 [00:08<00:11, 1.57it/s]\n 43%|████▎ | 13/30 [00:08<00:10, 1.57it/s]\n 47%|████▋ | 14/30 [00:09<00:10, 1.56it/s]\n 50%|█████ | 15/30 [00:10<00:09, 1.56it/s]\n 53%|█████▎ | 16/30 [00:10<00:08, 1.56it/s]\n 57%|█████▋ | 17/30 [00:11<00:08, 1.55it/s]\n 60%|██████ | 18/30 [00:12<00:07, 1.55it/s]\n 63%|██████▎ | 19/30 [00:12<00:07, 1.54it/s]\n 67%|██████▋ | 20/30 [00:13<00:06, 1.54it/s]\n 70%|███████ | 21/30 [00:14<00:05, 1.54it/s]\n 73%|███████▎ | 22/30 [00:14<00:05, 1.54it/s]\n 77%|███████▋ | 23/30 [00:15<00:04, 1.53it/s]\n 80%|████████ | 24/30 [00:16<00:03, 1.53it/s]\n 83%|████████▎ | 25/30 [00:16<00:03, 1.53it/s]\n 87%|████████▋ | 26/30 [00:17<00:02, 1.53it/s]\n 90%|█████████ | 27/30 [00:18<00:01, 1.52it/s]\n 93%|█████████▎| 28/30 [00:18<00:01, 1.51it/s]\n 97%|█████████▋| 29/30 [00:19<00:00, 1.51it/s]\n100%|██████████| 30/30 [00:20<00:00, 1.51it/s]\n100%|██████████| 30/30 [00:20<00:00, 1.50it/s]\n2023-04-02 07:54:26,723 [DEBUG] main.py.predict():197 :: Saved to /content/drive/MyDrive/tmp/images/out/out-0.png\n2023-04-02 07:54:26,846 [DEBUG] main.py.predict():197 :: Saved to /content/drive/MyDrive/tmp/images/out/out-1.png\n2023-04-02 07:54:26,961 [DEBUG] main.py.predict():197 :: Saved to /content/drive/MyDrive/tmp/images/out/out-2.png",
"metrics": {
"predict_time": 26.070355,
"total_time": 26.230495
},
"output": [
"https://replicate.delivery/pbxt/pUH6mzB5ARYFMdKDWjd7vxXu2SeRtc36GkenL8fQLC1l1cbhA/out-0.png",
"https://replicate.delivery/pbxt/6uOXSpdgDVLGJhhVVtV6lsitWTuXlHAvKrzPUeFPeoDzautQA/out-1.png",
"https://replicate.delivery/pbxt/aQelQG63kSTcUqy9wBQkEDJT520ovmEv2gcwK6w6lDLaN3WIA/out-2.png"
],
"started_at": "2023-04-02T07:54:03.072364Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/oyj2r4rnfbhlrnecq2vlo22s3q",
"cancel": "https://api.replicate.com/v1/predictions/oyj2r4rnfbhlrnecq2vlo22s3q/cancel"
},
"version": "1e4a05970ece5b18cf3670cf2b5fe4a97bd595853ec19abced65d8fe9c98def9"
}
2023-04-02 07:54:03,638 [DEBUG] main.py.predict():162 :: Running pipeline using stabilityai/stable-diffusion-2-inpainting
2023-04-02 07:54:03,639 [INFO] main.py.predict():163 :: Using seed: 5245
2023-04-02 07:54:03,639 [DEBUG] main.py.predict():164 :: Using preprocessing_choice: pad
2023-04-02 07:54:03,908 [DEBUG] TiffImagePlugin.py.load():856 :: tag: Orientation (274) - type: short (3) - value: b'\x00\x01'
2023-04-02 07:54:03,908 [DEBUG] TiffImagePlugin.py.load():856 :: tag: ExifIFD (34665) - type: long (4) - value: b'\x00\x00\x00&'
2023-04-02 07:54:05,398 [DEBUG] main.py.predict():178 :: Using prompt: RAW photo, a black++ leather++ couch in a living room-- in front of wall--, 8k uhd, dslr, high quality, high resolution
2023-04-02 07:54:05,398 [DEBUG] main.py.predict():179 :: Using negative_prompt: , sketch, cartoon, drawing, anime, deformed, distorted, disfigured
0%| | 0/30 [00:00<?, ?it/s]
3%|▎ | 1/30 [00:01<00:40, 1.39s/it]
7%|▋ | 2/30 [00:01<00:25, 1.08it/s]
10%|█ | 3/30 [00:02<00:21, 1.27it/s]
13%|█▎ | 4/30 [00:03<00:18, 1.38it/s]
17%|█▋ | 5/30 [00:03<00:17, 1.46it/s]
20%|██ | 6/30 [00:04<00:15, 1.50it/s]
23%|██▎ | 7/30 [00:05<00:15, 1.53it/s]
27%|██▋ | 8/30 [00:05<00:14, 1.55it/s]
30%|███ | 9/30 [00:06<00:13, 1.55it/s]
33%|███▎ | 10/30 [00:07<00:12, 1.57it/s]
37%|███▋ | 11/30 [00:07<00:12, 1.57it/s]
40%|████ | 12/30 [00:08<00:11, 1.57it/s]
43%|████▎ | 13/30 [00:08<00:10, 1.57it/s]
47%|████▋ | 14/30 [00:09<00:10, 1.56it/s]
50%|█████ | 15/30 [00:10<00:09, 1.56it/s]
53%|█████▎ | 16/30 [00:10<00:08, 1.56it/s]
57%|█████▋ | 17/30 [00:11<00:08, 1.55it/s]
60%|██████ | 18/30 [00:12<00:07, 1.55it/s]
63%|██████▎ | 19/30 [00:12<00:07, 1.54it/s]
67%|██████▋ | 20/30 [00:13<00:06, 1.54it/s]
70%|███████ | 21/30 [00:14<00:05, 1.54it/s]
73%|███████▎ | 22/30 [00:14<00:05, 1.54it/s]
77%|███████▋ | 23/30 [00:15<00:04, 1.53it/s]
80%|████████ | 24/30 [00:16<00:03, 1.53it/s]
83%|████████▎ | 25/30 [00:16<00:03, 1.53it/s]
87%|████████▋ | 26/30 [00:17<00:02, 1.53it/s]
90%|█████████ | 27/30 [00:18<00:01, 1.52it/s]
93%|█████████▎| 28/30 [00:18<00:01, 1.51it/s]
97%|█████████▋| 29/30 [00:19<00:00, 1.51it/s]
100%|██████████| 30/30 [00:20<00:00, 1.51it/s]
100%|██████████| 30/30 [00:20<00:00, 1.50it/s]
2023-04-02 07:54:26,723 [DEBUG] main.py.predict():197 :: Saved to /content/drive/MyDrive/tmp/images/out/out-0.png
2023-04-02 07:54:26,846 [DEBUG] main.py.predict():197 :: Saved to /content/drive/MyDrive/tmp/images/out/out-1.png
2023-04-02 07:54:26,961 [DEBUG] main.py.predict():197 :: Saved to /content/drive/MyDrive/tmp/images/out/out-2.png