Generate Image
During execution, the task sends the prompt (either literal text or a saved AI Prompt) to the configured provider and model, and returns the generated image(s) as output, either as a URL or base64-encoded data. Use it to produce illustrations, product mockups, or other visual content as part of a workflow, or to feed generated images into downstream tasks.
Prerequisites
Before using this task, you must have created an appropriate AI model integration in Orkes Conductor for your chosen provider (OpenAI, Azure OpenAI, Google Gemini, or Google Vertex). Integrate the required provider with Orkes Conductor before configuring this task.
Task parameters
Configure these parameters for the Generate Image task.
| Parameter | Description | Required/ Optional |
|---|---|---|
| inputParameters.llmProvider | The integration name of the AI model provider configured with your Conductor cluster. | Required. |
| inputParameters.model | The model or deployment name registered under the integration (e.g. dall-e-3, gpt-image-1, imagen-3.0-generate-002). |
Required. |
| inputParameters.prompt | The image description. By default, this value is looked up as the name of a saved AI Prompt rather than used as literal text. To use literal text, set allowRawPrompts to true. |
Required. |
| inputParameters.allowRawPrompts | Whether to treat prompt as literal text instead of a saved AI prompt.Note: If omitted or set to false, and prompt doesn't match an existing prompt name, the task fails. |
Optional. |
| inputParameters.n | Number of images to generate. Default is 1. | Optional. |
| inputParameters.size | Image dimensions, e.g. 1024x1024. |
Optional. |
| inputParameters.width | Image width in pixels, used as an alternative to size. Default is 1024. |
Optional. |
| inputParameters.height | Image height in pixels, used as an alternative to size. Default is 1024. |
Optional. |
| inputParameters.style | Provider-specific style hints, such as vivid or natural. |
Optional. |
| inputParameters.outputFormat | Output image format. Supported values: jpg, png, webp. Default is png. |
Optional. |
The following are generic configuration parameters that can be applied to the task and are not specific to the Generate Image task.
Caching parameters
You can cache the task outputs using the following parameters. Refer to Caching Task Outputs for a full guide.
| Parameter | Description | Required/ Optional |
|---|---|---|
| cacheConfig.ttlInSecond | The time to live in seconds, which is the duration for the output to be cached. | Required if using cacheConfig. |
| cacheConfig.key | The cache key is a unique identifier for the cached output and must be constructed exclusively from the task’s input parameters. It can be a string concatenation that contains the task’s input keys, such as ${uri}-${method} or re_${uri}_${method}. |
Required if using cacheConfig. |
Other generic parameters
Here are other parameters for configuring the task behavior.
| Parameter | Description | Required/ Optional |
|---|---|---|
| optional | Whether the task is optional. If set to true, any task failure is ignored, and the workflow continues with the task status updated to COMPLETED_WITH_ERRORS. However, the task must reach a terminal state. If the task remains incomplete, the workflow waits until it reaches a terminal state before proceeding. |
Optional. |
Task configuration
This is the task configuration for a Generate Image task.
{
"name": "generate_image",
"taskReferenceName": "generate_image_ref",
"inputParameters": {
"llmProvider": "<YOUR-INTEGRATION-HERE>",
"model": "<YOUR-MODEL-HERE>",
"prompt": "<YOUR-PROMPT-HERE>",
"allowRawPrompts": true,
"n": 1,
"size": "1024x1024"
},
"type": "GENERATE_IMAGE"
}
Task output
The Generate Image task will return the following parameters.
| Parameter | Description |
|---|---|
| media | Array of generated images. Each element contains either a location (URL to the generated image) or base64-encoded data, tagged with a mimeType such as image/png. |
Examples
Here are some examples for using the Generate Image task.