本文へ移動
cccskills
無料GitHub で公開

gpt-image-2

Generate or edit images with OpenAI's gpt-image-2 via GMI Cloud's async request-queue API (console.gmicloud.ai). One dual-mode script: with NO input image it runs `gpt-image-2-generate` (text-to-image); with one or more input images it runs `gpt-image-2-edit` (one request per image). Submits the job, polls until done, and downloads every result image to the shared project-root `outputs/` folder. Defaults: quality=medium, output_format=png, size=1920x1088, n=2. API key is read from a `.gmi_api_key` file in the skill folder (also accepts `--api-key` or `$GMI_API_KEY`). ACTIVATION IS BY EXPLICIT MODEL NAME ONLY. This skill ACTUALLY GENERATES / EDITS real images and spends API credits, so TRIGGER ONLY when the user explicitly names this model / provider — "gpt-image-2", "gpt image 2", "GMI", "GMI Cloud" — e.g. "用 gpt-image-2 生圖", "用 gpt-image-2 改圖", "GMI 生圖", "GMI Cloud 生圖", "跑 gpt-image-2", "gpt image 2 編輯", "gpt image 2 生成". DO NOT TRIGGER on generic image wording that does NOT name gpt-image-2 / GMI — e.g. "編輯圖片", "圖片編輯", "載入圖片編輯", "圖片編輯技能", "改圖", "修圖", "編輯這張圖", "轉為黑白線稿", "圖片生成", "生圖", "image editing", "edit image", "image generation". Those are PROMPT-WRITING requests, NOT generation: • editing an image / a hypothetical visual change → use `prompt-master-image-editor` (writes an English edit prompt only, never generates an actual image). • other prompt tasks → the relevant `prompt-master-*` skill. Also DO NOT TRIGGER for: Stable Diffusion / TensorArt generation (use `sd-image-gen`), Gemini / nano banana editing (use `nano-banana-pro-edit`), upscaling (use `sd-upscaler`), or image selection / judging (use `image-judge`).

日本語の概要は準備中です。原文の説明を表示しています。

Kouzui-HUANG/biz-ai-video-courseスター 4(GitHub 4 + cccskills 0)
連携ツールOpenAIGemini

実行スコア 未検証

インストール方法を見る

含まれるファイル(7)

  • SKILL.md7.4 KB
  • docs/examples_zh-TW.md3.4 KB
  • docs/flags_zh-TW.md5.5 KB
  • docs/SKILL_zh-TW.md6.8 KB
  • references/examples.md3.3 KB
  • references/flags.md5.3 KB
  • scripts/gpt_image_2.py20.9 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

gpt-image-2

Run scripts/gpt_image_2.py to call GMI Cloud's gpt-image-2 models. The script is dual-mode and auto-detecting:

  • No input image → generate (gpt-image-2-generate, text-to-image).
  • One or more input images → edit (gpt-image-2-edit, one request per image).

Every result image is saved to the shared outputs/ folder at the project root, prefixed gpt_. The drop-zone for edit sources is the shared uploads/ folder next to it. Both are defined once in .claude/lib/media_paths.py and shared with the gemini-3-pro-image and seedance-2-0 skills:

<project root>/uploads/        drop edit-source images here
<project root>/uploads/done/   sources move here after a successful run
<project root>/outputs/        every result lands here (gpt_ / gemini_ / seedance_)

Core directives

  1. Never hard-code the API key. It is resolved in this order: --api-key flag → $GMI_API_KEY (incl. project .env) → .gmi_api_key file in the skill folder (this is where the copied key lives). If none is found the script exits with a clear message. The same GMI key powers the gemini-3-pro-image skill.
  2. Run from project root — CWD is /Users/kouzuimac/Documents/反重力/0527課用教材/biz-ai-video-course. (The shared folders resolve from the script's own location, so another CWD still works; project root just keeps the relative paths below readable.)
  3. Ask for the prompt. No default prompt. If the user doesn't supply one, ask before running.
  4. Mode is decided by whether an image is supplied. Pass image path(s)/URL(s) as positional args (or --image) → edit. Pass none → generate. --mode generate|edit forces it.
  5. Long prompts → @file.txt. For prompts longer than a couple of lines, save to a file under project root and pass --prompt @prompts/x.txt. Avoids shell-quoting traps.
  6. Defaults: quality=medium, png, size=1920x1088, n=2. Override via --quality / --output-format / --size / --n only when asked.
  7. Size is flexible (verified live). gpt-image-2 accepts any WxH with edges multiple of 16, longest edge ≤ 3840, aspect ≤ 3:1, total pixels 0.65M–8.3M — so up to 4K (3840x2160). Default 1920x1088 (native 16:9 HD). Exact 1920x1080 is rejected (1080 isn't ÷16) — use 1920x1088. auto also works.
  8. Don't chain into posting. Report saved paths; do not auto-invoke multi-sns-post.
  9. Default source folder — the shared uploads/. Edit-source images live in the project-root drop-zone uploads/, shared with the other two generation skills. When the user wants to edit an image but doesn't give a full path (or just pastes/drops one), look there first. The script resolves bare filenames and a directory path against this folder automatically (also CWD, project root, and uploads/done/), so you can pass just 2026-06-10-23.png, or point at the whole uploads/ directory to edit every image inside it in one run (a directory ref lists only its top level, so already-archived images in done/ are not re-edited). Match the output --size to the source aspect ratio (e.g. a 9:16 portrait → 1088x1920) so the edit isn't stretched or cropped.
  10. Used sources self-archive. After a successful edit, sources that were sitting in uploads/ are moved to uploads/done/, so the drop-zone only ever shows what still needs doing. A failed edit leaves its source in place for a retry. Pass --keep-refs when the user wants several prompts on the same image; a re-run still accepts the bare filename either way.

Knowledge hub

Read only the reference file relevant to the task:

  • Need CLI flags, modes, exit codes, the GMI API contract (endpoints, payload fields, polling, response shape), output naming → references/flags.md
  • Need concrete invocation examples (generate, edit single/many, file-based prompt, URL input, overrides, stdout shape) → references/examples.md

Standard operating procedure

  1. Get the prompt from the user (inline or @file).
  2. Decide mode: did the user provide an image — a path, or one sitting in the shared uploads/ drop-zone? → edit, else generate. For edits without an explicit path, check uploads/ first.
  3. Run the script (see references/examples.md for forms):
    # generate (no image)
    python3 .claude/skills/gpt-image-2/scripts/gpt_image_2.py \
      --prompt "<text-or-@file>"
    
    # edit (one or more images)
    python3 .claude/skills/gpt-image-2/scripts/gpt_image_2.py \
      --prompt "<text-or-@file>" path/to/source.png
    
  4. Watch stdout: [mode] ..., [submit] ..., [poll] status=..., [✓] ..., 📦 ... (source archived), [done] ....
  5. Report saved outputs/ paths to the user.

Output protocol

  • Files land in the shared project-root outputs/ folder (auto-created):
    • generate: gpt_{YYYYmmdd_HHMMSS}[_k].{png|jpg}
    • edit: gpt_{YYYYmmdd_HHMMSS}_{source_stem}[_k].{png|jpg}
    • _k index suffix is added only when n > 1.
    • The gpt_ prefix is what tells these apart from gemini_ / seedance_ results in the same folder. An existing file is never overwritten — a colliding name gets a _1, _2… suffix.
  • Stdout prefixes: [mode] / [submit] / [poll] / [✓] / [batch] / [done] / [!]. Parse [✓] lines for paths when chaining into other tooling.
  • Exit codes: 0 all good · 1 config/validation error (bad key, invalid size/quality/format/n) · 2 job ran but ≥1 image failed.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

專為 Suno 與 Udio 設計的 AI 音樂提示詞(Prompt/Tags)生成助手。當使用者提出抽象的情緒、畫面或曲風融合需求(如:「古風結合賽博龐克」)時,請觸發此技能。它會將模糊的靈感精準轉譯為專業的音樂流派、樂器、混音與結構標籤,大幅提升 AI 音樂生成的品質與準確度。

日本語の概要は準備中です。原文の説明を表示しています。

Kouzui-HUANG/biz-ai-video-course42026年10月27日 更新

AI Short-Drama Director & Clip Prompt Architect (AI 短劇導演 × 分鏡 Clip 架構師). Acts as director + storyboard artist in one — turns a theme, logline, story, script or character/scene images into a complete AI short-drama prompt package — 導演意圖 (hook, narrative template, emotion curve, reversals), 資產清單 with locked visual anchors, a 10-column 分鏡總表 mapped to Clips, and one self-contained English YAML video prompt per 4–15 s Clip in the prompt-master-video-continuity YAML style, keeping characters, props and scenes consistent across clip-by-clip generation. Default look is gothic grotesque-cute dark fairy-tale cinema, overridable by any user-named style. Writes prompt TEXT only — never generates images or video and never calls a generation API. Use when the user mentions 「AI短劇」,「AI 短劇」,「微短劇」,「短劇提示詞」,「短劇分鏡」,「導演分鏡」,「導演模式」,「導演意圖」,「分段影片提示詞」,「Clip 提示詞」,「多段影片提示詞」,「暗黑童話」,「黑暗童話」,「哥德暗黑短片」, "AI short drama", "short drama prompt", "director mode", "multi-clip video prompt", "dark fairy tale film", or wants a story longer than one clip broken into consistent multi-clip video prompts. Do NOT trigger for — a single compact YAML video prompt 動態/動態生成/動態提示詞 (→ prompt-master-video-continuity); 文生影/t2v (→ prompt-master-text-to-video); 圖生影/i2v (→ prompt-master-image-to-video); text-to-image storyboard prompts 分鏡設計/分鏡建議 (→ storyboard-director); a Chinese 分鏡腳本 without video prompts (→ shot-script-director); writing a script only (→ screenwriter-architect); 九宮格 (→ prompt-master-9panel-grid); or actual generation with a named model such as seedance (→ seedance-2-0).

日本語の概要は準備中です。原文の説明を表示しています。

Kouzui-HUANG/biz-ai-video-course42026年10月27日 更新

Blocking Plan Director (運鏡平面圖導演). Turns ONE scene image (+ optional actor images) into ONE English image prompt for a top-down 90° orthographic, photoreal ArchViz 3D floor plan of that exact space with a clean vector blocking overlay - red dashed actor path through numbered marks, blue solid camera path through C1-Cn icons with field-of-view wedges and move labels, plus a legend. An actor image keeps that actor's look on the plan figure; without one a white clay mannequin (白模假人) stands in. Also outputs a zh-TW layout check and a time-coded Mark/C beat table reusable by prompt-master-video-continuity 一鏡到底. Generates immediately, prompt text only. Use when the user mentions 「運鏡平面圖」「空間動線」「走位圖」「機位圖」「動線圖」「場面調度圖」「拍攝平面圖」「俯視格局圖」, blocking diagram, camera floor plan, overhead shot plan, or wants actor/camera paths drawn on a scene. Not for 2x2 multi-view grids (prompt-master-scene-architect), 分鏡/storyboards, video prompts, or real generation with a named model.

日本語の概要は準備中です。原文の説明を表示しています。

Kouzui-HUANG/biz-ai-video-course42026年10月27日 更新

Hollywood Screenwriter & Character Architect (Oscar-grade, with a sociologist's and psychologist's acuity). Reverse-engineers living, dramatically charged characters from fragmentary clues (a line of dialogue, an accessory, or a single photo's composition and lighting) and generates THREE maximally differentiated, internally self-consistent character profile documents in Traditional Chinese — covering physical/social attributes, family background and trauma, MBTI/zodiac/blood-type coherence, speech habits & micro-expressions, plus a cinematic executive summary. Trigger when the user mentions "角色設定", "人格設定", "人物塑造", "人設", "角色檔案", "建立角色", "character profile", "character design", "persona creation", "character building", or wants to create/develop/expand a fictional character's settings or backstory. Do NOT trigger for image-generation prompt requests (portraits, character sheets, moe characters) — those belong to prompt-master-portrait / prompt-master-character-sheet / prompt-master-otaku-*.

日本語の概要は準備中です。原文の説明を表示しています。

Kouzui-HUANG/biz-ai-video-course42026年10月27日 更新

Chief Character Costume & Visual Design Director. Generates logically consistent, narratively-driven wardrobe designs for fictional characters based on their personality, background, mood, occasion, and climate. Outputs bilingual (EN/ZH) professional fashion descriptions using precise industry terminology. Use this skill when the user mentions "服裝設計", "穿搭", "角色穿什麼", "outfit", "costume", "wardrobe design", or asks what a character would wear in a given scene or context.

日本語の概要は準備中です。原文の説明を表示しています。

Kouzui-HUANG/biz-ai-video-course42026年10月27日 更新

Cultural Resonance Naming Master (文化共鳴命名大師) — a screenwriting-grade naming & renaming consultant that maps a character (or any narrative entity — faction, place, weapon, project, story title) onto a global mythological archetype and forges a name carrying metaphor, foreshadowing, and historical weight. Reads a character bio / brief, locates its psychological spectrum (chaos↔order · selfish↔altruistic · active↔passive) plus its fatal flaw and likely fate, retrieves candidate archetypes from a 12-culture Global Mythology Matrix (Chinese, Japanese, Hindu, Greco-Roman, Norse, Celtic, Slavic, Abrahamic mysticism, Egyptian, Mesopotamian, Indigenous Americas, Persian), runs an adversarial test to avoid the obvious pick, then delivers each name via naming alchemy (root recombination / concept translation) with a full cultural-resonance breakdown — archetype source, mythic backstory, and mapping logic (surface link / deep resonance with the fatal flaw & fate / cultural tension). Output analysis is in Traditional Chinese. Use when the user mentions 「命名」,「改名」,「取名」,「換名字」,「換個名字」,「角色命名」,「角色取名」,「幫角色取名」,「幫我的角色命名」,「神話命名」,「有寓意的名字」,「有典故的名字」,「賦予名字意義」,「名字的隱喻」, "naming", "rename", "renaming", "name my character", "give this character a name", "meaningful name", "mythological name", "archetypal name", or wants a story character/entity named or renamed with archetypal depth. It ONLY writes naming TEXT and its cultural analysis — it never generates images or calls any generation API. Do NOT trigger for — code identifier / variable / file naming, commercial light-novel-style work-title ideation such as 書名企劃・作品名發想・片名提案 (use lightnovel-title-architect), naming a skill or repo (use skill-creator), or pure brand-slogan / product-copy work with no narrative character behind it; and note it designs the NAME, not the character's full personality/backstory (that is character-architect — pair the two when both are needed).

日本語の概要は準備中です。原文の説明を表示しています。

Kouzui-HUANG/biz-ai-video-course42026年10月27日 更新

Kouzui-HUANG のスキルをすべて見る

このスキルの問題を報告する