Post Processing
整合
模型 id
post-processing
# 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/post-processing?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/post-processing?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/post-processing", 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/zh-TW/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": "post-processing",
"input": {
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
}
}
透過 Doitong API 呼叫 Post Processing 模型(post-processing)。代理程式文件:https://doitong.com/zh-TW/developers/models/post-processing.md
POST https://api.doitong.com/v1/run/post-processing?wait=20
Authorization: Bearer $DOITONG_API_KEY
Content-Type: application/json
{
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
}
如果回應狀態為 "queued" 或 "running",請輪詢 GET https://api.doitong.com/v1/requests/REQUEST_ID?wait=20,直到狀態變為 "succeeded";檔案位於 outputs[].url。使用相同主體傳送 POST https://api.doitong.com/v1/quote/post-processing,可在執行前取得確切價格。
此請求: $0.001 1 API 點數 在此頁面執行
您的新 API 金鑰。 僅會在此時顯示,且已填入下方的程式碼與 API 金鑰欄位。請妥善保密:切勿將其放入在瀏覽器中執行的程式碼。
建立請求
控制項是根據模型結構描述生成的。變更設定時,程式碼和價格會同步更新。
POST
/run/post-processing?wait=20
報價 → $0.001
# 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/post-processing?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/post-processing?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/post-processing", 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": "post-processing",
"input": {
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
},
"wait_seconds": 20
}
}
}
關於 Post Processing
在單次呼叫中對一張影像套用多種效果,每種效果都透過 `enable_` 開關啟用:顆粒、色彩校正、色差、模糊、暈映、拋物線變形和色調。每種效果都有自己的範圍,例如亮度和對比度為 -100 至 100、模糊半徑最高 31,以及 -20 至 20 的色版偏移。輸入為 `image_url`。
參數
請傳送標準名稱或原生名稱其中之一,不要同時傳送兩者。 標準名稱
名稱類型
預設值允許值
說明
image_url必填
image
類型url · image
用於處理的圖像 URL。
enable_grain選填
類型boolean
預設值false
底片顆粒效果的切換開關。
grain_intensity選填
類型number
預設值0.4
0 – 1
啟用效果時的底片顆粒強度。
grain_scale選填
類型number
預設值10
1 – 100
啟用效果時的底片顆粒尺度。
grain_style選填
類型enum
預設值modern
modernanalogkodakfujicinematicnewspaper
底片顆粒效果使用的風格。
enable_color_correction選填
類型boolean
預設值false
色彩校正的切換開關。
temperature選填
類型number
預設值0
-100 – 100
色溫調整。
brightness選填
類型number
預設值0
-100 – 100
圖像亮度調整。
contrast選填
類型number
預設值0
-100 – 100
圖像對比度調整。
saturation選填
類型number
預設值0
-100 – 100
色彩飽和度調整。
gamma選填
類型number
預設值1
0.2 – 2.2
Gamma 調整。
enable_chromatic選填
類型boolean
預設值false
色差效果的切換開關。
red_shift選填
類型integer
預設值0
-20 – 20
紅色通道的位移量。
red_direction選填
類型enum
預設值horizontal
horizontalvertical
紅色通道的位移方向。
green_shift選填
類型integer
預設值0
-20 – 20
綠色通道的位移量。
green_direction選填
類型enum
預設值horizontal
horizontalvertical
綠色通道的位移方向。
blue_shift選填
類型integer
預設值0
-20 – 20
藍色通道的位移量。
blue_direction選填
類型enum
預設值horizontal
horizontalvertical
藍色通道的位移方向。
enable_blur選填
類型boolean
預設值false
模糊效果的切換開關。
blur_type選填
類型enum
預設值gaussian
gaussiankuwahara
要使用的模糊方法。
blur_radius選填
類型integer
預設值3
0 – 31
模糊使用的半徑。
blur_sigma選填
類型number
預設值1
0.1 – 10
高斯模糊的 sigma 值。
enable_vignette選填
類型boolean
預設值false
暈映效果的切換開關。
vignette_strength選填
類型number
預設值0.5
0 – 10
啟用效果時的暈映強度。
enable_parabolize選填
類型boolean
預設值false
拋物線化效果的切換開關。
parabolize_coeff選填
類型number
預設值1
-10 – 10
拋物線化效果使用的係數。
vertex_x選填
類型number
預設值0.5
0 – 1
頂點的 X 座標。
vertex_y選填
類型number
預設值0.5
0 – 1
頂點的 Y 座標。
enable_tint選填
類型boolean
預設值false
色彩著色效果的切換開關。
tint_strength選填
類型number
預設值1
0.1 – 1
著色效果的強度。
tint_mode選填
類型enum
預設值sepia
sepiaredgreenbluecyanmagentayellowpurpleorangewarmcoollimenavyvintageroseteal
另有 4 個
maroonpeachlavenderolive著色使用的色彩模式。
enable_dissolve選填
類型boolean
預設值false
溶解效果的切換開關。
dissolve_image_url選填
類型url · image
預設值
第二張圖像的 URL,用於溶解效果。
dissolve_factor選填
類型number
預設值0.5
0 – 1
溶解效果的混合係數。
enable_dodge_burn選填
類型boolean
預設值false
加亮與加深效果的切換開關。
dodge_burn_intensity選填
類型number
預設值0.5
0 – 1
加亮與加深效果的強度。
dodge_burn_mode選填
類型enum
預設值dodge
dodgeburndodge_and_burnburn_and_dodgecolor_dodgecolor_burnlinear_dodgelinear_burn
加亮與加深效果使用的模式。
enable_glow選填
類型boolean
預設值false
發光效果的切換開關。
glow_intensity選填
類型number
預設值1
0 – 5
發光效果的強度。
glow_radius選填
類型integer
預設值5
1 – 50
用於模糊發光效果的半徑。
enable_sharpen選填
類型boolean
預設值false
銳化效果的切換開關。
sharpen_mode選填
類型enum
預設值basic
basicsmartcas
要使用的銳化方法。
sharpen_radius選填
類型integer
預設值1
1 – 15
基本模式中用於銳化的半徑。
sharpen_alpha選填
類型number
預設值1
0.1 – 5
基本模式中的銳化強度。
noise_radius選填
類型integer
預設值7
1 – 25
智慧銳化中用於雜訊的半徑。
preserve_edges選填
類型number
預設值0.75
0 – 1
邊緣保留程度。
smart_sharpen_strength選填
類型number
預設值5
0 – 25
智慧銳化強度。
smart_sharpen_ratio選填
類型number
預設值0.5
0 – 1
智慧銳化的混合比例。
cas_amount選填
類型number
預設值0.8
0 – 1
CAS 銳化強度。
enable_solarize選填
類型boolean
預設值false
是否套用色調分離。
solarize_threshold選填
類型number
預設值0.5
0 – 1
色調分離的閾值。
enable_desaturate選填
類型boolean
預設值false
是否套用去飽和。
desaturate_factor選填
類型number
預設值1
0 – 1
去飽和程度。
desaturate_method選填
類型enum
預設值luminance (Rec.709)
luminance (Rec.709)luminance (Rec.601)averagelightness
去飽和使用的方法。
必填
標準名稱,也可使用
檔案參數接受公開的 https:// URL、最大 10 MB 的 data: URI,或上傳檔案的 file_url。 檔案
輸出
GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
"id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
"object": "request",
"model": "post-processing",
"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": 1,
"usd": "0.001",
"charged": 1,
"refunded": 0
},
"input": {
"image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
},
"output": {
"images": [
{
"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"
}
}
您的檔案,由您選擇每個 outputs[].url 都是儲存空間中的副本:可永久保留(按 GB-月計費),或免費保留 7 天;可透過帳戶設定或 ?storage= 設定。
所有模型使用相同結構圖片、影片和音訊皆包含 type、url、content_type、width、height 和 duration。output 是模型自己的結果物件。
輸出欄位
- images
- array of object {url, content_type, file_name, file_size, width, height}處理後產生的圖像。
其他 Post Processing 變體
更多模型:圖像編輯
給 AI 代理程式:此頁面的 Markdown 位於 https://doitong.com/zh-TW/developers/models/post-processing.md. 所有模型與指南: https://doitong.com/developers/llms.txt






