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.
stability-ai /stable-diffusion-inpainting:95b72231
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";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run stability-ai/stable-diffusion-inpainting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"stability-ai/stable-diffusion-inpainting:95b7223104132402a9ae91cc677285bc5eb997834bd2349fa486f53910fd68b3",
{
input: {
mask: "https://replicate.delivery/pbxt/HtGQBqO9MtVbPm0G0K43nsvvjBB0E0PaWOhuNRrRBBT4ttbf/mask.png",
image: "https://replicate.delivery/pbxt/HtGQBfA5TrqFYZBf0UL18NTqHrzt8UiSIsAkUuMHtjvFDO6p/overture-creations-5sI6fQgYIuo.png",
width: 512,
height: 512,
prompt: "Face of a yellow cat, high resolution, sitting on a park bench",
scheduler: "DPMSolverMultistep",
num_outputs: 1,
guidance_scale: 7.5,
num_inference_steps: 25
}
}
);
console.log(output);
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 stability-ai/stable-diffusion-inpainting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"stability-ai/stable-diffusion-inpainting:95b7223104132402a9ae91cc677285bc5eb997834bd2349fa486f53910fd68b3",
input={
"mask": "https://replicate.delivery/pbxt/HtGQBqO9MtVbPm0G0K43nsvvjBB0E0PaWOhuNRrRBBT4ttbf/mask.png",
"image": "https://replicate.delivery/pbxt/HtGQBfA5TrqFYZBf0UL18NTqHrzt8UiSIsAkUuMHtjvFDO6p/overture-creations-5sI6fQgYIuo.png",
"width": 512,
"height": 512,
"prompt": "Face of a yellow cat, high resolution, sitting on a park bench",
"scheduler": "DPMSolverMultistep",
"num_outputs": 1,
"guidance_scale": 7.5,
"num_inference_steps": 25
}
)
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 stability-ai/stable-diffusion-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": "95b7223104132402a9ae91cc677285bc5eb997834bd2349fa486f53910fd68b3",
"input": {
"mask": "https://replicate.delivery/pbxt/HtGQBqO9MtVbPm0G0K43nsvvjBB0E0PaWOhuNRrRBBT4ttbf/mask.png",
"image": "https://replicate.delivery/pbxt/HtGQBfA5TrqFYZBf0UL18NTqHrzt8UiSIsAkUuMHtjvFDO6p/overture-creations-5sI6fQgYIuo.png",
"width": 512,
"height": 512,
"prompt": "Face of a yellow cat, high resolution, sitting on a park bench",
"scheduler": "DPMSolverMultistep",
"num_outputs": 1,
"guidance_scale": 7.5,
"num_inference_steps": 25
}
}' \
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": "2022-12-02T18:40:24.805380Z",
"created_at": "2022-12-02T18:40:22.058556Z",
"data_removed": false,
"error": null,
"id": "xkyxrm6j3jb3llitusuf4hycoa",
"input": {
"mask": "https://replicate.delivery/pbxt/HtGQBqO9MtVbPm0G0K43nsvvjBB0E0PaWOhuNRrRBBT4ttbf/mask.png",
"image": "https://replicate.delivery/pbxt/HtGQBfA5TrqFYZBf0UL18NTqHrzt8UiSIsAkUuMHtjvFDO6p/overture-creations-5sI6fQgYIuo.png",
"prompt": "Face of a yellow cat, high resolution, sitting on a park bench",
"num_outputs": 1,
"guidance_scale": 7.5,
"prompt_strength": 0.8,
"num_inference_steps": 25
},
"logs": "Using seed: 62372\n 0%| | 0/26 [00:00<?, ?it/s]\n 8%|▊ | 2/26 [00:00<00:01, 14.22it/s]\n 15%|█▌ | 4/26 [00:00<00:01, 15.62it/s]\n 23%|██▎ | 6/26 [00:00<00:01, 15.98it/s]\n 31%|███ | 8/26 [00:00<00:01, 16.07it/s]\n 38%|███▊ | 10/26 [00:00<00:00, 16.14it/s]\n 46%|████▌ | 12/26 [00:00<00:00, 16.29it/s]\n 54%|█████▍ | 14/26 [00:00<00:00, 16.39it/s]\n 62%|██████▏ | 16/26 [00:00<00:00, 16.40it/s]\n 69%|██████▉ | 18/26 [00:01<00:00, 16.42it/s]\n 77%|███████▋ | 20/26 [00:01<00:00, 16.49it/s]\n 85%|████████▍ | 22/26 [00:01<00:00, 16.31it/s]\n 92%|█████████▏| 24/26 [00:01<00:00, 16.37it/s]\n100%|██████████| 26/26 [00:01<00:00, 16.47it/s]\n100%|██████████| 26/26 [00:01<00:00, 16.26it/s]",
"metrics": {
"predict_time": 2.711119,
"total_time": 2.746824
},
"output": [
"https://replicate.delivery/pbxt/xs0pPOUM6HKmPlJJBXqKfE1YsiMzgNsCuGedlX0VqvPYifLgA/out-0.png"
],
"started_at": "2022-12-02T18:40:22.094261Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/xkyxrm6j3jb3llitusuf4hycoa",
"cancel": "https://api.replicate.com/v1/predictions/xkyxrm6j3jb3llitusuf4hycoa/cancel"
},
"version": "e5a34f913de0adc560d20e002c45ad43a80031b62caacc3d84010c6b6a64870c"
}
Using seed: 62372
0%| | 0/26 [00:00<?, ?it/s]
8%|▊ | 2/26 [00:00<00:01, 14.22it/s]
15%|█▌ | 4/26 [00:00<00:01, 15.62it/s]
23%|██▎ | 6/26 [00:00<00:01, 15.98it/s]
31%|███ | 8/26 [00:00<00:01, 16.07it/s]
38%|███▊ | 10/26 [00:00<00:00, 16.14it/s]
46%|████▌ | 12/26 [00:00<00:00, 16.29it/s]
54%|█████▍ | 14/26 [00:00<00:00, 16.39it/s]
62%|██████▏ | 16/26 [00:00<00:00, 16.40it/s]
69%|██████▉ | 18/26 [00:01<00:00, 16.42it/s]
77%|███████▋ | 20/26 [00:01<00:00, 16.49it/s]
85%|████████▍ | 22/26 [00:01<00:00, 16.31it/s]
92%|█████████▏| 24/26 [00:01<00:00, 16.37it/s]
100%|██████████| 26/26 [00:01<00:00, 16.47it/s]
100%|██████████| 26/26 [00:01<00:00, 16.26it/s]
This example was created by a different version, stability-ai/stable-diffusion-inpainting:e5a34f91.