gpt-image-2-generate

gpt-image-2 image generation: uses Azure OpenAI's gpt-image-2 to generate raster images and save them as files; suitable for creating PNG/JPEG/WebP and workflows involving prompt optimization and quality/size/background control.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "gpt-image-2-generate" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-796b2079cbadf893e222e92d9eb007f71be939e2dfb810c0c6995f086e997143. Verify the upstream source and version against https://skillhub.cn/skills/user_4741b2a8/gpt-image-2-generate before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

gpt-image-2 image generation: uses Azure OpenAI's gpt-image-2 to generate raster images and save them as files; suitable for creating PNG/JPEG/WebP and workflows involving prompt optimization and quality/size/background control.

0 Downloads

Introduction source: third_party · user_4741b2a8 · 1.0.0 Reference

SkillPi interpretation

Tasks
Generate raster images with Azure OpenAI gpt-image-2 and save them as files. Use this skill whenever the user asks to create, generate, draw, render, or make an image with gpt-image-2, GPT Image 2, Azure OpenAI image generation, or an OpenAI image generation model; also use it when they need saved PNG/JPEG/WebP image assets, prompt shaping for image generation, quality/size/background controls, or a reusable Azure-only CLI workflow for gpt-image-2.
Inputs and outputs
For transparent cutouts: After generation, inspect the result because transparent outputs are only useful if the subject edges are clean and the asset contains no unintended backdrop.
Software, accounts and paid services
Before calling the script, check: 1. `AZURE_OPENAI_API_KEY` is set in the shell environment. 2. Network access is available. 3. The output path is inside a writable workspace. If the key is missing, do not invent a workaround. Ask the user to provide or configure `AZURE_OPENAI_API_KEY`. The default Azure endpoint is: Use `AZURE_OPENAI_IMAGE_ENDPOINT` or `--endpoint <full-url>` only for another Azure OpenAI images/generations deployment URL.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: gpt-image-2-generator
description: Generate raster images with Azure OpenAI gpt-image-2 and save them as files. Use this skill whenever the user asks to create, generate, draw, render, or make an image with gpt-image-2, GPT Image 2, Azure OpenAI image generation, or an OpenAI image generation model; also use it when they need saved PNG/JPEG/WebP image assets, prompt shaping for image generation, quality/size/background controls, or a reusable Azure-only CLI workflow for gpt-image-2.
compatibility: Python 3.9+, network access, AZURE_OPENAI_API_KEY

GPT Image 2 Generator

Use this skill to generate new bitmap images with Azure OpenAI's gpt-image-2 deployment and save the results into the user's workspace.

What This Skill Does

  • Turns a user's image idea into a production-oriented prompt for gpt-image-2.
  • Calls the bundled Azure-only script at scripts/gpt_image_2_generate.py.
  • Saves generated images as PNG, JPEG, or WebP files.
  • Uses AZURE_OPENAI_API_KEY from the environment by default.
  • Sends requests to the cached Azure gpt-image-2 endpoint unless AZURE_OPENAI_IMAGE_ENDPOINT or --endpoint is provided.
  • Supports quality, size, background, output format, output compression, and multiple outputs.

If the user wants to edit an existing image rather than generate a new one, explain that this skill currently ships a generation script. You can still use the prompt guidance here, then implement or call an edit workflow separately if the environment provides one.

Requirements

Before calling the script, check:

  1. AZURE_OPENAI_API_KEY is set in the shell environment.
  2. Network access is available.
  3. The output path is inside a writable workspace.

If the key is missing, do not invent a workaround. Ask the user to provide or configure AZURE_OPENAI_API_KEY.

The default Azure endpoint is:

https://admin-mgoh5ri9-eastus2.cognitiveservices.azure.com/openai/deployments/gpt-image-2/images/generations?api-version=2024-02-01

Use AZURE_OPENAI_IMAGE_ENDPOINT or --endpoint <full-url> only for another Azure OpenAI images/generations deployment URL.

Workflow

  1. Decide the output intent:
    • preview: a quick image for the conversation.
    • project asset: an image that should be saved under the current project or workspace.
    • deliverable: a named final file such as a cover, poster, product visual, or illustration.
  2. Collect or infer the key image requirements:
    • subject
    • style
    • aspect ratio or exact size
    • output format
    • quality
    • any text that must appear in the image, written exactly
    • anything to avoid
  3. Shape the prompt into a concise visual spec. Preserve the user's creative direction; add only practical details that make the output more controllable.
  4. Run a dry run first if you are unsure about parameters:
    python scripts/gpt_image_2_generate.py \
      --prompt "A quiet alpine lake at sunrise, cinematic natural light" \
      --out ./image.png \
      --size auto \
      --quality medium \
      --dry-run
  5. Generate the image:
    python scripts/gpt_image_2_generate.py \
      --prompt "A quiet alpine lake at sunrise, cinematic natural light" \
      --out ./image.png \
      --size auto \
      --quality medium
  6. Inspect the saved image before finishing when possible.
  7. Report the saved file path and the final prompt used.

Prompt Shape

Use this structure when the user gives a vague prompt:

Use case: <preview, illustration, product visual, poster, wallpaper, concept art, etc.>
Primary request: <the user's requested image>
Subject: <main subject and important attributes>
Composition: <framing, camera angle, crop, balance>
Style: <photorealistic, editorial, painterly, 3D, anime, watercolor, etc.>
Lighting and color: <time of day, contrast, palette>
Background/environment: <setting>
Text in image: <exact text, or "none">
Avoid: <watermarks, logos, extra text, distorted anatomy, unwanted objects>

Keep prompts direct. gpt-image-2 follows compact, explicit visual direction well; stuffing the prompt with unrelated adjectives usually makes the result less controllable.

Parameter Guidance

  • --quality: use medium by default. Use low for fast drafts and high for final images, text-heavy images, product visuals, or photorealistic work.
  • --size: use auto by default unless the user names an exact size or aspect. If unsure, choose an aspect that matches the use case:
    • square/avatar: 1024x1024
    • portrait/social story: 1024x1536
    • landscape/header: 1536x1024
    • flexible/current API best fit: auto
  • --output-format: use png unless the user asks for smaller files (jpeg/webp) or transparency (png/webp).
  • --background: use auto normally. Use transparent only for cutouts, stickers, icons, isolated objects, or compositing assets.
  • --n: use 1 unless the user asks for variants.
  • --endpoint: use only for a complete Azure OpenAI images/generations deployment URL.
  • --api-key-env: use only when the Azure key is intentionally stored in a non-default environment variable.

Text In Images

When the user wants text in the image:

  • Put the exact desired text in quotes.
  • Keep wording short.
  • Mention that no other text should appear.
  • Prefer --quality high for text-heavy images.

Example:

python scripts/gpt_image_2_generate.py \
  --prompt 'Minimal coffee poster with the exact headline "SLOW MORNING" and no other text, warm editorial product photography style' \
  --out ./slow-morning.png \
  --quality high

Transparent Outputs

For transparent cutouts:

python scripts/gpt_image_2_generate.py \
  --prompt "A single red enamel camping mug, isolated product cutout, no text, no shadow" \
  --out ./mug.png \
  --background transparent \
  --output-format png \
  --quality high

After generation, inspect the result because transparent outputs are only useful if the subject edges are clean and the asset contains no unintended backdrop.

Script Reference

The script uses the Azure OpenAI Images generation endpoint with this payload shape:

{
  "prompt": "...",
  "size": "auto",
  "quality": "medium",
  "n": 1
}

Requests are sent to the Azure deployment URL and authenticated with the api-key header. The payload omits the model field because the deployment is encoded in the endpoint URL.

The script accepts base64 image responses and writes them to disk. Run:

python scripts/gpt_image_2_generate.py --help

Safety And Fit

Follow the user's applicable content constraints and local policy. Do not generate images that violate policy. Do not claim an image was generated by gpt-image-2 unless the Azure API call succeeded.

Useful Examples

Photorealistic scene:

python scripts/gpt_image_2_generate.py \
  --prompt "Photorealistic editorial image of a ceramic teapot on a walnut table beside a rainy window, soft morning light, shallow depth of field, no text" \
  --out ./teapot.png \
  --quality high \
  --size auto

Wallpaper:

python scripts/gpt_image_2_generate.py \
  --prompt "Wide digital painting wallpaper of a moonlit desert observatory, crisp stars, subtle teal and amber accents, calm cinematic atmosphere, no text" \
  --out ./observatory.webp \
  --output-format webp \
  --quality medium \
  --size 1536x1024

Variants:

python scripts/gpt_image_2_generate.py \
  --prompt "Three-quarter view concept art of a compact electric city bicycle, clean studio background, industrial design sketch render, no text" \
  --out ./city-bike.png \
  --n 3 \
  --quality medium

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供基于 Azure OpenAI gpt-image-2 的高质量图像生成能力,满足设计、内容创作等高频需求
  • 支持多种输出格式(PNG/JPEG/WebP)、质量控制、透明背景及多图生成,功能完整且实用
Trigger Precision90/100

Highlights

  • 触发词覆盖全面且边界清晰,准确匹配用户关于图像生成的多种表达方式
Structure and Standards95/100

Areas to improve

  • description 内容重复 Reported severity: Minor

    顶层 frontmatter 和 skill_body 内部均包含完整 description,存在冗余

    Recommendation: 建议移除 skill_body 开头的重复 frontmatter,保持单一权威描述源

  • 缺少显式 When to Use 章节 Reported severity: Minor

    文档未设置独立 'When to Use' 章节,尽管 Workflow 已涵盖使用场景

    Recommendation: 可添加简短 'When to Use' 段落以提升可读性

Highlights

  • 文档结构清晰,包含完整的工作流、参数指导和安全说明
  • 提供丰富的端到端示例和 dry-run 机制,便于用户理解和测试
Execution Reliability90/100

Highlights

  • 脚本路径明确,参数校验完善,支持环境变量配置和自定义端点
  • 包含 API key 缺失处理逻辑和 dry-run 预检机制,执行可靠性高
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • admin-mgoh5ri9-eastus2.cognitiveservices.azure.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before calling the script, check: 1. `AZURE_OPENAI_API_KEY` is set in the shell environment. 2. Network access is available. 3. The output path is inside a writable workspace. If the key is missing, do not invent a workaround. Ask the user to provide or configure `AZURE_OPENAI_API_KEY`. The default Azure endpoint is: Use `AZURE_OPENAI_IMAGE_ENDPOINT` or `--endpoint <full-url>` only for another Azure OpenAI images/generations deployment URL.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.