메인 콘텐츠로 건너뛰기
POST
/
v1
/
images
/
generations
curl -s https://api.cometapi.com/v1/images/generations \
  -H "Authorization: Bearer $COMETAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedream-5-0-260128",
    "prompt": "a cat wearing a scarf sitting by the window watching rain, illustration style",
    "size": "2K",
    "response_format": "url",
    "watermark": false
  }' | jq -r '.data[].url'
{
  "created": 123,
  "data": [
    {
      "url": "<string>",
      "b64_json": "<string>",
      "size": "<string>"
    }
  ],
  "usage": {
    "generated_images": 123,
    "output_tokens": 123,
    "total_tokens": 123
  },
  "model": "<string>"
}

개요

표준 OpenAI 호환 /v1/images/generations 엔드포인트를 통해 ByteDance의 Seedream 모델로 이미지를 생성합니다. 텍스트-투-이미지이미지-투-이미지 생성 모두 지원합니다. 전체 모델 목록은 Models 페이지를 참고하세요. 공급자의 자세한 파라미터 문서는 VolcEngine documentation을 참고하세요.
순차적(다중 이미지) 생성을 사용할 때는 sequential_image_generationauto로 설정하고, 필요하면 sequential_image_generation_options.max_images를 설정해 출력 이미지 수를 제한하세요. 참조 이미지와 생성된 이미지의 총합은 15 이하여야 합니다.

이미지-투-이미지

텍스트 프롬프트와 함께 image 파라미터(배열 형태의 URL 또는 base64 data URI)를 통해 하나 이상의 참조 이미지를 전달하세요. 최대 14개의 참조 이미지를 지원합니다.

반환된 URL에서 AccessDenied가 발생하나요?

반환된 url& 및 기타 특수 문자를 포함하는 서명된 오브젝트 스토리지 링크입니다.
원시 JSON을 복사해 브라우저나 스크립트에 직접 붙여 넣으면 셸 이스케이프나 터미널 잘림 때문에 서명 파라미터가 제거되어 다음과 같은 결과가 발생할 수 있습니다:
\{"Code":"AccessDenied","Message":"Access Denied","EC":"0003-00000015"\}
해결 방법:
  • curl: | jq -r '.data[].url'로 파이프해 URL을 깔끔하게 추출하세요.
  • Python: result.data[0].url 또는 image["url"]을 사용하세요 — 문자열은 이미 완전하므로 requests.get() 또는 webbrowser.open()에 직접 전달하면 됩니다.
  • JavaScript: 동일한 방식으로 result.data[0].url을 사용하세요.
  • 일반: URL의 &%가 잘리거나 중복 이스케이프되지 않도록 주의하세요.

인증

Authorization
string
header
필수

Bearer token authentication. Use your CometAPI key.

본문

application/json

Parameters for Seedream image generation (text-to-image and image-to-image).

model
string
기본값:doubao-seedream-5-0-260128
필수

Model to use. See the Models page for current Seedream model IDs.

prompt
string
기본값:a cat wearing a scarf sitting by the window
필수

Text prompt describing the image to generate. Supports both Chinese and English. Recommended max 300 Chinese characters or 1000 English characters.

response_format
enum<string>
기본값:url

Output format. url returns a temporary image link (valid for 24 hours); b64_json returns base64-encoded image data.

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

Output resolution. Presets 2K, 4K, or exact pixels like 2048x2048, 2304x1728, 2848x1600, 1600x2848, etc. Default: 2048x2048.

image
string[]

Reference image(s) for image-to-image generation. Each item is a public URL or base64 data URI (data:image/png;base64,...). Supports up to 14 reference images. Supported formats: jpeg, png, webp, bmp, tiff, gif.

watermark
boolean
기본값:true

When true, adds an 'AI Generated' watermark to the bottom-right corner of the output image.

guidance_scale
number
기본값:2.5

Controls how closely the output follows the prompt. Higher values increase adherence but may reduce naturalness. Range: 1.0–10.0. Not supported by Seedream 5.0 (ignored).

seed
integer
기본값:-1

Random seed for reproducible outputs. Range: -1 to 2147483647. Use -1 (default) for random generation. Legacy parameter — ignored by newer models.

sequential_image_generation
enum<string>
기본값:disabled

Controls sequential (multi-image) generation mode.

  • auto: model decides whether to generate a sequence based on the prompt
  • disabled: always generate a single image
사용 가능한 옵션:
auto,
disabled
sequential_image_generation_options
object

Configuration for sequential (multi-image) generation. Only effective when sequential_image_generation is auto.

output_format
enum<string>
기본값:jpeg

Output image file format. Options: png, jpeg.

사용 가능한 옵션:
png,
jpeg

응답

200 - application/json

Successful Response

created
integer
필수

Unix timestamp (seconds) when the image was generated.

data
object[]
필수

Array of generated image objects.

usage
object
필수

Resource usage information for this request.

model
string

The model used for generation.