Generate an image
adsoptimiser_generate_imageCreate ad images from prompts with Grok or Luma, and edit or restyle existing images using reference images. Returns an image URL or job ID.
Instructions
Generate an ad image with Grok (or Luma where enabled). Uses one image generation from the workspace's monthly plan allowance. Usually returns the finished image URL; if it takes longer, returns the job id to check with adsoptimiser_get_job. To edit or restyle existing images pass reference_image_paths (local files, uploaded for you), reference_image_urls or reference_job_ids.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | ||
| wait | No | Wait briefly for the finished image (default true). false returns the job id at once. | |
| model | No | Model id from adsoptimiser_list_models. Defaults to grok-imagine-image-2.0. | |
| prompt | Yes | What to create. | |
| quality | No | Grok Image 2.0 only. low is fastest (about 13s); medium and auto can take 45 to 50s. | |
| resolution | No | ||
| aspect_ratio | No | For example 9:16 (TikTok vertical), 1:1 or 16:9. See adsoptimiser_list_models. | |
| reference_job_ids | No | Finished image jobs to use as references instead of URLs. | |
| reference_image_urls | No | Images to edit or use as references (https URLs, for example media_url values). | |
| reference_image_paths | No | Local image files (absolute paths; png, jpg, webp or gif, max 10 MB each) to upload and edit or use as references. |