Pixelcut Product Photo
整合
模型 id
pixelcut/product-photo
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/pixelcut/product-photo?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.ru/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.ru/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/pixelcut/product-photo?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.ru/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/pixelcut/product-photo", 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.ru/v1/mcp \
--header "Authorization: Bearer $DOITONG_API_KEY"
# 2. Your agent calls the "run" tool with:
{
"model_id": "pixelcut/product-photo",
"input": {
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
}
}
透過 Doitong API 呼叫 Pixelcut Product Photo 模型(pixelcut/product-photo)。代理程式文件:https://doitong.com/zh-TW/developers/models/pixelcut/product-photo.md
POST https://api.doitong.ru/v1/run/pixelcut/product-photo?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.ru/v1/requests/REQUEST_ID?wait=20,直到狀態變為 "succeeded";檔案位於 outputs[].url。使用相同主體傳送 POST https://api.doitong.ru/v1/quote/pixelcut/product-photo,可在執行前取得確切價格。
此請求: $0.024 24 API 點數 · ≈ ₽2.56 在此頁面執行
您的新 API 金鑰。 僅會在此時顯示,且已填入下方的程式碼與 API 金鑰欄位。請妥善保密:切勿將其放入在瀏覽器中執行的程式碼。
建立請求
控制項是根據模型結構描述生成的。變更設定時,程式碼和價格會同步更新。
POST
/run/pixelcut/product-photo?wait=20
報價 → $0.024
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/pixelcut/product-photo?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.ru/v1/requests/REQUEST_ID?wait=20" \
-H "Authorization: Bearer $DOITONG_API_KEY"
const API = "https://api.doitong.ru/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/pixelcut/product-photo?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.ru/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/pixelcut/product-photo", 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": "pixelcut/product-photo",
"input": {
"image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
},
"wait_seconds": 20
}
}
}
關於 Pixelcut Product Photo
將商品照片處理為目錄風格圖片。可使用 `image_size` 預設值或自訂尺寸設定畫布,選擇純色、透明或圖片 `background`,並調整 `margin`。可使用生成式或投影 `shadow`,也可選擇加入 `watermark` 疊加層。輸出格式為 png 或 jpeg;透明背景無法搭配 jpeg。
參數
請傳送標準名稱或原生名稱其中之一,不要同時傳送兩者。 標準名稱
名稱類型
預設值允許值
說明
image_url必填
image
類型url · image
用於處理的產品圖像 URL。
image_size選填
類型object
預設值square_hd
square_hdsquareportrait_4_3portrait_16_9landscape_4_3landscape_16_9
輸出畫布尺寸,可指定自訂 {width, height} 或預設值:square_hd、square、portrait_4_3、portrait_16_9、landscape_4_3、landscape_16_9。預設值為 square_hd (1024x1024)。
background選填
類型object
輸出背景:可為圖像、透明背景或預設為白色的純色。
background.mode選填
類型enum
預設值Color
TransparentColorImage
背景模式:'Color' 使用 `color`,預設為白色;'Transparent' 產生透明背景且一律使用 PNG;'Image' 將結果合成至 `image_url` 上。
background.color選填
類型object
預設值{"b":255,"g":255,"r":255}
'Color' 模式的純色背景填滿色彩,預設為白色,透過範圍為 0 至 255 的 R/G/B 元件指定。
background.color.r必填
類型integer
0 – 255
background.color.g必填
類型integer
0 – 255
background.color.b必填
類型integer
0 – 255
background.image_url選填
類型url · image
背景圖像的 URL;'Image' 模式中為必要項目。
background.image_fit選填
類型enum
預設值Cover
CoverContainStretch
選擇背景圖像符合畫布的方式。'Contain' 會保留符合尺寸的圖像,並在 `color` 上加上黑邊;'Stretch' 會以變形方式符合尺寸;'Cover' 會裁切以填滿畫布。
margin選填
類型object
產品與畫布邊緣之間的間距。使用 `all` 設定所有邊距,也可選擇覆寫個別邊;預設值為每邊 20%。
margin.all選填
類型string
預設值20%
所有邊的統一邊距,以畫布尺寸的 '%' 指定,範圍為 0 至 49%,或以 'px' 指定且最小值為 0px。
margin.left選填
類型string | null
取代該側 `all` 的左邊距。接受 0 至 49% 的 '%',或 0px 以上的 'px'。
margin.right選填
類型string | null
取代該側 `all` 的右邊距。接受 0 至 49% 的 '%',或 0px 以上的 'px'。
margin.top選填
類型string | null
取代該側 `all` 的上邊距。接受 0 至 49% 的 '%',或 0px 以上的 'px'。
margin.bottom選填
類型string | null
取代該側 `all` 的下邊距。接受 0 至 49% 的 '%',或 0px 以上的 'px'。
shadow選填
類型object
陰影設定:選擇 'Generative' 或 'Drop' 並設定其選項。未設定時不套用陰影。
shadow.type選填
類型enum
GenerativeDrop
選用陰影樣式;未設定時不使用陰影。選擇 'Generative' 以進行 AI 合成,或選擇 'Drop' 以使用確定性的投影陰影。
shadow.generative選填
類型object
AI 生成陰影的設定,會在類型為 'Generative' 時套用。
shadow.generative.opacity選填
類型number
預設值0.2
0 – 1
完全合成後陰影的不透明度,範圍為 0 至 1。
shadow.generative.light_source選填
類型object
用於陰影合成的明確虛擬光源;提供後會取代從圖像自動估算的光線方向。
shadow.drop選填
類型object
投影陰影的設定,會在類型為 'Drop' 時套用。
shadow.drop.color選填
類型object
預設值{"b":0,"g":0,"r":0}
陰影的 RGB 色彩;預設為黑色。
shadow.drop.horizontal選填
類型number
預設值50
-100 – 100
水平陰影位移;最大設定值 100 代表畫布寬度的 10%。值的範圍為 -100 至 100,負值向左移動,正值向右移動。
shadow.drop.vertical選填
類型number
預設值8
-100 – 100
垂直陰影位移;最大設定值 100 代表畫布高度的 10%。值的範圍為 -100 至 100,負值向上移動,正值向下移動。
shadow.drop.blur選填
類型number
預設值24
0 – 100
陰影模糊設定;100 的最大柔化程度對應於畫布較短尺寸 5% 的半徑。範圍從 0 開始,0 會保留銳利邊緣。
shadow.drop.opacity選填
類型number
預設值0.25
0 – 1
陰影的不透明度,範圍為 0 至 1。
watermark選填
類型object
提供圖像即可啟用標誌或浮水印覆蓋;省略時輸出不含浮水印,這也是預設行為。
watermark.image_url選填
類型url · image
標誌或浮水印圖像的 URL。空值會使輸出不含浮水印。
watermark.remove_background選填
類型boolean
預設值false
是否使用背景移除功能去除浮水印背景,使覆蓋內容不包含背景。
watermark.position選填
類型enum
預設值bottom_right
top_lefttop_rightbottom_leftbottom_rightcenter
浮水印的位置。
watermark.scale選填
類型number
預設值0.1
0.01 – 1
浮水印寬度,以畫布寬度的比例表示。
watermark.opacity選填
類型number
預設值1
0 – 1
浮水印的不透明度,範圍為 0 至 1。
watermark.margin選填
類型string
預設值3%
距離畫布邊緣向內的距離,以畫布的 '%'(0–49%)或 'px' 表示。
output_format選填
類型enum
pngjpeg
輸出圖像編碼,可選擇 PNG 或 JPEG;透明背景不支援 JPEG。省略選擇時會保留輸入格式。
必填
標準名稱,也可使用
檔案參數接受公開的 https:// URL、最大 10 MB 的 data: URI,或上傳檔案的 file_url。 檔案
輸出
GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
"id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
"object": "request",
"model": "pixelcut/product-photo",
"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": 24,
"usd": "0.024",
"charged": 24,
"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.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
"cancel": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
}
}
您的檔案,由您選擇每個 outputs[].url 都是儲存空間中的副本:可永久保留(按 GB-月計費),或免費保留 7 天;可透過帳戶設定或 ?storage= 設定。
所有模型使用相同結構圖片、影片和音訊皆包含 type、url、content_type、width、height 和 duration。output 是模型自己的結果物件。
輸出欄位
- image
- object {url, content_type, file_name, file_size, width, height} | null為目錄使用準備的產品照片。
其他 Pixelcut 變體
更多模型:圖像編輯
給 AI 代理程式:此頁面的 Markdown 位於 https://doitong.com/zh-TW/developers/models/pixelcut/product-photo.md. 所有模型與指南: https://doitong.com/developers/llms.txt






