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.
smoretalk /flamel-inpainting:4d25d55d
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 smoretalk/flamel-inpainting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"smoretalk/flamel-inpainting:4d25d55d1842be85eafb5556076fe1384cce372653a23e6ef408babd431578f3",
{
input: {
prompt: "A cat",
mask_blur: 5,
init_image: "https://replicate.delivery/pbxt/LiFs7DmGM9L6CxF6ydycrt8wH0mAaRXyyzY1s2UkHZBqg34R/binary%20%283%29.png",
mask_image: "https://replicate.delivery/pbxt/LiFs8472d5c1BuJTd66RhSoOMIaRqc310xRstSpDrwoH3KdT/mask-1725956473279.png",
guidance_scale: 1.5,
mask_inflation: 5,
controlnet_scale: 1,
num_inference_steps: 8,
num_images_per_prompt: 1
}
}
);
// 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 smoretalk/flamel-inpainting using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"smoretalk/flamel-inpainting:4d25d55d1842be85eafb5556076fe1384cce372653a23e6ef408babd431578f3",
input={
"prompt": "A cat",
"mask_blur": 5,
"init_image": "https://replicate.delivery/pbxt/LiFs7DmGM9L6CxF6ydycrt8wH0mAaRXyyzY1s2UkHZBqg34R/binary%20%283%29.png",
"mask_image": "https://replicate.delivery/pbxt/LiFs8472d5c1BuJTd66RhSoOMIaRqc310xRstSpDrwoH3KdT/mask-1725956473279.png",
"guidance_scale": 1.5,
"mask_inflation": 5,
"controlnet_scale": 1,
"num_inference_steps": 8,
"num_images_per_prompt": 1
}
)
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 smoretalk/flamel-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": "smoretalk/flamel-inpainting:4d25d55d1842be85eafb5556076fe1384cce372653a23e6ef408babd431578f3",
"input": {
"prompt": "A cat",
"mask_blur": 5,
"init_image": "https://replicate.delivery/pbxt/LiFs7DmGM9L6CxF6ydycrt8wH0mAaRXyyzY1s2UkHZBqg34R/binary%20%283%29.png",
"mask_image": "https://replicate.delivery/pbxt/LiFs8472d5c1BuJTd66RhSoOMIaRqc310xRstSpDrwoH3KdT/mask-1725956473279.png",
"guidance_scale": 1.5,
"mask_inflation": 5,
"controlnet_scale": 1,
"num_inference_steps": 8,
"num_images_per_prompt": 1
}
}' \
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": "2024-09-30T10:37:06.895702Z",
"created_at": "2024-09-30T10:34:48.001000Z",
"data_removed": false,
"error": null,
"id": "d2n41nsx85rj40cj89zre226n0",
"input": {
"prompt": "A cat",
"mask_blur": 5,
"init_image": "https://replicate.delivery/pbxt/LiFs7DmGM9L6CxF6ydycrt8wH0mAaRXyyzY1s2UkHZBqg34R/binary%20%283%29.png",
"mask_image": "https://replicate.delivery/pbxt/LiFs8472d5c1BuJTd66RhSoOMIaRqc310xRstSpDrwoH3KdT/mask-1725956473279.png",
"guidance_scale": 1.5,
"mask_inflation": 5,
"controlnet_scale": 1,
"num_inference_steps": 8,
"num_images_per_prompt": 1
},
"logs": "DEVICE: cuda\nDTYPE: torch.float16\nUsing seed: 40762\n[~] Finish setup in 0.056426048278808594 secs.\nStart inference...\n[Debug] Prompt: A cat, best quality, high detail, sharp focus\n 0%| | 0/7 [00:00<?, ?it/s]\n 14%|█▍ | 1/7 [00:00<00:01, 3.59it/s]\n 29%|██▊ | 2/7 [00:00<00:01, 4.54it/s]\n 43%|████▎ | 3/7 [00:00<00:00, 4.96it/s]\n 57%|█████▋ | 4/7 [00:00<00:00, 5.18it/s]\n 71%|███████▏ | 5/7 [00:00<00:00, 5.30it/s]\n 86%|████████▌ | 6/7 [00:01<00:00, 5.38it/s]\n100%|██████████| 7/7 [00:01<00:00, 5.44it/s]\n100%|██████████| 7/7 [00:01<00:00, 5.15it/s]\n[~] Finish generation in 2.5994410514831543 secs.",
"metrics": {
"predict_time": 3.7533543910000002,
"total_time": 138.894702
},
"output": [
"https://replicate.delivery/yhqm/ZhSHtxiGmvreUiU2fdwMLcAkcJ1a2MT2PDk3pzOCyktSFDiTA/out_0.png"
],
"started_at": "2024-09-30T10:37:03.142347Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/d2n41nsx85rj40cj89zre226n0",
"cancel": "https://api.replicate.com/v1/predictions/d2n41nsx85rj40cj89zre226n0/cancel"
},
"version": "4d25d55d1842be85eafb5556076fe1384cce372653a23e6ef408babd431578f3"
}
DEVICE: cuda
DTYPE: torch.float16
Using seed: 40762
[~] Finish setup in 0.056426048278808594 secs.
Start inference...
[Debug] Prompt: A cat, best quality, high detail, sharp focus
0%| | 0/7 [00:00<?, ?it/s]
14%|█▍ | 1/7 [00:00<00:01, 3.59it/s]
29%|██▊ | 2/7 [00:00<00:01, 4.54it/s]
43%|████▎ | 3/7 [00:00<00:00, 4.96it/s]
57%|█████▋ | 4/7 [00:00<00:00, 5.18it/s]
71%|███████▏ | 5/7 [00:00<00:00, 5.30it/s]
86%|████████▌ | 6/7 [00:01<00:00, 5.38it/s]
100%|██████████| 7/7 [00:01<00:00, 5.44it/s]
100%|██████████| 7/7 [00:01<00:00, 5.15it/s]
[~] Finish generation in 2.5994410514831543 secs.