$npx -y skills add inference-sh/skills --skill gpt-imageGenerate and edit images with OpenAI GPT-Image-2 via inference.sh CLI. Models: GPT-Image-2. Capabilities: text-to-image, image editing, inpainting, mask-based editing, multi-image reference, batch generation. Use for: product mockups, marketing visuals, image editing, concept art
| 1 | > **Install the belt CLI skill:** `npx skills add belt-sh/cli` |
| 2 | |
| 3 | # GPT-Image-2 |
| 4 | |
| 5 | Generate and edit images with OpenAI's GPT-Image-2 via [inference.sh](https://inference.sh) CLI. |
| 6 | |
| 7 | ## Quick Start |
| 8 | |
| 9 | > Requires inference.sh CLI (`belt`). [Install instructions](https://raw.githubusercontent.com/inference-sh/skills/refs/heads/main/cli-install.md) |
| 10 | |
| 11 | ```bash |
| 12 | belt login |
| 13 | |
| 14 | belt app run openai/gpt-image-2 --input '{"prompt": "a cat astronaut floating in space"}' |
| 15 | ``` |
| 16 | |
| 17 | |
| 18 | ## Capabilities |
| 19 | |
| 20 | GPT-Image-2 supports text-to-image generation, image editing with reference images, and mask-based inpainting — all through a single model. |
| 21 | |
| 22 | | Feature | Description | |
| 23 | |---------|-------------| |
| 24 | | Text-to-Image | Generate images from text prompts | |
| 25 | | Image Editing | Edit images using reference images | |
| 26 | | Inpainting | Mask-based editing of specific regions | |
| 27 | | Batch Generation | Generate up to 10 images at once | |
| 28 | | Multiple Formats | PNG, JPEG, WebP output | |
| 29 | | Flexible Resolution | Any size in 32px increments (256–4096) | |
| 30 | |
| 31 | ## Examples |
| 32 | |
| 33 | ### Text-to-Image |
| 34 | |
| 35 | ```bash |
| 36 | belt app run openai/gpt-image-2 --input '{ |
| 37 | "prompt": "professional product photo of sneakers on a white background, studio lighting", |
| 38 | "quality": "high" |
| 39 | }' |
| 40 | ``` |
| 41 | |
| 42 | ### Multiple Images |
| 43 | |
| 44 | ```bash |
| 45 | belt app run openai/gpt-image-2 --input '{ |
| 46 | "prompt": "minimalist logo design for a coffee shop", |
| 47 | "n": 4, |
| 48 | "quality": "medium" |
| 49 | }' |
| 50 | ``` |
| 51 | |
| 52 | ### Image Editing with Reference |
| 53 | |
| 54 | ```bash |
| 55 | belt app run openai/gpt-image-2 --input '{ |
| 56 | "prompt": "change the background to a beach at sunset", |
| 57 | "images": ["https://your-image.jpg"] |
| 58 | }' |
| 59 | ``` |
| 60 | |
| 61 | ### Multi-Image Reference |
| 62 | |
| 63 | ```bash |
| 64 | belt app run openai/gpt-image-2 --input '{ |
| 65 | "prompt": "combine these two characters into one scene", |
| 66 | "images": ["https://character1.jpg", "https://character2.jpg"] |
| 67 | }' |
| 68 | ``` |
| 69 | |
| 70 | ### Inpainting with Mask |
| 71 | |
| 72 | ```bash |
| 73 | belt app run openai/gpt-image-2 --input '{ |
| 74 | "prompt": "replace with a red sports car", |
| 75 | "images": ["https://street-scene.jpg"], |
| 76 | "mask": "https://car-mask.png" |
| 77 | }' |
| 78 | ``` |
| 79 | |
| 80 | ### Custom Resolution |
| 81 | |
| 82 | ```bash |
| 83 | belt app run openai/gpt-image-2 --input '{ |
| 84 | "prompt": "wide cinematic landscape, mountains at golden hour", |
| 85 | "width": 1920, |
| 86 | "height": 1080, |
| 87 | "quality": "high" |
| 88 | }' |
| 89 | ``` |
| 90 | |
| 91 | ### Fast Drafts |
| 92 | |
| 93 | ```bash |
| 94 | belt app run openai/gpt-image-2 --input '{ |
| 95 | "prompt": "quick concept sketch of a robot", |
| 96 | "quality": "low" |
| 97 | }' |
| 98 | ``` |
| 99 | |
| 100 | ## Pricing |
| 101 | |
| 102 | | Quality | ~Price per Image | |
| 103 | |---------|-----------------| |
| 104 | | Low | $0.006 | |
| 105 | | Medium | $0.024 | |
| 106 | | High | $0.21 | |
| 107 | |
| 108 | Larger resolutions cost more. See `belt app get openai/gpt-image-2` for full pricing details. |
| 109 | |
| 110 | ## Parameters |
| 111 | |
| 112 | | Parameter | Type | Default | Description | |
| 113 | |-----------|------|---------|-------------| |
| 114 | | `prompt` | string | required | Text prompt describing the image | |
| 115 | | `images` | array | - | Reference image(s) for editing | |
| 116 | | `mask` | string | - | Mask image for inpainting | |
| 117 | | `n` | integer | 1 | Number of images (1–10) | |
| 118 | | `quality` | string | - | low, medium, or high | |
| 119 | | `width` | integer | - | Output width (256–4096, multiples of 32) | |
| 120 | | `height` | integer | - | Output height (256–4096, multiples of 32) | |
| 121 | | `output_format` | string | png | png, jpeg, or webp | |
| 122 | | `output_compression` | integer | - | Compression level for jpeg/webp (0–100) | |
| 123 | |
| 124 | ## Related Skills |
| 125 | |
| 126 | ```bash |
| 127 | # Full platform skill (all apps) |
| 128 | npx skills add inference-sh/skills@infsh-cli |
| 129 | |
| 130 | # All image generation models |
| 131 | npx skills add inference-sh/skills@ai-image-generation |
| 132 | |
| 133 | # FLUX models |
| 134 | npx skills add inference-sh/skills@flux-image |
| 135 | |
| 136 | # Pruna P-Image (fast & economical) |
| 137 | npx skills add inference-sh/skills@p-image |
| 138 | ``` |
| 139 | |
| 140 | Browse all image apps: `belt app store --category image` |
| 141 | |
| 142 | ## Documentation |
| 143 | |
| 144 | - [Running Apps](https://inference.sh/docs/apps/running) - How to run apps via CLI |
| 145 | - [Streaming Results](https://inference.sh/docs/api/sdk/streaming) - Real-time progress updates |