Skip to main content
Our image endpoints are compatible with the OpenAI API, supporting the same v1/images/generations and v1/images/edits formats, plus additional analysis capabilities.

Image generation

Here is an example of image generation: Parameters:
  • model: The model ID of the model you want to use
  • prompt: The text description of the image to generate
  • n: The number of images to generate (default: 1, range: 1-10)
  • quality: The quality of the generated image (default: “standard”, options: “standard”, “hd”)
  • response_format: The format of the returned image (default: “url”, options: “url”, “b64_json”)
  • size: The size of the generated image (default: “1024x1024”, options: “256x256”, “512x512”, “1024x1024”, “1792x1024”, “1024x1792”)
  • style: The style of the generated image (default: “vivid”, options: “vivid”, “natural”)

Image editing

Here is an example of image editing: Parameters:
  • model: The model ID of the model you want to use
  • image: The image to edit (base64 encoded, URL, or file)
  • prompt: The text description of the changes to make
  • mask: The mask image indicating areas to edit (optional)
  • n: The number of edited images to generate (default: 1, range: 1-10)
  • size: The size of the edited image (default: “1024x1024”)
  • response_format: The format of the returned image (default: “url”, options: “url”, “b64_json”)

Image to text

Here is an example of image analysis to extract text descriptions: Parameters:
  • model: The model ID of the model you want to use
  • inputs: The image to analyze (base64 encoded, URL, or file)
  • max_new_tokens: Maximum number of tokens to generate (default: 300)
  • generate_kwargs: Additional generation parameters (optional)

Image feature extraction

Here is an example of extracting features from images: Parameters:
  • model: The model ID of the model you want to use
  • inputs: The image to extract features from (base64 encoded, URL, or file)

Image segmentation

Here is an example of image segmentation: Parameters:
  • model: The model ID of the model you want to use
  • inputs: The image to analyze (base64 encoded, URL, or file)
  • subtask: The segmentation subtask (default: “panoptic”)
  • threshold: The confidence threshold (default: 0.9)
  • mask_threshold: The mask threshold (default: 0.5)
  • overlap_mask_area_threshold: The overlap mask area threshold (default: 0.5)

Depth estimation

Here is an example of depth estimation: Parameters:
  • model: The model ID of the model you want to use
  • inputs: The image to analyze (base64 encoded, URL, or file)
  • parameters: Additional parameters for depth estimation (optional)

Object detection

Here is an example of object detection: Parameters:
  • model: The model ID of the model you want to use
  • inputs: The image to analyze (base64 encoded, URL, or file)
  • threshold: The confidence threshold for detections (default: 0.5)

Mask Generation

Here is an example of mask generation: Parameters:
  • image: The image to generate masks for (base64 encoded, URL, or file)
  • mask_threshold: The threshold for mask generation (default: 0.0)
  • pred_iou_thresh: The threshold for prediction IOU (default: 0.88)
  • stability_score_thresh: The threshold for stability score (default: 0.95)
  • stability_score_offset: The offset for stability score (default: 1)
  • crops_nms_thresh: The threshold for crops NMS (default: 0.7)
  • crops_n_layers: The number of crops layers (default: 0)
  • crop_overlap_ratio: The overlap ratio for crops (default: 0.3413)
  • crop_n_points_downscale_factor: The number of points to downscale for crops (default: 1)
You can also try image generation and editing using the Playground. For deeper insights into the image endpoints, see our API reference.