텍스트→이미지

Seedream 4.5

MegaBrain API로 쓰는 Seedream 4.5(텍스트→이미지): 이미지당 $0.039. 모든 모델에 키 하나, 달러 선불 잔액에서 결제, 구독 없음.

bytedance/seedream/v4.5/text-to-image
가격
$0.039
이미지당

작업이 대기열에 들어갈 때 차감되고, 생성에 실패하면 환불됩니다.

출력 예시

예시: Seedream 4.5

브라우저에서 사용해 보기

로그인하면 영어 페이지의 플레이그라운드에서 Seedream 4.5을(를) 브라우저로 실행할 수 있으며, API와 같은 잔액에서 결제됩니다.

플레이그라운드 열기

요청 파라미터

요청 JSON 본문의 필드입니다. 모델은 다른 필드를 받지 않으며, 포함하면 400 오류가 반환됩니다.

  • prompt문자열필수
    최대 50,000 자
  • image_size문자열 또는 객체선택
    기본값:
    2048×2048
    값:
    square_hd (1024×1024), square (512×512), portrait_4_3 (768×1024), portrait_16_9 (576×1024), landscape_4_3 (1024×768), landscape_16_9 (1024×576), auto_2K, auto_4K 또는 {"width", "height"}, 각 변 1024–4096 px
  • num_images정수선택
    기본값:
    1
    범위:
    1–4
  • seed정수선택

API로 사용하기

작업을 보내고 status_url이 COMPLETED가 될 때까지 확인한 뒤 response_url에서 결과를 받으세요. 같은 키와 잔액으로 텍스트 모델도 쓸 수 있습니다. API 문서(영어)

curl

curl -X POST https://getmegabrain.com/api/gateway/v1/queue/bytedance/seedream/v4.5/text-to-image \
  -H "Authorization: Bearer $MEGABRAIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"wooden matryoshka dolls on a frosty windowsill, soft morning light, photo"}'

# Then poll status_url and fetch the result from response_url:
curl https://getmegabrain.com/api/gateway/v1/queue/requests/$REQUEST_ID -H "Authorization: Bearer $MEGABRAIN_API_KEY"

Python

import os, time, requests

BASE = "https://getmegabrain.com/api/gateway/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['MEGABRAIN_API_KEY']}"}

job = requests.post(f"{BASE}/queue/bytedance/seedream/v4.5/text-to-image", headers=HEADERS, json={
  "prompt": "wooden matryoshka dolls on a frosty windowsill, soft morning light, photo"
}).json()

while requests.get(job["status_url"], headers=HEADERS).json()["status"] not in ("COMPLETED", "FAILED"):
    time.sleep(2)

print(requests.get(job["response_url"], headers=HEADERS).json())

JavaScript

const BASE = 'https://getmegabrain.com/api/gateway/v1';
const headers = {
  Authorization: `Bearer ${process.env.MEGABRAIN_API_KEY}`,
  'Content-Type': 'application/json',
};

const job = await fetch(`${BASE}/queue/bytedance/seedream/v4.5/text-to-image`, {
  method: 'POST',
  headers,
  body: JSON.stringify({
    "prompt": "wooden matryoshka dolls on a frosty windowsill, soft morning light, photo"
  }),
}).then(r => r.json());

let status = job.status;
while (status !== 'COMPLETED' && status !== 'FAILED') {
  await new Promise(r => setTimeout(r, 2000));
  ({ status } = await fetch(job.status_url, { headers }).then(r => r.json()));
}
console.log(await fetch(job.response_url, { headers }).then(r => r.json()));

자주 묻는 질문

Seedream 4.5 API 가격은 얼마인가요?

이미지당 $0.039. 달러 선불 잔액에서 차감되며, 실패한 생성은 전액 환불됩니다. 구독은 없습니다.

Seedream 4.5을(를) API로 어떻게 사용하나요?

MegaBrain API 키로 POST https://getmegabrain.com/api/gateway/v1/queue/bytedance/seedream/v4.5/text-to-image에 작업을 보내고, status_url이 COMPLETED가 될 때까지 확인한 뒤 response_url에서 결과를 받으세요. 같은 키와 잔액으로 텍스트 모델도 쓸 수 있습니다.

코드 없이 Seedream 4.5을(를) 써 볼 수 있나요?

네. 로그인하면 모델의 영어 페이지에 있는 플레이그라운드에서 Seedream 4.5을(를) 브라우저로 실행할 수 있으며, API와 같은 잔액에서 결제됩니다.