Skip to content

rdcrystallab/openrouter-image-gen

v1.0.0MIT

透過 OpenRouter API 生成圖片,支援 Flux、Gemini、GPT-5 Image 等多種模型。需要 OPENROUTER_API_KEY 環境變數。

openrouter-image-gen

透過 OpenRouter API 生成圖片,支援 Flux、Gemini、GPT-5 Image 等多種模型。

原作者:Burke Holland

支援模型

模型費用最適合
google/gemini-2.5-flash-image最便宜通用、快速、品質好
google/gemini-3.1-flash-image-preview延伸長寬比、支援 0.5K
google/gemini-3-pro-image-preview更高品質 Gemini
black-forest-labs/flux.2-pro寫實攝影風格
black-forest-labs/flux.2-max最高品質 Flux
openai/gpt-5-image-mini中高GPT 級提示詞理解
openai/gpt-5-image最佳提示詞跟隨 + 推理
bytedance-seed/seedream-4.5ByteDance 圖像生成

設定

取得 OpenRouter API 金鑰:openrouter.ai/keys

將金鑰設為環境變數:

export OPENROUTER_API_KEY=your-key-here

使用

在 Claude Code 中直接描述你想要的圖片,例如:

  • 「幫我生成一張 16:9 的 YouTube 縮圖,主題是...」
  • 「建立一張手繪風格的架構圖...」
  • 「把這張圖片的天空改成紫色」