Ideogram Inpainting
Powered by Ideogram AI, this API edits specific areas of an image using mask-based inpainting with prompt-guided generation.
Key capabilities
- Mask-based editing: Use a black-and-white mask to precisely define which areas of the image to modify
- Multiple rendering speeds: Choose between TURBO (fastest), DEFAULT (balanced), or QUALITY (highest quality)
- MagicPrompt: Automatically enhance your prompt for better results (AUTO, ON, or OFF)
- Style customization: Apply style codes, style types (AUTO, GENERAL, REALISTIC, DESIGN), and style reference images
- Character consistency: Use character reference images to maintain consistent characters across edits
- Color palette control: Guide the color palette of generated content
- Reproducible results: Optional seed parameter (0-2147483647) for consistent output across requests
- Flexible input: Accepts HTTPS URLs or base64-encoded images (max 10MB per image)
- Async processing: Webhook notifications or polling for task completion
Use cases
- Object replacement: Replace objects in a scene with AI-generated alternatives
- Background editing: Modify or replace backgrounds while preserving subjects
- Content removal: Remove unwanted elements from images seamlessly
- Creative retouching: Edit specific areas with creative prompts for artistic effects
- Product photography: Modify product backgrounds or surroundings for e-commerce
- Character editing: Maintain character consistency across multiple edited images
Edit images with Ideogram Inpainting
Submit an image with a mask and prompt to edit specific regions. The service returns a task ID for async polling or webhook notification.Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
image | string | Yes | - | Image to edit. HTTPS URL or base64-encoded (JPEG, WebP, PNG, max 10MB) |
mask | string | Yes | - | Black-and-white mask image (same size as input). Black regions indicate areas to edit. HTTPS URL or base64-encoded (max 10MB) |
prompt | string | Yes | - | Text describing the desired changes to the image |
rendering_speed | string | No | DEFAULT | Rendering speed: TURBO, DEFAULT, or QUALITY |
magic_prompt | string | No | - | MagicPrompt enhancement: AUTO, ON, or OFF |
style_type | string | No | - | Style type: AUTO, GENERAL, REALISTIC, or DESIGN |
style_codes | array | No | - | List of style codes for image generation |
style_reference_images | array | No | - | Images to use as style references (URLs or base64) |
character_reference_images | array | No | - | Images for character consistency (URLs or base64) |
color_palette | object | No | - | Color palette to guide generated content |
seed | integer | No | random | Seed for reproducibility (0-2147483647) |
webhook_url | string | No | - | URL for task completion notification |
Frequently Asked Questions
What is Ideogram Inpainting and how does it work?
What is Ideogram Inpainting and how does it work?
Ideogram Inpainting is an AI-powered image editing API. You provide an image, a black-and-white mask indicating which areas to edit, and a text prompt describing the desired changes. The API generates new content in the masked regions that blends seamlessly with the rest of the image. You receive a task ID immediately, then poll for results or receive a webhook notification.
How does the mask work?
How does the mask work?
The mask must be the same size as the input image. It should be a black-and-white image where black regions indicate the areas you want to edit. White regions will remain unchanged. Supported formats are JPEG, WebP, and PNG (max 10MB).
What are the rendering speed options?
What are the rendering speed options?
There are three rendering speeds: TURBO is the fastest with lower quality, DEFAULT provides balanced speed and quality, and QUALITY is slower but produces the highest quality results. The default is DEFAULT.
What is MagicPrompt?
What is MagicPrompt?
MagicPrompt automatically enhances your text prompt for better generation results. Set it to
AUTO to let the model decide, ON to always use it, or OFF to disable it. This can significantly improve output quality with minimal effort.Can I maintain character consistency across edits?
Can I maintain character consistency across edits?
Yes. Use the
character_reference_images parameter to provide reference images of the character you want to maintain. Combined with style_type, this helps ensure consistent characters across multiple edits.What image formats are supported?
What image formats are supported?
The API accepts JPEG, WebP, and PNG images up to 10MB each. Both HTTPS URLs and base64-encoded strings are supported for images, masks, and reference images. The output is returned as a downloadable image URL.
What are the rate limits for Ideogram Inpainting?
What are the rate limits for Ideogram Inpainting?
Rate limits vary by subscription tier. See Rate Limits for current limits.
How much does Ideogram Inpainting cost?
How much does Ideogram Inpainting cost?
See the Pricing page for current rates and subscription options.
Best practices
- Precise masks: Create clean, well-defined masks for the best results. Avoid feathered or blurry edges
- Descriptive prompts: Be specific about what you want in the edited region (e.g., “red roses in a garden” instead of just “flowers”)
- MagicPrompt for quick results: Use
magic_prompt: "AUTO"to let the model enhance your prompt automatically - Rendering speed tradeoffs: Use TURBO for quick previews, DEFAULT for production, and QUALITY for final outputs
- Style references: Provide style reference images when you need a specific visual style across edits
- Seed for consistency: Use the same seed value when you need reproducible results across multiple API calls
- Production integration: Use webhooks instead of polling for scalable applications
- Error handling: Implement retry logic with exponential backoff for 503 errors
Related APIs
- Ideogram Image Expand: Expand images beyond their boundaries with Ideogram
- Image Upscaler: Enhance image resolution and quality
- Remove Background: Remove image backgrounds for compositing
- Reimagine Flux: Reimagine images with Flux