# DALL-E 2 > OpenAI's legacy image generation model supporting generations, edits with masks (inpainting), and variations ## Quick Reference - Model ID: dall-e-2 - Creator: OpenAI - Status: deprecated - Family: dall-e - Base URL: https://api.lumenfall.ai/openai/v1 ## Specifications - Max Resolution: 1024x1024 - Max Output Images: 10 - Input Modalities: text, image - Output Modalities: image ## Model Identifiers - Primary Slug: dall-e-2 ## Dates - Sunset Date: May 12, 2026 ## Tags image-generation, text-to-image, image-editing, inpainting ## Available Providers ### Replicate - Config Key: replicate/dall-e-2 - Provider Model ID: openai/dall-e-2 - Pricing: - source: official - currency: USD - components: [{"type" => "output", "metric" => "image", "unit_price" => 0.02}] - source_url: https://replicate.com/openai/dall-e-2 - effective_at: 2026-01-27 ### OpenAI - Config Key: openai/dall-e-2 - Provider Model ID: dall-e-2 - Pricing: - notes: ["Deprecated model - will stop being supported on May 12, 2026", "Pricing is per image, varying by size", "Supports generations, edits with masks (inpainting), and variations"] - source: official - currency: USD - components: [{"type" => "output", "metric" => "image", "conditions" => {"size" => "256x256"}, "unit_price" => 0.016}, {"type" => "output", "metric" => "image", "conditions" => {"size" => "512x512"}, "unit_price" => 0.018}, {"type" => "output", "metric" => "image", "conditions" => {"size" => "1024x1024"}, "unit_price" => 0.02}] - source_url: https://platform.openai.com/docs/pricing ## Image Gallery 4 images available for this model. - Curated examples: 4 - "A wide, cinematic shot of a sophisticated artisan chocolate boutique at dusk, where the name "DALL-E 2" is elegantly ..." - "A hyper-realistic, wide-angle interior shot of a sun-drenched minimalist ceramic studio. In the center, a weathered w..." - "A hyper-realistic, wide-angle cinematic shot of a master carpenter's sun-drenched workshop. In the foreground, a beau..." - "A sunlit, rustic bakery storefront with a large glass window displaying the hand-painted gold leaf typography "THE GO..." ## Example Prompt The following prompt was used to generate an example image in our playground: A sunlit, rustic bakery storefront with a large glass window displaying the hand-painted gold leaf typography "THE GOLDEN CRUST" on the pane. A cozy capybara sits quietly on the sidewalk by the door, watching people pass by. 8k, warm tones. ## Code Examples ### Text to Image (Generation) #### 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": "dall-e-2", "prompt": "A serene mountain landscape at sunset", "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: 'dall-e-2', prompt: 'A serene mountain landscape at sunset', 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="dall-e-2", prompt="A serene mountain landscape at sunset", size="1024x1024" ) # { created: 1234567890, data: [{ url: "https://...", revised_prompt: "..." }] } print(response.data[0].url) ### Image Editing #### cURL curl -X POST \ https://api.lumenfall.ai/openai/v1/images/edits \ -H "Authorization: Bearer $LUMENFALL_API_KEY" \ -F "model=dall-e-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: 'dall-e-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="dall-e-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 DALL-E 2 is a legacy text-to-image diffusion model developed by OpenAI that generates images from natural language descriptions. While succeeded by newer iterations, it remains a stable benchmark for image synthesis, offering a distinct feature set that includes image-to-image variations and mask-based inpainting. It is particularly known for its ability to combine disparate concepts and objects in a coherent, albeit often stylized, visual manner. ## Strengths * **Image Inpainting:** The model excels at modifying existing images through masking, allowing users to replace specific elements or extend backgrounds while maintaining the original image's context and lighting. * **Concept Blending:** It demonstrates a strong capability for semantic synthesis, such as placing a 3D-rendered character in a real-world setting or applying specific artistic styles (e.g., "in the style of Van Gogh") to original subjects. * **Compositional Understanding:** DALL-E 2 handles spatial relationships and object attributes with reasonable accuracy, ensuring that adjectives are generally applied to the correct nouns within a prompt. * **Variation Generation:** It can ingest an existing image and output multiple visual permutations that retain the original’s core theme and color palette without being exact copies. ## Limitations * **Low Resolution:** Native output is limited to 1024x1024 pixels, which often lacks the fine-grained texture and sharp detail found in more modern models like DALL-E 3 or Midjourney. * **Text Rendering:** The model struggle significantly with rendering legible text; characters often appear as nonsensical glyphs or blurred artifacts. * **Photorealism Constraints:** Compared to newer latent diffusion models, DALL-E 2 often produces images with a "plastic" or overly smooth aesthetic, struggling with complex human anatomy like hands or eyes. ## Technical Background DALL-E 2 is built on a CLIP-guided diffusion architecture, specifically a process OpenAI refers to as "unCLIP." It uses the CLIP (Contrastive Language-Image Pre-training) latent space to translate text embeddings into image embeddings, which a decoder then converts into a visual representation. This approach prioritizes the relationship between visual concepts and their linguistic descriptions over raw pixel-mapping. ## Best For DALL-E 2 is best suited for rapid prototyping, creating stylized illustrations, and performing basic image editing tasks like inpainting or outpainting where high-fidelity photorealism isn't the primary requirement. It is a cost-effective choice for developers who need consistent, programmatic image variations. This model is available for testing and integration through Lumenfall’s unified API and interactive playground, allowing you to compare its outputs directly against more recent generative models. ## Frequently Asked Questions ### How much does DALL-E 2 cost? DALL-E 2 starts at $0.016 per image through Lumenfall. Pricing varies by provider. Lumenfall does not add any markup to provider pricing. ### How do I use DALL-E 2 via API? You can use DALL-E 2 through Lumenfall's OpenAI-compatible API. Send requests to the unified endpoint with model ID "dall-e-2". Code examples are available in Python, JavaScript, and cURL. ### Which providers offer DALL-E 2? DALL-E 2 is available through Replicate and OpenAI on Lumenfall. Lumenfall automatically routes requests to the best available provider. ### What is the maximum resolution for DALL-E 2? DALL-E 2 supports images up to 1024x1024 resolution. ## Links - Model Page: https://lumenfall.ai/models/openai/dall-e-2 - About: https://lumenfall.ai/models/openai/dall-e-2/about - Providers, Pricing & Performance: https://lumenfall.ai/models/openai/dall-e-2/providers - API Reference: https://lumenfall.ai/models/openai/dall-e-2/api - Benchmarks: https://lumenfall.ai/models/openai/dall-e-2/benchmarks - Use Cases: https://lumenfall.ai/models/openai/dall-e-2/use-cases - Gallery: https://lumenfall.ai/models/openai/dall-e-2/gallery - Playground: https://lumenfall.ai/playground?model=dall-e-2 - API Documentation: https://docs.lumenfall.ai