mcpField
M
modelslab-video-generation

modelslab-video-generation

github.com/modelslabクリエイティブ・メディア1394 回インストール36 週間前に更新
リポジトリ

modelslab-video-generation について

modelslab-video-generationは、ModelsLab APIで動画を生成・変換するスキルです。動画制作を行うクリエイターや開発者向けに、テキスト・画像からの生成、動画変換、リップシンク、モーション制御を扱います。

主な機能

  1. 01テキストからの動画生成
  2. 02静止画の動画化
  3. 03動画から動画への変換
  4. 04音声と動画のリップシンク
  5. 05参照動画によるモーション制御
  6. 06モデル検索と非同期結果処理

活用シーン

  1. 01テキストプロンプトから短い動画を作成
  2. 02静止画に動きを付ける
  3. 03既存映像のスタイルや内容を変換
  4. 04動画内の人物の口の動きを音声に同期

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/modelslab/skills --skill modelslab-video-generation

インストール後、Claude Code で/modelslab-video-generationを入力して読み込まれたか確認します。

詳細

ModelsLab Video Generation

最先端の動画生成モデルを使用して、テキストの説明からAI動画を生成したり、静止画像をアニメーション化したり、既存の動画を変換したりできます。

このスキルを使用する場面

  • テキストの説明から動画を生成する
  • 静止画像をアニメーション化する
  • 既存の動画を変換する(動画から動画)
  • 音声を動画にリップシンクする
  • 参照動画からモーション制御を適用する
  • ショート動画コンテンツを作成する
  • 動画マーケティング素材を作成する

利用可能な API(v7)

Video Fusion エンドポイント
  • テキストから動画:POST https://modelslab.com/api/v7/video-fusion/text-to-video
  • 画像から動画:POST https://modelslab.com/api/v7/video-fusion/image-to-video
  • 動画から動画:POST https://modelslab.com/api/v7/video-fusion/video-to-video
  • リップシンク:POST https://modelslab.com/api/v7/video-fusion/lip-sync
  • モーション制御:POST https://modelslab.com/api/v7/video-fusion/motion-control
  • 結果の取得:POST https://modelslab.com/api/v7/video-fusion/fetch/{id}

Note:v6 エンドポイント(/api/v6/video/text2video など)も引き続き動作しますが、現在のバージョンは v7 です。

動画モデルの検索

# Search all video models
modelslab models search --feature video_fusion

# Search by name
modelslab models search --search "seedance"
modelslab models search --search "wan"
modelslab models search --search "veo"

# Get model details
modelslab models detail --id seedance-t2v

テキストから動画

import requests
import time

def generate_video(prompt, api_key, model_id="seedance-t2v"):
    """Generate a video from a text prompt.

    Args:
        prompt: Text description of the video
        api_key: Your ModelsLab API key
        model_id: Video model to use
    """
    response = requests.post(
        "https://modelslab.com/api/v7/video-fusion/text-to-video",
        json={
            "key": api_key,
            "model_id": model_id,
            "prompt": prompt,
            "negative_prompt": "low quality, blurry, static, distorted"
        }
    )

    data = response.json()

    if data["status"] == "error":
        raise Exception(f"Error: {data['message']}")

    if data["status"] == "success":
        return data["output"][0]

    # Video generation is async - poll for results
    request_id = data["id"]
    print(f"Video processing... Request ID: {request_id}")
    print(f"Estimated time: {data.get('eta', 'unknown')} seconds")

    return poll_video_result(request_id, api_key)

def poll_video_result(request_id, api_key, timeout=600):
    """Poll for video generation results."""
    start_time = time.time()

    while time.time() - start_time < timeout:
        fetch = requests.post(
            f"https://modelslab.com/api/v7/video-fusion/fetch/{request_id}",
            json={"key": api_key}
        )
        result = fetch.json()

        if result["status"] == "success":
            return result["output"][0]
        elif result["status"] == "failed":
            raise Exception(result.get("message", "Generation failed"))

        print(f"Status: processing... ({int(time.time() - start_time)}s elapsed)")
        time.sleep(10)

    raise Exception("Timeout waiting for video generation")

# Usage
video_url = generate_video(
    "A spaceship flying through an asteroid field, cinematic, 4K",
    "your_api_key",
    model_id="seedance-t2v"
)
print(f"Video ready: {video_url}")

画像から動画(画像のアニメーション化)

def animate_image(image_url, prompt, api_key, model_id="seedance-i2v"):
    """Animate a static image based on a motion prompt.

    Args:
        image_url: URL of the image to animate
        prompt: Description of desired motion/animation
        model_id: Video model for image-to-video
    """
    response = requests.post(
        "https://modelslab.com/api/v7/video-fusion/image-to-video",
        json={
            "key": api_key,
            "model_id": model_id,
            "init_image": [image_url],  # v7 expects array
            "prompt": prompt,
            "negative_prompt": "static, still, low quality, blurry"
        }
    )

    data = response.json()

    if data["status"] == "success":
        return data["output"][0]
    elif data["status"] == "processing":
        return poll_video_result(data["id"], api_key)
    else:
        raise Exception(data.get("message", "Unknown error"))

# Animate a landscape
video = animate_image(
    "https://example.com/landscape.jpg",
    "The clouds moving slowly across the sky, birds flying in the distance",
    "your_api_key",
    model_id="seedance-i2v"
)
print(f"Animated video: {video}")

動画から動画

def transform_video(video_url, prompt, api_key, model_id="wan2.1"):
    """Transform an existing video with a new style or content.

    Args:
        video_url: URL of the source video
        prompt: Description of desired transformation
    """
    response = requests.post(
        "https://modelslab.com/api/v7/video-fusion/video-to-video",
        json={
            "key": api_key,
            "model_id": model_id,
            "init_video": [video_url],  # v7 expects array
            "prompt": prompt
        }
    )

    data = response.json()
    if data["status"] == "processing":
        return poll_video_result(data["id"], api_key)
    elif data["status"] == "success":
        return data["output"][0]

リップシンク

def lip_sync(video_url, audio_url, api_key, model_id="lipsync-2"):
    """Sync lip movements to audio.

    Args:
        video_url: URL of the video with a face
        audio_url: URL of the audio to sync to
    """
    response = requests.post(
        "https://modelslab.com/api/v7/video-fusion/lip-sync",
        json={
            "key": api_key,
            "model_id": model_id,
            "init_video": video_url,
            "init_audio": audio_url
        }
    )

    data = response.json()
    if data["status"] == "processing":
        return poll_video_result(data["id"], api_key)
    elif data["status"] == "success":
        return data["output"][0]

人気の動画モデル ID

テキストから動画
  • seedance-t2v - Seedance テキストから動画(BytePlus)
  • seedance-1.0-pro-fast-t2v - Seedance Pro Fast
  • wan2.6-t2v - Wan 2.6 テキストから動画(Alibaba)
  • wan2.1 - Wan 2.1(ModelsLab 内製)
  • veo2 - Google Veo 2
  • veo3 - Google Veo 3
  • sora-2 - OpenAI Sora 2
  • Hailuo-2.3-t2v - Hailuo 2.3(MiniMax)
  • kling-v2-5-turbo-t2v - Kling V2.5 Turbo
画像から動画
  • seedance-i2v - Seedance 画像から動画
  • seedance-1.0-pro-i2v - Seedance Pro
  • wan2.6-i2v - Wan 2.6 画像から動画
  • Hailuo-2.3-i2v - Hailuo 2.3
  • kling-v2-1-i2v - Kling V2.1
リップシンク
  • lipsync-2 - Sync Labs Lipsync 2
モーション制御
  • kling-motion-control - Kling Motion Control
  • omni-human - OmniHuman(BytePlus)

すべてのモデルを見る:https://modelslab.com/models

主なパラメーター

パラメーター説明推奨値
model_id動画生成モデル(必須)上記のモデル一覧を参照
prompt動画の内容を説明するテキスト動きやシーンを具体的に指定
negative_prompt避ける内容"static, low quality, blurry"
init_imagei2v のソース画像(配列)["https://..."]
init_videov2v のソース動画(配列)["https://..."]
init_audioリップシンク/動画用の音声URL 文字列
width / height動画の寸法(512-1024)512、768、1024
duration動画の長さ(秒)4-30
aspect_ratioアスペクト比"16:9"、"9:16"、"1:1"
webhook非同期通知 URLURL 文字列
track_idカスタム追跡 ID任意の文字列

ベストプラクティス

1. 動きを重視したプロンプトを書く
Bad: "A cat"
Good: "A cat walking through a garden, looking around curiously, sunlight filtering through trees"

Include: Action, movement, camera motion, atmosphere
2. 現実的な期待値を設定する
  • 動画の長さは通常 4~30 秒です
  • モデルによって、生成には 30 秒から数分かかります
  • 長編作品ではなく、短いクリップに適しています
3. 非同期処理を扱う
# Video generation is ALWAYS async
# Always implement polling or use webhooks
if data["status"] == "processing":
    video = poll_video_result(data["id"], api_key)
4. Webhook を使用する
payload = {
    "key": api_key,
    "model_id": "seedance-t2v",
    "prompt": "...",
    "webhook": "https://yourserver.com/webhook/video",
    "track_id": "video_001"
}

エラー処理

try:
    video = generate_video(prompt, api_key, model_id="seedance-t2v")
    print(f"Video generated: {video}")
except Exception as e:
    print(f"Video generation failed: {e}")

リソース

関連スキル

  • modelslab-model-discovery - モデルを検索して絞り込む
  • modelslab-image-generation - img2video 用の画像を生成する
  • modelslab-audio-generation - リップシンク用の音声を生成する
  • modelslab-chat-generation - LLM モデルとチャットする
  • modelslab-webhooks - 非同期処理を効率的に扱う

コメント