1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/gpt-image-1.5-edit";
const data = {
"prompt": "A photorealistic wide drone shot of a colossal man (exact face/body from the reference) casually sitting across a London street, one knee raised, hand resting. He wears a navy overcoat, knit sweater, dark trousers, boots, and a minimalist beanie. Tiny cars, buses, bikes, and pedestrians move around him, with classic London red-brick buildings, black lamps, and cobblestone streets dwarfed by his size. Soft overcast London daylight highlights wet pavement.",
"image_urls": "https://segmind-resources.s3.amazonaws.com/input/92a8e420-2d12-48c0-97f5-73c6c4820c34-black-man-image.jpeg",
"size": "auto",
"quality": "high",
"background": "opaque",
"output_compression": 100,
"output_format": "png",
"moderation": "auto"
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();Text prompt guides image generation. Example: 'A cyberpunk city skyline at night.'
Links to reference images.
Image to be used as a base. Leave null to upload later.
Choose image resolution. 'auto' balances speed and quality.
Allowed values:
Sets visual quality. 'auto' balances detail and performance.
Allowed values:
Background type for the image. Transparent is useful for overlays.
Allowed values:
Defines output image compression level. Use 100 for best quality.
Specifies the output image format. Use 'png' for high-quality needs.
Allowed values:
Sets moderation strictness. 'low' relaxes content restrictions.
Allowed values:
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
GPT Image 1.5 Edit is OpenAI's multimodal AI model that transforms image editing workflows through natural language instructions. Instead of manual pixel manipulation, developers can now describe desired changes in plain English—"replace the blue sky with a sunset" or "remove the background and make it transparent"—and the model executes these edits with professional precision. Built for production environments, it offers zero-latency cold starts and REST API integration, making it ideal for high-volume creative pipelines, e-commerce platforms, and design automation tools.
E-commerce & Product Photography: Swap backgrounds, retouch product images, adjust lighting, and generate lifestyle shots at scale.
Marketing & Content Creation: Edit campaign visuals, personalize ad creatives, and maintain brand consistency across multiple assets.
UI/UX Design: Rapidly prototype interface variations, edit mockups, and adjust visual elements without leaving design workflows.
Photography Post-Processing: Remove unwanted objects, extend image boundaries, adjust colors, and perform complex retouching operations.
Social Media Management: Adapt content for different platforms, create variations, and apply quick edits to archival photography.
Be Specific and Descriptive: Instead of "make it better," write "increase brightness by 20%, add warm color grading, and soften shadows."
Leverage Quality Parameters: Use quality: high for final deliverables; quality: auto balances speed and detail for iterative work.
Combine Masks with Prompts: Upload mask images to isolate edit zones—perfect for changing specific objects while preserving surroundings.
Reference Images for Style Transfer: Include multiple image_urls to guide aesthetic consistency, especially for brand-compliant edits.
Resolution Strategy: Choose size: auto for the model to determine optimal resolution, or specify exact dimensions for precise output requirements.
Format Selection: Use PNG for transparency needs and maximum quality; JPEG/WebP for smaller file sizes in web applications.
How is GPT Image 1.5 Edit different from text-to-image models?
Unlike generative models that create images from scratch, GPT Image 1.5 Edit modifies existing images based on your instructions, preserving context and composition while applying targeted changes.
What parameters should I adjust for best results?
Start with quality: high and output_compression: 100 for professional work. Lower compression (80-95) reduces file size for web use. Use background: transparent when generating assets for compositing.
Can I edit multiple areas in a single API call?
Yes, through detailed prompts or mask images. Describe all changes in one comprehensive prompt (e.g., "remove person on left, change sky to sunset, brighten foreground"), or use masks to target specific regions.
Does the model support batch processing?
The REST API accepts individual requests. For batch editing, implement parallel API calls in your application logic to process multiple images simultaneously.
What image formats are supported as input?
The model accepts standard web formats via image_urls parameter (PNG, JPEG, WebP). Provide publicly accessible URLs for both base images and optional masks.
Is GPT Image 1.5 Edit suitable for automated workflows?
Absolutely. The zero-cold-start architecture and REST API integration make it perfect for real-time editing pipelines, content management systems, and automated design tools requiring consistent, fast responses.