Actions26
- Upload Actions
- Transform Actions
- Generate Actions
- Asset Actions
- Widget Actions
- Library Actions
- Asset (Legacy, by Public ID) Actions
Generate → Generate Image From Reference Images
AI-generatedSummary
Generate an AI-edited image from reference images using Cloudinary's generation service, applying a text prompt and up to four reference images to steer the result.
Inputs
- prompt (required) — The edit instruction. Refer to reference images by position: [1], [2], and so on.
- reference_images (required) — Up to 4 reference images that steer the generation, in order. Each can be a URL or a managed asset by asset ID. Some models accept fewer (Recraft V3 and MAI edit models accept 1; Grok Imagine and Qwen Image edit models accept 3).
- modelSelection — Select how the generation model is chosen. 'Default' uses the service default edit model for reference images. 'By family and tier' picks a model family and quality tier. 'By model ID' pins an exact edit model. 'Auto' lets the service choose per request.
- imageToImageModelId — Specific edit model ID, shown when modelSelection is 'id'. Lists models such as nano-banana-2-edit, flux-2-klein-9b-edit, recraft-v3-edit, grok-imagine-image-edit, and others. Default: nano-banana-2-edit.
- imageSize — Output size settings. 'Model default' uses the model's default resolution. 'Aspect ratio' picks a portable tier. 'Exact dimensions' sets width and height in pixels.
- imageSizeAspectRatio — Output aspect ratio, width to height. Shown when imageSize is 'aspectRatio': 1:1, 16:9, 9:16, 4:3, 3:4.
- imageSizeResolution — Output resolution tier. Shown when imageSize is 'aspectRatio': 0.5K, 1K, 2K, 4K (longest edge). Default: 1K.
- imageSizeWidth — Output width in pixels. Shown when imageSize is 'dimensions'. Minimum 64, maximum 4096. Default: 1024.
- imageSizeHeight — Output height in pixels. Shown when imageSize is 'dimensions'. Minimum 64, maximum 4096. Default: 1024.
- generateOptions — Additional generation options. Includes: Async (return immediately with task_id), Format (JPEG, PNG, WebP), Notification URL (webhook for async completion), Public ID (store under managed asset), Seed (reproducible generation, supported by FLUX, Nano Banana, Ideogram, Qwen Image 3), Storage (Managed Asset or Temporary), and Upload Preset (managed asset only).
- simplify — Whether to return one item per generated image with storage fields (public_id, asset_id, secure_url, etc.) at the top level, instead of the raw API response. Default: true.
Output shape
A single normalized record with generated image metadata (public_id, asset_id, secure_url, format, width, height) when simplify is true; otherwise the raw Cloudinary API generation response object.
The simplify parameter controls output shape. When simplify is true (default), the workflow receives a normalized record per generated image. When false, the full API response is returned, which may include task IDs, error details, or additional metadata for async generation.
Examples
Example 1: Edit a product photo into a kitchen scene
Set prompt to 'Place the product from [1] on a marble kitchen counter, soft morning light', add one reference image via URL at reference_images[0], choose modelSelection 'default' (nano-banana-2-edited, keep default image size, and leave simplify true for a direct secure_url output.
Example 2: Generate multiple aspect variants from a single reference
Set prompt to 'Change the background to a sunny garden', add three reference images for context, set modelSelection to 'id' with flux-2-klein-9b-edited, set imageSize to 'aspectRatio' with 16:9 and resolution 2K, enable async false for synchronous return.
Example 3: Reproducible AI generation with seed
Set prompt to 'Redesign the logo with Art Deco style', add two reference images, set modelSelection to 'family', modelFamily to 'ideogram', modelTier to 'premium', seed to 42, target_type to 'temporary', and async true to poll via Get Generation Task later.