giggle-generation-drama

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

⚠️ Review Before Installing

⚠️ 安装前须知

Please review before installing. This skill will:
  1. Network – Calls Giggle.pro API for video generation
Requirements:
python3
,
GIGGLE_API_KEY
(system environment variable), pip packages:
requests
No Retry on Error: If script execution encounters an error, do not retry. Report the error to the user directly and stop.

请在安装前仔细阅读。 本Skill将:
  1. 网络 – 调用Giggle.pro API生成视频
要求
python3
GIGGLE_API_KEY
(系统环境变量)、pip包:
requests
错误时不重试:如果脚本执行遇到错误,请勿重试。直接向用户报告错误并停止。

Required Setup Before First Use

首次使用前的必要设置

Before performing any operation, confirm the user has configured the API Key to avoid workflow failure due to auth errors.
  • API Key: Log in to Giggle.pro and obtain the API Key from account settings.
  • Configuration: Set system environment variable
    GIGGLE_API_KEY
    • export GIGGLE_API_KEY=your_api_key
Verification steps:
  1. Confirm the user has configured
    GIGGLE_API_KEY
    in system environment.
  2. If not configured, guide the user:
    Hello! Before using the video generation feature, you need to configure the API Key. Please go to Giggle.pro to get your API Key, then run
    export GIGGLE_API_KEY=your_api_key
    in the terminal.
  3. Wait for the user to configure before continuing the workflow.
在执行任何操作之前,请确认用户已配置API Key,避免因认证错误导致工作流失败。
  • API Key:登录Giggle.pro,从账户设置中获取API Key。
  • 配置:设置系统环境变量
    GIGGLE_API_KEY
    • export GIGGLE_API_KEY=your_api_key
验证步骤
  1. 确认用户已在系统环境中配置
    GIGGLE_API_KEY
  2. 如果未配置,引导用户
    您好!在使用视频生成功能前,您需要配置API Key。请前往Giggle.pro获取您的API Key,然后在终端中运行
    export GIGGLE_API_KEY=your_api_key
  3. 等待用户完成配置后再继续工作流。

Generation Modes

生成模式

Supports three modes. Ask the user to select a mode before starting the workflow. If not specified, default to Episodes mode (
director
).
Modeproject_typeDescription
Episodes
director
AI-directed short drama with storyboards and shot language
Narration
narration
Narration-focused video
Short Film
short-film
Story and visuals balanced; cinematic short film
支持三种模式。在启动工作流前,请让用户选择一种模式。如果未指定,默认使用剧集模式
director
)。
模式project_type描述
剧集模式
director
AI执导的短剧,包含故事板和镜头语言
旁白模式
narration
以旁白为主的视频
短片模式
short-film
故事与视觉效果平衡;电影质感短片

Main Workflow: execute_workflow

主要工作流:execute_workflow

Use
execute_workflow
to run the full workflow: submit + poll + auto-pay (if needed) + wait for completion. Call once and wait for return.
  1. Submit task
  2. Poll progress every 3 seconds
  3. Detect pending payment and auto-pay (if needed)
  4. Wait for completion (max 1 hour)
  5. Return video download link or error
使用
execute_workflow
运行完整工作流:提交 + 轮询 + 自动支付(如有需要) + 等待完成。调用一次并等待返回。
  1. 提交任务
  2. 每3秒轮询一次进度
  3. 检测待支付状态并自动支付(如有需要)
  4. 等待完成(最长1小时)
  5. 返回视频下载链接或错误信息

Function Signature

函数签名

python
execute_workflow(
    diy_story: str,                           # Story/script content (required)
    aspect: str,                              # Aspect ratio: 16:9 or 9:16 (required)
    project_name: str,                        # Project name (required)
    video_duration: str = "auto",             # Duration, default "auto" (optional)
    style_id: Optional[int] = None,          # Style ID (optional)
    project_type: str = "director",           # Mode, default "director" (optional)
    character_info: Optional[List[Dict]] = None  # Character images (optional)
)
python
execute_workflow(
    diy_story: str,                           # 故事/脚本内容(必填)
    aspect: str,                              # 宽高比:16:9 或 9:16(必填)
    project_name: str,                        # 项目名称(必填)
    video_duration: str = "auto",             # 时长,默认值为"auto"(可选)
    style_id: Optional[int] = None,          # 风格ID(可选)
    project_type: str = "director",           # 模式,默认值为"director"(可选)
    character_info: Optional[List[Dict]] = None  # 角色图片(可选)
)

Parameter Description

参数说明

ParameterRequiredDescription
diy_storyyesStory or script content
aspectyesAspect ratio:
16:9
or
9:16
project_nameyesProject name
video_durationno
auto
,
30
,
60
,
120
,
180
,
240
,
300
; default
"auto"
style_idnoStyle ID; omit if not specified
project_typeno
director
/
narration
/
short-film
; default
"director"
character_infonoCharacter image list:
[{"name": "Character name", "url": "Image URL"}, ...]
参数是否必填描述
diy_story故事或脚本内容
aspect宽高比:
16:9
9:16
project_name项目名称
video_duration
auto
30
60
120
180
240
300
;默认值为
"auto"
style_id风格ID;未指定则省略
project_type
director
/
narration
/
short-film
;默认值为
"director"
character_info角色图片列表:
[{"name": "角色名称", "url": "图片URL"}, ...]

Usage Flow

使用流程

  1. Introduce and select generation mode (required): Before generating, must introduce the three modes and let the user choose. Display:
    We support three video generation modes. Please choose:
    Episodes (director): AI director handles storyboards and shot language. Good for short drama with dialogue and plot.
    Narration (narration): Narration-focused with visuals. Good for knowledge sharing, news commentary, product introductions.
    Short Film (short-film): Story and visuals balanced; cinematic shots and pacing. Good for emotional shorts, creative stories, artistic expression.
    Wait for explicit user choice before continuing. If not specified, default to Episodes.
  2. If the user wants to pick a style: Call
    get_styles()
    for the style list; show ID, name, category, description; wait for choice before continuing.
  3. If the user provides character image URLs: Build
    character_info
    array with
    name
    and
    url
    per character.
  4. Run workflow:
    • Call
      execute_workflow()
      with story, aspect ratio, project name.
    • Set
      project_type
      per chosen mode; pass
      video_duration
      if specified (else
      "auto"
      ); pass
      style_id
      if chosen; pass
      character_info
      if provided.
    • Call once and wait — the function handles create, submit, poll, pay, and completion; returns download link or error.
  1. 介绍并选择生成模式(必填):在生成前,必须向用户介绍三种模式并让用户选择。显示内容:
    我们支持三种视频生成模式,请您选择:
    剧集模式(director):由AI导演负责故事板和镜头语言。适合带有对话和情节的短剧。
    旁白模式(narration):以旁白为主,搭配视觉内容。适合知识分享、新闻评论、产品介绍等场景。
    短片模式(short-film):故事与视觉效果平衡;采用电影质感的镜头和节奏。适合情感短片、创意故事、艺术表达等场景。
    等待用户明确选择后再继续。如果未指定,默认使用剧集模式。
  2. 如果用户想要选择风格:调用
    get_styles()
    获取风格列表;展示ID、名称、分类、描述;等待用户选择后再继续。
  3. 如果用户提供角色图片URL:为每个角色构建包含
    name
    url
    character_info
    数组。
  4. 运行工作流
    • 传入故事、宽高比、项目名称调用
      execute_workflow()
    • 根据用户选择的模式设置
      project_type
      ;如果指定了时长则传入
      video_duration
      (否则为
      "auto"
      );如果选择了风格则传入
      style_id
      ;如果提供了角色信息则传入
      character_info
    • 调用一次并等待——该函数会处理创建、提交、轮询、支付和完成流程;返回下载链接或错误信息。

Examples

示例

View style list:
python
api = TrusteeModeAPI()
styles_result = api.get_styles()
查看风格列表
python
api = TrusteeModeAPI()
styles_result = api.get_styles()

Display style list to user

向用户展示风格列表


**Basic workflow (no duration, no style)**:

```python
api = TrusteeModeAPI()
result = api.execute_workflow(
    diy_story="An adventure story...",
    aspect="16:9",
    project_name="My Video Project"
)

**基础工作流(无指定时长、无指定风格)**:

```python
api = TrusteeModeAPI()
result = api.execute_workflow(
    diy_story="一个冒险故事...",
    aspect="16:9",
    project_name="我的视频项目"
)

result contains download URL or error

result包含下载URL或错误信息


**Specify duration, no style**:

```python
result = api.execute_workflow(
    diy_story="An adventure story...",
    aspect="16:9",
    project_name="My Video Project",
    video_duration="60"
)
Specify duration and style:
python
result = api.execute_workflow(
    diy_story="An adventure story...",
    aspect="16:9",
    project_name="My Video Project",
    video_duration="60",
    style_id=142
)
Narration mode:
python
result = api.execute_workflow(
    diy_story="Today we'll talk about AI development...",
    aspect="16:9",
    project_name="Narration Video",
    project_type="narration"
)
Short film mode:
python
result = api.execute_workflow(
    diy_story="Sunset. An old fisherman rows home alone. The sea glows red...",
    aspect="16:9",
    project_name="Short Film",
    project_type="short-film"
)
With character images (when user provides character image URLs):
python
result = api.execute_workflow(
    diy_story="Xiao Ming and Xiao Hong meet in the park, they smile at each other...",
    aspect="16:9",
    project_name="Custom Character Video",
    character_info=[
        {"name": "Xiao Ming", "url": "https://xxx/xiaoming.jpg"},
        {"name": "Xiao Hong", "url": "https://xxx/xiaohong.jpg"}
    ]
)

**指定时长、无指定风格**:

```python
result = api.execute_workflow(
    diy_story="一个冒险故事...",
    aspect="16:9",
    project_name="我的视频项目",
    video_duration="60"
)
指定时长和风格
python
result = api.execute_workflow(
    diy_story="一个冒险故事...",
    aspect="16:9",
    project_name="我的视频项目",
    video_duration="60",
    style_id=142
)
旁白模式
python
result = api.execute_workflow(
    diy_story="今天我们来聊聊AI的发展...",
    aspect="16:9",
    project_name="旁白视频",
    project_type="narration"
)
短片模式
python
result = api.execute_workflow(
    diy_story="日落时分,一位老渔夫独自划着船回家。海面泛着红光...",
    aspect="16:9",
    project_name="短片",
    project_type="short-film"
)
包含角色图片(当用户提供角色图片URL时):
python
result = api.execute_workflow(
    diy_story="小明和小红在公园相遇,他们相视一笑...",
    aspect="16:9",
    project_name="自定义角色视频",
    character_info=[
        {"name": "小明", "url": "https://xxx/xiaoming.jpg"},
        {"name": "小红", "url": "https://xxx/xiaohong.jpg"}
    ]
)

Return Value

返回值

The function blocks until the task completes (success or failure) or times out (1 hour). Wait for it to return.
Success (includes download link):
json
{
    "code": 200,
    "msg": "success",
    "uuid": "...",
    "data": {
        "project_id": "...",
        "video_asset": {...},
        "status": "completed"
    }
}
Return the full signed URL to the user (
data.video_asset.download_url
), e.g.:
https://assets.giggle.pro/private/ai_director/348e4956c7bd4f763b/qzjc7gwkpf.mp4?Policy=...&Key-Pair-Id=...&Signature=...&response-content-disposition=attachment
Do not return unsigned URLs without query params, e.g.:
https://assets.giggle.pro/private/ai_director/348e4956c7bd4f763b/qzjc7gwkpf.mp4
Failure:
json
{
    "code": -1,
    "msg": "Error message",
    "data": null
}
函数会阻塞直到任务完成(成功或失败)或超时(1小时)。等待其返回结果。
成功(包含下载链接):
json
{
    "code": 200,
    "msg": "success",
    "uuid": "...",
    "data": {
        "project_id": "...",
        "video_asset": {...},
        "status": "completed"
    }
}
向用户返回完整的签名URL
data.video_asset.download_url
),例如:
https://assets.giggle.pro/private/ai_director/348e4956c7bd4f763b/qzjc7gwkpf.mp4?Policy=...&Key-Pair-Id=...&Signature=...&response-content-disposition=attachment
请勿返回不带查询参数的未签名URL,例如:
https://assets.giggle.pro/private/ai_director/348e4956c7bd4f763b/qzjc7gwkpf.mp4
失败
json
{
    "code": -1,
    "msg": "Error message",
    "data": null
}