还没有图片。提交表单以生成图片。
探索不同用例和参数配置
透明定价,无隐藏费用。按需支付。
| 规则与模式 | 渠道 | 积分 | 价格(美元) | 官方/参考价格 | 每日节省 |
|---|---|---|---|---|---|
image-face-swap imageapipass | Regular | 5per run | $0.023 | - | - |
image-face-swap 使用完整指南
只需一次 API 调用,即可将可用于生产环境的 AI 换脸能力集成到你的应用中。

ApiPass 上的 Image Face Swap API 可让你以编程方式替换照片中的人脸,并获得惊艳逼真的效果。该 API 由先进的人脸识别、对齐和融合算法驱动,接收一张基础图像和一张参考人脸图像,然后返回干净、无水印的结果,同时保留原始照片的光照、姿态和表情。无论你是在构建社交媒体工具、创意内容平台、摄影应用还是娱乐产品,该 API 都能大规模提供自然无缝的换脸效果——无冷启动、吞吐稳定,并支持简单直接的 REST 集成。
每个请求都需要 face_image 和 image。face_image 提供身份来源,而 image 是目标照片,其中检测到的人脸将被替换。
target_index 用于选择目标图像中要替换的已检测人脸。默认值为 0,接受整数字符串,并且必须为非负数。
从修复合影中闭眼的人像、制作专业证件照,到生成表情包、性别转换、名人变身和绘画叠加效果——该 API 足够灵活,可支持广泛的创意和商业应用。
模型会自动适配源人脸与目标人脸之间的肤色、光照方向和阴影一致性,生成自然且完全融合的效果,而不是简单拼贴——无需手动修图。
换脸过程中会保留原主体的头部倾斜、视线方向和面部表情,使最终输出可信自然,并符合基础照片的场景语境。
当照片中包含多个人物时,可使用 target_index 参数精确指定要替换哪一张人脸——第一张、第二张、第三张,依此类推。无需猜测、没有意外,每次都能获得稳定且可预期的结果。
每次响应都会返回无水印的 JPEG、PNG 或 WEBP 图像,可立即用于消费级应用、营销素材或视觉设计流程,并可通过 API 参数选择 Base64 编码和同步模式。
该集成流程与 ApiPass 上其他由 APIPASS 支持的异步图像模型一致。
选择 apipass/image-face-swap 作为模型,并准备包含 face_image、image、可选的 target_index、可选的 output_format 以及可选的 enable_base64_output 的 input。
将 payload 发送到 ApiPass /api/v1/jobs/createTask 端点。适配器会将模型名称重写为 apipass/image-face-swap,并将标准化后的 payload 提交给 APIPASS。
通过 /api/v1/jobs/recordInfo 跟踪任务执行,或配置 callBackUrl 以接收异步完成通知。
任务成功后,从任务响应对象的 resultJson.resultUrls 中读取换脸后的图像 URL。
这些建议遵循适配器的保护规则以及当前 APIPASS 参数约定。
选择一张 face_image,其中人脸应清晰可见、无遮挡,并具备足够分辨率以呈现身份细节。避免严重模糊、极端角度和明显遮挡。
当目标图像包含多张人脸时,请显式设置 target_index,确保请求的替换目标在重试时保持稳定。
保持 enable_sync_mode 设置为 false。ApiPass 使用异步 webhook/callback 系统,并在内部管理任务 ID,以处理状态轮询和结果。
在获得相关人员同意的情况下,为头像、个人资料图片、营销活动样机或内部视觉测试创建获准的人像变体。
将选定的身份来源与目标构图结合,用于预览角色、服装或场景概念。
通过将顾客的人脸替换到专业模特图像上,让顾客看到自己使用产品的效果,从而显著提升购买信心并降低退货率。
文档使用 apipass/image-face-swap,因为这是代码库和示例脚本当前使用的 SUPPORT_MODEL 值。
readme 和 API 部分说明 ApiPass 会将 apipass/image-face-swap 转发到 ApiPass 的 apipass/image-face-swap 端点,并与 get_provider_model_name 保持一致。
该 JSON 记录了适配器中针对 face_image、image、target_index、output_format、enable_base64_output 和 enable_sync_mode 实现的相同验证逻辑。
所有 API 都需要通过 Bearer Token 进行身份验证。
Authorization: Bearer
通过 ApiPass 统一任务 API 创建新的 Image Face Swap 任务
ApiPass 保持公共请求封装稳定。换脸参数会通过 input 对象传入,并由 WaveSpeed 适配器进行规范化。
1{
2 "model": "apipass/image-face-swap",
3 "callBackUrl": "string (optional)",
4 "input": {
5 "face_image": "https://example.com/face.jpeg",
6 "image": "https://example.com/target.jpeg",
7 "target_index": 0,
8 "output_format": "jpeg",
9 "enable_base64_output": false,
10 "enable_sync_mode": false
11 },
12 "channel": "auto"
13}model必填stringImage Face Swap 的 ApiPass 公共模型名称。
"apipass/image-face-swap"
callBackUrl可选string可选的用户回调 URL,用于接收 ApiPass 任务完成通知。
"https://your-domain.com/api/callback"
channel可选string你可以通过 channel 参数在 APIPASS 中指定对应的提供商;这些提供商负责实际的图像和视频生成任务。APIPASS 目前提供三种提供商选项:
channel 参数的默认值为 auto。启用后,APIPASS 会根据实时价格和稳定性指标,在可用提供商之间自动分配任务,以平衡最低成本和可靠性能。除非你有自定义路由需求,否则请保留默认值 auto。
可用选项:
auto
input 对象包含 WaveSpeed 适配器接受的换脸参数。
input.face_image必填string | array<string>源人脸图片 URL。直接 API 请求可以发送字符串;Playground 上传器会发送单项数组,适配器会使用第一个非空 URL。
"https://static.wavespeed.ai/examples/face.jpeg"
input.image必填string | array<string>目标图片 URL。直接 API 请求可以发送字符串;Playground 上传器会发送单项数组,适配器会使用第一个非空 URL。
"https://static.wavespeed.ai/examples/source.jpeg"
input.target_index可选number要替换的目标人脸的从 0 开始的索引。默认值为 0。适配器接受诸如 "2" 的整数字符串,并会拒绝负值。
0
input.output_format可选string可选的输出格式。当存在此字段时,适配器要求其为非空字符串,并会将 jpg 规范化为 jpeg。
可用选项:
"jpeg"
input.enable_base64_output可选boolean是否向 WaveSpeed 请求 base64 输出。默认值为 false。ApiPass 会将成功输出转换为 resultJson.resultUrls。
false
input.enable_sync_mode可选boolean为兼容提供商而接受该参数,但由于 ApiPass 以 webhook 模式提交任务,WaveSpeed 适配器会强制将其设为 false。
false
1curl -X POST "https://api.apipass.dev/api/v1/jobs/createTask" \
2 -H "Content-Type: application/json" \
3 -H "Authorization: Bearer YOUR_API_KEY" \
4 -d '{
5 "model": "apipass/image-face-swap",
6 "callBackUrl": "https://your-domain.com/api/callback",
7 "input": {
8 "face_image": "https://static.wavespeed.ai/examples/0e20bb80259f4840ba394ec2e7f213be/1752459933783339486_bT840WSP.jpeg",
9 "image": "https://static.wavespeed.ai/examples/0e20bb80259f4840ba394ec2e7f213be/1752459923195240956_OHfc951Y.jpeg",
10 "target_index": 0,
11 "output_format": "jpeg",
12 "enable_base64_output": false,
13 "enable_sync_mode": false
14 }
15 }'1{
2 "code": 200,
3 "message": "success",
4 "data": {
5 "taskId": "task_image_face_swap_1767168190655"
6 }
7}code状态码。200 表示 ApiPass 任务已成功创建。
messageApiPass 返回的响应消息。
data.taskId用于后续状态查询的任务标识符。在内部,适配器会将 WaveSpeed 请求 ID 存储为提供商任务 ID。

flux
flux
Generate photorealistic images with robust text
起价
0 积分
Nano Banana 2 Lite, aka Gemini 3.1 Flash-Lite Image, is a newly released image model from Google DeepMind built for fast 1K image generation, efficient creative iteration, prompt-based image editing, and responsive visual output in product-facing creative scenarios.
起价
0 积分
OpenAI
OpenAI
Generate intentionally designed visuals with less prompting using the latest OpenAI GPT Image 2 model.
起价
0 积分
Fast image generation model built on Gemini 3.1 Flash Image. Supports text-to-image, image editing, multi-image fusion with up to 14 reference images, Google Search grounding, and outputs up to 4K resolution.
起价
0 积分
apipass
apipass
Seamlessly remove watermarks, logos, and unwanted text from your images at scale with our powerful AI-driven API.
起价
0 积分
seedream
seedream
起价
0 积分
grok
grok
Grok Imagine is xAI’s AI video generation model for creating high-quality videos with realistic motion, native audio, and synchronized speech. Grok Imagine 1.5 introduces faster generation speeds, improved motion physics, and stronger visual consistency for modern AI video applications.
起价
0 积分
seedream
seedream
起价
0 积分
OpenAI
OpenAI
Bring your ideas to life with sharper, faster, more precise image generation using the GPT Image 2.5 API.
起价
0 积分
Luma
Luma
起价
0 积分
seedream
seedream
起价
0 积分