Live Portrait · Image
Integracija
live-portrait/image
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/live-portrait/image?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.com/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/live-portrait/image?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://api.doitong.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/live-portrait/image", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
# 1. Connect once (Claude Code; Cursor, VS Code, Claude Desktop: https://doitong.com/sl/developers/docs/mcp)
claude mcp add --transport http doitong-models https://api.doitong.com/v1/mcp \
--header "Authorization: Bearer $DOITONG_API_KEY"
# 2. Your agent calls the "run" tool with:
{
"model_id": "live-portrait/image",
"input": {
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
}
}
Pokličite model Live Portrait · Image (live-portrait/image) prek Doitong API. Dokumentacija za agente: https://doitong.com/sl/developers/models/live-portrait/image.md
POST https://api.doitong.com/v1/run/live-portrait/image?wait=20
Authorization: Bearer $DOITONG_API_KEY
Content-Type: application/json
{
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
}
Če je stanje odgovora "queued" ali "running", pošiljajte poizvedbe GET https://api.doitong.com/v1/requests/REQUEST_ID?wait=20, dokler ni "succeeded"; datoteke so v outputs[].url. POST https://api.doitong.com/v1/quote/live-portrait/image z enakim telesom vrne natančno ceno pred zagonom.
Do 1,125 $ na zagon zaračuna se dejanska uporaba, preostanek se vrne Zaženi na tej strani
Vaš novi ključ API. Prikazan je samo zdaj in je že v kodi ter v spodnjem polju ključa API. Hranite ga kot skrivnost: nikoli ga ne vključite v kodo, ki se izvaja v brskalniku.
Tukaj bo vaš prvi rezultat
Spodaj sestavite zahtevo in jo zaženite s svojim ključem API. Izhodi se kopirajo v našo shrambo, kjer se hranijo za vedno ali 7 dni brezplačno.
Ustvari zahtevo
Kontrolniki se ustvarijo iz sheme modela. Koda in cena se posodobita, ko ju spreminjate.
/run/live-portrait/image?wait=20
cena → 1,125 $
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/live-portrait/image?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
}'
# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.com/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/live-portrait/image?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://api.doitong.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/live-portrait/image", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run",
"arguments": {
"model_id": "live-portrait/image",
"input": {
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
},
"wait_seconds": 20
}
}
}
Zaženi to zahtevo
Vaš ključ ostane v tem brskalniku: pošlje se samo v Doitong API in shrani v localStorage samo, če označite možnost Zapomni si. Pridobi ključ API
O modelu Live Portrait · Image
Prilagodi obraz na eni portretni fotografiji brez vodilnega videoposnetka. Drsniki zajemajo mežikanje, obrvi, pomežik, položaj zenic, oblike ust (aaa, eee, woo), nasmeh in vrtenje glave (pitch, yaw, roll). Možnosti obrezovanja, kot sta `flag_do_crop` in `scale`, ter `dsize` (privzeto 512) nadzorujejo izrez obraza. Izhod je privzeto jpeg ali png.
Parametri
Pošlji kanonično ali izvorno ime, ne obeh. Kanonična imena
image_urlobvezno
image
blinkneobvezno
eyebrowneobvezno
winkneobvezno
pupil_xneobvezno
pupil_yneobvezno
aaaneobvezno
eeeneobvezno
wooneobvezno
smileneobvezno
rotate_pitchneobvezno
rotate_yawneobvezno
rotate_rollneobvezno
flag_pastebackneobvezno
flag_do_cropneobvezno
flag_do_rotneobvezno
flag_lip_zeroneobvezno
dsizeneobvezno
scaleneobvezno
vx_rationeobvezno
vy_rationeobvezno
enable_safety_checkerneobvezno
output_formatneobvezno
Parametri datotek sprejmejo javni https:// URL, podatkovni URI data: do 10 MB ali file_url naložene datoteke. Datoteke
Izhod
{
"id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
"object": "request",
"model": "live-portrait/image",
"status": "succeeded",
"created_at": "2026-10-20T12:00:00Z",
"started_at": "2026-10-20T12:00:02Z",
"completed_at": "2026-10-20T12:00:09Z",
"queue_position": null,
"cost": {
"credits": 1125,
"usd": "1.125",
"charged": 1125,
"refunded": 0
},
"input": {
"image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
},
"output": {
"image": {
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
"content_type": "image/jpeg",
"file_name": "0-output.jpeg",
"file_size": 1843200,
"width": 1024,
"height": 768
}
},
"outputs": [
{
"type": "image",
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
"content_type": "image/jpeg",
"file_size": 1843200,
"width": 1024,
"height": 768,
"stored": true
}
],
"error": null,
"metrics": {
"inference_seconds": 6.8
},
"urls": {
"self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
"cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
}
}
Polja izhoda
- image
- object {url, content_type, file_name, file_size, width, height}Slikovna datoteka, ustvarjena z generiranjem.
Druge različice Live Portrait
Več modelov: Urejanje slik
Za agente AI: ta stran je v obliki Markdown na voljo na https://doitong.com/sl/developers/models/live-portrait/image.md. Vsi modeli in vodniki: https://doitong.com/developers/llms.txt






