Skip to main content

Ideogram Inpainting

Powered by Ideogram AI, this API edits specific areas of an image using mask-based inpainting with prompt-guided generation.
Ideogram Inpainting is an AI-powered image editing API that lets you modify specific regions of an image using a mask and a text prompt. Provide a black-and-white mask where black regions indicate the areas to edit, along with a prompt describing the desired changes. The API supports multiple rendering speeds (TURBO, DEFAULT, QUALITY), automatic prompt enhancement via MagicPrompt, and style/character reference images for consistent results.

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

ParameterTypeRequiredDefaultDescription
imagestringYes-Image to edit. HTTPS URL or base64-encoded (JPEG, WebP, PNG, max 10MB)
maskstringYes-Black-and-white mask image (same size as input). Black regions indicate areas to edit. HTTPS URL or base64-encoded (max 10MB)
promptstringYes-Text describing the desired changes to the image
rendering_speedstringNoDEFAULTRendering speed: TURBO, DEFAULT, or QUALITY
magic_promptstringNo-MagicPrompt enhancement: AUTO, ON, or OFF
style_typestringNo-Style type: AUTO, GENERAL, REALISTIC, or DESIGN
style_codesarrayNo-List of style codes for image generation
style_reference_imagesarrayNo-Images to use as style references (URLs or base64)
character_reference_imagesarrayNo-Images for character consistency (URLs or base64)
color_paletteobjectNo-Color palette to guide generated content
seedintegerNorandomSeed for reproducibility (0-2147483647)
webhook_urlstringNo-URL for task completion notification

Frequently Asked Questions

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.
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).
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.
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.
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.
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.
Rate limits vary by subscription tier. See Rate Limits for current limits.
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