Riferimento API di Face Swap Plus
Scambio volto con adattamento automatico dell’incarnato
Con una sola chiave API di PopNow chiami Face Swap Plus dal tuo codice. Qui trovi gli ID del modello da inviare, ogni campo di input accettato, quanti crediti costa ogni richiesta e una richiesta da incollare nel terminale così com’è.
Le descrizioni dei parametri provengono dallo schema di input del modello e sono disponibili solo in inglese.
In sintesi
- Sviluppato da
- PopNow
- Risultato
- Immagine
- Da
- 24 crediti per immagine ($0.24)
- Tempo tipico
- circa 31 s
- ID del modello
1 credito = 0,01 $. All’accettazione l’attività trattiene l’importo massimo possibile e alla fine addebita il consumo reale, arrotondato al credito superiore; il resto viene sbloccato. Le attività non riuscite non vengono addebitate. Per conoscere la cifra esatta prima di eseguire, chiama POST /api/v1/jobs/quote.
Scambio volto
popnow/face-swap-v1-plus/edit
Prezzo
| Opzione | Crediti (per immagine) | Dollari USA |
|---|---|---|
Predefinito | 24 | $0.24 |
Parametri
| Campo | Tipo | Predefinito | Valori ammessi | A cosa serve |
|---|---|---|---|---|
image_urlObbligatorio | string | — | — | Target image. The face of the person in this image is the one that gets replaced. |
reference_image_urlObbligatorio | string | — | — | Reference face image. The facial identity from this image is transferred onto the target. |
promptFacoltativo | string | — | fino a 200 caratteri | Optional short note guiding one subtle attribute of the result, such as an accessory, an expression or a different hairstyle. |
output_formatFacoltativo | string | jpeg | png, jpeg, webp | File format of the returned image. |
output_qualityFacoltativo | integer | 95 | da 10 a 100 | Requested image quality for the result, from 10 to 100. |
seedFacoltativo | integer | — | da 0 a 2147483647 | Random seed; reuse it to keep two runs over the same image pair comparable. |
Richiesta di esempio
Questa richiesta funziona così com’è; i campi omessi usano il valore predefinito. Prima salva la tua chiave in POPNOW_API_KEY.
L’esempio usa file di prova di PopNow in image_url, reference_image_url. Sostituiscili con i tuoi link HTTPS pubblici, file caricati o asset salvati.
curl -X POST "https://api.popnow.ai/api/v1/jobs/createTask?wait=60" \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "popnow/face-swap-v1-plus/edit",
"input": {
"prompt": "Change the orange jacket to deep forest green and add soft golden-hour light; keep the face, pose and background unchanged",
"image_url": "https://media.popnow.ai/influencer/examples/marco.webp",
"reference_image_url": "https://media.popnow.ai/influencer/examples/ava.webp"
}
}'La risposta contiene subito un taskId. Recupera il risultato con GET /api/v1/jobs/recordInfo, oppure aggiungi callBackUrl per ricevere una notifica.
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=TASK_ID_FROM_CREATE_TASK" \
-H "Authorization: Bearer $POPNOW_API_KEY"
