Communitygithub.com

Kling AI 비디오 확장

Kling AI 연속 기능을 사용하여 비디오 길이를 확장합니다. 짧은 클립에서 더 긴 비디오를 만들거나 시퀀스를 구축할 때 사용합니다. 'klingai extend video', 'kling ai video continuation', 'klingai longer video', 'extend klingai clip' 등의 문구로 트리거합니다.

Kling AI 비디오 확장란 무엇인가요?

이 스킬은 Kling AI의 비디오 확장 API를 통해 생성된 비디오의 길이를 연장하는 방법을 제공합니다. `task_id`를 기반으로 완료된 비디오에 추가 초를 자연스럽게 연결하여 더 긴 영상을 제작할 수 있습니다. Python SDK를 사용하여 초기 비디오 생성, 확장 작업 제출, 완료 여부 폴링 및 여러 확장을 연결하는 전체 워크플로우를 자동화합니다. Kling AI Developer Portal을 통해 제공되는 이 API는 표준 및 프로페셔널 모드를 지원하며, 각 확장마다 크레딧이 소모됩니다. 주로 Claude Code, Cursor, Codex와 같은 AI 에이전트 환경에서 비디오 생성 및 편집 작업을 확장하는 데 유용합니다.

지원 대상✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/HEAD/plugins/saas-packs/klingai-pack/skills/klingai-video-extension

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Kling AI 비디오 확장은(는) 무엇을 하나요?

개요

기존 비디오에 추가 초를 추가하여 확장합니다. 확장 엔드포인트는 완료된 비디오의 task_id를 받아 자연스러운 연속을 생성합니다.

엔드포인트: POST https://api.klingai.com/v1/videos/video-extend

요청 매개변수

매개변수유형필수설명
task_idstring예완료된 소스 비디오의 작업 ID
promptstring아니요확장을 위한 움직임/장면 설명
durationstring아니요확장 길이: "5" (기본값)
modestring아니요"standard" 또는 "professional"
model_namestring아니요기본값: "kling-v2-master"
callback_urlstring아니요완료를 위한 웹훅

기본 확장

import jwt, time, os, requests

BASE = "https://api.klingai.com/v1"

def get_headers():
    ak, sk = os.environ["KLING_ACCESS_KEY"], os.environ["KLING_SECRET_KEY"]
    token = jwt.encode(
        {"iss": ak, "exp": int(time.time()) + 1800, "nbf": int(time.time()) - 5},
        sk, algorithm="HS256", headers={"alg": "HS256", "typ": "JWT"}
    )
    return {"Authorization": f"Bearer {token}", "Content-Type": "application/json"}

# 1단계: 초기 5초 비디오 생성
initial = requests.post(f"{BASE}/videos/text2video", headers=get_headers(), json={
    "model_name": "kling-v2-master",
    "prompt": "사막 풍경에서 발사되는 로켓, 시네마틱",
    "duration": "5",
    "mode": "standard",
}).json()
initial_task_id = initial["data"]["task_id"]

# 완료 대기 중...
# (task_status == "succeed"가 될 때까지 폴링)

# 2단계: 5초 더 확장
extension = requests.post(f"{BASE}/videos/video-extend", headers=get_headers(), json={
    "task_id": initial_task_id,
    "prompt": "로켓이 구름을 뚫고 성층권으로 올라갑니다",
    "duration": "5",
    "mode": "standard",
}).json()
ext_task_id = extension["data"]["task_id"]

# 3단계: 확장 작업 폴링
while True:
    time.sleep(15)
    result = requests.get(
        f"{BASE}/videos/video-extend/{ext_task_id}", headers=get_headers()
    ).json()
    if result["data"]["task_status"] == "succeed":
        extended_url = result["data"]["task_result"]["videos"][0]["url"]
        print(f"확장된 비디오: {extended_url}")
        break
    elif result["data"]["task_status"] == "failed":
        print(f"실패: {result['data']['task_status_msg']}")
        break

여러 확장 연결

def chain_extensions(initial_task_id: str, prompts: list[str],
                     duration: str = "5", mode: str = "standard") -> list[str]:
    """여러 확장을 연결하여 더 긴 비디오를 만듭니다."""
    current_task_id = initial_task_id
    video_urls = []

    for i, prompt in enumerate(prompts):
        print(f"확장 {i + 1}/{len(prompts)}: 제출 중...")

        # 확장 제출
        r = requests.post(f"{BASE}/videos/video-extend", headers=get_headers(), json={
            "task_id": current_task_id,
            "prompt": prompt,
            "duration": duration,
            "mode": mode,
        }).json()
        ext_task_id = r["data"]["task_id"]

        # 완료를 위해 폴링
        while True:
            time.sleep(15)
            result = requests.get(
                f"{BASE}/videos/video-extend/{ext_task_id}", headers=get_headers()
            ).json()
            status = result["data"]["task_status"]

            if status == "succeed":
                url = result["data"]["task_result"]["videos"][0]["url"]
                video_urls.append(url)
                current_task_id = ext_task_id  # 다음 확장이 여기서 연결됨
                print(f"확장 {i + 1} 완료: {url}")
                break
            elif status == "failed":
                raise RuntimeError(f"확장 {i + 1} 실패: {result['data']['task_status_msg']}")

    return video_urls

사용법: 20초 비디오 만들기

# 초기 5초 생성
initial_r = requests.post(f"{BASE}/videos/text2video", headers=get_headers(), json={
    "model_name": "kling-v2-master",
    "prompt": "산 호수 위의 아침 일출, 안개가 피어오름",
    "duration": "5",
    "mode": "standard",
}).json()
initial_id = initial_r["data"]["task_id"]
# ... 완료될 때까지 폴링 ...

# 3개의 추가 확장 연결 = 총 5 + 5 + 5 + 5 = 20초
extensions = chain_extensions(initial_id, [
    "해가 더 높이 뜨고, 새들이 호수 위를 날기 시작합니다",
    "사슴 한 마리가 물가로 다가와 물을 마십니다",
    "와이드 샷이 뒤로 물러나 전체 산맥을 보여줍니다",
])

비용

각 확장은 새로운 생성과 동일한 비용이 듭니다:

확장 길이표준프로페셔널
5초10 크레딧35 크레딧

20초 비디오 (초기 + 3개 확장)는 표준 모드에서 40 크레딧이 소요됩니다.

오류 처리

오류원인해결 방법
task_id 오류소스 작업이 존재하지 않음완료된 생성의 task_id인지 확인
소스가 완료되지 않음아직 처리 중인 작업 확장소스 작업이 succeed 상태가 될 때까지 대기
확장 실패프롬프트가 소스와 충돌확장 프롬프트를 원본 장면과 일치시킴

사전 요구 사항

  • 완료되고 권리가 명확하거나 합성된 소스 초안, 승인된 확장 브리프, 권한이 있는 작업 공간 및 크레딧 예산, 정책 검토, 초안 전용 대상, 롤백/제거 소유자.

지침

  1. 확장을 생성하기 전에 소스 소유권, 완료 상태, 승인된 연속성 브리프를 확인하십시오. 개인, 라이선스 없음 또는 정책 제한 자료를 사용하지 마십시오.
  2. 승인된 길이 및 크레딧 상한 내에서 워터마크된 초안 카나리 하나를 제출한 다음 정책, 권리, 품질 및 대상 제어를 확인하십시오.
  3. 연속성, 정책, 권리 또는 예산 이탈 시 중단하고 게시하는 대신 확장 작업을 삭제하십시오.
  4. 소유자 승인 후에만 홍보하십시오. 수정된 영수증을 보관하고 합의된 보존 경계에서 임시 자산을 제거하십시오.

출력

소스 작업 참조, 권리 분류, 모드/길이, 크레딧 예상, 정책 검토, 초안 대상, 승인자, 보존/제거 참조 및 작업 ID가 포함된 확장 영수증을 생성하십시오. 프롬프트, 신원 및 자산 URL은 제외하십시오.

예시

source=synthetic-task-42; rights=cleared; duration=5s; mode=standard; policy=pass; destination=draft-only; cleanup=24h는 검토에 안전합니다.

리소스

Individual skills in this repo

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

jeremylongshore/tons-of-skills-marketplace

Use when asked to structure a landing page for positioning, plan a conversion-optimized page layout, or design a launch page. Examples: "landing page for product launch", "conversion-optimized layout for SaaS

jeremylongshore/tons-of-skills-marketplace

Use when asked to design growth-optimized landing pages, activation funnel layouts, or experiment-friendly page structures. Examples: "growth-optimized landing", "activation funnel layout", "A/B testable page

jeremylongshore/tons-of-skills-marketplace

Use when asked to structure a landing page, design page layout for conversion, or plan landing page information architecture. Examples: "landing page structure for SaaS", "conversion-optimized layout

jeremylongshore/tons-of-skills-marketplace

Generate polished demo videos from a single prompt. Use when the user asks to create a demo video, product walkthrough, feature showcase, or animated presentation. Trigger with "make a demo video", "create a product video", "demo walkthrough", or "feature showcase video".

jeremylongshore/tons-of-skills-marketplace

Track cryptocurrency portfolio with real-time valuations, allocation analysis, and P&L tracking. Use when checking portfolio value, viewing holdings breakdown, analyzing allocations, or exporting portfolio data. Trigger with phrases like "show my portfolio", "check crypto holdings", "portfolio allocation", "track my crypto", or "export portfolio".

jeremylongshore/tons-of-skills-marketplace

Runs the full release workflow for the current project. Commits any uncommitted changes, pushes to remote, creates and merges a PR if on a feature branch, determines the next semver version from conventional commits, creates an annotated git tag and GitHub release with generated notes, cleans up merged branches, and returns to a clean main. Use when the user says promote, ship, release, commit and push, tag and release, or get back to main.

jeremylongshore/tons-of-skills-marketplace

Agent skill at plugins/productivity/content-multiplier/skills/channel-formats/SKILL.md

jeremylongshore/tons-of-skills-marketplace

Operate an evidence-backed editorial queue, balance topic and format coverage, schedule approved drafts, and reconcile backlog state with the publishing system. Use when choosing or scheduling the next blog work. Trigger with "show the editorial calendar" or "pick the next topic".

jeremylongshore/tons-of-skills-marketplace

Configure CI/CD pipeline for AppFolio property management integrations. Trigger: "appfolio CI".

jeremylongshore/tons-of-skills-marketplace

Diagnose and fix common AppFolio API integration errors. Trigger: "appfolio error".

jeremylongshore/tons-of-skills-marketplace

Build property management dashboard with AppFolio API data. Trigger: "appfolio property dashboard".

jeremylongshore/tons-of-skills-marketplace

Automate tenant management and lease operations with AppFolio. Trigger: "appfolio tenant management".

jeremylongshore/tons-of-skills-marketplace

Collect AppFolio API debug evidence for support tickets. Trigger: "appfolio debug".

jeremylongshore/tons-of-skills-marketplace

Deploy AppFolio integration service to cloud infrastructure. Trigger: "deploy appfolio".

jeremylongshore/tons-of-skills-marketplace

Query AppFolio properties, units, and tenants via REST API. Trigger: "appfolio hello world".

jeremylongshore/tons-of-skills-marketplace

Configure AppFolio Stack API authentication with OAuth 2.0. Use when setting up property management API access, registering as an AppFolio Stack partner, or configuring client credentials for API calls. Trigger: "install appfolio", "setup appfolio", "appfolio auth", "appfolio API key".

jeremylongshore/tons-of-skills-marketplace

Set up local development for AppFolio property management API integration. Trigger: "appfolio local dev".

jeremylongshore/tons-of-skills-marketplace

Production readiness checklist for AppFolio integrations. Trigger: "appfolio production checklist".

jeremylongshore/tons-of-skills-marketplace

Handle AppFolio API rate limits with throttling and backoff. Trigger: "appfolio rate limit".

jeremylongshore/tons-of-skills-marketplace

Reference architecture for AppFolio property management integration. Trigger: "appfolio architecture".

관련 스킬