CometAPI の POST /v1/images/generations を使用して、Seedream のテキストから画像生成および画像から画像生成を行います。連続マルチ画像出力と参照画像に対応しています。
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>"
}/v1/images/generations エンドポイントを通じて、ByteDance の Seedream モデルで画像を生成します。text-to-image と image-to-image の両方に対応しています。
完全なモデル一覧については、Models page を参照してください。プロバイダーによる詳細なパラメータ仕様については、VolcEngine documentation を参照してください。
sequential_image_generation を auto に設定し、必要に応じて sequential_image_generation_options.max_images を設定して出力画像数を制限してください。参照画像と生成画像の合計数は 15 以下 である必要があります。image パラメータ(URL の配列または base64 data URI)で渡します。最大 14 枚の参照画像をサポートします。
url は署名付きのオブジェクトストレージリンクで、& やその他の特殊文字を含みます。\{"Code":"AccessDenied","Message":"Access Denied","EC":"0003-00000015"\}
| jq -r '.data[].url' にパイプして URL を正しく抽出してください。result.data[0].url または image["url"] を使用してください。文字列はすでに完全なので、そのまま requests.get() または webbrowser.open() に渡せます。result.data[0].url を使用します。& や % が切り詰められたり、二重にエスケープされたりしていないことを確認してください。Bearer token authentication. Use your CometAPI key.
Parameters for Seedream image generation (text-to-image and image-to-image).
Model to use. See the Models page for current Seedream model IDs.
Text prompt describing the image to generate. Supports both Chinese and English. Recommended max 300 Chinese characters or 1000 English characters.
Output format. url returns a temporary image link (valid for 24 hours); b64_json returns base64-encoded image data.
url, b64_json Output resolution. Presets 2K, 4K, or exact pixels like 2048x2048, 2304x1728, 2848x1600, 1600x2848, etc. Default: 2048x2048.
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.
When true, adds an 'AI Generated' watermark to the bottom-right corner of the output image.
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).
Random seed for reproducible outputs. Range: -1 to 2147483647. Use -1 (default) for random generation. Legacy parameter — ignored by newer models.
Controls sequential (multi-image) generation mode.
auto: model decides whether to generate a sequence based on the promptdisabled: always generate a single imageauto, disabled Configuration for sequential (multi-image) generation. Only effective when sequential_image_generation is auto.
Show child attributes
Output image file format. Options: png, jpeg.
png, jpeg Successful Response
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>"
}