Generate images
Generate images from text prompts using thegenerate_images method:
Configuration options
TheGenerateImagesConfig supports the following parameters:
- number_of_images - Number of images to generate (default: 1)
- include_rai_reason - Include Responsible AI filtering reasons
- output_mime_type - Output format:
image/jpegorimage/png
Upscale images
Image upscaling is only supported in Vertex AI.
upscale_factor parameter accepts 'x2' or 'x4' for 2x or 4x upscaling.
Edit images
Image editing is only supported in Vertex AI and uses a separate model (
imagen-3.0-capability-001).Edit modes
Theedit_mode parameter supports:
- EDIT_MODE_INPAINT_INSERTION - Insert new content into masked regions
- EDIT_MODE_INPAINT_REMOVAL - Remove content from masked regions
- EDIT_MODE_OUTPAINT - Extend the image beyond its borders
Mask modes
Themask_mode parameter supports:
- MASK_MODE_BACKGROUND - Mask the background
- MASK_MODE_FOREGROUND - Mask the foreground
- MASK_MODE_SEMANTIC - Mask based on semantic segmentation