typefile
{
"guidance_scale": 4,
"height": 1024,
"id_weight": 1,
"main_face_image": "https://replicate.delivery/pbxt/LcInBKpC4SEhXm0w6wyxA92HIPeQY5BWci8HELwtPmRiHh7n/image.png",
"max_sequence_length": 128,
"negative_prompt": "bad quality, worst quality, text, signature, watermark, extra limbs",
"num_steps": 20,
"output_format": "webp",
"output_quality": 90,
"prompt": "portrait of man holding a sign that says 'PULID for FLUX', neon color, cinematic",
"start_step": 0,
"true_cfg": 1,
"width": 768
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_OEZ**********************************
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/flux-pulid using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"bytedance/flux-pulid:32235af21106089aad447a5afda017a7766f46ee09350243774091f115336d7f",
{
input: {
guidance_scale: 4,
height: 1024,
id_weight: 1,
main_face_image: "https://replicate.delivery/pbxt/LcInBKpC4SEhXm0w6wyxA92HIPeQY5BWci8HELwtPmRiHh7n/image.png",
max_sequence_length: 128,
negative_prompt: "bad quality, worst quality, text, signature, watermark, extra limbs",
num_steps: 20,
output_format: "webp",
output_quality: 90,
prompt: "portrait of man holding a sign that says 'PULID for FLUX', neon color, cinematic",
start_step: 0,
true_cfg: 1,
width: 768
}
}
);
// 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_OEZ**********************************
This is your API token. Keep it to yourself.
import replicate
Run bytedance/flux-pulid using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"bytedance/flux-pulid:32235af21106089aad447a5afda017a7766f46ee09350243774091f115336d7f",
input={
"guidance_scale": 4,
"height": 1024,
"id_weight": 1,
"main_face_image": "https://replicate.delivery/pbxt/LcInBKpC4SEhXm0w6wyxA92HIPeQY5BWci8HELwtPmRiHh7n/image.png",
"max_sequence_length": 128,
"negative_prompt": "bad quality, worst quality, text, signature, watermark, extra limbs",
"num_steps": 20,
"output_format": "webp",
"output_quality": 90,
"prompt": "portrait of man holding a sign that says 'PULID for FLUX', neon color, cinematic",
"start_step": 0,
"true_cfg": 1,
"width": 768
}
)
# 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_OEZ**********************************
This is your API token. Keep it to yourself.
Run bytedance/flux-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/flux-pulid:32235af21106089aad447a5afda017a7766f46ee09350243774091f115336d7f",
"input": {
"guidance_scale": 4,
"height": 1024,
"id_weight": 1,
"main_face_image": "https://replicate.delivery/pbxt/LcInBKpC4SEhXm0w6wyxA92HIPeQY5BWci8HELwtPmRiHh7n/image.png",
"max_sequence_length": 128,
"negative_prompt": "bad quality, worst quality, text, signature, watermark, extra limbs",
"num_steps": 20,
"output_format": "webp",
"output_quality": 90,
"prompt": "portrait of man holding a sign that says \'PULID for FLUX\', neon color, cinematic",
"start_step": 0,
"true_cfg": 1,
"width": 768
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "217hvztdmsrj20chxggvrtmhqw",
"model": "bytedance/flux-pulid",
"version": "32235af21106089aad447a5afda017a7766f46ee09350243774091f115336d7f",
"input": {
"guidance_scale": 4,
"height": 1024,
"id_weight": 1,
"main_face_image": "https://replicate.delivery/pbxt/LcInBKpC4SEhXm0w6wyxA92HIPeQY5BWci8HELwtPmRiHh7n/image.png",
"max_sequence_length": 128,
"negative_prompt": "bad quality, worst quality, text, signature, watermark, extra limbs",
"num_steps": 20,
"output_format": "webp",
"output_quality": 90,
"prompt": "portrait of man holding a sign that says 'PULID for FLUX', neon color, cinematic",
"start_step": 0,
"true_cfg": 1,
"width": 768
},
"logs": "Using seed: 2067585737\nGenerating 'portrait of man holding a sign that says 'PULID for FLUX', neon color, cinematic' with seed 2067585737\nDenoising time: 6.45 seconds\nDecoding time: 0.06 seconds\nTotal generate_image time: 6.85 seconds\nImage generated with seed: 2067585737\nTotal prediction time: 6.93 seconds",
"output": [
"https://replicate.delivery/yhqm/U53VSu2yUOYZBt5d6pr2EwwBJ5pDP53EXu49EpBMwtiqUI3E/output.webp"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-09-13T16:04:51.238Z",
"started_at": "2024-09-13T16:04:51.247827Z",
"completed_at": "2024-09-13T16:04:58.453408Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/217hvztdmsrj20chxggvrtmhqw/cancel",
"get": "https://api.replicate.com/v1/predictions/217hvztdmsrj20chxggvrtmhqw",
"web": "https://replicate.com/p/217hvztdmsrj20chxggvrtmhqw"
},
"metrics": {
"predict_time": 7.205580654,
"total_time": 7.215408
}
}
