Midjourney Inpaint
Repaint or modify specific regions within existing images using mask-based editing with our /inpaint API.
What is Inpaint?
Select specific areas in an image and repaint them with new content while keeping the rest unchanged.
Use /inpaint API
Integrate Midjourney's inpaint functionality directly into your applications.
API Example
curl --location 'https://api.legnext.ai/api/v1/inpaint' \ --header 'x-api-key: YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "jobId": "job_12345", "imageNo": 0, "remixPrompt": "Replace with a blooming flower", "mask": { "areas": [{ "width": 1024, "height": 1024, "points": [288, 288, 408, 288, 408, 408, 288, 408] }] }, "callback": "https://your-domain.com/webhook" }'
Parameters
- jobId: Original image generation task ID
- imageNo: Image number to edit (0-3)
- mask: Regions to repaint (polygon or URL)
- remixPrompt: Text prompt for repaint area
- callback: Webhook URL
Response
Returns job ID, status, and up to 4 inpainted image URLs
Mask Methods
1
Polygon AreasDefine repaint areas using polygon coordinates
2
Mask ImageUpload black and white mask image (white areas repainted)