GPT Image 1 - Image Mask Editor
Edit and transform specific areas of images using mask-based selection with OpenAI's GPT Image 1 model. This premium inpainting solution provides pixel-perfect control over which parts of an image to modify, delivering exceptional quality and seamless integration. Precisely define areas to edit with a mask, then describe your desired changes using natural language for intelligent content generation.
Endpoint
Request Headers
| Field | Value |
|---|---|
| API-KEY | <api-key> |
| Content-Type | application/json |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Feature type identifier. Must be IMAGE_INPAINTER |
model | string | Yes | AI model identifier. Must be gpt-image-1 |
promptObject | object | Yes | Configuration object containing all image editing parameters |
Prompt Object Parameters
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
imageUrl | string | Yes | Path to the source image to be edited | - |
maskUrl | string | Yes | Path to the mask image (white=edit, black=preserve) | - |
prompt | string | Yes | Description of content to generate in masked areas (max 4000 characters) | - |
size | string | Yes | Output image dimensions | 1024x1024 |
n | number | Yes | Number of images to generate (1-10) | 1 |
quality | string | No | Quality level of the generated content | medium |
output_format | string | No | Output format for the processed image | png |
output_compression | number | No | Compression level (0-100, higher = better quality) | 85 |
Size Options
| Size | Description |
|---|---|
1024x1024 | Square format (1:1) |
1024x1536 | Portrait format (2:3) |
1536x1024 | Landscape format (3:2) |
Quality Options
| Quality | Description | Use Case |
|---|---|---|
low | Faster processing, good detail | Quick iterations, concept testing |
medium | Balanced quality and speed | Standard workflows, most projects |
high | Maximum detail and blending | Professional work, critical edits, final outputs |
Output Format Options
| Format | Description | Best For |
|---|---|---|
png | Lossless format with transparency support | Professional use, detailed editing, archival quality |
jpeg | Compressed format suitable for photographs | Web optimization, social media |
webp | Modern format with superior compression | Web applications, modern browsers |
Mask Image Requirements
| Requirement | Description |
|---|---|
| Format | PNG, JPEG, or WebP formats supported |
| Dimensions | Must match source image dimensions exactly |
| Color Scheme | White (#FFFFFF) = edit areas, Black (#000000) = preserve areas |
| Grayscale Support | Gray values for partial blending and soft transitions |
| Edge Quality | Clean, well-defined boundaries for best results |
Code Examples
- cURL
- JavaScript
- Python
curl -X POST "https://api.1min.ai/api/features" \
-H "API-KEY: <api-key>" \
-H "Content-Type: application/json" \
-d '{
"type": "IMAGE_INPAINTER",
"model": "gpt-image-1",
"promptObject": {
"imageUrl": "development/images/2025_12_04_18_10_29_882_cat.png",
"maskUrl": "development/images/2025_12_04_18_11_04_824_image.png",
"prompt": "elegant modern chandelier with crystal elements, warm ambient lighting, luxurious and sophisticated",
"size": "1024x1024",
"n": 1,
"quality": "high",
"output_format": "png",
}
}'
fetch('https://api.1min.ai/api/features', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'API-KEY': 'YOUR_API_KEY'
},
body: JSON.stringify({
type: 'IMAGE_INPAINTER',
model: 'gpt-image-1',
promptObject: {
imageUrl: 'development/images/2025_12_04_18_10_29_882_cat.png',
maskUrl: 'development/images/2025_12_04_18_11_04_824_image.png',
prompt: 'elegant modern chandelier with crystal elements, warm ambient lighting, luxurious and sophisticated',
size: '1024x1024',
n: 1,
quality: 'high',
output_format: 'png',
}
})
})
.then(response => response.json())
.then(data => console.log(data));
import requests
url = "https://api.1min.ai/api/features"
headers = {
"Content-Type": "application/json",
"API-KEY": "YOUR_API_KEY"
}
data = {
"type": "IMAGE_INPAINTER",
"model": "gpt-image-1",
"promptObject": {
"imageUrl": "development/images/2025_12_04_18_10_29_882_cat.png",
"maskUrl": "development/images/2025_12_04_18_11_04_824_image.png",
"prompt": "elegant modern chandelier with crystal elements, warm ambient lighting, luxurious and sophisticated",
"size": "1024x1024",
"n": 1,
"quality": "high",
"output_format": "png",
}
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
Interactive Playground
API Playground
https://api.1min.ai/api/featuresPath to the source image to be edited
Path to mask (white areas will be edited, black areas preserved)
Describe what to generate in masked areas (max 4000 characters)
Dimensions of the output image
Number of edited images to generate (1-10)
Quality affects detail, blending, and credit cost
Format of the output image
Compression level (0-100, higher = better quality)
Generated cURL Command:
curl -X POST "https://api.1min.ai/api/features" \
-H "API-KEY: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"type": "IMAGE_INPAINTER",
"model": "gpt-image-1",
"promptObject": {
"imageUrl": "development/images/2025_12_04_18_10_29_882_cat.png",
"maskUrl": "development/images/2025_12_04_18_11_04_824_image.png",
"prompt": "elegant modern chandelier with crystal elements, warm ambient lighting, luxurious and sophisticated",
"size": "1024x1024",
"n": 1,
"quality": "high",
"output_format": "png"
}
}'
Response Format
{
"aiRecord": {
"uuid": "i1m2p3a4-v5e6-7890-abcd-ef1234567890",
"userId": "user-12345",
"teamId": "team-67890",
"teamUser": {
"teamId": "team-67890",
"userId": "user-12345",
"userName": "Alex Designer",
"userAvatar": "https://example.com/avatar.jpg",
"status": "ACTIVE",
"role": "ADMIN",
"creditLimit": 100000000,
"usedCredit": 250000,
"createdAt": "2025-01-01T00:00:00.000Z",
"createdBy": "SYSTEM",
"updatedAt": "2025-01-15T16:00:00.000Z",
"updatedBy": "SYSTEM"
},
"model": "gpt-image-1",
"type": "IMAGE_INPAINTER",
"metadata": null,
"rating": null,
"feedback": null,
"conversationId": null,
"status": "SUCCESS",
"createdAt": "2025-01-15T16:00:00.000Z",
"aiRecordDetail": {
"promptObject": {
"imageUrl": "development/images/2025_12_04_18_10_29_882_cat.png",
"maskUrl": "development/images/2025_12_04_18_11_04_824_image.png",
"prompt": "elegant modern chandelier with crystal elements, warm ambient lighting, luxurious and sophisticated",
"size": "1024x1024",
"n": 1,
"quality": "high",
"output_format": "png",
},
"resultObject": [
"development/images/2025_01_15_16_00_30_001_inpainted.png"
],
"responseObject": {}
},
"additionalData": null,
"temporaryUrl": "https://s3.us-east-1.amazonaws.com/asset.1min.ai/development/images/2025_01_15_16_00_30_001_inpainted.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=EXAMPLE_CREDENTIAL&X-Amz-Date=20250115T160000Z&X-Amz-Expires=604800&X-Amz-Signature=example_signature&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject"
}
}
Use Cases
Professional Photo Editing
- Object Replacement: Replace specific items with different objects or variations
- Damage Repair: Fix scratches, imperfections, or unwanted elements
- Content Addition: Add new elements that blend seamlessly with existing scene
- Color Modifications: Change colors of specific objects or areas
- Style Matching: Ensure new content matches original image style and quality
E-commerce & Product Photography
- Product Customization: Show different product variations or features
- Imperfection Removal: Clean up product photos by removing defects
- Environmental Changes: Modify props or settings around products
- Seasonal Updates: Add seasonal elements to product imagery
- Brand Elements: Insert logos, text, or branded elements precisely
Interior Design & Architecture
- Furniture Replacement: Visualize different furniture options in spaces
- Décor Modifications: Change wall art, fixtures, or decorative elements
- Material Swaps: Show different finishes, textures, or materials
- Lighting Changes: Add or modify light fixtures and their effects
- Renovation Visualization: Preview changes before implementation
Creative & Artistic Projects
- Conceptual Photography: Create impossible or surreal imagery
- Artistic Elements: Add artistic flourishes or stylized components
- Narrative Storytelling: Insert contextual elements that support stories
- Fantasy Scenes: Create magical or fantastical elements within realistic photos
- Portfolio Development: Showcase creative editing capabilities
Marketing & Advertising
- Campaign Localization: Adapt imagery for different markets by editing specific elements
- Brand Consistency: Ensure consistent branded elements across image sets
- A/B Testing: Create variations for testing different visual approaches
- Seasonal Marketing: Update imagery with season-appropriate elements
- Product Variations: Show multiple product configurations efficiently
Mask Creation Tools
Recommended Tools for Professional Masks
- Adobe Photoshop: Industry-standard with advanced selection and masking tools
- GIMP: Free alternative with comprehensive masking capabilities
- Canva: User-friendly online tool for basic mask creation
- Paint.NET: Windows-based tool with good selection features
- Procreate: iPad app excellent for precise digital masking
Mask Quality Checklist
- ✅ Exact Dimensions: Mask matches source image size perfectly
- ✅ High Contrast: Clear distinction between edit areas (white) and preserve areas (black)
- ✅ Clean Boundaries: Smooth, well-defined edges around objects
- ✅ Appropriate Coverage: All target areas properly marked for editing
- ✅ Edge Quality: Suitable edge treatment (hard or soft) for the editing type