Skip to main content

Create Image Edit

Edits images using OpenAI's DALL-E models by applying modifications based on a text prompt and mask.

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 - The connection ID for the OpenAI service.
  • Image Path - File path to the original image to edit.
  • Mask Path - File path to the mask image that specifies which areas to edit.
  • Prompt - Text prompt describing the desired edits to the image.

Options

  • Size - The size of the generated images. Options include:
    • 256x256
    • 512x512
    • 1024x1024
  • Number of Images - Number of edited images to generate. Default is 1.
  • Response Format - Format of the response. Options are "URL" or "Base64 JSON".
  • User - A unique identifier representing your end-user.

Output

  • Images - The edited images as a JSON object containing URLs or base64 encoded data.

How It Works

The Create Image Edit node uses OpenAI's DALL-E models to edit images based on text prompts and masks:

  1. Validates the provided Connection Id and file paths
  2. Reads the original image and mask files
  3. Prepares the image edit request with the specified prompt and options
  4. Sends the request to the DALL-E model for image editing
  5. Processes the response and returns the edited images

Requirements

  • A valid OpenAI API key (Robomotion Credits cannot be used with this node)
  • An active OpenAI connection
  • File paths to both the original image and mask image
  • A text prompt describing the desired edits
  • Read access to the specified image files

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid Connection Id
  • Empty or invalid Image Path
  • Empty or invalid Mask Path
  • Empty or invalid Prompt
  • Invalid option values (number of images, size, etc.)
  • OpenAI API errors
  • File access errors for image files

Usage Notes

  • This node does not support Robomotion Credits, only direct OpenAI API keys
  • The mask image should be a PNG file where white pixels indicate areas to edit and black pixels indicate areas to keep unchanged
  • The default size is 1024x1024
  • The default number of images is 1
  • The response format can be set to return URLs or base64 encoded image data
  • Edited images are available for 1 hour when using URL format
  • The user parameter can be used to track usage by end-user
  • Only PNG images are supported for editing