> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markifact.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit Image

> Edit or enhance an existing image, ad, infographic, slide or creative using AI

Edit or enhance an existing image, ad, infographic, slide or creative using AI. Provide an image URL and describe the changes you want to make to generate a new version. Supports multiple AI image models, including the leading Gemini Nano Banana model.

|                      |                     |
| -------------------- | ------------------- |
| **App**              | AI                  |
| **Operation ID**     | `ai_edit_image`     |
| **Type**             | Action              |
| **Connection**       | None                |
| **Credits per run**  | 25                  |
| **Agent / MCP tool** | Yes                 |
| **MCP**              | Not exposed via MCP |

## Inputs

| Field           | Type                       | Required | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| --------------- | -------------------------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `prompt`        | string                     | Yes      | -       | Instructions for editing the image. This is a multi-line text area where you can: - Describe the changes you want to make - Specify styles, objects to add/remove, or modifications - Reference dynamic data for personalized edits - Use line breaks to structure complex edit instructions  Example: "Remove the background and add a professional office setting Make the lighting more vibrant Ensure the person looks professional"                               |
| `images`        | array of string            | Yes      | -       | List of image URLs to edit (first image will be used for editing). You can reference images from upstream nodes using \{\{nodeId\_\_data}} syntax.  Supported formats: JPEG, PNG, GIF, WebP Images can be from URLs, file uploads, or outputs from other workflow nodes.  Example: \["`https://example.com/image.jpg`"] or \["\{\{imageNodeId\_\_data.url}}"]                                                                                                          |
| `model`         | string or SelectableOption | Yes      | -       | The AI model to use for image analysis. Available options: 'gemini-3.1-flash-image-preview' - This is the RECOMMENDED model. AKA 'Nano Banana 2', You must use this model by default for best results, unless user request something else. 'gemini-3-pro-image-preview' - AKA 'Nano Banana Pro', 'gpt-image-2' - OpenAI's most advanced image generation model, best for complex prompts and highest quality 'gpt-image-1.5' - OpenAI's old model for image generation |
| `numImages`     | integer                    | No       | `1`     | Number of edited image variations to generate (1-10). More variations give you more options to choose from.                                                                                                                                                                                                                                                                                                                                                            |
| `output_format` | string or SelectableOption | No       | -       | Format of the edited images (GPT-Image only). Available options: 'png' - High quality, supports transparency 'jpg' - Smaller file size, good for photos 'webp' - Modern format, good compression                                                                                                                                                                                                                                                                       |
| `quality`       | string or SelectableOption | No       | -       | Quality of the edited images (GPT-Image only).                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `size`          | string or SelectableOption | No       | -       | Size of the edited images (GPT-Image only). Available options: '1024x1024' - Good for social media '1792x1024' - Wide format '1024x1792' - Tall format                                                                                                                                                                                                                                                                                                                 |
| `background`    | string or SelectableOption | No       | -       | Background type for the edited images. (GPT-Image only). Available options: 'transparent' - Remove background 'white' - Clean white background 'original' - Maintain existing background 'custom' - Specify in prompt                                                                                                                                                                                                                                                  |
| `aspect_ratio`  | string or SelectableOption | No       | -       | Aspect ratio for the edited images (Gemini model only). Available options: '1:1' - Square '1:4' - Ultra Tall '1:8' - Ultra Tall '2:3' - Portrait '3:2' - Portrait '3:4' - Portrait '4:1' - Ultra Wide '4:3' - Portrait '4:5' - Portrait '5:4' - Portrait '8:1' - Panorama '9:16' - Portrait '16:9' - Landscape '21:9' - Wide Landscape                                                                                                                                 |
| `resolution`    | string or SelectableOption | No       | -       | Resolution for edited images (Gemini only). Available options: '512px' '1K' '2K' '4K'                                                                                                                                                                                                                                                                                                                                                                                  |

### SelectableOption

| Field   | Type   | Required | Default | Description |
| ------- | ------ | -------- | ------- | ----------- |
| `value` | string | Yes      | -       |             |
| `label` | string | Yes      | -       |             |

## Output

**Type**: `str | List[str]`

Returns URL(s) of edited image(s). Single URL if one image, list if multiple.
