typefile
{
"guidance_scale": 7.5,
"image_num": 4,
"image_path": "https://replicate.delivery/pbxt/JAIk0rFAOUG00uetuiLOHPz42lBcf7QfX3xWi7TVaxMXXD4n/sofa1.png",
"manual_seed": -1,
"negative_prompt": "illustration, 3d, sepia, painting, cartoons, sketch, (worst quality:2)",
"num_inference_steps": 20,
"pixel": "512 * 512",
"product_size": "0.5 * width",
"prompt": "modern sofa+ in a contemporary living room, filled with stylish decor+;modern, contemporary, sofa, living room, stylish decor",
"scale": 3
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Fls**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run logerzhu/ad-inpaint using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"logerzhu/ad-inpaint:b1c17d148455c1fda435ababe9ab1e03bc0d917cc3cf4251916f22c45c83c7df",
{
input: {
guidance_scale: 7.5,
image_num: 4,
image_path: "https://replicate.delivery/pbxt/JAIk0rFAOUG00uetuiLOHPz42lBcf7QfX3xWi7TVaxMXXD4n/sofa1.png",
manual_seed: -1,
negative_prompt: "illustration, 3d, sepia, painting, cartoons, sketch, (worst quality:2)",
num_inference_steps: 20,
pixel: "512 * 512",
product_size: "0.5 * width",
prompt: "modern sofa+ in a contemporary living room, filled with stylish decor+;modern, contemporary, sofa, living room, stylish decor",
scale: 3
}
}
);
// 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=r8_Fls**********************************
This is your API token. Keep it to yourself.
import replicate
Run logerzhu/ad-inpaint using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"logerzhu/ad-inpaint:b1c17d148455c1fda435ababe9ab1e03bc0d917cc3cf4251916f22c45c83c7df",
input={
"guidance_scale": 7.5,
"image_num": 4,
"image_path": "https://replicate.delivery/pbxt/JAIk0rFAOUG00uetuiLOHPz42lBcf7QfX3xWi7TVaxMXXD4n/sofa1.png",
"manual_seed": -1,
"negative_prompt": "illustration, 3d, sepia, painting, cartoons, sketch, (worst quality:2)",
"num_inference_steps": 20,
"pixel": "512 * 512",
"product_size": "0.5 * width",
"prompt": "modern sofa+ in a contemporary living room, filled with stylish decor+;modern, contemporary, sofa, living room, stylish decor",
"scale": 3
}
)
# To access the file URL:
print(output[0].url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output[0].read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Fls**********************************
This is your API token. Keep it to yourself.
Run logerzhu/ad-inpaint 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": "logerzhu/ad-inpaint:b1c17d148455c1fda435ababe9ab1e03bc0d917cc3cf4251916f22c45c83c7df",
"input": {
"guidance_scale": 7.5,
"image_num": 4,
"image_path": "https://replicate.delivery/pbxt/JAIk0rFAOUG00uetuiLOHPz42lBcf7QfX3xWi7TVaxMXXD4n/sofa1.png",
"manual_seed": -1,
"negative_prompt": "illustration, 3d, sepia, painting, cartoons, sketch, (worst quality:2)",
"num_inference_steps": 20,
"pixel": "512 * 512",
"product_size": "0.5 * width",
"prompt": "modern sofa+ in a contemporary living room, filled with stylish decor+;modern, contemporary, sofa, living room, stylish decor",
"scale": 3
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "ruw4whdbwnqkmntk45gfnbt4um",
"model": "logerzhu/ad-inpaint",
"version": "b1c17d148455c1fda435ababe9ab1e03bc0d917cc3cf4251916f22c45c83c7df",
"input": {
"guidance_scale": 7.5,
"image_num": 4,
"image_path": "https://replicate.delivery/pbxt/JAIk0rFAOUG00uetuiLOHPz42lBcf7QfX3xWi7TVaxMXXD4n/sofa1.png",
"manual_seed": -1,
"negative_prompt": "illustration, 3d, sepia, painting, cartoons, sketch, (worst quality:2)",
"num_inference_steps": 20,
"pixel": "512 * 512",
"product_size": "0.5 * width",
"prompt": "modern sofa+ in a contemporary living room, filled with stylish decor+;modern, contemporary, sofa, living room, stylish decor",
"scale": 3
},
"logs": "1. Image matting: (2040, 1128)\n2. Generate ad images\nSeed: 10401463081148911623\n 0%| | 0/5 [00:00<?, ?it/s]\n 20%|██ | 1/5 [00:00<00:00, 4.66it/s]\n 60%|██████ | 3/5 [00:00<00:00, 5.76it/s]\n100%|██████████| 5/5 [00:00<00:00, 8.13it/s]\n100%|██████████| 5/5 [00:00<00:00, 7.32it/s]\n 0%| | 0/20 [00:00<?, ?it/s]\n 5%|▌ | 1/20 [00:00<00:04, 4.67it/s]\n 10%|█ | 2/20 [00:00<00:03, 5.66it/s]\n 15%|█▌ | 3/20 [00:00<00:02, 6.07it/s]\n 20%|██ | 4/20 [00:00<00:02, 6.28it/s]\n 25%|██▌ | 5/20 [00:00<00:02, 6.41it/s]\n 30%|███ | 6/20 [00:00<00:02, 6.49it/s]\n 35%|███▌ | 7/20 [00:01<00:01, 6.54it/s]\n 40%|████ | 8/20 [00:01<00:01, 6.57it/s]\n 45%|████▌ | 9/20 [00:01<00:01, 6.60it/s]\n 50%|█████ | 10/20 [00:01<00:01, 6.61it/s]\n 55%|█████▌ | 11/20 [00:01<00:01, 6.63it/s]\n 60%|██████ | 12/20 [00:01<00:01, 6.64it/s]\n 65%|██████▌ | 13/20 [00:02<00:01, 6.64it/s]\n 70%|███████ | 14/20 [00:02<00:00, 6.65it/s]\n 75%|███████▌ | 15/20 [00:02<00:00, 6.65it/s]\n 80%|████████ | 16/20 [00:02<00:00, 6.65it/s]\n 85%|████████▌ | 17/20 [00:02<00:00, 6.65it/s]\n 90%|█████████ | 18/20 [00:02<00:00, 6.65it/s]\n 95%|█████████▌| 19/20 [00:02<00:00, 6.65it/s]\n100%|██████████| 20/20 [00:03<00:00, 6.66it/s]\n100%|██████████| 20/20 [00:03<00:00, 6.51it/s]\n4. Super resolution image\n- image 0\n- image 1\n- image 2\n- image 3",
"output": [
"https://replicate.delivery/pbxt/OWLoZ3R76QKUPxv1D9K2p4xrjIhQycwAcoYxebqN3POsv3pIA/top.png",
"https://replicate.delivery/pbxt/yBfegYrL1Yn91UhjDiRB2GghF81RkM7ewbyOrJeZ80yi99OFB/ad_inpaint_0.jpg",
"https://replicate.delivery/pbxt/k1NvfCQBe0qLl0VaEULDWyMVcAosy6eHLb6VMX7obPDwe9OFB/ad_inpaint_1.jpg",
"https://replicate.delivery/pbxt/wOJj1YoeoepFrEzCsbXfc9lcjyvoOF3SzlUMvtqXOJnze9OFB/ad_inpaint_2.jpg",
"https://replicate.delivery/pbxt/3ZmtvTJWj3a0Al9XR7SSKqpAfLTZtrkM7t5KjLvz7Nqsv3pIA/ad_inpaint_3.jpg"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-07-26T16:10:16.04047Z",
"started_at": "2023-07-26T16:11:51.194498Z",
"completed_at": "2023-07-26T16:12:09.608092Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/ruw4whdbwnqkmntk45gfnbt4um/cancel",
"get": "https://api.replicate.com/v1/predictions/ruw4whdbwnqkmntk45gfnbt4um"
},
"metrics": {
"predict_time": 18.413594,
"total_time": 113.567622
}
}




