Communitygithub.com

ComeOnOliver/skillshub

マルチショットAI動画生成パイプライン。顔の一貫性を保ちながら、スクリプトやアイデアから完全な動画を生成します。キャラクター抽出、ストーリーボード、フレーム生成、動画アセンブリを実行。300回の実験で検証済み、顔の距離指標を70%改善。

skillshub とは?

このスキルは、テキストのスクリプトやアイデアから、複数のショットで構成された動画を自動生成するパイプライン「ViMax」を提供します。最大の特徴は、すべてのショットでキャラクターの顔の一貫性を保つことにあり、257回の実験により顔の距離指標を70%改善(0.74→0.22)しています。パイプラインは、キャラクター抽出、ポートレート生成、ストーリーボード作成、フレーム生成、動画クリップ生成、最終的な動画の連結という一連のステップを自動実行します。HappyCapy AI Gateway上で動作し、画像生成にはGemini、動画生成にはVeoを使用します。開発者はスクリプトを入力するだけで、顔の一貫性が保たれた高品質な動画を取得できます。

対応~Claude Code✓Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/happycapy-ai/Happycapy-skills/capy-video-gen-skill

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Capy Video Gen Skill - スクリプトから動画へのパイプライン

スクリプトやアイデアから、すべてのシーンで一貫したキャラクターの顔を持つマルチショット動画を生成します。HappyCapy AI Gateway用に構築。300回の実験で検証済み、顔の距離指標を70%改善。

概要

ViMaxはテキストスクリプトを完全な動画に変換する自動パイプラインです。

  1. 詳細な身体的特徴を含むキャラクターをスクリプトから抽出
  2. 正面/横/後ろのキャラクターポートレートを生成
  3. ショットごとのストーリーボードを設計
  4. 各ショットを最初のフレーム、最後のフレーム、モーション記述に分解
  5. ショット関係のカメラツリーを構築
  6. 参照画像選択(顔の同一性を最優先)でフレームを生成
  7. フレームから動画クリップを生成
  8. 最終動画に連結

インストール場所

ViMaxパイプラインコードのパス: /home/node/a0/workspace/527fb591-1439-4b5b-ad5d-90f972773f95/workspace/tmp/ViMax/

すべてのコマンドはこのディレクトリからvenvを使用して実行する必要があります。

cd /home/node/a0/workspace/527fb591-1439-4b5b-ad5d-90f972773f95/workspace/tmp/ViMax

前提条件

  • AI_GATEWAY_API_KEY 環境変数(HappyCapyでは自動設定)
  • .venv/ にあるPython venv(既に設定済み)

クイックスタート

スクリプトから動画へ

エントリスクリプトでスクリプト、要件、スタイルを編集し、次を実行:

cd /home/node/a0/workspace/527fb591-1439-4b5b-ad5d-90f972773f95/workspace/tmp/ViMax
.venv/bin/python main_happycapy_script2video.py

アイデアから動画へ

簡潔なアイデアから生成する場合(最初にスクリプトを自動生成):

cd /home/node/a0/workspace/527fb591-1439-4b5b-ad5d-90f972773f95/workspace/tmp/ViMax
.venv/bin/python main_happycapy_idea2video.py

プログラムでの使用

import asyncio
from langchain.chat_models import init_chat_model
from tools.render_backend import RenderBackend
from utils.config_loader import load_config
from pipelines.script2video_pipeline import Script2VideoPipeline

config = load_config("configs/happycapy_script2video.yaml")
chat_model = init_chat_model(**config["chat_model"]["init_args"])
backend = RenderBackend.from_config(config)

pipeline = Script2VideoPipeline(
    chat_model=chat_model,
    image_generator=backend.image_generator,
    video_generator=backend.video_generator,
    working_dir=config["working_dir"],
)

# パイプラインを実行
asyncio.run(pipeline(
    script="ここにスクリプトを記述...",
    user_requirement="合計8ショット以内。",
    style="シネマティック、暖かい照明"
))

パイプライン

Script2VideoPipeline

  • 入力: キャラクターのダイアログとシーン説明を含むフォーマット済みスクリプト
  • 出力: {working_dir}/final_video.mp4 に連結された動画
  • 設定: configs/happycapy_script2video.yaml

Idea2VideoPipeline

  • 入力: 簡潔なアイデア/コンセプト(1~3段落)
  • 出力: スクリプトを自動生成し、その後動画を生成
  • 設定: configs/happycapy_idea2video.yaml

設定

configs/happycapy_script2video.yaml のHappyCapy設定:

chat_model:
  init_args:
    model: gpt-4.1
    model_provider: openai
    api_key: ${AI_GATEWAY_API_KEY}
    base_url: https://ai-gateway.happycapy.ai/api/v1/openai/v1

image_generator:
  class_path: tools.ImageGeneratorHappyCapyAPI
  init_args:
    api_key: ${AI_GATEWAY_API_KEY}
    model: google/gemini-3.1-flash-image-preview

video_generator:
  class_path: tools.VideoGeneratorHappyCapyAPI
  init_args:
    api_key: ${AI_GATEWAY_API_KEY}
    model: google/veo-3.1-generate-preview

working_dir: .working_dir/script2video

主要コンポーネント

エージェント(AI処理)

エージェントファイル目的
CharacterExtractoragents/character_extractor.pyスクリプトから静的/動的特徴を持つキャラクターを抽出
CharacterPortraitsGeneratoragents/character_portraits_generator.py各キャラクターの正面/横/後ろポートレートを生成
StoryboardArtistagents/storyboard_artist.py最初/最後のフレームとモーションを含むショットごとのストーリーボードを設計
ReferenceImageSelectoragents/reference_image_selector.py各フレームに最適な参照画像を選択(顔の同一性を最優先)
CameraImageGeneratoragents/camera_image_generator.pyカメラツリーを構築し、遷移動画を生成
BestImageSelectoragents/best_image_selector.py候補から最適な生成画像を選択
Screenwriteragents/screenwriter.pyアイデアからスクリプトを生成

ツール(生成バックエンド)

ツールファイル目的
ImageGeneratorHappyCapyAPItools/image_generator_happycapy_api.pyHappyCapy Gateway(Gemini)経由の画像生成
VideoGeneratorHappyCapyAPItools/video_generator_happycapy_api.pyHappyCapy Gateway(Veo)経由の動画生成
RenderBackendtools/render_backend.py設定からジェネレーターをインスタンス化するファクトリ

インターフェース(データモデル)

  • CharacterInScene - 識別子、static_features、dynamic_featuresを持つキャラクター
  • ShotDescription - ff_desc、lf_desc、motion_desc、variation_typeを持つショット
  • Camera - 親子関係を持つカメラ
  • Frame - shot_idx、frame_type、可視キャラクターを持つフレーム
  • ImageOutput / VideoOutput - 保存メソッドを持つ生成出力

顔の同一性の一貫性(重要)

このパイプラインには、257回の実験で検証された顔の同一性の改善が含まれています(顔の距離指標を70%改善、0.74から0.22へ)。

組み込みの保護機能

  1. 参照画像セレクター: 参照画像を選択する際、顔の同一性が最優先事項です。キャラクターの顔が見える場合、正面ポートレートは常に含まれます。

  2. キャラクターポートレート: 拡張されたプロンプトにより、シーンをまたいだ認識のための同一性に重要な詳細(正確な鼻の形状、目の間隔、顎のライン、識別マーク)が生成されます。

  3. 動画プロンプト顔ロック: すべての動画生成プロンプトには、クリップ全体を通じてキャラクターの顔が開始フレームと同一であることを要求する顔同一性指示が前置されます。

ViMax使用時のベストプラクティス

  • 超詳細なキャラクター説明: 人種、年齢、髪の質感/スタイル/色、目の形、顔の毛、眼鏡、肌のトーン、体格、識別マークをスクリプトのキャラクター紹介に含める
  • 極端なクローズアップショット: キャラクターごとに少なくとも1つの極端なクローズアップを含めて同一性を固定する
  • 一貫した照明: シーン間で同様の照明を指定して顔のドリフトを防ぐ
  • ユーザー提供の参照写真: 写真を作業ディレクトリに配置し、character_portraits_registry として渡すとAIポートレート生成をスキップできる

機能しないもの

  • 複雑なプロンプトエンジニアリング(ビセームモーフィング、フォニームアンカリング)は顔の同一性を改善しない
  • 詳細な身体的特徴を含むシンプルで直接的なプロンプトが、巧妙なプロンプトよりも優れている
  • 外部オーディオへのリップシンクは不可能(Veoは内部オーディオを独自に生成する)

詳細はViMaxディレクトリの FACE_IDENTITY_GUIDE.md を参照。

出力構造

実行後、作業ディレクトリには以下が含まれます:

.working_dir/script2video/
  characters.json                      # 抽出されたキャラクター
  character_portraits_registry.json    # ポートレートパスレジストリ
  character_portraits/                 # 生成されたポートレート
    0_CharacterName/
      front.png
      side.png
      back.png
  storyboard.json                     # ショット説明
  camera_tree.json                    # カメラの関係
  shots/
    0/
      shot_description.json
      first_frame.png
      last_frame.png (中/大バリエーションの場合)
      video.mp4
    1/
      ...
  final_video.mp4                     # 最終的な連結出力

カスタマイズ

独自の参照写真を使用する

AI生成ポートレートの代わりに実際の写真を使用するには:

# 写真を指すポートレートレジストリを構築
character_portraits_registry = {
    "Alice": {
        "front": {"path": "/path/to/alice_front.png", "description": "Aliceの正面図"},
        "side": {"path": "/path/to/alice_side.png", "description": "Aliceの側面図"},
        "back": {"path": "/path/to/alice_back.png", "description": "Aliceの背面図"},
    }
}

# パイプラインに渡す(ポートレート生成をスキップ)
await pipeline(
    script=script,
    user_requirement=user_requirement,
    style=style,
    character_portraits_registry=character_portraits_registry,
)

モデルの変更

YAML設定を編集して異なるモデルを使用:

  • 画像: google/gemini-3.1-flash-image-preview(顔の同一性に推奨)
  • 動画: google/veo-3.1-generate-preview(推奨)または openai/sora-2
  • チャット: gpt-4.1(推奨)または任意のOpenAI互換モデル

トラブルシューティング

「No module named 'tools'」などのインポートエラー

ViMaxルートディレクトリから実行:

cd /home/node/a0/workspace/527fb591-1439-4b5b-ad5d-90f972773f95/workspace/tmp/ViMax
.venv/bin/python main_happycapy_script2video.py

APIレート制限エラー

YAML設定で max_requests_per_minute を減らす。

生成動画での顔の同一性ドリフト

  • スクリプトのキャラクター説明に身体的特徴の詳細を追加
  • AI生成ポートレートの代わりにユーザー提供の参照写真を使用
  • 重要なキャラクターには極端なクローズアップショットを含める
  • シーン間で照明を一貫させる

Individual skills in this repo

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

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

関連スキル