# GPT Image 2 > OpenAI's state-of-the-art image generation model with arbitrary resolution up to 4K and strong instruction following ## Quick Reference - Model ID: gpt-image-2 - Creator: OpenAI - Status: active - Family: gpt-image - Base URL: https://api.lumenfall.ai/openai/v1 ## Specifications - Max Resolution: 3840x2160 - Max Output Images: 1 - Max Input Images: 10 - Input Modalities: text, image - Output Modalities: image - Supported Modes: Text to Image, Image Edit ## API Parameters The compiled parameter schema for this model is available via the API: `GET /v1/models/gpt-image-2?schema=true`. ### Core Parameters - `prompt` (string) — REQUIRED: Text prompt for image generation. Modes: Text to Image, Image Edit - `quality` (string): Image quality level. Values: high, low, medium. Modes: Text to Image ### Size & Layout - `size` (string): Image dimensions as WxH pixels (e.g. "1024x1024") or aspect ratio (e.g. "16:9"). Modes: Text to Image, Image Edit - `aspect_ratio` (string): Aspect ratio of the output image (e.g. "16:9", "1:1"). Modes: Text to Image, Image Edit - `resolution` (string): Output resolution tier (e.g. "1K", "4K"). Modes: Text to Image, Image Edit ### Media Inputs - `image` (file) — REQUIRED: Input image(s) to edit. Modes: Image Edit ### Output & Format - `response_format` (string): How to return the image. Default: url. Values: url, b64_json. Modes: Text to Image, Image Edit - `output_format` (string): Output image format. Values: png, jpeg, gif, webp, avif. Modes: Text to Image, Image Edit - `output_compression` (integer): Compression level for lossy formats (JPEG, WebP, AVIF). Modes: Text to Image, Image Edit - `n` (integer): Number of images to generate. Default: 1. Modes: Text to Image, Image Edit ### Additional Parameters - `background` (string): Background handling. gpt-image-2 does not currently support transparent backgrounds.. Values: opaque. Modes: Text to Image, Image Edit. Only available via openai - `moderation` (string): Moderation strictness.. Values: low. Modes: Text to Image, Image Edit. Only available via openai - `user` (string): Stable end-user identifier used by OpenAI abuse monitoring.. Modes: Text to Image, Image Edit. Only available via openai ## Model Identifiers - Primary Slug: gpt-image-2 ## Tags image-generation, text-to-image, image-editing ## Available Providers ### OpenAI - Config Key: openai/gpt-image-2 - Provider Model ID: gpt-image-2 - Pricing: $5.00/M input tokens, $1.25/M input tokens, $8.00/M input tokens (image), $2.00/M input tokens (image), $10.00/M output tokens, $30.00/M output tokens (image) - Note: Token-based pricing; gpt-image-2 accepts arbitrary resolutions so a per-image table is not encoded here. - Note: Example per-image costs at the three legacy preset sizes (derived from the same token pricing): - Note: Low 1024x1024 ~= $0.006, 1024x1536 ~= $0.005, 1536x1024 ~= $0.005 - Note: Medium 1024x1024 ~= $0.053, 1024x1536 ~= $0.041, 1536x1024 ~= $0.041 - Note: High 1024x1024 ~= $0.211, 1024x1536 ~= $0.165, 1536x1024 ~= $0.165 - Note: Processes every image input at high fidelity; input_fidelity parameter is not supported. - Note: Does not support transparent backgrounds. - Source: https://platform.openai.com/docs/pricing ## Performance Metrics Provider performance over the last 30 days. ### openai - Median Generation Time (p50): 58739ms - 95th Percentile Generation Time (p95): 142760ms - Average Generation Time: 68514ms - Success Rate: 83.1% - Total Requests: 148 - Time to First Byte (p50): 56881ms - Time to First Byte (p95): 142107ms ## Image Gallery 5 images available for this model. Browse all at https://lumenfall.ai/models/openai/gpt-image-2/gallery ### Curated Examples - [A towering, ancient stone monolith stands amidst a swirling mystical sandstorm in a vast desert l...](https://assets.lumenfall.ai/V9lRu2Dm8iLsSF118-GGKcB5YgRQFKG5DSpd-NlxJxM/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/tsgafxf8yd78djbco6djgvpc5t3y@jpeg) - [A wide, cinematic 16:9 shot of a high-end, contemporary boutique at dusk. The shop's storefront f...](https://assets.lumenfall.ai/Gag0qct37Mhll8cEqVXe_amAUYetiXEK0t2C4H2ioeI/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/zai2a70mapph24kk0t92qj1oykqj@jpeg) - [Cinematic overhead shot of a long wooden harvest table set for a rustic autumn feast, featuring c...](https://assets.lumenfall.ai/NHPxNqyFbHfw6QaO0-6jehNx477qEzRWdJSkUjDdT_4/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/38j0159ugztm7fcyd169vmaz65dq@jpeg) - [A macro photography shot of an intricate, vintage mechanical watch movement, focusing on the bras...](https://assets.lumenfall.ai/_4DjDpqaG8e32jwS00ANsgNSB-1gXcsolvB7TLJ7CIk/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/mr5kpirbr4qbmnyqhz5ydby3797a@jpeg) - [A cozy, sunlit bookstore window showcasing a minimalist poster that reads "READ MORE BOOKS" in el...](https://assets.lumenfall.ai/DZbVSBQPxFNlstMRjOzArEzpBJG2n0qSNm9pCHrz6j4/rs:fit:1500:1500/plain/gs://lumenfall-prod-assets/m90fozlm50arj3b5tjw04dg2yyu6@jpeg) ## Example Prompt The following prompt was used to generate an example image in our playground: A cozy, sunlit bookstore window showcasing a minimalist poster that reads "READ MORE BOOKS" in elegant, sharp gold typography. In the soft-focus background inside the shop, a capybara is calmly resting on a plush rug near a stack of novels. ## Code Examples ### Text to Image (/v1/images/generations) #### cURL curl -X POST \ https://api.lumenfall.ai/openai/v1/images/generations \ -H "Authorization: Bearer $LUMENFALL_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image-2", "prompt": "", "size": "1024x1024" }' # Response: # { "created": 1234567890, "data": [{ "url": "https://...", "revised_prompt": "..." }] } #### JavaScript import OpenAI from 'openai'; const client = new OpenAI({ apiKey: 'YOUR_API_KEY', baseURL: 'https://api.lumenfall.ai/openai/v1' }); const response = await client.images.generate({ model: 'gpt-image-2', prompt: '', size: '1024x1024' }); // { created: 1234567890, data: [{ url: "https://...", revised_prompt: "..." }] } console.log(response.data[0].url); #### Python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.lumenfall.ai/openai/v1" ) response = client.images.generate( model="gpt-image-2", prompt="", size="1024x1024" ) # { created: 1234567890, data: [{ url: "https://...", revised_prompt: "..." }] } print(response.data[0].url) ### Image Edit (/v1/images/edits) #### cURL curl -X POST \ https://api.lumenfall.ai/openai/v1/images/edits \ -H "Authorization: Bearer $LUMENFALL_API_KEY" \ -F "model=gpt-image-2" \ -F "image=@source.png" \ -F "prompt=Add a starry night sky to this image" \ -F "size=1024x1024" # Response: # { "created": 1234567890, "data": [{ "url": "https://...", "revised_prompt": "..." }] } #### JavaScript import OpenAI from 'openai'; import fs from 'fs'; const client = new OpenAI({ apiKey: 'YOUR_API_KEY', baseURL: 'https://api.lumenfall.ai/openai/v1' }); const response = await client.images.edit({ model: 'gpt-image-2', image: fs.createReadStream('source.png'), prompt: 'Add a starry night sky to this image', size: '1024x1024' }); // { created: 1234567890, data: [{ url: "https://...", revised_prompt: "..." }] } console.log(response.data[0].url); #### Python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.lumenfall.ai/openai/v1" ) response = client.images.edit( model="gpt-image-2", image=open("source.png", "rb"), prompt="Add a starry night sky to this image", size="1024x1024" ) # { created: 1234567890, data: [{ url: "https://...", revised_prompt: "..." }] } print(response.data[0].url) ## About ## Overview GPT Image 2 is a high-fidelity image generation model developed by OpenAI, designed to produce visual content from text prompts and existing images. It represents an evolution in the GPT-image family, characterized by its ability to handle arbitrary resolutions up to 4K and its rigorous adherence to complex, multi-part instructions. This model supports both text-to-image generation and granular image editing, allowing users to move from initial concept to refined final asset within a single framework. ## Strengths * **High-Resolution Output:** The model generates images at arbitrary aspect ratios with a maximum resolution of 4K, making it suitable for professional print and digital media without immediate upscaling requirements. * **Prompt Adherence:** It demonstrates strong instruction-following capabilities, accurately placing specific objects, managing spatial relationships, and maintaining stylistic consistency as described in the input text. * **Multi-mode Versatility:** GPT Image 2 natively supports both text-to-image (creating visuals from scratch) and image-editing (modifying existing imagery based on textual instructions), ensuring a cohesive workflow for iterative design. * **Complex Composition:** The model excels at rendering scenes with multiple subjects or dense detail that typically challenge standard diffusion models, maintaining structural integrity even at high pixel densities. ## Limitations * **Compute Intensity:** Due to the 4K resolution ceiling and model complexity, generation times may be longer compared to lower-resolution latent diffusion models. * **Instruction Sensitivity:** While following instructions accurately, the model may require precise, descriptive language to achieve specific artistic styles, as it prioritizes literal interpretation of the prompt. ## Technical Background GPT Image 2 is built upon OpenAI's proprietary architecture for visual synthesis, moving beyond fixed-aspect ratio training to support dynamic resolution scaling. The model utilizes a training approach that emphasizes the alignment between dense textual descriptions and high-resolution visual tokens. This allows the model to interpret nuanced natural language prompts as precise spatial and stylistic commands during the generation process. ## Best For GPT Image 2 is optimized for professional workflows requiring high-definition assets, such as marketing collateral, detailed concept art, and complex photo manipulation. It is particularly effective for users who need to iterate on an existing image through precise text-based edits rather than regenerating a scene from scratch. This model is available for integration and testing through Lumenfall’s unified API and playground, providing a streamlined environment for experimenting with 4K generation and image editing. ## Frequently Asked Questions ### How do I use GPT Image 2 via API? You can use GPT Image 2 through Lumenfall's OpenAI-compatible API. Send requests to the unified endpoint with model ID "gpt-image-2". Code examples are available in Python, JavaScript, and cURL. ### Which providers offer GPT Image 2? GPT Image 2 is available through OpenAI on Lumenfall. Lumenfall automatically routes requests to the best available provider. ### What is the maximum resolution for GPT Image 2? GPT Image 2 supports images up to 3840x2160 resolution. ## Links - Model Page: https://lumenfall.ai/models/openai/gpt-image-2 - About: https://lumenfall.ai/models/openai/gpt-image-2/about - Providers, Pricing & Performance: https://lumenfall.ai/models/openai/gpt-image-2/providers - API Reference: https://lumenfall.ai/models/openai/gpt-image-2/api - Benchmarks: https://lumenfall.ai/models/openai/gpt-image-2/benchmarks - Use Cases: https://lumenfall.ai/models/openai/gpt-image-2/use-cases - Gallery: https://lumenfall.ai/models/openai/gpt-image-2/gallery - Playground: https://lumenfall.ai/playground?model=gpt-image-2 - API Documentation: https://docs.lumenfall.ai