typefile
{
"character_image": "https://replicate.delivery/pbxt/NV0JLz4NfRmXPOkVrzjiASCfJvsea419i9agH2EuPJlHjG9h/0_1.webp",
"target_image": "https://replicate.delivery/pbxt/NV0Nn3hi2eLGDlj3Y0oP71nX3tLJbyvW9xwdlGb1Iy7ptjlV/blonde_mj.png"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_da6**********************************
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 fofr/face-swap-with-ideogram using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
character_image: "https://replicate.delivery/pbxt/NV0JLz4NfRmXPOkVrzjiASCfJvsea419i9agH2EuPJlHjG9h/0_1.webp",
target_image: "https://replicate.delivery/pbxt/NV0Nn3hi2eLGDlj3Y0oP71nX3tLJbyvW9xwdlGb1Iy7ptjlV/blonde_mj.png"
};
const output = await replicate.run("fofr/face-swap-with-ideogram", { input });
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", 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=r8_da6**********************************
This is your API token. Keep it to yourself.
import replicate
Run fofr/face-swap-with-ideogram using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"fofr/face-swap-with-ideogram",
input={
"character_image": "https://replicate.delivery/pbxt/NV0JLz4NfRmXPOkVrzjiASCfJvsea419i9agH2EuPJlHjG9h/0_1.webp",
"target_image": "https://replicate.delivery/pbxt/NV0Nn3hi2eLGDlj3Y0oP71nX3tLJbyvW9xwdlGb1Iy7ptjlV/blonde_mj.png"
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.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_da6**********************************
This is your API token. Keep it to yourself.
Run fofr/face-swap-with-ideogram 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 $'{
"input": {
"character_image": "https://replicate.delivery/pbxt/NV0JLz4NfRmXPOkVrzjiASCfJvsea419i9agH2EuPJlHjG9h/0_1.webp",
"target_image": "https://replicate.delivery/pbxt/NV0Nn3hi2eLGDlj3Y0oP71nX3tLJbyvW9xwdlGb1Iy7ptjlV/blonde_mj.png"
}
}' \
https://api.replicate.com/v1/models/fofr/face-swap-with-ideogram/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "26ezrmt2f1rmc0crh7ebxsqxdm",
"model": "fofr/face-swap-with-ideogram",
"version": "hidden",
"input": {
"character_image": "https://replicate.delivery/pbxt/NV0JLz4NfRmXPOkVrzjiASCfJvsea419i9agH2EuPJlHjG9h/0_1.webp",
"target_image": "https://replicate.delivery/pbxt/NV0Nn3hi2eLGDlj3Y0oP71nX3tLJbyvW9xwdlGb1Iy7ptjlV/blonde_mj.png"
},
"logs": "🔍 Starting faceswap...\n📝 Step 1: Analyzing target image with Claude to generate contextual prompt...\n✅ Generated prompt: **AI Image Generation Prompt:**\n\nProfessional headshot portrait of a woman with soft, natural lighti...\n🎭 Step 2: Extracting face mask using SA2VA segmentation...\n✅ Face segmentation complete\n🔄 Step 3: Inverting mask for Ideogram compatibility...\n✅ Mask inverted and saved\n🎨 Step 4: Performing face swap with Ideogram Character model...\n✅ Face swap complete!",
"output": "https://replicate.delivery/xezq/DwUytb6AY8q1F9FXP9W91Bo8VCWhhAVOPzhfC1ft7zBX06IVA/tmpoza_3kkg.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-08-08T13:26:10.296Z",
"started_at": "2025-08-08T13:26:11.245924Z",
"completed_at": "2025-08-08T13:26:47.334228Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/26ezrmt2f1rmc0crh7ebxsqxdm/cancel",
"children": "https://api.replicate.com/v1/predictions/26ezrmt2f1rmc0crh7ebxsqxdm/children",
"get": "https://api.replicate.com/v1/predictions/26ezrmt2f1rmc0crh7ebxsqxdm",
"root": "https://api.replicate.com/v1/predictions/26ezrmt2f1rmc0crh7ebxsqxdm",
"stream": "https://stream.replicate.com/v1/files/bcwr-hkkycv6dmytkyusuluxwdsefd7kbvbqrtw4p34cgnjutf2kaegpq",
"web": "https://replicate.com/p/26ezrmt2f1rmc0crh7ebxsqxdm"
},
"metrics": {
"predict_time": 36.08830387,
"total_time": 37.038228
}
}

