Skip to main content

Edit Image

Edit an existing image based on a text prompt using DALL-E and GPT-Image models.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Connection Id - Connection identifier from Connect node. Optional if providing API Key directly.
  • API Key - OpenAI API key credential. Optional if using Connection Id.
  • Image Path - Local file path to the PNG image to edit (max 4MB).
  • Mask Path - Optional path to a mask image (PNG). Transparent areas will be edited.
  • Prompt - Description of the edits you want to make to the image.
  • Use Robomotion AI Credits - Use Robomotion credits instead of your own API key.
warning

This node requires Use Robomotion AI Credits to be enabled. Image editing is not available with direct API key usage in the current version.

Options

Model Selection

  • Model - Image editing model:
    • DALL-E 2 - Standard editing model (default)
    • GPT-Image-1 - Advanced editing model

Generation Settings

  • Number of Images - Number of edited variations to generate (1-4). Default: 1.
  • Size - Output image size:
    • 256x256 - Small
    • 512x512 - Medium
    • 1024x1024 - Large (default)

Advanced

  • User - Unique identifier for your end-user.
  • Timeout (seconds) - Request timeout. Default: 120.
  • Include Raw Response - Include the full API response. Default: false.

Outputs

  • Image - File path to the edited image. Returns a string if Number of Images is 1, or an array of strings if more than 1.
  • Raw Response - Complete API response object (only set when "Include Raw Response" is enabled).

How It Works

The Edit Image node modifies existing images using AI. When executed:

  1. Validates the connection with Robomotion Credits enabled
  2. Loads the source image from the specified path
  3. Loads the optional mask image (if provided)
  4. Sends the image, mask, and edit prompt to OpenAI
  5. Downloads and saves the edited image(s)
  6. Returns the file path(s) to the edited image(s)

Usage Examples

Example 1: Add Object to Image

Input:
- Image Path: "C:/images/living_room.png"
- Prompt: "Add a large potted plant next to the window"
- Model: dall-e-2

Output:
- Image: "/tmp/robomotion/images/image_0.png"

Example 2: Remove Object (Using Mask)

Input:
- Image Path: "C:/images/photo.png"
- Mask Path: "C:/images/mask.png" (transparent where object should be removed)
- Prompt: "Remove the object and fill with appropriate background"
- Model: dall-e-2

Output:
- Image: "/tmp/robomotion/images/image_0.png"

Example 3: Change Image Style

Input:
- Image Path: "C:/images/portrait.png"
- Prompt: "Convert to watercolor painting style"
- Model: dall-e-2
- Number of Images: 3

Output:
- Image: ["/tmp/image_0.png", "/tmp/image_1.png", "/tmp/image_2.png"]

Example 4: Modify Colors

Input:
- Image Path: "C:/images/product.png"
- Prompt: "Change the product color to red while keeping everything else the same"
- Size: 1024x1024

Output:
- Image: "/tmp/robomotion/images/image_0.png"

Requirements

  • Robomotion AI Credits enabled (direct API key not supported)
  • Connection Id from Connect node with Robomotion Credits enabled
  • Source image in PNG format (max 4MB)
  • Optional mask image in PNG format
  • Non-empty edit prompt
  • Write access to temporary file storage

Error Handling

The node will return errors in these cases:

  • ErrUnsupportedFeature: Attempting to use without Robomotion Credits
  • ErrInvalidArg: Image path is empty, file doesn't exist, or prompt is empty
  • File format errors: Image is not PNG or exceeds 4MB
  • ErrAPICall: OpenAI API errors
  • Timeout errors: Request exceeded timeout duration

Tips for RPA Developers

  • Image Format: Only PNG images are supported. Convert JPEGs to PNG first.
  • File Size: Keep images under 4MB. Resize large images before editing.
  • Masking: Create masks with transparent areas where you want edits. Opaque areas remain unchanged.
  • Prompt Clarity: Be specific about what to edit. Mention what should stay the same.
  • Robomotion Credits Only: This feature requires Robomotion Credits mode - you cannot use your own API key.
  • Batch Edits: Generate multiple variations to choose the best result.
  • Edit Type: The model works best with additive edits and replacements. Complete transformations may not preserve the original image well.

Common Errors and Solutions

Error: "Image editing requires Robomotion Credits mode"

  • Solution: Enable "Use Robomotion AI Credits" in your Connect node.

Error: "Image Path cannot be empty"

  • Solution: Provide a valid file path to a PNG image.

Error: "Image file does not exist"

  • Solution: Check that the file path is correct and the file exists.

Error: "Prompt cannot be empty"

  • Solution: Provide a description of the edits you want to make.

Poor edit quality

  • Solution: Try different prompts, generate multiple variations, or ensure your source image is high quality.