### Successful Image Generation Response Source: https://docs.byteplus.com/en/docs/ModelArk/1541523 This is an example of a successful response from the image generation API. It includes the model used, creation timestamp, image data (URL and size), and usage statistics. ```json { "model": "seedream-5-0-260128", "created": 1757323224, "data": [ { "url": "https://...", "size": "1760x2368" } ], "usage": { "generated_images": 1, "output_tokens": 16280, "total_tokens": 16280 } } ``` -------------------------------- ### Generate Image Request using Curl Source: https://docs.byteplus.com/en/docs/ModelArk/1541523 This snippet shows how to make a text-to-image generation request using Curl. Ensure you replace '$ARK_API_KEY' with your actual API key and adjust the model and prompt as needed. ```curl curl https://ark.ap-southeast.bytepluses.com/api/v3/images/generations \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ARK_API_KEY" \ -d '{ "model": "seedream-5-0-260128", "prompt": "Vibrant close-up editorial portrait, model with piercing gaze, wearing a sculptural hat, rich color blocking, sharp focus on eyes, shallow depth of field, Vogue magazine cover aesthetic, shot on medium format, dramatic studio lighting.", "size": "2K", "output_format":"png", "watermark": false }' ``` -------------------------------- ### Image Generation API Source: https://docs.byteplus.com/en/docs/ModelArk/1541523 Generates images based on provided text prompts and optional reference images. Supports multiple models and generation configurations. ```APIDOC ## POST /api/v3/images/generations ### Description This API endpoint is used to generate images. It supports various models and can generate single or multiple images based on text prompts and reference images. ### Method POST ### Endpoint https://ark.ap-southeast.bytepluses.com/api/v3/images/generations ### Parameters #### Request Body - **model** (string) - Required - The model ID used for image generation (e.g., Model ID or inference endpoint ID). - **prompt** (string) - Required - The text prompt used for image generation. Recommended to keep under 600 English words. - **image** (string/array) - Optional - Provide the image to edit as a Base64 string or an accessible URL. Supported by seedream-5-0-lite, 4-5 and 4-0 for single or multiple images. Not supported by seededit-3-0-t2i. For Base64 encoding, use the format `data:image/;base64,`. - **size** (string) - Optional - Specify the output image dimensions. Can be specified using natural language (e.g., '2K', '3K', '4K') or by providing width and height in pixels (e.g., '3750x1250'). Default is '2048x2048'. ### Request Example ```json { "model": "seedream-5-0-lite", "prompt": "A futuristic cityscape at sunset", "size": "4K" } ``` ### Response #### Success Response (200) - **images** (array) - A list of generated image URLs or Base64 encoded strings. - **job_id** (string) - The ID of the image generation job. #### Response Example ```json { "images": [ "https://example.com/image1.png", "https://example.com/image2.png" ], "job_id": "job-12345" } ``` ``` -------------------------------- ### Image Generation Source: https://docs.byteplus.com/en/docs/ModelArk/1541523 Generates images based on a provided prompt using specified models and parameters. Supports various output formats and includes options for prompt optimization. ```APIDOC ## POST /api/v3/images/generations ### Description Generates images based on a provided prompt using specified models and parameters. Supports various output formats and includes options for prompt optimization. ### Method POST ### Endpoint https://ark.ap-southeast.bytepluses.com/api/v3/images/generations ### Parameters #### Request Body - **model** (string) - Required - The model ID used for image generation (model name-version). - **prompt** (string) - Required - The text prompt to guide image generation. - **size** (string) - Optional - The desired size of the generated image (e.g., "2K"). Only seedream-5-0-lite, 4-5 and 4-0 support this parameter. - **output_format** (string) - Optional - The desired output format for the image (e.g., "png"). - **watermark** (boolean) - Optional - Whether to include a watermark on the generated image. - **optimize_prompt_options.mode** (string) - Optional - Set the mode for the prompt optimization feature. Supported values: "standard" (higher quality, longer generation time) or "fast" (faster, average quality). Default: "standard". Only seedream-5-0-lite/4-5 and seedream-4-0 support this parameter. ### Request Example ```json { "model": "seedream-5-0-260128", "prompt": "Vibrant close-up editorial portrait, model with piercing gaze, wearing a sculptural hat, rich color blocking, sharp focus on eyes, shallow depth of field, Vogue magazine cover aesthetic, shot on medium format, dramatic studio lighting.", "size": "2K", "output_format":"png", "watermark": false } ``` ### Response #### Success Response (200) - **model** (string) - The model ID used for image generation. - **created** (integer) - The Unix timestamp in seconds of the creation time of the request. - **data** (array) - Information of the output images. - **data.url** (string) - The URL of the image. This link will expire within 24 hours. - **data.b64_json** (string) - The Base64 information of the image. - **data.size** (string) - The width and height of the image in pixels, in the format x. - **usage** (object) - Usage information for the current request. - **usage.generated_images** (integer) - The number of images successfully generated. - **usage.output_tokens** (integer) - The number of tokens consumed for the images generated. - **usage.total_tokens** (integer) - The total number of tokens consumed by this request. #### Response Example ```json { "model": "seedream-5-0-260128", "created": 1757323224, "data": [ { "url": "https://...", "size": "1760x2368" } ], "usage": { "generated_images": 1, "output_tokens": 16280, "total_tokens": 16280 } } ``` ### Error Handling - **error** (object) - The error message for this request, if any. - **error.code** (string) - The error code for a failed image generation. See Error Codes. - **error.message** (string) - Error message for a failed image generation. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.