seedream-5.0/product-image
Seedream 5.0 — Generate and transform high-realism AI images with Seedream 5.0 — studio-grade aesthetic composition, sharp text rendering, 1K – 4K quality (1K, 2K, 4K), supports up to 3 reference images for character/scene consistency, multiple aspect ratios (1:1, 16:9, 9:16, 4:3, 3:4...), unlimited prompt characters.
Server SV1 hiện có nhiều gói sản phẩm khác nhau thuộc cùng dòng seedream-5.0. Để chạy chính xác 100% đúng gói này, hãy truyền thẳng mã gói "model": "seedream-5.0/product-image" kèm "server": "sv1".
seedream-5.0GET /api/v1/models/seedream-5.0/serversBảng giá API chi tiết theo từng cấu hình tham số
Đơn giá thực tế (VNĐ) trừ vào ví khi gọi POST /v1/generations (hoặc kiểm tra trước qua POST /v1/generations/estimate).
Input — request parameters
/v1/generationsGửi JSON theo cấu trúc chuẩn "model": "seedream-5.0/product-image", "server": "sv1" and the parameters below at the same level. Parameters not listed in the table are rejected (400).
| Parameter | Type | Supported values | Description |
|---|---|---|---|
modelrequired | string | seedream-5.0/product-image | Mã gói sản phẩm duy nhất (khuyến nghị truyền đúng mã này để chốt chính xác gói trên SV). |
server | string | sv1auto | Chốt máy chủ SV chạy đơn (cũng nhận alias server_id) hoặc auto để tự chọn SV healthy giá tốt nhất. Kiểm tra SV sống qua GET /v1/models/seedream-5.0/servers. |
image_urlrequired | string (URL image) | Original product photo | |
reference_image_urls | string[] (URL image) | Up to 3 files | Model / scene reference (optional) |
product_stylerequired | enum | Ảnh chụp sản phẩm thương mại chuyên nghiệp, đặt sản phẩmNgười mẫu nữ trẻ đẹp Việt Nam cầm và giới thiệu sản phẩmNgười mẫu nam lịch lãm cầm và giới thiệu sản phẩmCận cảnh bàn tay thon đẹp đang cầm sản phẩm Default: | Photo style |
product_scenerequired | enum | trên bục đá cẩm thạch trắng trong studio cao cấp, ánh sáng thương mại sắc néttrên mặt bàn gỗ tự nhiên cạnh cây xanh, nắng sớm dịu nhẹgiữa không gian phòng khách hiện đại sang trọngtrên nền màu pastel tối giản với bóng đổ mềmngoài bãi biển đầy nắng, nước trong xanh Default: | Setting |
prompt | string | Extra camera angle / props (optional) | |
aspect_ratiorequired | enum | 1:14:33:416:99:163:22:321:9adaptive | Aspect ratio |
- File parameters (string URL) accept a public http(s) link — the server downloads it — or a URL returned by the file upload API POST /account/ai/uploads.
- Element order in array
reference_image_urls([url_1, url_2, url_3]) is strictly mapped 1-to-1 by the system in exact order: Image 1 / FIRST image, Image 2 / SECOND image, Image 3 / THIRD image. When uploading local files via POST /account/ai/uploads, upload them sequentially in exact [1, 2, 3] order so the URL array stays aligned. - Bỏ trống tham số không bắt buộc thì dùng giá trị mặc định. Có thể gửi thêm header Idempotency-Key để thử lại an toàn không trừ tiền 2 lần.
Sample request (cURL)
curl -X POST https://promptflow.web.id/api/v1/generations \
-H "X-API-Key: $API_KEY" -H "Content-Type: application/json" \
-d '{
"model": "seedream-5.0/product-image",
"server": "sv1",
"image_url": "https://example.com/image.jpg",
"product_style": "Ảnh chụp sản phẩm thương mại chuyên nghiệp, đặt sản phẩm",
"product_scene": "trên bục đá cẩm thạch trắng trong studio cao cấp, ánh sáng thương mại sắc nét",
"prompt": "Keep the pose and composition of Image 1, swap in the outfit from Image 2, and use the face from Image 3.",
"aspect_ratio": "1:1"
}'Complete integration code sample (Upload file → Create job → Poll result)
Python 3
import os, time, requests
BASE = "https://promptflow.web.id/api"
API_KEY = os.environ["API_KEY"] # lấy tại trang /api-keys
HEADERS = {"X-API-Key": API_KEY}
def upload_file(local_path: str) -> str:
"""Tải 1 file từ máy lên server và trả về URL đầu vào"""
with open(local_path, "rb") as f:
r = requests.post(f"{BASE}/account/ai/uploads", headers=HEADERS, files={"file": f}, timeout=120)
data = r.json()
if not r.ok:
raise RuntimeError(data.get("message") or r.text)
return data["url"]
# Bước 1: Upload tuần tự đúng thứ tự Ảnh 1 -> Ảnh 2 -> Ảnh 3 (hoặc dùng thẳng link https công khai)
image_urls = [
upload_file("./1.jpg"), # Ảnh 1 (Image 1 / FIRST image)
upload_file("./2.jpg"), # Ảnh 2 (Image 2 / SECOND image)
upload_file("./3.jpg"), # Ảnh 3 (Image 3 / THIRD image)
]
# Bước 2: Gửi yêu cầu với đúng thứ tự mảng reference_image_urls [1, 2, 3]
payload = {
"model": "seedream-5.0/product-image",
"server": "sv1",
"image_url": "https://example.com/image.jpg",
"product_style": "Ảnh chụp sản phẩm thương mại chuyên nghiệp, đặt sản phẩm",
"product_scene": "trên bục đá cẩm thạch trắng trong studio cao cấp, ánh sáng thương mại sắc nét",
"prompt": "Keep the pose and composition of Image 1, swap in the outfit from Image 2, and use the face from Image 3.",
"aspect_ratio": "1:1"
}
payload["reference_image_urls"] = image_urls
r = requests.post(f"{BASE}/v1/generations", headers=HEADERS, json=payload, timeout=60)
gen = r.json()
if not r.ok:
raise RuntimeError(gen.get("message") or r.text)
# Bước 3: Hỏi trạng thái mỗi 5 giây tới khi hoàn tất
while gen["status"] in ("queued", "processing"):
time.sleep(5)
poll = requests.get(f"{BASE}/v1/generations/{gen['id']}", headers=HEADERS, timeout=60)
gen = poll.json()
if gen["status"] != "succeeded":
raise RuntimeError(gen.get("error") or gen["status"])
print("Kết quả:", [f["url"] for f in gen["output"]["files"]])Node.js (18+)
import fs from "node:fs";
import path from "node:path";
const BASE = "https://promptflow.web.id/api";
const API_KEY = process.env.API_KEY; // lấy tại trang /api-keys
async function uploadFile(filePath) {
const form = new FormData();
const buf = fs.readFileSync(filePath);
form.append("file", new Blob([buf]), path.basename(filePath));
const res = await fetch(`${BASE}/account/ai/uploads`, {
method: "POST",
headers: { "X-API-Key": API_KEY },
body: form,
});
const data = await res.json();
if (!res.ok) throw new Error(data.message || res.statusText);
return data.url;
}
// Bước 1: Upload tuần tự từng ảnh 1 -> 2 -> 3 để giữ đúng thứ tự mảng
const imageUrls = [];
for (const file of ["./1.jpg", "./2.jpg", "./3.jpg"]) {
imageUrls.push(await uploadFile(file));
}
// Bước 2: Gửi tạo tác vụ
const createRes = await fetch(`${BASE}/v1/generations`, {
method: "POST",
headers: { "X-API-Key": API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({
...{
"model": "seedream-5.0/product-image",
"server": "sv1",
"image_url": "https://example.com/image.jpg",
"product_style": "Ảnh chụp sản phẩm thương mại chuyên nghiệp, đặt sản phẩm",
"product_scene": "trên bục đá cẩm thạch trắng trong studio cao cấp, ánh sáng thương mại sắc nét",
"prompt": "Keep the pose and composition of Image 1, swap in the outfit from Image 2, and use the face from Image 3.",
"aspect_ratio": "1:1"
},
reference_image_urls: imageUrls,
}),
});
let gen = await createRes.json();
if (!createRes.ok) throw new Error(gen.message || createRes.statusText);
// Bước 3: Chờ kết quả
while (["queued", "processing"].includes(gen.status)) {
await new Promise((r) => setTimeout(r, 5000));
const pollRes = await fetch(`${BASE}/v1/generations/${gen.id}`, {
headers: { "X-API-Key": API_KEY },
});
gen = await pollRes.json();
}
if (gen.status !== "succeeded") throw new Error(gen.error ?? gen.status);
console.log("Kết quả:", gen.output.files.map((f) => f.url));Output — response
Jobs run asynchronously. POST /v1/generations immediately returns a generation object with status queued or processing; poll GET /v1/generations/{id} every 5–10 seconds until status is succeeded, failed or cancelled.
/v1/generations/{id}{
"id": "3f1c...-uuid",
"object": "generation",
"code": "T8KQ2M4X",
"model": "seedream-5.0/product-image",
"canonical_model": "seedream-5.0",
"server_id": "sv1",
"server_name": "SV1",
"status": "succeeded", // queued | processing | succeeded | failed | cancelled
"progress": 100,
"cost": 2400, // amount charged
"currency": "VND",
"refunded": false,
"output": {
"type": "image",
"files": [{ "url": "https://promptflow.web.id/uploads/ai/outputs/....png", "type": "image", "name": "image.png" }],
"text": null
},
"error": null,
"created_at": "2026-10-30T08:00:00.000Z",
"completed_at": "2026-10-30T08:01:12.000Z"
}| Field | Meaning |
|---|---|
| model / server_id | Đúng mã gói sản phẩm và máy chủ SV đã thực thi tác vụ. |
| output.files[].url | Result file links — download them to your own system; files on our server may be cleaned up after some time. |
| output.text | Text content (only for models that return text). |
| cost | Amount in VND charged to your balance; refunded automatically on failure or cancellation (refunded = true). |
| error | Error reason when status = failed. |
Get a quote before running
/v1/generations/estimateCùng body với POST /v1/generations, không chạy và không trừ tiền (tự áp % chiết khấu riêng nếu tài khoản có).
# => {
# "object": "estimate",
# "model": "seedream-5.0/product-image",
# "canonical_model": "seedream-5.0",
# "server_id": "sv1",
# "server_name": "SV1",
# "cost": 2400,
# "currency": "VND"
# }