Shiyun API GPT-image-2 Image Generation and Editing
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.pywhen there is no input image and the goal is to create a new image; usescripts/edit_image.pywhen 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 extractimageorimages; preferSHIYUN_API_KEY, and if the user provides a key, persist it withscripts/save_api_key.py --api-key-stdinvia stdin. - Parameters and output: default
modelisgpt-image-2; commonsizevalues include1024x1024,1536x1024,1024x1536, andauto; the scripts saveurl,b64_json,base64, or unknownresponse.json, and writemetadata.json. - Troubleshooting: check the key for 401/403; check
prompt,size,quality, andmaskfor 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.
Related Skills
Generate an interactive HTML product detail page from images and copy, with multi-product carousel, inline text editing, design controls, and PDF/JPG/PSD export support.
Enter a material name to get preview and download links for free, commercially usable video assets, with paid platform options, pricing, and search suggestions when results are limited.
A local CLI for Dreamina image and video generation, including credit checks, async submission, result queries, and task history review.
Generate and validate JianYing drafts from storyboard JSON with narrated commentary, original-sound preservation, timing checks, and draft inspection.