Image Generation

Generate image from text

Generates one or more images from a text prompt using a text-to-image model. This operation is asynchronous: the response returns a job_id with status queued. Poll Get image result until the status is completed to retrieve the generated images.

post/images/generations

Request

  • Base URL: https://console.hyperstack.cloud/ai/api/v1
  • URL: https://console.hyperstack.cloud/ai/api/v1/images/generations
  • Auth: API key in header api_key

Request body

modelstring required

ID of the text-to-image model to use, such as FLUX.1-schnell. Use the model_name from List base models; the model must support the text-to-image modality.

promptstring required

Text description of the image to generate.

negative_promptstring

Text describing what to exclude from the generated image.

image_sizestring

Output image size, as an aspect-ratio preset or an explicit WIDTHxHEIGHT value.

num_imagesinteger

Number of images to generate.

num_inference_stepsinteger

Number of denoising steps. Higher values can improve quality at the cost of speed.

guidance_scalenumber

How closely the result follows the prompt. Higher values follow the prompt more strictly.

seedinteger

Random seed for reproducible results.

schedulerstring

Sampler or scheduler to use, when supported by the model.

output_format'png' | 'jpeg' | 'webp'

Format of the returned image.

presetstring

Named quality or style preset, when supported by the model.

Response

Accepted

job_idinteger

Identifier of the asynchronous image job. Poll Get image result to retrieve the result.

statusstring

Initial job status, such as queued.

Changes

No recorded changes to this operation across all 1 revision of this API.