AI Agent Hub
Back to skills
Shiyun API GPT-image-2 Image Generation and Editing icon

Shiyun API GPT-image-2 Image Generation and Editing

Design & Media Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please install @user_cfdd25ec/gpt-image-2-shiyunapi according to https://skillhub.cn/install/skillhub.md.

About this skill

What problem it addresses

Calling gpt-image-2 through ShiyunApi is not only about sending a request. The workflow needs to choose between /v1/images/generations and /v1/images/edits, handle inconsistent model and modal fields, normalize url, b64_json, or unknown JSON responses, and keep API keys out of commands, logs, and memory. This skill packages task routing, parameter validation, script execution, and result persistence into a repeatable flow.

How it works

  • Route the task first: use scripts/generate_image.py when there is no input image and the goal is to create a new image; use scripts/edit_image.py when the user supplies an image, reference image, mask, or asks to modify an existing image.
  • Covered use cases: Chinese and English prompts for posters, avatars, covers, illustrations, product shots, character sheets, and concept art; also single-image or multi-image editing, background replacement, subject preservation, local redraw, and compositing.
  • Execution path: extract prompt, and for editing extract image or images; prefer SHIYUN_API_KEY, and if the user provides a key, persist it with scripts/save_api_key.py --api-key-stdin via stdin.
  • Parameters and output: default model is gpt-image-2; common size values include 1024x1024, 1536x1024, 1024x1536, and auto; the scripts save url, b64_json, base64, or unknown response.json, and write metadata.json.
  • Troubleshooting: check the key for 401/403; check prompt, size, quality, and mask for 400/422; check file size for 413; preserve the raw JSON for unknown responses before summarizing.

Scope and cautions

Suitable for online generation and editing of png, jpg, jpeg, and webp images. It does not support video generation, image-to-video, local offline retouching, screenshots, compression, or cropping, and it does not replace other vendors by default. A mask’s transparent area marks the edit region, and it is normally smaller than 4MB and the same size as the first image.

Use Cases

  • E-commerce ops use product selling-point prompts to quickly generate multiple main image background assets before launch.
  • Designers take white-background product shots, extract the subject, and replace the background for landing pages.
  • Indie developers combine multiple UI screenshots or reference images to generate a complete app concept demo.
  • Content editors process old posters with watermarks or flaws, using masks to redraw and repair specific areas.

Best For

  • Visual designers who need to rapidly produce posters, illustrations, and character sheets, and composite multiple reference images into new ones.
  • E-commerce operations handling product main images and detail pages who frequently need to replace product backgrounds or perform local retouching.
  • Product managers or indie developers building apps who need to call API scripts to quickly generate app store covers and UI concept demos.
  • Content creators making video thumbnails or graphic posts who need to adjust styles and preserve subjects based on existing images.