Community影像github.com

dotslashsimran/image-gen

使用使用者自己的 API 金鑰(Google Gemini「Nano Banana」或 OpenAI gpt-image)生成圖片。當被要求生成、創作或製作圖片、插圖、圖示、剪影、貼紙、縮圖、紋理、模型或視覺資產,編輯圖片,或製作多張風格一致(相同角色或物體)的圖片時使用。vox-explainer 技能也用它來製作拼貼剪影。

image-gen 是什麼?

此技能讓 AI 助手能直接使用使用者自己的 API 金鑰(支援 Google Gemini 和 OpenAI gpt-image 模型)生成與編輯圖片。它透過一個純 Python 指令碼執行,僅依賴標準函式庫,因此相容於任何 Python 3 環境。技能的核心優勢在於安全地管理 API 金鑰、支援多種圖片生成需求(如變體、指定長寬比、參考圖片、去背輸出),並提供一個清晰的指令集來控制生成過程。透過 `--ref` 參數,使用者可以保持角色或物體在系列圖片中的一致性;而 `--cutout` 參數則能產生透明背景 PNG,非常適合拼貼與合成。該技能也內建了品牌套件整合與詳細的提示最佳實踐,協助使用者產出高品質、風格統一的視覺資產。

相容平台~Claude Code✓Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/dotslashsimran/simcraft/tree/HEAD/skills/image-gen

Installed? Explore more 影像 skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

圖片生成

python3 ~/simcraft/skills/image-gen/scripts/gen_image.py "<提示詞>" --out <目錄> --name <檔名> [選項]

僅使用標準函式庫,因此任何 python3 都可運行。

金鑰

此指令碼會從環境變數或 ~/.config/simcraft/keys.env 檔案(每行一個 NAME=value,權限設為 600)中讀取 GEMINI_API_KEY 和 OPENAI_API_KEY。

  • 執行 --check 可查看已設定哪些金鑰。它絕不會印出金鑰內容。
  • 如果未設定任何金鑰,請告知使用者自行開啟檔案(open -e ~/.config/simcraft/keys.env)並貼入金鑰。切勿要求他們將金鑰貼到對話中,也不要從其他專案的檔案中讀取金鑰。
  • 金鑰僅用於請求標頭。絕不應出現在 URL、日誌或側車檔案中。
  • 取得 Gemini 金鑰:前往 aistudio.google.com/apikey(有免費方案)。取得 OpenAI 金鑰:前往 platform.openai.com/api-keys。

選項

選項功能說明
--n 4並行生成 4 個變體,外加 <name>_sheet.png 供挑選。任何重要的生成都請使用此選項。
--aspect 16:9設定圖片形狀:16:9、9:16、1:1、4:3 或 3:4。配合圖片的放置位置選擇。
--ref a.png b.png參考圖片。用於編輯圖片、匹配風格,或在不同圖片間保持相同的角色或物體。
--cutout生成適用於拼貼的透明 PNG。若使用 Gemini,會在綠幕上生成並由指令碼以乾淨邊緣去背;若使用 OpenAI,則直接生成真正的透明背景圖片。
--provider gemini|openai選擇提供商。預設:若已設定 Gemini 金鑰,則使用 Gemini。
--model M選擇模型。預設情況下,Gemini 會選擇金鑰可用的最新圖片模型(--models 可列出所有模型),OpenAI 則使用 gpt-image-2。
--quality low|medium|high僅適用於 OpenAI。預設為高。
--brand devin將品牌套件的圖片風格與色板加入提示詞中。任何品牌相關的工作,請先執行品牌套件技能。

每張圖片都會生成一個 <name>.json 側車檔案,其中包含確切的提示詞、模型與設定,方便日後重新生成或微調。

選擇哪個提供商

  • Gemini: 快速且便宜。最適合迭代、編輯圖片,以及使用 --ref 保持一致性。
  • OpenAI gpt-image: 最適合含有文字的圖片,以及需要真正透明去背的圖片。

提示技巧

  • 依序描述主體、媒介、光線與構圖。說明要排除的內容。
  • 圖片中不應包含文字,除非使用者明確要求。模型仍容易拼錯單字。後續請在程式碼中加入文字。
  • 若要製作一系列圖片,請先生成一張錨點圖片。然後將這張錨點圖片作為 --ref 傳給其他所有圖片。切勿將第二張圖片串接到第三張,因為小錯誤會累積。
  • 在使用圖片前,先向使用者展示預覽總表。只重新生成其中一個變體,而非全部。

Individual skills in this repo

This repo contains 3 individual skills — each has its own dedicated page.

dotslashsimran/clean-audio

Clean up voice audio in a video: rumble, electrical hum, background noise and hiss, muddy or harsh tone, sharp S sounds, uneven volume, and loudness for YouTube/Instagram/TikTok. Measures the audio first, picks the strongest cleanup that doesn't make the words less clear, and keeps lip sync exact. Use when the user says "clean up the audio", "fix the sound", "remove background noise", "remove hum", "my audio is too quiet/loud", "make it sound better", or after a rough cut.

dotslashsimran/perspective-illusion

Make a looping illustrated 3D video that plays with perception, the way Japanese illusion artists do (e.g. @garments__): a scene squashed flat by a telephoto lens morphs into deep perspective, things that looked side by side turn out to be at different depths, and objects quietly swap position while the view is flat. Also for recreating a reference illusion video, or a new scene (street, supermarket, station, room) in that style. Use when asked for a perspective/optical-illusion video, a "dolly zoom" or "flat to 3D" effect, or to recreate one of these clips.

dotslashsimran/rough-cut

Trim the fat from raw talking footage. Turns raw video into a tight first cut by removing dead air, ums and uhs, stutters, false starts and bad takes (keeping the last good take), then checks the result by listening to it again. Use when the user says "rough cut", "first cut", "trim the fat", "cut the pauses", "remove the ums", "cut my retakes", "make it snappy", or hands over raw footage to edit.

相關技能