Skip to main content
POST
CometAPI의 OpenAI 호환 POST /v1/images/generations 경로를 사용해 Seedream 이미지 생성을 실행하세요. 이 엔드포인트는 텍스트-투-이미지 프롬프트, 참조 이미지 요청, 그리고 선택한 model이 해당 제어를 지원하는 경우 제한된 순차 이미지 출력을 지원합니다. 이 페이지에서는 Pro 텍스트-투-이미지 요청용 seedream-5-0-pro-260628과 Seedream 5.0 참조 이미지, 순차, 비동기 예제용 seedream-5-0-260128을 다룹니다. 계정에서 사용 가능한지 확인하려면 모델 페이지를 보거나 /v1/models를 조회하세요. provider 파라미터의 자세한 내용은 BytePlus의 image generation APISeedream 4.0-5.0 tutorial을 참고하세요.

요청 형태 선택하기

  • 텍스트-투-이미지: model, prompt, sizeresponse_format, output_format, watermark 같은 선택적 출력 제어를 전송합니다.
  • 이미지-투-이미지: 공개 HTTPS URL 또는 data URI의 배열로 image를 추가합니다. 참조 이미지 하나만 보내는 경우에도 배열을 사용하세요.
  • 순차 프롬프트: sequential_image_generationauto로 설정하고 sequential_image_generation_options.max_images를 상한으로 사용합니다. model은 최대값보다 적은 이미지를 반환할 수 있습니다.
  • 비동기 작업: 생성 요청이 HTTP 연결을 계속 열어두는 대신 data.task_id를 반환하게 하려면 async: true를 추가합니다.
참조 이미지와 생성된 이미지의 합계는 provider 제한 이내여야 합니다. 순차 요청은 max_images로 제한을 두세요.

비동기 이미지 작업 실행하기

클라이언트가 제출하고 폴링해야 하는 이미지 작업에는 asynctrue로 설정하세요. 생성 요청은 data.task_id를 반환합니다. data.statussuccess 또는 failure가 될 때까지 Seedream 이미지 작업 조회하기와 함께 이 값을 사용하세요. 비동기 예제에서는 Seedream 5.0 요청에 2K를 사용합니다. 지원되는 size는 model ID에 따라 다르므로, 비동기 작업을 제출하기 전에 model이 지원하는 size를 선택하세요.

참조 이미지 전송하기

인라인 이미지 데이터에는 data:image/png;base64,YOUR_BASE64_IMAGE를 사용하거나, provider가 가져올 수 있는 공개 HTTPS URL을 사용하세요. API 레퍼런스 예제에는 각 요청 유형에 대한 전체 JSON 형태가 나와 있습니다.

출력 URL 읽기

반환되는 url은 서명된 오브젝트 스토리지 링크이며 &, % 및 기타 특수 문자를 포함할 수 있습니다. 터미널 줄의 일부를 복사하지 말고 파싱된 JSON에서 URL을 추출하세요. 셸 예제에서 jq -r '.data[]?.url'는 전체 서명 URL을 그대로 보존합니다.

인증

Authorization
string
header
필수

Bearer token authentication. Use your CometAPI key.

본문

application/json

Parameters for Seedream image generation. Send JSON for text-to-image, image-to-image, and sequential prompt requests.

model
string
기본값:seedream-5-0-pro-260628
필수

Seedream model ID to use. Query /v1/models or open the Models page for available model IDs.

prompt
string
기본값:A clean product-style render of a blue ceramic mug on a white table, soft studio lighting.
필수

Text prompt describing the image or edit goal. Use a concrete visual request, such as a blue ceramic mug on a white table, soft studio lighting.

response_format
enum<string>
기본값:url

Response image format. Use url for a temporary signed image URL, or b64_json when you need base64 image data in the response.

사용 가능한 옵션:
url,
b64_json
size
string
기본값:2K

Output resolution. Use a model-supported tier such as 2K or a model-supported WIDTHxHEIGHT value such as 2048x2048. Not every model ID accepts every tier.

image
string[]

Optional reference images for image-to-image generation. Each item can be a public HTTPS URL or a data URI such as data:image/png;base64,YOUR_BASE64_IMAGE. Use an array even for one image. Reference images plus generated images must not exceed the provider limit.

watermark
boolean
기본값:false

When true, requests a visible AI-generated watermark on the output image. Set false when your workflow handles disclosure separately.

async
boolean
기본값:false

CometAPI asynchronous task mode. Set this to true to return immediately with data.task_id, then poll the Seedream image task endpoint GET /v1/images/generations/{task_id} for the final image data.

output_format
enum<string>
기본값:png

Output image file format. Use png when you need lossless output, or jpeg for smaller files.

사용 가능한 옵션:
png,
jpeg
guidance_scale
number

Optional prompt-adherence control for model versions that support it. Higher values can follow the prompt more closely but may reduce naturalness. Omit this field when you do not need model-specific tuning.

필수 범위: 1 <= x <= 10
seed
integer
기본값:-1

Optional random seed for reproducible attempts on model versions that support seeding. Use -1 or omit the field for a random seed.

필수 범위: -1 <= x <= 2147483647
sequential_image_generation
enum<string>
기본값:disabled

Controls sequential prompt handling. Use auto to let the model return a sequence when the prompt calls for one. Use disabled for ordinary single-image requests.

사용 가능한 옵션:
auto,
disabled
sequential_image_generation_options
object

Options for sequential prompt handling. This object is only used when sequential_image_generation is auto.

응답

200 - application/json

Image generation response. Synchronous requests return completed image data. Async requests return a task response with data.task_id.

created
integer
필수

Unix timestamp in seconds when the image response was created.

data
object[]
필수

Generated image results. The array can contain one or more images depending on the request and model response.

usage
object

Usage information for the request. Fields vary by model and route.