fenglinglwb / large-hole-image-inpainting
MAT: Mask-Aware Transformer for Large Hole Image Inpainting
Prediction
fenglinglwb/large-hole-image-inpainting:58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9Input
{ "mask": "https://replicate.delivery/mgxm/afd9384f-ac1e-4e4a-bf04-ed558383dda7/mask2.png", "seed": -1, "image": "https://replicate.delivery/mgxm/77aa654a-36e1-477a-8e05-2ea1724a6791/test2.jpg", "model": "places", "noise_mode": "const", "truncation_psi": 0.9 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run fenglinglwb/large-hole-image-inpainting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "fenglinglwb/large-hole-image-inpainting:58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9", { input: { mask: "https://replicate.delivery/mgxm/afd9384f-ac1e-4e4a-bf04-ed558383dda7/mask2.png", seed: -1, image: "https://replicate.delivery/mgxm/77aa654a-36e1-477a-8e05-2ea1724a6791/test2.jpg", model: "places", noise_mode: "const", truncation_psi: 0.9 } } ); // 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.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run fenglinglwb/large-hole-image-inpainting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "fenglinglwb/large-hole-image-inpainting:58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9", input={ "mask": "https://replicate.delivery/mgxm/afd9384f-ac1e-4e4a-bf04-ed558383dda7/mask2.png", "seed": -1, "image": "https://replicate.delivery/mgxm/77aa654a-36e1-477a-8e05-2ea1724a6791/test2.jpg", "model": "places", "noise_mode": "const", "truncation_psi": 0.9 } ) # To access the file URL: print(output.url()) #=> "http://example.com" # To write the file to disk: with open("my-image.png", "wb") as file: file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
Run fenglinglwb/large-hole-image-inpainting 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": "fenglinglwb/large-hole-image-inpainting:58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9", "input": { "mask": "https://replicate.delivery/mgxm/afd9384f-ac1e-4e4a-bf04-ed558383dda7/mask2.png", "seed": -1, "image": "https://replicate.delivery/mgxm/77aa654a-36e1-477a-8e05-2ea1724a6791/test2.jpg", "model": "places", "noise_mode": "const", "truncation_psi": 0.9 } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2022-06-26T20:51:29.527455Z", "created_at": "2022-06-26T20:48:02.294685Z", "data_removed": false, "error": null, "id": "plrmmyhc3ncvld3j7sdnodskrm", "input": { "mask": "https://replicate.delivery/mgxm/afd9384f-ac1e-4e4a-bf04-ed558383dda7/mask2.png", "seed": -1, "image": "https://replicate.delivery/mgxm/77aa654a-36e1-477a-8e05-2ea1724a6791/test2.jpg", "model": "places", "noise_mode": "const", "truncation_psi": 0.9 }, "logs": "dpath:/tmp/tmpf1sbl7rctest2.jpg, model:places, trunc:0.9: noise:const\nUsing seed 4205516860......\nLoading data from: /tmp/tmpf1sbl7rctest2.jpg\nLoading mask from: /tmp/tmpzmjyj2a9mask2.png\nSetting loaded models\nPerforming model inference\nProcessing: tmpf1sbl7rctest2.png\nSetting up PyTorch plugin \"bias_act_plugin\"... Done.\nSetting up PyTorch plugin \"upfirdn2d_plugin\"... Done.\nSaving output image", "metrics": { "predict_time": 46.36934, "total_time": 207.23277 }, "output": "https://replicate.delivery/mgxm/6c3130ea-3d47-4a86-ae9a-8ede29b42c69/output.png", "started_at": "2022-06-26T20:50:43.158115Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/plrmmyhc3ncvld3j7sdnodskrm", "cancel": "https://api.replicate.com/v1/predictions/plrmmyhc3ncvld3j7sdnodskrm/cancel" }, "version": "58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9" }
Generated indpath:/tmp/tmpf1sbl7rctest2.jpg, model:places, trunc:0.9: noise:const Using seed 4205516860...... Loading data from: /tmp/tmpf1sbl7rctest2.jpg Loading mask from: /tmp/tmpzmjyj2a9mask2.png Setting loaded models Performing model inference Processing: tmpf1sbl7rctest2.png Setting up PyTorch plugin "bias_act_plugin"... Done. Setting up PyTorch plugin "upfirdn2d_plugin"... Done. Saving output image
Prediction
fenglinglwb/large-hole-image-inpainting:58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9IDlpssloquufcrtebnuhpafzfgruStatusSucceededSourceWebHardware–Total durationCreatedInput
{ "mask": "https://replicate.delivery/mgxm/3a207278-045a-4002-8250-c6cb23d09878/mask1.png", "seed": -1, "image": "https://replicate.delivery/mgxm/e9e8264f-c2f1-4ac4-ad2b-197c15ee9066/test1.jpg", "model": "places", "noise_mode": "random", "truncation_psi": 1 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run fenglinglwb/large-hole-image-inpainting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "fenglinglwb/large-hole-image-inpainting:58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9", { input: { mask: "https://replicate.delivery/mgxm/3a207278-045a-4002-8250-c6cb23d09878/mask1.png", seed: -1, image: "https://replicate.delivery/mgxm/e9e8264f-c2f1-4ac4-ad2b-197c15ee9066/test1.jpg", model: "places", noise_mode: "random", truncation_psi: 1 } } ); // 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.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run fenglinglwb/large-hole-image-inpainting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "fenglinglwb/large-hole-image-inpainting:58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9", input={ "mask": "https://replicate.delivery/mgxm/3a207278-045a-4002-8250-c6cb23d09878/mask1.png", "seed": -1, "image": "https://replicate.delivery/mgxm/e9e8264f-c2f1-4ac4-ad2b-197c15ee9066/test1.jpg", "model": "places", "noise_mode": "random", "truncation_psi": 1 } ) # To access the file URL: print(output.url()) #=> "http://example.com" # To write the file to disk: with open("my-image.png", "wb") as file: file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
Run fenglinglwb/large-hole-image-inpainting 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": "fenglinglwb/large-hole-image-inpainting:58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9", "input": { "mask": "https://replicate.delivery/mgxm/3a207278-045a-4002-8250-c6cb23d09878/mask1.png", "seed": -1, "image": "https://replicate.delivery/mgxm/e9e8264f-c2f1-4ac4-ad2b-197c15ee9066/test1.jpg", "model": "places", "noise_mode": "random", "truncation_psi": 1 } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2022-06-26T20:51:30.237856Z", "created_at": "2022-06-26T20:48:31.120366Z", "data_removed": false, "error": null, "id": "lpssloquufcrtebnuhpafzfgru", "input": { "mask": "https://replicate.delivery/mgxm/3a207278-045a-4002-8250-c6cb23d09878/mask1.png", "seed": -1, "image": "https://replicate.delivery/mgxm/e9e8264f-c2f1-4ac4-ad2b-197c15ee9066/test1.jpg", "model": "places", "noise_mode": "random", "truncation_psi": 1 }, "logs": "dpath:/tmp/tmp_q15ef4jtest1.jpg, model:places, trunc:1.0: noise:random\nUsing seed 4266714067......\nLoading data from: /tmp/tmp_q15ef4jtest1.jpg\nLoading mask from: /tmp/tmpcnu5azlymask1.png\nSetting loaded models\nPerforming model inference\nProcessing: tmp_q15ef4jtest1.png\nSaving output image", "metrics": { "predict_time": 1.332776, "total_time": 179.11749 }, "output": "https://replicate.delivery/mgxm/05a9e4ca-802a-4a8d-be99-2570154a6e34/output.png", "started_at": "2022-06-26T20:51:28.905080Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/lpssloquufcrtebnuhpafzfgru", "cancel": "https://api.replicate.com/v1/predictions/lpssloquufcrtebnuhpafzfgru/cancel" }, "version": "58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9" }
Generated indpath:/tmp/tmp_q15ef4jtest1.jpg, model:places, trunc:1.0: noise:random Using seed 4266714067...... Loading data from: /tmp/tmp_q15ef4jtest1.jpg Loading mask from: /tmp/tmpcnu5azlymask1.png Setting loaded models Performing model inference Processing: tmp_q15ef4jtest1.png Saving output image
Prediction
fenglinglwb/large-hole-image-inpainting:58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9ID7jp5yi426vb3do55uysv5p5idiStatusSucceededSourceWebHardware–Total durationCreatedInput
{ "mask": "https://replicate.delivery/mgxm/c9f7b189-a232-4feb-8c83-ba5f1322b499/mask2.png", "seed": "545329024", "image": "https://replicate.delivery/mgxm/f50d767f-c2e5-4d02-a045-bcdabca6946f/test2.png", "model": "celeba", "noise_mode": "const", "truncation_psi": 0.97 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run fenglinglwb/large-hole-image-inpainting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "fenglinglwb/large-hole-image-inpainting:58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9", { input: { mask: "https://replicate.delivery/mgxm/c9f7b189-a232-4feb-8c83-ba5f1322b499/mask2.png", seed: "545329024", image: "https://replicate.delivery/mgxm/f50d767f-c2e5-4d02-a045-bcdabca6946f/test2.png", model: "celeba", noise_mode: "const", truncation_psi: 0.97 } } ); // 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.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run fenglinglwb/large-hole-image-inpainting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "fenglinglwb/large-hole-image-inpainting:58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9", input={ "mask": "https://replicate.delivery/mgxm/c9f7b189-a232-4feb-8c83-ba5f1322b499/mask2.png", "seed": "545329024", "image": "https://replicate.delivery/mgxm/f50d767f-c2e5-4d02-a045-bcdabca6946f/test2.png", "model": "celeba", "noise_mode": "const", "truncation_psi": 0.97 } ) # To access the file URL: print(output.url()) #=> "http://example.com" # To write the file to disk: with open("my-image.png", "wb") as file: file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
Run fenglinglwb/large-hole-image-inpainting 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": "fenglinglwb/large-hole-image-inpainting:58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9", "input": { "mask": "https://replicate.delivery/mgxm/c9f7b189-a232-4feb-8c83-ba5f1322b499/mask2.png", "seed": "545329024", "image": "https://replicate.delivery/mgxm/f50d767f-c2e5-4d02-a045-bcdabca6946f/test2.png", "model": "celeba", "noise_mode": "const", "truncation_psi": 0.97 } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2022-06-26T21:01:39.783945Z", "created_at": "2022-06-26T21:01:38.001096Z", "data_removed": false, "error": null, "id": "7jp5yi426vb3do55uysv5p5idi", "input": { "mask": "https://replicate.delivery/mgxm/c9f7b189-a232-4feb-8c83-ba5f1322b499/mask2.png", "seed": "545329024", "image": "https://replicate.delivery/mgxm/f50d767f-c2e5-4d02-a045-bcdabca6946f/test2.png", "model": "celeba", "noise_mode": "const", "truncation_psi": 0.97 }, "logs": "dpath:/tmp/tmp4ct5bknxtest2.png, model:celeba, trunc:0.97: noise:const\nUsing seed 545329024......\nLoading data from: /tmp/tmp4ct5bknxtest2.png\nLoading mask from: /tmp/tmpbovbn5kxmask2.png\nSetting loaded models\nPerforming model inference\nProcessing: tmp4ct5bknxtest2.png\nSaving output image", "metrics": { "predict_time": 1.651136, "total_time": 1.782849 }, "output": "https://replicate.delivery/mgxm/2e628013-412d-4ba2-8b09-e0e946caf3dd/output.png", "started_at": "2022-06-26T21:01:38.132809Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/7jp5yi426vb3do55uysv5p5idi", "cancel": "https://api.replicate.com/v1/predictions/7jp5yi426vb3do55uysv5p5idi/cancel" }, "version": "58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9" }
Generated indpath:/tmp/tmp4ct5bknxtest2.png, model:celeba, trunc:0.97: noise:const Using seed 545329024...... Loading data from: /tmp/tmp4ct5bknxtest2.png Loading mask from: /tmp/tmpbovbn5kxmask2.png Setting loaded models Performing model inference Processing: tmp4ct5bknxtest2.png Saving output image
Prediction
fenglinglwb/large-hole-image-inpainting:58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9ID7urz5hwkw5c2hhxusvpz2ua3vqStatusSucceededSourceWebHardware–Total durationCreatedInput
{ "mask": "https://replicate.delivery/mgxm/292a2043-4e6f-440f-8469-55894a792d48/mask2.png", "seed": "223401596", "image": "https://replicate.delivery/mgxm/19354859-5cb8-4758-8209-137e577bf432/building.jpeg", "model": "places", "noise_mode": "const", "truncation_psi": 0.99 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run fenglinglwb/large-hole-image-inpainting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "fenglinglwb/large-hole-image-inpainting:58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9", { input: { mask: "https://replicate.delivery/mgxm/292a2043-4e6f-440f-8469-55894a792d48/mask2.png", seed: "223401596", image: "https://replicate.delivery/mgxm/19354859-5cb8-4758-8209-137e577bf432/building.jpeg", model: "places", noise_mode: "const", truncation_psi: 0.99 } } ); // 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.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run fenglinglwb/large-hole-image-inpainting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "fenglinglwb/large-hole-image-inpainting:58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9", input={ "mask": "https://replicate.delivery/mgxm/292a2043-4e6f-440f-8469-55894a792d48/mask2.png", "seed": "223401596", "image": "https://replicate.delivery/mgxm/19354859-5cb8-4758-8209-137e577bf432/building.jpeg", "model": "places", "noise_mode": "const", "truncation_psi": 0.99 } ) # To access the file URL: print(output.url()) #=> "http://example.com" # To write the file to disk: with open("my-image.png", "wb") as file: file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
Run fenglinglwb/large-hole-image-inpainting 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": "fenglinglwb/large-hole-image-inpainting:58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9", "input": { "mask": "https://replicate.delivery/mgxm/292a2043-4e6f-440f-8469-55894a792d48/mask2.png", "seed": "223401596", "image": "https://replicate.delivery/mgxm/19354859-5cb8-4758-8209-137e577bf432/building.jpeg", "model": "places", "noise_mode": "const", "truncation_psi": 0.99 } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2022-06-26T21:03:21.807536Z", "created_at": "2022-06-26T21:03:19.993165Z", "data_removed": false, "error": null, "id": "7urz5hwkw5c2hhxusvpz2ua3vq", "input": { "mask": "https://replicate.delivery/mgxm/292a2043-4e6f-440f-8469-55894a792d48/mask2.png", "seed": "223401596", "image": "https://replicate.delivery/mgxm/19354859-5cb8-4758-8209-137e577bf432/building.jpeg", "model": "places", "noise_mode": "const", "truncation_psi": 0.99 }, "logs": "dpath:/tmp/tmpbq3dzwz7building.jpeg, model:places, trunc:0.99: noise:const\nUsing seed 223401596......\nLoading data from: /tmp/tmpbq3dzwz7building.jpeg\nLoading mask from: /tmp/tmpd9adg8jxmask2.png\nSetting loaded models\nPerforming model inference\nProcessing: tmpbq3dzwz7building.jpeg\nSaving output image", "metrics": { "predict_time": 1.681152, "total_time": 1.814371 }, "output": "https://replicate.delivery/mgxm/36c1a7d6-ef8b-4180-a22e-4c651b6b7163/output.png", "started_at": "2022-06-26T21:03:20.126384Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/7urz5hwkw5c2hhxusvpz2ua3vq", "cancel": "https://api.replicate.com/v1/predictions/7urz5hwkw5c2hhxusvpz2ua3vq/cancel" }, "version": "58ff5d9beb279c180abf221f33d37214bfd2b1e0fc9528c655fbf0ae0a5efbb9" }
Generated indpath:/tmp/tmpbq3dzwz7building.jpeg, model:places, trunc:0.99: noise:const Using seed 223401596...... Loading data from: /tmp/tmpbq3dzwz7building.jpeg Loading mask from: /tmp/tmpd9adg8jxmask2.png Setting loaded models Performing model inference Processing: tmpbq3dzwz7building.jpeg Saving output image
Prediction
fenglinglwb/large-hole-image-inpainting:e00f409dc6d1417f0e7301015f9a18a338cb4e5eb872dc77271a64cf1b4dc44eIDlqlyobxz4bdtte3xea2xaw3sheStatusSucceededSourceWebHardware–Total durationCreatedInput
{ "seed": "-1", "image": "https://replicate.delivery/mgxm/761409eb-fb75-46e9-ac68-2c5a9568cdaf/building.jpeg", "model": "places", "noise_mode": "random", "truncation_psi": 1 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run fenglinglwb/large-hole-image-inpainting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "fenglinglwb/large-hole-image-inpainting:e00f409dc6d1417f0e7301015f9a18a338cb4e5eb872dc77271a64cf1b4dc44e", { input: { seed: "-1", image: "https://replicate.delivery/mgxm/761409eb-fb75-46e9-ac68-2c5a9568cdaf/building.jpeg", model: "places", noise_mode: "random", truncation_psi: 1 } } ); // 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.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run fenglinglwb/large-hole-image-inpainting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "fenglinglwb/large-hole-image-inpainting:e00f409dc6d1417f0e7301015f9a18a338cb4e5eb872dc77271a64cf1b4dc44e", input={ "seed": "-1", "image": "https://replicate.delivery/mgxm/761409eb-fb75-46e9-ac68-2c5a9568cdaf/building.jpeg", "model": "places", "noise_mode": "random", "truncation_psi": 1 } ) # To access the file URL: print(output.url()) #=> "http://example.com" # To write the file to disk: with open("my-image.png", "wb") as file: file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
Run fenglinglwb/large-hole-image-inpainting 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": "fenglinglwb/large-hole-image-inpainting:e00f409dc6d1417f0e7301015f9a18a338cb4e5eb872dc77271a64cf1b4dc44e", "input": { "seed": "-1", "image": "https://replicate.delivery/mgxm/761409eb-fb75-46e9-ac68-2c5a9568cdaf/building.jpeg", "model": "places", "noise_mode": "random", "truncation_psi": 1 } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2022-06-26T21:49:54.189159Z", "created_at": "2022-06-26T21:49:52.380695Z", "data_removed": false, "error": null, "id": "lqlyobxz4bdtte3xea2xaw3she", "input": { "seed": "-1", "image": "https://replicate.delivery/mgxm/761409eb-fb75-46e9-ac68-2c5a9568cdaf/building.jpeg", "model": "places", "noise_mode": "random", "truncation_psi": 1 }, "logs": "Using seed 1842419593......\nLoading data from: image.jpg\nSetting loaded models\nUsing Places Model....\nPerforming model inference\nProcessing: image.png\nSaving output image", "metrics": { "predict_time": 1.683542, "total_time": 1.808464 }, "output": "https://replicate.delivery/mgxm/4fcdcd7a-7f5c-4ebb-8792-63c7b8053c44/output.png", "started_at": "2022-06-26T21:49:52.505617Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/lqlyobxz4bdtte3xea2xaw3she", "cancel": "https://api.replicate.com/v1/predictions/lqlyobxz4bdtte3xea2xaw3she/cancel" }, "version": "e00f409dc6d1417f0e7301015f9a18a338cb4e5eb872dc77271a64cf1b4dc44e" }
Prediction
fenglinglwb/large-hole-image-inpainting:4b52aba43c7acdf89dd71429921a60f3696c2bb9c9242f10f1a6c212c0e596ebIDt4kjzfprk5ajzg5usemgjdnfxaStatusSucceededSourceWebHardware–Total durationCreatedInput
{ "mask": "https://replicate.delivery/mgxm/0b85ff4d-5718-4a53-8d33-7051007889e3/mask2.png", "seed": -1, "image": "https://replicate.delivery/mgxm/fc611025-f218-4049-a40b-6807bb13b728/test1.png", "model": "celeba", "noise_mode": "const", "truncation_psi": 0.95 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run fenglinglwb/large-hole-image-inpainting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "fenglinglwb/large-hole-image-inpainting:4b52aba43c7acdf89dd71429921a60f3696c2bb9c9242f10f1a6c212c0e596eb", { input: { mask: "https://replicate.delivery/mgxm/0b85ff4d-5718-4a53-8d33-7051007889e3/mask2.png", seed: -1, image: "https://replicate.delivery/mgxm/fc611025-f218-4049-a40b-6807bb13b728/test1.png", model: "celeba", noise_mode: "const", truncation_psi: 0.95 } } ); // 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.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run fenglinglwb/large-hole-image-inpainting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "fenglinglwb/large-hole-image-inpainting:4b52aba43c7acdf89dd71429921a60f3696c2bb9c9242f10f1a6c212c0e596eb", input={ "mask": "https://replicate.delivery/mgxm/0b85ff4d-5718-4a53-8d33-7051007889e3/mask2.png", "seed": -1, "image": "https://replicate.delivery/mgxm/fc611025-f218-4049-a40b-6807bb13b728/test1.png", "model": "celeba", "noise_mode": "const", "truncation_psi": 0.95 } ) # To access the file URL: print(output.url()) #=> "http://example.com" # To write the file to disk: with open("my-image.png", "wb") as file: file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
Run fenglinglwb/large-hole-image-inpainting 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": "fenglinglwb/large-hole-image-inpainting:4b52aba43c7acdf89dd71429921a60f3696c2bb9c9242f10f1a6c212c0e596eb", "input": { "mask": "https://replicate.delivery/mgxm/0b85ff4d-5718-4a53-8d33-7051007889e3/mask2.png", "seed": -1, "image": "https://replicate.delivery/mgxm/fc611025-f218-4049-a40b-6807bb13b728/test1.png", "model": "celeba", "noise_mode": "const", "truncation_psi": 0.95 } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2022-06-26T22:25:39.196412Z", "created_at": "2022-06-26T22:25:37.333332Z", "data_removed": false, "error": null, "id": "t4kjzfprk5ajzg5usemgjdnfxa", "input": { "mask": "https://replicate.delivery/mgxm/0b85ff4d-5718-4a53-8d33-7051007889e3/mask2.png", "seed": -1, "image": "https://replicate.delivery/mgxm/fc611025-f218-4049-a40b-6807bb13b728/test1.png", "model": "celeba", "noise_mode": "const", "truncation_psi": 0.95 }, "logs": "Using seed 2200029999......\nLoading data from: /tmp/tmp0z6zm1g2test1.png\nLoading mask from: /tmp/tmpgke0lceamask2.png\nSetting loaded models\nUsing CelebA model.....\nPerforming model inference\nProcessing: tmp0z6zm1g2test1.png\nSaving output image", "metrics": { "predict_time": 1.708998, "total_time": 1.86308 }, "output": "https://replicate.delivery/mgxm/8bd8e914-16ee-4ae7-8e8e-6ca040e09842/output.png", "started_at": "2022-06-26T22:25:37.487414Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/t4kjzfprk5ajzg5usemgjdnfxa", "cancel": "https://api.replicate.com/v1/predictions/t4kjzfprk5ajzg5usemgjdnfxa/cancel" }, "version": "4b52aba43c7acdf89dd71429921a60f3696c2bb9c9242f10f1a6c212c0e596eb" }
Prediction
fenglinglwb/large-hole-image-inpainting:4b52aba43c7acdf89dd71429921a60f3696c2bb9c9242f10f1a6c212c0e596ebIDjw3ulo3fyjctnbkedrl7wth4aqStatusSucceededSourceWebHardware–Total durationCreatedInput
{ "mask": "https://replicate.delivery/mgxm/b37ad7ee-9901-423e-8b3b-7b10779d9382/mask1.png", "seed": "744671987", "image": "https://replicate.delivery/mgxm/ed08488c-e105-4251-b443-ae9b42df0b8c/test1.png", "model": "celeba", "noise_mode": "const", "truncation_psi": 0.7 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; import fs from "node:fs"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run fenglinglwb/large-hole-image-inpainting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "fenglinglwb/large-hole-image-inpainting:4b52aba43c7acdf89dd71429921a60f3696c2bb9c9242f10f1a6c212c0e596eb", { input: { mask: "https://replicate.delivery/mgxm/b37ad7ee-9901-423e-8b3b-7b10779d9382/mask1.png", seed: "744671987", image: "https://replicate.delivery/mgxm/ed08488c-e105-4251-b443-ae9b42df0b8c/test1.png", model: "celeba", noise_mode: "const", truncation_psi: 0.7 } } ); // 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.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run fenglinglwb/large-hole-image-inpainting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "fenglinglwb/large-hole-image-inpainting:4b52aba43c7acdf89dd71429921a60f3696c2bb9c9242f10f1a6c212c0e596eb", input={ "mask": "https://replicate.delivery/mgxm/b37ad7ee-9901-423e-8b3b-7b10779d9382/mask1.png", "seed": "744671987", "image": "https://replicate.delivery/mgxm/ed08488c-e105-4251-b443-ae9b42df0b8c/test1.png", "model": "celeba", "noise_mode": "const", "truncation_psi": 0.7 } ) # To access the file URL: print(output.url()) #=> "http://example.com" # To write the file to disk: with open("my-image.png", "wb") as file: file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
Run fenglinglwb/large-hole-image-inpainting 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": "fenglinglwb/large-hole-image-inpainting:4b52aba43c7acdf89dd71429921a60f3696c2bb9c9242f10f1a6c212c0e596eb", "input": { "mask": "https://replicate.delivery/mgxm/b37ad7ee-9901-423e-8b3b-7b10779d9382/mask1.png", "seed": "744671987", "image": "https://replicate.delivery/mgxm/ed08488c-e105-4251-b443-ae9b42df0b8c/test1.png", "model": "celeba", "noise_mode": "const", "truncation_psi": 0.7 } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2022-06-26T22:26:09.680530Z", "created_at": "2022-06-26T22:26:07.861656Z", "data_removed": false, "error": null, "id": "jw3ulo3fyjctnbkedrl7wth4aq", "input": { "mask": "https://replicate.delivery/mgxm/b37ad7ee-9901-423e-8b3b-7b10779d9382/mask1.png", "seed": "744671987", "image": "https://replicate.delivery/mgxm/ed08488c-e105-4251-b443-ae9b42df0b8c/test1.png", "model": "celeba", "noise_mode": "const", "truncation_psi": 0.7 }, "logs": "Using seed 744671987......\nLoading data from: /tmp/tmp23bt8txdtest1.png\nLoading mask from: /tmp/tmp4l0tmwvlmask1.png\nSetting loaded models\nUsing CelebA model.....\nPerforming model inference\nProcessing: tmp23bt8txdtest1.png\nSaving output image", "metrics": { "predict_time": 1.663382, "total_time": 1.818874 }, "output": "https://replicate.delivery/mgxm/34e26d34-3b37-4370-a277-ddf74e4c28b4/output.png", "started_at": "2022-06-26T22:26:08.017148Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/jw3ulo3fyjctnbkedrl7wth4aq", "cancel": "https://api.replicate.com/v1/predictions/jw3ulo3fyjctnbkedrl7wth4aq/cancel" }, "version": "4b52aba43c7acdf89dd71429921a60f3696c2bb9c9242f10f1a6c212c0e596eb" }
Want to make some of these yourself?
Run this model