transform_image_from_encoded
Transform a base64-encoded image with Gemini using a text prompt, and optionally save the generated result to a chosen directory.
Instructions
Transform a base64-encoded image using Gemini.
Args: encoded_image: Base64 data URL (data:image/[format];base64,[data]). prompt: Text description of desired transformation. output_dir: Optional directory to save the generated image. If not provided, the image is only returned in the response (not saved to disk). model: Optional Gemini model name. If not provided, uses GEMINI_MODEL environment variable. ctx: Optional context for progress reporting.
Returns: List containing ImageContent with the transformed image, and optionally TextContent with file path if saved.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | ||
| prompt | Yes | ||
| output_dir | No | ||
| encoded_image | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |