openai / gpt-image-2-custom
gpt-image-2-custom
Create or edit images with OpenAI GPT Image 2 using custom pixel sizes, quality tiers, and format controls. Add optional masks to target specific edits.
Overview
GPT Image 2 Custom is an image generation and editing model from OpenAI. It turns a text brief into a finished raster image, and it can also transform an existing image using the same kind of brief. For edits, it uses your source image plus an optional mask to redraw only selected regions. This helps you ship usable design assets fast, without manual retouching for every iteration.
What you can build
- Poster and flyer concepts with crisp, readable text in the image
- Product shots and lifestyle scenes for catalogs and listings
- Brand mockups by combining multiple reference images into one result
- Targeted edits like removing objects, changing backgrounds, or swapping colors
- Social graphics in custom sizes, up to 4K edges
- Illustration variants for storyboards, characters, and scene exploration
Inputs
- A required text description of what to generate or how to edit an image. It can be up to 32,000 characters.
- Optional reference images to edit or use as visual guidance. You can provide up to 16 images.
- An optional mask image for selective edits. Use this when you want to restrict changes to specific areas. The mask must match the first input image’s dimensions.
- Output width and height in pixels. Each edge must be a multiple of 16 and cannot exceed 3840 px. The longest-to-shortest edge ratio cannot exceed 3:1. Total pixels must be between 655,360 and 8,294,400.
- A quality tier selection: low, medium, or high.
- An optional background mode to control whether the output background is chosen automatically or forced opaque.
- An optional output file format selection: PNG, JPEG, or WebP.
- An optional compression level (0 to 100) when you choose JPEG or WebP output.
- The number of images to generate per request (1 to 10).
- An optional moderation strictness setting that can be left on automatic filtering or set to a less restrictive mode.
Outputs
- One to 10 generated images.
- Each image is returned as a raster file in the selected format (PNG, JPEG, or WebP).
- Results include the delivered pixel dimensions of each image, which match your requested size when valid.
Limitations
- The model outputs raster images only. It does not return layered files like PSD, nor vector formats like SVG.
- Edits are not guaranteed to be pixel-stable outside the intended region. Small changes can appear in surrounding areas.
- Custom sizes must follow strict geometry rules. Invalid sizes may be replaced with a safe fallback size.
- Mask-based edits require a mask image that matches the source image dimensions. Mismatched masks can fail or produce unexpected edits.
- Low-quality inputs can degrade results. Heavy JPEG artifacts, tiny faces, motion blur, and over-compressed images often reduce edit fidelity.
- Scanned documents, screenshots with strong compression, and images with tiny text can cause warped details after edits.
Safety & compliance
All requests are subject to OpenAI’s content policy and safety filtering. Don’t use the model to generate disallowed content, or to edit images in ways that violate consent, privacy, or intellectual property rights. If you enable less restrictive filtering, it may change what is blocked, but it does not remove policy enforcement.
Example prompts
Great starting points for gpt-image-2-custom.
API quick start
Run gpt-image-2-custom with a single API call.
{
"prompt": "Restyle this image as a 1940s film noir c…",
"width": 1024,
"height": 1024,
"quality": "low"
}