Seedream 이미지 생성
CometAPI의 POST /v1/images/generations를 사용해 텍스트 프롬프트, 참조 이미지, 순차 이미지 출력, 비동기 작업으로 Seedream 이미지 생성을 수행합니다.
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 API 및 Seedream 4.0-5.0 tutorial을 참고하세요.
요청 형태 선택하기
- 텍스트-투-이미지:
model,prompt,size와response_format,output_format,watermark같은 선택적 출력 제어를 전송합니다. - 이미지-투-이미지: 공개 HTTPS URL 또는 data URI의 배열로
image를 추가합니다. 참조 이미지 하나만 보내는 경우에도 배열을 사용하세요. - 순차 프롬프트:
sequential_image_generation을auto로 설정하고sequential_image_generation_options.max_images를 상한으로 사용합니다. model은 최대값보다 적은 이미지를 반환할 수 있습니다. - 비동기 작업: 생성 요청이 HTTP 연결을 계속 열어두는 대신
data.task_id를 반환하게 하려면async: true를 추가합니다.
max_images로 제한을 두세요.비동기 이미지 작업 실행하기
클라이언트가 제출하고 폴링해야 하는 이미지 작업에는async를 true로 설정하세요. 생성 요청은 data.task_id를 반환합니다. data.status가 success 또는 failure가 될 때까지 Seedream 이미지 작업 조회하기와 함께 이 값을 사용하세요.
비동기 예제에서는 Seedream 5.0 요청에 2K를 사용합니다. 지원되는 size는 model ID에 따라 다르므로, 비동기 작업을 제출하기 전에 model이 지원하는 size를 선택하세요.
참조 이미지 전송하기
인라인 이미지 데이터에는data:image/png;base64,YOUR_BASE64_IMAGE를 사용하거나, provider가 가져올 수 있는 공개 HTTPS URL을 사용하세요. API 레퍼런스 예제에는 각 요청 유형에 대한 전체 JSON 형태가 나와 있습니다.
출력 URL 읽기
인증
Bearer token authentication. Use your CometAPI key.
본문
Parameters for Seedream image generation. Send JSON for text-to-image, image-to-image, and sequential prompt requests.
Seedream model ID to use. Query /v1/models or open the Models page for available model IDs.
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 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 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.
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.
When true, requests a visible AI-generated watermark on the output image. Set false when your workflow handles disclosure separately.
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 image file format. Use png when you need lossless output, or jpeg for smaller files.
png, jpeg 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 <= 10Optional random seed for reproducible attempts on model versions that support seeding. Use -1 or omit the field for a random seed.
-1 <= x <= 2147483647Controls 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 Options for sequential prompt handling. This object is only used when sequential_image_generation is auto.
응답
Image generation response. Synchronous requests return completed image data. Async requests return a task response with data.task_id.
- Option 1
- Async task response