How to Build an AI Face‑Swap Workflow with Coze in 7 Simple Steps
This step‑by‑step guide shows how to create a Coze workflow, add and configure start, face‑swap, and end nodes, test the workflow with sample image URLs, publish it, retrieve its workflow ID, and invoke the Coze API using a JSON payload.
1. Create workflow
In Coze, start a new workflow.
2. Add nodes
Insert the “Intelligent Face Swap” node from “More Image Plugins”.
3. Configure nodes
3.1 Start node
Define two input parameters: source_url (URL of the source portrait) and target_url (URL of the target portrait).
3.2 Face‑Swap node
Map the start node outputs to the face‑swap node inputs: reference_picture_url ←
source_url template_picture_url← target_url The node returns the swapped image.
3.3 End node
Select the node’s return value as the workflow output.
4. Test run
Use two publicly accessible portrait images, for example:
Source: https://qcloud.dpfile.com/pc/6it6-wSAtuDIQ4I0sC7Mwl-38nWSg4HL9q5EUval_2sJ7OUzNmXLyzmJmWen46VO.jpg
Target: https://img1.baidu.com/it/u=3021032973,104136814&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=889
5. Publish workflow
6. Retrieve workflow ID
The generated ID is 7530470053024759808.
7. Call Coze API
Send a POST request to the Coze execution endpoint with the authentication token, workflow_id, and a JSON payload containing source_url and target_url.
{
"source_url": "https://qcloud.dpfile.com/pc/6it6-wSAtuDIQ4I0sC7Mwl-38nWSg4HL9q5EUval_2sJ7OUzNmXLyzmJmWen46VO.jpg",
"target_url": "https://img1.baidu.com/it/u=3021032973,104136814&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=889"
}Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
AI Software Product Manager
Daily updates of Xiaomi's latest AI internal materials
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
