GPT Image 1 Mini
GPT Image 1 Mini generates high-quality images from text descriptions, empowering efficient visual content creation.
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
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-mini"
# Request payload
data = {
"prompt": "Design a pop-art urban street-inspired cover. Bright yellow, red, cyan with black/white contrast. Include graffiti textures, comic-style murals, playful stickers, and hand-drawn typography. Bold, energetic, and vibrant style, ideal for street festivals, concerts, or city cultural events.",
"size": "1024x1024",
"quality": "high",
"moderation": "auto",
"background": "opaque",
"output_compression": 100,
"output_format": "png"
}
headers = {'x-api-key': api_key}
response = requests.post(url, json=data, headers=headers)
print(response.content) # The response is the generated image
Attributes
Describe the image you want to generate. Try using descriptive keywords and context for creative imagery or straight-forward terms for clear visuals.
Choose how big the image should be. Use square for fast results and larger sizes for detailed or wide visuals.
Allowed values:
Set the image's visual quality. Use high for intricate details or medium for efficiency without much compromise.
Allowed values:
Choose moderation level for content. Use low for creative freedom, auto for balanced safety.
Allowed values:
Decide if background should be see-through or solid. Transparent is best for overlays; opaque suits standalone images.
Allowed values:
Select how compressed the output image is. A higher number preserves quality; lower numbers shrink file size.
Choose the file type for saving. PNG is great for quality; jpeg for smaller files.
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 Mini
GPT Image 1 Mini Guide
GPT Image 1 Mini is an API-driven text-to-image model that balances high-quality visuals with resource efficiency. Whether youâre building an e-commerce site, crafting social media graphics, or prototyping brand assets, this guide will help you pick the right parameters and write prompts that unlock the modelâs full potential.
1. Crafting Effective Prompts
- â˘Be specific. Instead of âfuturistic city,â try âsleek neon-lit skyline at dusk with flying cars.â
- â˘Include style cues. Add âwatercolor,â âhyper-realistic,â or âflat designâ to steer the mood.
- â˘Describe composition. Mention camera angles (âoverhead view,â âwide shotâ) and lighting (âsoft morning light,â âdramatic backlightâ).
- â˘Call out key elements. Specify objects, colors, textures, and focal points: âa red racing bicycle against a graffiti wall.â
2. Key Parameters & Recommendations
Parameter | Best Practice | Use Case Examples |
---|---|---|
size | 1024x1024 for balanced detail & speed. | Social posts, blog images. |
1536x1024 or 1024x1536 for widescreen. | Banners, header images. | |
auto for dynamic layouts. | Responsive web design. | |
quality | high for final assets with fine detail. | Print, marketing collateral. |
medium for quick iterations. | Prototyping, A/B tests. | |
low for thumbnails or placeholders. | Wireframes, drafts. | |
moderation | auto for safe defaults. | Public-facing applications. |
low for full creative freedom. | Internal experimentation. | |
background | transparent for overlays & compositing. | UI elements, logos. |
opaque for standalone visuals. | Social media posts, presentations. | |
output_compression | 100 for max quality. | Print, detailed art. |
60â80 for web-optimized files. | Websites, email campaigns. | |
output_format | png for lossless quality. | Logos, graphics with transparency. |
jpeg for smaller photographs. | Photo galleries, portfolios. | |
webp for modern web use. | High-performance sites. |
3. Advanced Tips
- â˘Inpainting: Pass an existing image plus mask to refine or extend visuals.
- â˘Style reference: Supply a URL to an example image and mention âin the style of this referenceâ to match textures or color palettes.
- â˘Batch requests: Send arrays of prompts with shared parameters for bulk generationâideal for catalog images or product variations.
- â˘Rate limits & caching: Implement local caching of generated outputs to reduce repeated calls and speed up your app.
4. Workflow Examples
- â˘E-commerce Catalog: size=1024x1024, quality=medium, background=opaque, format=jpeg, compression=80.
- â˘Blog Feature Image: size=1536x1024, quality=high, background=opaque, format=png, compression=100.
- â˘UI Icon Set: size=1024x1024, quality=high, background=transparent, format=png, compression=100.
Use these guidelines to streamline your integration with GPT Image 1 Mini and produce compelling visuals at scale.
Other Popular Models
Discover other models you might be interested in.
idm-vton
Best-in-class clothing virtual try on in the wild

illusion-diffusion-hq
Monster Labs QrCode ControlNet on top of SD Realistic Vision v5.1

faceswap-v2
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

sdxl1.0-txt2img
The SDXL model is the official upgrade to the v1.5 model. The model is released as open-source software
