Runflow
Back to Gallery

openai/gpt-image-2/edit

GPT Image 2.0, OpenAI's latest image model, is capable of making fine-grained, detailed edits to images.

$0.133/image 2026-04-21

Install

pip install requests

Run the model

import requests

response = requests.post(
    "https://api.runflow.io/v1/run/gpt-image-2/edit",
    headers={"Authorization": "Bearer RUNFLOW_API_KEY"},
    json={
    "prompt": "Replace the background with a sunlit seaside cafe at golden hour, keep the su...",
    "image_urls": [
        "https://public.runflow.io/images/models/_base/portrait-woman-studio.png"
    ]
    },
)

data = response.json()
print(data["images"][0]["url"])

Input schema

ParameterTypeDescription
promptstringThe prompt for image generation
image_urlsimage_listThe URLs of the images to use as a reference for the generation.
num_imagesintegerNumber of images to generate
output_formatstringOutput format for the images
image_sizestringThe size of the generated image. Use 'auto' to infer from input images.
mask_urlimageThe URL of the mask image to use for the generation. This indicates what part of the image to edit.
qualitystringQuality for the generated image
sync_modebooleanIf `True`, the media will be returned as a data URI and the output data won't be available in the request history.

Output schema

FieldTypeDescription
outputsjsonUnified output array.
seedjsonSeed used for generation, or null.
timingjsonProvider timing info, or null.
nsfw_detectedjsonNSFW flag, or null.

Related models

Start generating with GPT Image 2 Edit

Get API access in minutes. No GPU setup, no infrastructure to manage.