Communitygithub.com

AI 多模態技能

使用 Gemini API 分析圖片、音訊、影片(視覺能力優於 Claude),並可生成圖片(Imagen 4)與影片(Veo 3)。適用於視覺分析、語音辨識、光學字元辨識、設計萃取及多模態 AI 任務。

AI 多模態技能 是什麼?

這是一個專為 AI 代理(如 Claude Code、Cursor、Codex)設計的多模態技能,整合 Google Gemini API,提供強大的視覺分析與內容生成能力。它支援分析圖片、音訊、影片和文件,並能生成高品質圖片(Imagen 4)與影片(Veo 3)。技能包含多個實用腳本:`gemini_batch_process.py` 作為 CLI 編排器,自動解析 API 金鑰、選擇最佳模型、處理檔案串流並輸出結構化結果;`media_optimizer.py` 使用 ffmpeg/Pillow 壓縮、調整媒體檔案以符合 API 限制;`document_converter.py` 將文件轉換為 Markdown 格式;`check_setup.py` 則驗證環境就緒狀態。特別適合需要超越 Claude 視覺限制的場景,例如精細圖像分析、長音頻/長影片轉錄(超過 15 分鐘時自動分段處理)。支援多 API 金鑰輪換以應對高用量或速率限制,並提供 stdin 管道支援。參考文件涵蓋音樂生成、音訊處理、視覺理解、圖片生成、影片分析與影片生成等主題。

相容平台✓Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/majiayu000/claude-skill-registry-data/tree/HEAD/ai-ml/ai-multimodal-hoanghd218-landing-page-ai-kien

在你喜歡的 AI 中提問

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

說明文件

AI 多模態

使用 Google Gemini 多模態 API 處理音訊、圖片、影片、文件,並生成圖片與影片。

設定

export GEMINI_API_KEY="your-key"  # 從 https://aistudio.google.com/apikey 取得
pip install google-genai python-dotenv pillow

API 金鑰輪換 (選擇性)

若需高用量使用或遇到速率限制,可設定多組 API 金鑰:

# 主要金鑰 (必要)
export GEMINI_API_KEY="key1"

# 額外金鑰 (選擇性)
export GEMINI_API_KEY_2="key2"
export GEMINI_API_KEY_3="key3"

或在 .env 檔案中:

GEMINI_API_KEY=key1
GEMINI_API_KEY_2=key2
GEMINI_API_KEY_3=key3

功能特色:

  • 遇到速率限制錯誤 (429/RESOURCE_EXHAUSTED) 時自動輪換
  • 每組金鑰在速率限制後冷卻 60 秒
  • 使用 --verbose 標記記錄輪換事件
  • 向下相容:單一金鑰仍可運作

快速入門

驗證設定:python scripts/check_setup.py 分析媒體:python scripts/gemini_batch_process.py --files <檔案> --task <analyze|transcribe|extract>

  • 提示:當你被要求分析圖片時,先檢查 gemini 指令是否可用,若可用則使用 echo "<分析圖片的提示>" | gemini -y -m <gemini.model> 指令(從 .claude/.ck.json 讀取模型:gemini.model)。若 gemini 指令不可用,則使用 python scripts/gemini_batch_process.py --files <檔案> --task analyze 指令。 生成內容:python scripts/gemini_batch_process.py --task <generate|generate-video> --prompt "描述"

stdin 支援:你可以透過 stdin 直接傳遞檔案(自動偵測 PNG/JPG/PDF/WAV/MP3)。

  • cat image.png | python scripts/gemini_batch_process.py --task analyze --prompt "描述這個"
  • python scripts/gemini_batch_process.py --files image.png --task analyze (傳統方式)

模型

  • 圖片生成:imagen-4.0-generate-001 (標準)、imagen-4.0-ultra-generate-001 (品質)、imagen-4.0-fast-generate-001 (速度)
  • 影片生成:veo-3.1-generate-preview (8 秒片段含音訊)
  • 分析:gemini-2.5-flash (建議)、gemini-2.5-pro (進階)

腳本

  • gemini_batch_process.py:用於 transcribe|analyze|extract|generate|generate-video 的 CLI 編排器,可自動解析 API 金鑰、針對任務選取合理的預設模型、串流內聯檔案或使用 File API,並儲存結構化輸出(文字/JSON/CSV/Markdown 以及生成的資產)以支援 Imagen 4 + Veo 工作流程。
  • media_optimizer.py:基於 ffmpeg/Pillow 的前置處理工具,可壓縮/調整大小/轉換音訊、圖片和影片輸入,強制目標大小/碼率,將長片段分割為一小時區塊,並批次處理目錄,確保媒體檔案符合 Gemini 限制。
  • document_converter.py:基於 Gemini 的轉換器,可上傳 PDF/圖片/Office 文件,套用保留 Markdown 格式的提示,批次處理多個檔案,在 docs/assets 下自動命名輸出,並提供 CLI 標記用於模型、提示、自動檔案命名與詳細日誌。
  • check_setup.py:互動式就緒檢查器,驗證目錄結構、集中式環境變數解析器、必要的 Python 依賴項及 GEMINI_API_KEY 的可用性/格式,接著執行即時 Gemini API 呼叫,並在出現問題時列印修復指引。

使用 --help 檢視選項。

參考資料

載入以取得詳細指引:

主題檔案說明
音樂references/music-generation.mdLyria RealTime API,用於背景音樂生成、風格提示、即時控制、與影片製作整合。
音訊references/audio-processing.md音訊格式與限制、轉錄(時間戳、說話者、段落)、非語音分析、File API 與內聯輸入、TTS 模型、最佳實務、成本與 Token 計算,以及具體的會議/播客/訪談實例。
圖片references/vision-understanding.md視覺能力總覽、支援的格式與模型、標註/分類/VQA、偵測與分割、OCR 與文件閱讀、多圖片工作流程、結構化 JSON 輸出、Token 成本、最佳實務,以及常見產品/螢幕截圖/圖表/場景使用案例。
圖片生成references/image-generation.mdImagen 4 與 Gemini 圖片模型總覽、generate_images 與 generate_content API、長寬比與成本、文字/圖片/兩者模式、編輯與合成、風格與品質控制、安全設定、最佳實務、疑難排解,以及常見行銷/概念藝術/UI 情境。
影片references/video-analysis.md影片分析能力與支援格式、模型/上下文選擇、本地/內聯/YouTube 輸入、片段與 FPS 控制、多影片比較、時間問答與場景偵測、結合視覺上下文的轉錄、Token 與成本指引,以及最佳化/最佳實務模式。
影片生成references/video-generation.mdVeo 模型矩陣、文字轉影片與圖片轉影片快速入門、多參考與延伸流程、攝影機與時間控制、設定(解析度、長寬比、音訊、安全)、提示設計模式、效能提示、限制、疑難排解與成本估算。

限制

格式:音訊 (WAV/MP3/AAC, 9.5 小時)、圖片 (PNG/JPEG/WEBP, 3,600 張)、影片 (MP4/MOV, 6 小時)、PDF (1,000 頁) 大小:內聯 20MB,File API 2GB 重要事項:

  • 如果要生成音訊轉錄稿,且音訊長度超過 15 分鐘,由於 Gemini API 回應的輸出 Token 限制,轉錄稿經常會被截斷。為取得完整轉錄稿,你必須將音訊分割成較小的區塊(每個區塊最多 15 分鐘),並逐段轉錄以獲得完整文字。
  • 如果要生成影片轉錄稿,且影片長度超過 15 分鐘,請使用 ffmpeg 從影片中擷取音訊,將音訊截短為 15 分鐘,轉錄所有音訊片段,再將各段轉錄稿合併為一份。 轉錄輸出要求:
  • 格式:Markdown
  • 中繼資料:持續時間、檔案大小、產生日期、說明、檔案名稱、涵蓋主題等
  • 段落:起迄時間 (例如 00:00-00:15)、音訊區塊名稱、轉錄稿、狀態等
  • 轉錄格式:
    [HH:MM:SS -> HH:MM:SS] 轉錄內容
    [HH:MM:SS -> HH:MM:SS] 轉錄內容
    ...
    

資源

Individual skills in this repo

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

majiayu000/claude-skill-registry-data

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry-data

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry-data

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry-data

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry-data

Analyzes current state and user query to answer BMad questions or recommend the next workflow or agent. Use when user says what should I do next, what do I do now, or asks a question about BMad

majiayu000/claude-skill-registry-data

Build AI agents with Google ADK Python (Agent Development Kit). Use for multi-agent systems, workflow agents (sequential/parallel/loop), Vertex AI deployment, tool integration, human-in-the-loop.

majiayu000/claude-skill-registry-data

Build AI agents with Google ADK Python (Agent Development Kit). Use for multi-agent systems, workflow agents (sequential/parallel/loop), Vertex AI deployment, tool integration, human-in-the-loop.

majiayu000/claude-skill-registry-data

Portfolio allocation and rebalancing optimizer. Manages asset allocation across stocks/cash/bonds, performs periodic rebalancing, and ensures diversification according to market regime and risk tolerance.

majiayu000/claude-skill-registry-data

Create a hilarious and ultra-realistic video of an anthropomorphic animal acting like a human vlogger in a real-world setting.

majiayu000/claude-skill-registry-data

Speech-to-text transcription and translation via OpenAI Audio API -- models, response formats, timestamps, prompting, streaming, chunking, and diarization

majiayu000/claude-skill-registry-data

This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.

majiayu000/claude-skill-registry-data

小省导购员数字人带货版即梦视频提示词生成系统,基于四大智能体协同(提示词生成师、质量管控师、知识库运维师、跨环节适配师),按照"主体+运动+场景+(镜头语言+光影+氛围)"公式输出中英文双版提示词,适配5s短视频。确保人物一致性、视觉连贯性、情绪连贯性,支持知识库智能复用和跨工具适配(Suno音乐、AI绘画),为数字人带货视频提供高质量提示词生成服务。

majiayu000/claude-skill-registry-data

Upload and manage files using Google Gemini File API via scripts/. Use for uploading images, audio, video, PDFs, and other files for use with Gemini models. Supports file upload, status checking, and file management. Triggers on "upload file", "file API", "upload image", "upload PDF", "upload video", "file management".

majiayu000/claude-skill-registry-data

Analyze images/audio/video with Gemini API (better vision than Claude). Generate images (Imagen 4), videos (Veo 3). Use for vision analysis, transcription, OCR, design extraction, multimodal AI.

majiayu000/claude-skill-registry-data

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

majiayu000/claude-skill-registry-data

Conduct domain and industry research. Use when the user says "lets create a research report on [domain or industry]

majiayu000/claude-skill-registry-data

Conduct market research on competition and customers. Use when the user says "create a market research report about [business idea]".

majiayu000/claude-skill-registry-data

Conduct technical research on technologies and architecture. Use when the user says "create a technical research report on [topic]".

majiayu000/claude-skill-registry-data

Understand an existing codebase through systematic exploration

majiayu000/claude-skill-registry-data

Builds, edit or validate Agent Skill through conversational discovery. Use when the user requests to "Create an Agent", "Optimize an Agent" or "Edit an Agent".

相關技能