typefile
{
"cfg_scale": 1.2,
"generation_mode": "fidelity",
"identity_scale": 0.8,
"image_height": 1024,
"image_width": 768,
"main_face_image": "https://replicate.delivery/pbxt/Kr6iendsvYS0F3MLmwRZ8q07XIMEJdemnQI3Cmq9nNrauJbq/zcy.webp",
"mix_identities": false,
"negative_prompt": "flaws in the eyes, flaws in the face, flaws, lowres, non-HDRi, low quality, worst quality,artifacts noise, text, watermark, glitch, deformed, mutated, ugly, disfigured, hands, low resolution, partially rendered objects, deformed or partially rendered eyes, deformed, deformed eyeballs, cross-eyed,blurry",
"num_samples": 4,
"num_steps": 4,
"output_format": "webp",
"output_quality": 80,
"prompt": "portrait, impressionist painting, loose brushwork, vibrant color, light and shadow play"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_TQU**********************************
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 bytedance/pulid using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"bytedance/pulid:c169c3b8f6952cf895d043d7b56830b4e9a3e9409a026004e9efbd9da42912b4",
{
input: {
cfg_scale: 1.2,
generation_mode: "fidelity",
identity_scale: 0.8,
image_height: 1024,
image_width: 768,
main_face_image: "https://replicate.delivery/pbxt/Kr6iendsvYS0F3MLmwRZ8q07XIMEJdemnQI3Cmq9nNrauJbq/zcy.webp",
mix_identities: false,
negative_prompt: "flaws in the eyes, flaws in the face, flaws, lowres, non-HDRi, low quality, worst quality,artifacts noise, text, watermark, glitch, deformed, mutated, ugly, disfigured, hands, low resolution, partially rendered objects, deformed or partially rendered eyes, deformed, deformed eyeballs, cross-eyed,blurry",
num_samples: 4,
num_steps: 4,
output_format: "webp",
output_quality: 80,
prompt: "portrait, impressionist painting, loose brushwork, vibrant color, light and shadow play"
}
}
);
// 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_TQU**********************************
This is your API token. Keep it to yourself.
import replicate
Run bytedance/pulid using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"bytedance/pulid:c169c3b8f6952cf895d043d7b56830b4e9a3e9409a026004e9efbd9da42912b4",
input={
"cfg_scale": 1.2,
"generation_mode": "fidelity",
"identity_scale": 0.8,
"image_height": 1024,
"image_width": 768,
"main_face_image": "https://replicate.delivery/pbxt/Kr6iendsvYS0F3MLmwRZ8q07XIMEJdemnQI3Cmq9nNrauJbq/zcy.webp",
"mix_identities": False,
"negative_prompt": "flaws in the eyes, flaws in the face, flaws, lowres, non-HDRi, low quality, worst quality,artifacts noise, text, watermark, glitch, deformed, mutated, ugly, disfigured, hands, low resolution, partially rendered objects, deformed or partially rendered eyes, deformed, deformed eyeballs, cross-eyed,blurry",
"num_samples": 4,
"num_steps": 4,
"output_format": "webp",
"output_quality": 80,
"prompt": "portrait, impressionist painting, loose brushwork, vibrant color, light and shadow play"
}
)
# 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_TQU**********************************
This is your API token. Keep it to yourself.
Run bytedance/pulid 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": "bytedance/pulid:c169c3b8f6952cf895d043d7b56830b4e9a3e9409a026004e9efbd9da42912b4",
"input": {
"cfg_scale": 1.2,
"generation_mode": "fidelity",
"identity_scale": 0.8,
"image_height": 1024,
"image_width": 768,
"main_face_image": "https://replicate.delivery/pbxt/Kr6iendsvYS0F3MLmwRZ8q07XIMEJdemnQI3Cmq9nNrauJbq/zcy.webp",
"mix_identities": false,
"negative_prompt": "flaws in the eyes, flaws in the face, flaws, lowres, non-HDRi, low quality, worst quality,artifacts noise, text, watermark, glitch, deformed, mutated, ugly, disfigured, hands, low resolution, partially rendered objects, deformed or partially rendered eyes, deformed, deformed eyeballs, cross-eyed,blurry",
"num_samples": 4,
"num_steps": 4,
"output_format": "webp",
"output_quality": 80,
"prompt": "portrait, impressionist painting, loose brushwork, vibrant color, light and shadow play"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "wkqmbjhy8nrgj0cf7xmvky7p58",
"model": "bytedance/pulid",
"version": "c169c3b8f6952cf895d043d7b56830b4e9a3e9409a026004e9efbd9da42912b4",
"input": {
"cfg_scale": 1.2,
"generation_mode": "fidelity",
"identity_scale": 0.8,
"image_height": 1024,
"image_width": 768,
"main_face_image": "https://replicate.delivery/pbxt/Kr6iendsvYS0F3MLmwRZ8q07XIMEJdemnQI3Cmq9nNrauJbq/zcy.webp",
"mix_identities": false,
"negative_prompt": "flaws in the eyes, flaws in the face, flaws, lowres, non-HDRi, low quality, worst quality,artifacts noise, text, watermark, glitch, deformed, mutated, ugly, disfigured, hands, low resolution, partially rendered objects, deformed or partially rendered eyes, deformed, deformed eyeballs, cross-eyed,blurry",
"num_samples": 4,
"num_steps": 4,
"output_format": "webp",
"output_quality": 80,
"prompt": "portrait, impressionist painting, loose brushwork, vibrant color, light and shadow play"
},
"logs": "Using seed: 61631\n[!] (<class 'cog.types.Path'>) main_face_image=/tmp/tmpk7az_pmizcy.webp\n[!] (<class 'NoneType'>) auxiliary_face_image1=None\n[!] (<class 'NoneType'>) auxiliary_face_image2=None\n[!] (<class 'NoneType'>) auxiliary_face_image3=None\n[!] (<class 'str'>) prompt=portrait, impressionist painting, loose brushwork, vibrant color, light and shadow play\n[!] (<class 'str'>) negative_prompt=flaws in the eyes, flaws in the face, flaws, lowres, non-HDRi, low quality, worst quality,artifacts noise, text, watermark, glitch, deformed, mutated, ugly, disfigured, hands, low resolution, partially rendered objects, deformed or partially rendered eyes, deformed, deformed eyeballs, cross-eyed,blurry\n[!] (<class 'float'>) cfg_scale=1.2\n[!] (<class 'int'>) num_samples=4\n[!] (<class 'int'>) seed=61631\n[!] (<class 'int'>) num_steps=4\n[!] (<class 'int'>) image_height=1024\n[!] (<class 'int'>) image_width=768\n[!] (<class 'float'>) identity_scale=0.8\n[!] (<class 'str'>) generation_mode=fidelity\n[!] (<class 'bool'>) mix_identities=False\n 0%| | 0/4 [00:00<?, ?it/s]\n 25%|██▌ | 1/4 [00:00<00:00, 5.54it/s]\n 50%|█████ | 2/4 [00:00<00:00, 6.73it/s]\n 75%|███████▌ | 3/4 [00:00<00:00, 6.12it/s]\n100%|██████████| 4/4 [00:00<00:00, 5.87it/s]\n100%|██████████| 4/4 [00:00<00:00, 5.98it/s]\n 0%| | 0/4 [00:00<?, ?it/s]\n 25%|██▌ | 1/4 [00:00<00:00, 5.53it/s]\n 50%|█████ | 2/4 [00:00<00:00, 6.70it/s]\n 75%|███████▌ | 3/4 [00:00<00:00, 6.09it/s]\n100%|██████████| 4/4 [00:00<00:00, 5.85it/s]\n100%|██████████| 4/4 [00:00<00:00, 5.95it/s]\n 0%| | 0/4 [00:00<?, ?it/s]\n 25%|██▌ | 1/4 [00:00<00:00, 5.50it/s]\n 50%|█████ | 2/4 [00:00<00:00, 6.66it/s]\n 75%|███████▌ | 3/4 [00:00<00:00, 6.08it/s]\n100%|██████████| 4/4 [00:00<00:00, 5.84it/s]\n100%|██████████| 4/4 [00:00<00:00, 5.94it/s]\n 0%| | 0/4 [00:00<?, ?it/s]\n 25%|██▌ | 1/4 [00:00<00:00, 5.52it/s]\n 50%|█████ | 2/4 [00:00<00:00, 6.68it/s]\n 75%|███████▌ | 3/4 [00:00<00:00, 6.08it/s]\n100%|██████████| 4/4 [00:00<00:00, 5.83it/s]\n100%|██████████| 4/4 [00:00<00:00, 5.94it/s]\n[~] Saving to output_image_0.webp...\n[~] Output format: WEBP\n[~] Output quality: 80\n[~] Saving to output_image_1.webp...\n[~] Output format: WEBP\n[~] Output quality: 80\n[~] Saving to output_image_2.webp...\n[~] Output format: WEBP\n[~] Output quality: 80\n[~] Saving to output_image_3.webp...\n[~] Output format: WEBP\n[~] Output quality: 80",
"output": [
"https://replicate.delivery/pbxt/nDciJ2jxtSYcCVxGxprSzvycVWR6fIHyJYQFeyDDwDSqrswSA/output_image_0.webp",
"https://replicate.delivery/pbxt/f8UCxdcfXNrYokQMYOUFPzBnVsiRY6Ok1Eotaorg14ZrrswSA/output_image_1.webp",
"https://replicate.delivery/pbxt/k7YRRLjBos7EBhiOz8OD7kGrgFwdbemQTbvsQAOmizo1VWYJA/output_image_2.webp",
"https://replicate.delivery/pbxt/Tif4TmIemNjDiksQWaGTUzG4momOuqeGcEqAMhQHxUdYXZhlA/output_image_3.webp"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-05-03T17:03:32.933Z",
"started_at": "2024-05-03T17:03:32.970579Z",
"completed_at": "2024-05-03T17:03:40.427024Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/wkqmbjhy8nrgj0cf7xmvky7p58/cancel",
"get": "https://api.replicate.com/v1/predictions/wkqmbjhy8nrgj0cf7xmvky7p58",
"web": "https://replicate.com/p/wkqmbjhy8nrgj0cf7xmvky7p58"
},
"metrics": {
"predict_time": 7.456445,
"total_time": 7.494024
}
}



