GPT Image 1 Edit Mini
GPT Image 1 Mini generates and edits high-quality images seamlessly from text and visual inputs.
API
If you're looking for an API, you can choose from your desired programming language.
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import requests
import base64
# Use this function to convert an image file from the filesystem to base64
def image_file_to_base64(image_path):
with open(image_path, 'rb') as f:
image_data = f.read()
return base64.b64encode(image_data).decode('utf-8')
# Use this function to fetch an image from a URL and convert it to base64
def image_url_to_base64(image_url):
response = requests.get(image_url)
image_data = response.content
return base64.b64encode(image_data).decode('utf-8')
# Use this function to convert a list of image URLs to base64
def image_urls_to_base64(image_urls):
return [image_url_to_base64(url) for url in image_urls]
api_key = "YOUR_API_KEY"
url = "https://api.segmind.com/v1/gpt-image-1-edit-mini"
# Request payload
data = {
"prompt": "Use the reference airship scene. Make it larger scale and more dynamic, with multiple airships in the sky, steam trails, moving propellers, and adventurous characters posing heroically. Retain steampunk details and style.",
"image_urls": [
"https://segmind-resources.s3.amazonaws.com/input/be87b383-38d7-435e-a795-5ece083301e9-0f4a926b22d2b98cf40bf1e17385deed_0.jpeg"
],
"size": "auto",
"quality": "auto",
"background": "opaque",
"output_compression": 100,
"output_format": "png",
"moderation": "auto"
}
headers = {'x-api-key': api_key}
response = requests.post(url, json=data, headers=headers)
print(response.content) # The response is the generated image
Attributes
Text input to generate the desired image. For a 3D action figure, describe clothing and accessories vividly.
URLs of source images. Include multiple URLs for diverse image references.
Input Image for masking. Use when specific parts of the image need editing.
Image resolution selection. Use 'auto' for default or 1024x1024 for quicker generation.
Allowed values:
Controls output image quality. 'Auto' suits most needs while 'high' is best for detailed outputs.
Allowed values:
Chooses between transparent or opaque background. Use 'transparent' for standalone figures.
Allowed values:
Set compression level from 1-100. Use 100 for no compression and optimal quality.
Choose image format: PNG for transparency, JPEG for smaller file size.
Allowed values:
Controls image generation moderation strictness. Opt for 'low' to reduce 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.
Resources to get you started
Everything you need to know to get the most out of GPT Image 1 Edit Mini
GPT Image 1 Mini Usage Guide
GPT Image 1 Mini is a powerful multimodal model that excels at generating and editing images from text prompts and reference visuals. Whether you’re building e-commerce catalogs, crafting concept art, or rapidly prototyping UI mockups, this guide will help you choose the right parameters to balance speed, quality, and file size.
Getting Started
- •Prompt: Provide a clear, detailed text description (required).
- •Image Inputs: Use
image_urls
for reference images, and includemask
when you need inpainting or targeted edits. - •Core Parameters:
- •size: Auto, 1024×1024, 1536×1024 or 1024×1536
- •quality: low, medium, high or auto
- •background: opaque or transparent
- •output_format: png, jpeg or webp
- •output_compression: 1–100 (100 = no compression)
- •moderation: low or auto
Optimal Parameter Settings
1. E-Commerce & Product Visualization
- •size: 1024×1024 (fast turnaround)
- •quality: high (sharp details)
- •background: transparent (isolated product shots)
- •output_format: png
- •output_compression: 100
2. Concept Art & High-Detail Scenes
- •size: 1536×1024 (wider aspect for scenes)
- •quality: high (fine textures, lighting)
- •background: opaque
- •output_format: webp (web optimization) or png
- •output_compression: 80 (good quality, smaller file)
3. Rapid Prototyping & UI/UX Mockups
- •size: 1024×1024 (balanced speed & clarity)
- •quality: auto or medium (quicker generation)
- •background: opaque
- •output_format: jpeg
- •output_compression: 60 (smaller assets)
4. Inpainting & Photo-Based Editing
- •Provide both
image_urls
andmask
- •size: match source image resolution (use auto for consistency)
- •quality: medium (balance speed and seam concealment)
- •background: opaque
- •output_format: png
- •output_compression: 90
Prompt Best Practices
- •Be specific about style, mood, and composition (“cinematic lighting,” “vibrant color palette”).
- •Mention object details (material, scale, accessories).
- •Break complex scenes into shorter phrases for clarity.
- •Use nouns and adjectives strategically—e.g., “wooden dining chair with tufted red velvet cushion.”
Tips & Troubleshooting
- •If outputs feel over-restrained, set
moderation: low
. - •Reduce prompt length if generation stalls.
- •For transparent elements (logos, overlays), always choose
background: transparent
. - •Adjust
output_compression
down to 70–80 if final files must load faster on web pages.
By aligning these parameters with your project’s goals—speed, fidelity, or file size—you’ll unlock GPT Image 1 Mini’s full potential for seamless, professional image generation and editing.
Other Popular Models
Discover other models you might be interested in.
face-to-many
Turn a face into 3D, emoji, pixel art, video game, claymation or toy

sd1.5-epicrealism
This model corresponds to the Stable Diffusion Epic Realism checkpoint for detailed images at the cost of a super detailed prompt

codeformer
CodeFormer is a robust face restoration algorithm for old photos or AI-generated faces.

sd2.1-faceswapper
Take a picture/gif and replace the face in it with a face of your choice. You only need one image of the desired face. No dataset, no training
