typefile
{
"guidance_scale": 5,
"input_image": "https://replicate.delivery/pbxt/KEp5Vxjgp2aqb28WsY9SEuPSeLABFXaPE69t8YSPyRUZU1Sl/IMG_9143.webp",
"negative_prompt": "nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry",
"num_steps": 20,
"prompt": "A photo of a blonde woman gwen Stacy, short hair, long on one side, solid white spider woman outfit, neon highlights, mid length portrait img",
"style_name": "Photographic (Default)",
"style_strength_ratio": 15
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_9lq**********************************
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 tencentarc/photomaker using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"tencentarc/photomaker:ec21add1fbbe49f58c1bff41de81c8bd0aa4267eb74019e6a67b5ed871cf86c9",
{
input: {
guidance_scale: 5,
input_image: "https://replicate.delivery/pbxt/KEp5Vxjgp2aqb28WsY9SEuPSeLABFXaPE69t8YSPyRUZU1Sl/IMG_9143.webp",
negative_prompt: "nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry",
num_steps: 20,
prompt: "A photo of a blonde woman gwen Stacy, short hair, long on one side, solid white spider woman outfit, neon highlights, mid length portrait img",
style_name: "Photographic (Default)",
style_strength_ratio: 15
}
}
);
// 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_9lq**********************************
This is your API token. Keep it to yourself.
import replicate
Run tencentarc/photomaker using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"tencentarc/photomaker:ec21add1fbbe49f58c1bff41de81c8bd0aa4267eb74019e6a67b5ed871cf86c9",
input={
"guidance_scale": 5,
"input_image": "https://replicate.delivery/pbxt/KEp5Vxjgp2aqb28WsY9SEuPSeLABFXaPE69t8YSPyRUZU1Sl/IMG_9143.webp",
"negative_prompt": "nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry",
"num_steps": 20,
"prompt": "A photo of a blonde woman gwen Stacy, short hair, long on one side, solid white spider woman outfit, neon highlights, mid length portrait img",
"style_name": "Photographic (Default)",
"style_strength_ratio": 15
}
)
# 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_9lq**********************************
This is your API token. Keep it to yourself.
Run tencentarc/photomaker 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": "tencentarc/photomaker:ec21add1fbbe49f58c1bff41de81c8bd0aa4267eb74019e6a67b5ed871cf86c9",
"input": {
"guidance_scale": 5,
"input_image": "https://replicate.delivery/pbxt/KEp5Vxjgp2aqb28WsY9SEuPSeLABFXaPE69t8YSPyRUZU1Sl/IMG_9143.webp",
"negative_prompt": "nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry",
"num_steps": 20,
"prompt": "A photo of a blonde woman gwen Stacy, short hair, long on one side, solid white spider woman outfit, neon highlights, mid length portrait img",
"style_name": "Photographic (Default)",
"style_strength_ratio": 15
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "4sx5uwdbxzpul5yjezba3morsy",
"model": "tencentarc/photomaker",
"version": "ec21add1fbbe49f58c1bff41de81c8bd0aa4267eb74019e6a67b5ed871cf86c9",
"input": {
"guidance_scale": 5,
"input_image": "https://replicate.delivery/pbxt/KEp5Vxjgp2aqb28WsY9SEuPSeLABFXaPE69t8YSPyRUZU1Sl/IMG_9143.webp",
"negative_prompt": "nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry",
"num_steps": 20,
"prompt": "A photo of a blonde woman gwen Stacy, short hair, long on one side, solid white spider woman outfit, neon highlights, mid length portrait img",
"style_name": "Photographic (Default)",
"style_strength_ratio": 15
},
"logs": "Using seed 440821064...\nStart inference...\n[Debug] Prompt: cinematic photo A photo of a blonde woman gwen Stacy, short hair, long on one side, solid white spider woman outfit, neon highlights, mid length portrait img . 35mm photograph, film, bokeh, professional, 4k, highly detailed\n[Debug] Neg Prompt: drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly nsfw, lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry\n3\n 0%| | 0/20 [00:00<?, ?it/s]\n 5%|▌ | 1/20 [00:00<00:03, 4.75it/s]\n 10%|█ | 2/20 [00:00<00:03, 4.76it/s]\n 15%|█▌ | 3/20 [00:00<00:03, 4.76it/s]\n 20%|██ | 4/20 [00:00<00:03, 4.75it/s]\n 25%|██▌ | 5/20 [00:01<00:03, 4.76it/s]\n 30%|███ | 6/20 [00:01<00:02, 4.77it/s]\n 35%|███▌ | 7/20 [00:01<00:02, 4.78it/s]\n 40%|████ | 8/20 [00:01<00:02, 4.77it/s]\n 45%|████▌ | 9/20 [00:01<00:02, 4.77it/s]\n 50%|█████ | 10/20 [00:02<00:02, 4.77it/s]\n 55%|█████▌ | 11/20 [00:02<00:01, 4.76it/s]\n 60%|██████ | 12/20 [00:02<00:01, 4.76it/s]\n 65%|██████▌ | 13/20 [00:02<00:01, 4.77it/s]\n 70%|███████ | 14/20 [00:02<00:01, 4.77it/s]\n 75%|███████▌ | 15/20 [00:03<00:01, 4.77it/s]\n 80%|████████ | 16/20 [00:03<00:00, 4.78it/s]\n 85%|████████▌ | 17/20 [00:03<00:00, 4.77it/s]\n 90%|█████████ | 18/20 [00:03<00:00, 4.77it/s]\n 95%|█████████▌| 19/20 [00:03<00:00, 4.77it/s]\n100%|██████████| 20/20 [00:04<00:00, 4.76it/s]\n100%|██████████| 20/20 [00:04<00:00, 4.77it/s]",
"output": [
"https://replicate.delivery/pbxt/2wb14RrZGvbEBBSYMfJTyF7ow1fX9s7Cizfz3gWB9MkjKTakA/image_0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-01-16T20:30:03.803347Z",
"started_at": "2024-01-16T20:30:03.837449Z",
"completed_at": "2024-01-16T20:30:10.686196Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/4sx5uwdbxzpul5yjezba3morsy/cancel",
"get": "https://api.replicate.com/v1/predictions/4sx5uwdbxzpul5yjezba3morsy"
},
"metrics": {
"predict_time": 6.848747,
"total_time": 6.882849
}
}
