Reference · Tools

OpenAI Image Edit

Edit images using OpenAI DALL-E and GPT-Image models.

Action (binary) AI v1 Binary data

OpenAI Image Edit alters an existing image rather than generating a new one — removing objects, changing regions or applying prompt-driven style changes — using DALL-E 2 inpainting with an optional mask, or gpt-image-1 for prompt-only edits. A typical build is stripping backgrounds from user-submitted product photos.

Node type
Action (binary)
Parameters
8
Outputs
Output, Error
Credentials
OpenAI

OpenAI Image Edit

Edit images using OpenAI DALL-E and GPT-Image models

Overview

The OpenAI Image Edit tool calls the OpenAI Images Edit API (POST /v1/images/edits) to modify an existing image based on a text prompt. It supports two models: (1) DALL-E 2 — classic inpainting with an optional transparent-area mask PNG; (2) gpt-image-1 — newer model that edits based on prompt alone without requiring a mask, supports quality and additional sizes. The tool reads a source image from binary input, uploads it as multipart/form-data along with the prompt and optional parameters, then receives the edited image(s) either as base64 data (decoded to binary) or as temporary URLs. Multiple output images per input are supported.

Category: AI
Tool Name: openai_image_edit
Version: 1

Appearance: Icon: openai | Color: #10a37f

Node Type

Action (Binary) — handles file/binary data operations

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires OpenAI credentials. See the Credentials Guide for setup instructions.

Parameters

ParameterTypeRequiredDefaultDescription
ModeloptionsNo(current default)The OpenAI image editing model. The /images/edits endpoint only supports gpt-image-1 (modern, prompt-only) and DALL·E 2 (legacy, mask-based inpainting, PNG, <4MB, square). DALL·E 3 is generation-only and not available here.
Options: the OpenAI image-edit models available to your workspace — pick one from the dropdown.
PromptstringYesA text description of the desired edit. For gpt-image-1 this drives the entire edit. For DALL-E 2 this describes what should appear in the transparent mask region. Supports expressions.
Input Binary PropertystringNodataName of the binary property containing the source image to edit.
Mask Binary PropertystringNomaskName of the binary property containing the mask image. The mask must be a PNG with transparent areas indicating where the edit should be applied. Same dimensions as the source image. Only used with DALL-E 2. (shown when Model is dall-e-2)
Output Binary PropertystringNodataName of the binary property to write the edited image(s) to.
OptionscollectionNo{}Optional image settings — add only the fields you need.
— Number of ImagesnumberNo1Number of edited images to generate (1-10).
— SizeoptionsNoautoOutput image resolution. DALL-E 2 supports 256x256, 512x512, 1024x1024. gpt-image-1 also supports 1536x1024, 1024x1536, and auto.
Options: auto (gpt-image-1 only), 256x256 (small square, DALL-E 2), 512x512 (medium square, DALL-E 2), 1024x1024 (large square, both models), 1536x1024 (landscape, gpt-image-1 only), 1024x1536 (portrait, gpt-image-1 only)
— QualityoptionsNoautoImage quality level. Only available for gpt-image-1.
Options: auto, low (fastest, lowest cost), medium (balanced), high (highest fidelity)
— Response FormatoptionsNobinaryDataHow to return the edited image(s). Binary Data decodes and stores the image. Image URL returns a temporary URL.
Options: binaryData, imageUrl
Include InputbooleanNofalseWhether to include the original input item JSON fields in the output.
Max ConcurrencynumberNo5Maximum number of items to process concurrently. Keep low to respect OpenAI rate limits.

Output Data

One output item per edited image, so an input item with Number of Images set to 3 fans out into three output items. Each carries the edit metadata in its JSON, and the image itself as binary data on the property named by Output Binary Property (data by default), stored as edited_<index>.png and merged with any binary the input item already had.

{
  "imageIndex": 0,
  "edited": true,
  "model": "the image model that produced the edit"
}
  • imageIndex is the position of this image within the request — 0 for the first, 1 for the second, and so on.
  • When the API returns a temporary URL instead of image data, the item carries imageUrl in the JSON and no new binary. These URLs expire, so download or store the image promptly.
  • The rest of the input item JSON is dropped unless Include Input is on. With Include Input on, every fanned-out item repeats the same input fields.

Usage Examples

  • Edit an image by describing changes with gpt-image-1
  • Inpaint a region of an image using DALL-E 2 with a mask
  • Add objects to an existing image with a text prompt
  • Generate multiple edit variations of a source image
  • Remove a background element using a transparent mask

Example Configuration

Prompt-only edit of an image arriving on the default binary property:

{
  "type": "openai_image_edit",
  "parameters": {
    "prompt": "Replace the background with a bright studio backdrop.",
    "inputBinaryPropertyName": "data",
    "outputBinaryPropertyName": "data"
  }
}

Three high-quality landscape variants written to a named property:

{
  "type": "openai_image_edit",
  "parameters": {
    "prompt": "{{ $json.editInstruction }}",
    "inputBinaryPropertyName": "photo",
    "outputBinaryPropertyName": "variants",
    "includeInput": true,
    "options": {
      "n": 3,
      "size": "1536x1024",
      "quality": "high"
    }
  }
}

Mask-based inpainting with DALL-E 2:

{
  "type": "openai_image_edit",
  "parameters": {
    "model": "dall-e-2",
    "prompt": "A potted fern on the empty side table.",
    "inputBinaryPropertyName": "room",
    "maskBinaryPropertyName": "mask",
    "outputBinaryPropertyName": "editedRoom",
    "options": {
      "size": "1024x1024"
    }
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

The OpenAI Image Edit tool modifies an existing image via the OpenAI Images Edit API, supporting DALL-E 2 inpainting with an optional mask or gpt-image-1 for prompt-only edits. Use it when a workflow needs to alter image content, remove objects, or apply prompt-driven style changes without regenerating an image from scratch. It produces one or more edited images as binary data on the main channel, with errors routed to the error channel.

Frequently asked questions

When do I need a mask?

For DALL-E 2 inpainting, where the mask marks the region to change. gpt-image-1 supports prompt-only edits, so no mask is required with that model.

How is this different from image generation?

It starts from an existing image and modifies it, preserving what you did not ask to change — generation starts from nothing but the prompt.

How many images come back?

One or more edited images as binary data on the main output, so you can review alternatives before choosing.

Which credential does it need?

An OpenAI credential with access to the image models.

Build with the OpenAI Image Edit node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need OpenAI credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.