gpt-image
GPT-Image-2
Generate and edit images with OpenAI's GPT-Image-2 via inference.sh CLI.
Quick Start
Requires inference.sh CLI (
belt). Install instructions
belt login
belt app run openai/gpt-image-2 --input '{"prompt": "a cat astronaut floating in space"}'
Capabilities
GPT-Image-2 supports text-to-image generation, image editing with reference images, and mask-based inpainting — all through a single model.
| Feature | Description |
|---|---|
| Text-to-Image | Generate images from text prompts |
| Image Editing | Edit images using reference images |
| Inpainting | Mask-based editing of specific regions |
| Batch Generation | Generate up to 10 images at once |
| Multiple Formats | PNG, JPEG, WebP output |
| Flexible Resolution | Any size in 32px increments (256–4096) |
Examples
Text-to-Image
belt app run openai/gpt-image-2 --input '{
"prompt": "professional product photo of sneakers on a white background, studio lighting",
"quality": "high"
}'
Multiple Images
belt app run openai/gpt-image-2 --input '{
"prompt": "minimalist logo design for a coffee shop",
"n": 4,
"quality": "medium"
}'
Image Editing with Reference
belt app run openai/gpt-image-2 --input '{
"prompt": "change the background to a beach at sunset",
"images": ["https://your-image.jpg"]
}'
Multi-Image Reference
belt app run openai/gpt-image-2 --input '{
"prompt": "combine these two characters into one scene",
"images": ["https://character1.jpg", "https://character2.jpg"]
}'
Inpainting with Mask
belt app run openai/gpt-image-2 --input '{
"prompt": "replace with a red sports car",
"images": ["https://street-scene.jpg"],
"mask": "https://car-mask.png"
}'
Custom Resolution
belt app run openai/gpt-image-2 --input '{
"prompt": "wide cinematic landscape, mountains at golden hour",
"width": 1920,
"height": 1080,
"quality": "high"
}'
Fast Drafts
belt app run openai/gpt-image-2 --input '{
"prompt": "quick concept sketch of a robot",
"quality": "low"
}'
Pricing
| Quality | ~Price per Image |
|---|---|
| Low | $0.006 |
| Medium | $0.024 |
| High | $0.21 |
Larger resolutions cost more. See belt app get openai/gpt-image-2 for full pricing details.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
prompt |
string | required | Text prompt describing the image |
images |
array | - | Reference image(s) for editing |
mask |
string | - | Mask image for inpainting |
n |
integer | 1 | Number of images (1–10) |
quality |
string | - | low, medium, or high |
width |
integer | - | Output width (256–4096, multiples of 32) |
height |
integer | - | Output height (256–4096, multiples of 32) |
output_format |
string | png | png, jpeg, or webp |
output_compression |
integer | - | Compression level for jpeg/webp (0–100) |
Related Skills
# Full platform skill (all 250+ apps)
npx skills add inference-sh/skills@infsh-cli
# All image generation models
npx skills add inference-sh/skills@ai-image-generation
# FLUX models
npx skills add inference-sh/skills@flux-image
# Pruna P-Image (fast & economical)
npx skills add inference-sh/skills@p-image
Browse all image apps: belt app list --category image
Documentation
- Running Apps - How to run apps via CLI
- Streaming Results - Real-time progress updates
More from inference-sh/skills
agent-tools
Run 250+ AI apps via inference.sh CLI - image generation, video creation, LLMs, search, 3D, Twitter automation. Models: FLUX, Veo, Gemini, Grok, Claude, Seedance, OmniHuman, Tavily, Exa, OpenRouter, and many more. Use when running AI apps, generating images/videos, calling LLMs, web search, or automating Twitter. Triggers: inference.sh, infsh, ai model, run ai, serverless ai, ai api, flux, veo, claude api, image generation, video generation, openrouter, tavily, exa search, twitter api, grok
745ai-image-generation
Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FLUX.2 Klein LoRA, Gemini 3 Pro Image, Grok Imagine, Seedream 4.5, Reve, ImagineArt. Capabilities: text-to-image, image-to-image, inpainting, LoRA, image editing, upscaling, text rendering. Use for: AI art, product mockups, concept art, social media graphics, marketing visuals, illustrations. Triggers: flux, image generation, ai image, text to image, stable diffusion, generate image, ai art, midjourney alternative, dall-e alternative, text2img, t2i, image generator, ai picture, create image with ai, generative ai, ai illustration, grok image, gemini image, gpt image, openai image, chatgpt image
736ai-video-generation
Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0, HappyHorse 1.0, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, reference-to-video, video editing, lipsync, avatar animation, video upscaling, foley sound. Use for: social media videos, marketing content, explainer videos, product demos, AI avatars. Triggers: video generation, ai video, text to video, image to video, veo, animate image, video from image, ai animation, video generator, generate video, t2v, i2v, ai video maker, create video with ai, runway alternative, pika alternative, sora alternative, kling alternative, seedance, happyhorse
733twitter-automation
Automate Twitter/X with posting, engagement, and user management via inference.sh CLI. Apps: x/post-tweet, x/post-create (with media), x/post-like, x/post-retweet, x/dm-send, x/user-follow. Capabilities: post tweets, schedule content, like posts, retweet, send DMs, follow users, get profiles. Use for: social media automation, content scheduling, engagement bots, audience growth, X API. Triggers: twitter api, x api, tweet automation, post to twitter, twitter bot, social media automation, x automation, tweet scheduler, twitter integration, post tweet, twitter post, x post, send tweet
662web-search
Web search and content extraction with Tavily and Exa via inference.sh CLI. Apps: Tavily Search, Tavily Extract, Exa Search, Exa Answer, Exa Extract. Capabilities: AI-powered search, content extraction, direct answers, research. Use for: research, RAG pipelines, fact-checking, content aggregation, agents. Triggers: web search, tavily, exa, search api, content extraction, research, internet search, ai search, search assistant, web scraping, rag, perplexity alternative
626agent-browser
Browser automation for AI agents via inference.sh. Navigate web pages, interact with elements using @e refs, take screenshots, record video. Capabilities: web scraping, form filling, clicking, typing, drag-drop, file upload, JavaScript execution. Use for: web automation, data extraction, testing, agent browsing, research. Triggers: browser, web automation, scrape, navigate, click, fill form, screenshot, browse web, playwright, headless browser, web agent, surf internet, record video
625