giggle-generation-aimv
Original:🇺🇸 English
Translated
1 scriptsChecked / no sensitive code detected
Use when the user wants to create AI music videos (MV)—including generating music from text prompts or using custom lyrics. Triggers: generate MV, music video, make video for this song, lyrics video, create MV, AI music video, music+video, generate video from lyrics.
5installs
Sourcegiggle-official/skills
Added on
NPX Install
npx skill4agent add giggle-official/skills giggle-generation-aimvTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →简体中文 | English
MV Trustee Mode API Skill
Calls the MV trustee mode API to run the full MV generation workflow. Project creation and task submission are merged into one step in the script—call once only; never call create and submit separately.
execute_workflow⚠️ Review Before Installing
Please review before installing. This skill will:
- Network – Calls Giggle.pro API for MV generation
Requirements: , (system environment variable), pip packages:
python3 (>=3.6)GIGGLE_API_KEYrequestsNo Retry on Error: If script execution encounters an error, do not retry. Report the error to the user directly and stop.
Required Setup Before First Use
Before performing any operation, confirm the user has configured the API Key.
API Key: Log in to Giggle.pro and obtain the API Key from account settings.
Configuration: Set system environment variable
GIGGLE_API_KEYexport GIGGLE_API_KEY=your_api_key
Verification steps:
- Confirm the user has configured in system environment
GIGGLE_API_KEY - If not configured, guide the user:
Hello! Before using the MV generation feature, you need to configure the API Key. Please go to Giggle.pro to get your API Key, then runin the terminal.
export GIGGLE_API_KEY=your_api_key - Wait for the user to configure before continuing the workflow
Two Music Generation Modes
| Mode | music_generate_type | Required params | Description |
|---|---|---|---|
| Prompt | | prompt, vocal_gender | Describe music in text |
| Custom | | lyrics, style, title | Provide lyrics, style, and title |
Shared Parameters (All Modes, Required)
- reference_image or reference_image_url: Reference image—provide at least one (asset_id or download URL). Also supports base64 image, e.g. . For base64: pass the raw Base64 string directly; do not add the data:image/xxx;base64 prefix.
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==" - aspect: Aspect ratio, or
16:99:16 - scene_description: Visual scene description, default empty—only set when the user explicitly mentions the scene (max 200 chars)
- subtitle_enabled: Enable subtitles, default false
Mode-Specific Parameters
Prompt mode:
- : Music description (required)
prompt - : Vocal gender —
vocal_gender/male/female(optional, defaultauto)auto - : Instrumental only (optional, default false)
instrumental
Custom mode:
- : Lyrics content (required)
lyrics - : Music style (required)
style - : Song title (required)
title
Workflow Function
Use to run the full workflow—call once and wait. Internally: create project + submit task (merged) → poll progress (every 3 sec) → detect and pay pending items → wait for completion (max 1 hour).
execute_workflowImportant:
- Never call and
create_projectseparately—always usesubmit_mv_taskorexecute_workflowcreate_and_submit - After calling, just wait for the function to return; all intermediate steps are automatic
Function Signature
python
execute_workflow(
music_generate_type: str, # Mode: prompt / custom
aspect: str, # Aspect ratio: 16:9 or 9:16
project_name: str, # Project name
reference_image: str = "", # Reference image asset_id (mutually exclusive with reference_image_url)
reference_image_url: str = "", # Reference image URL or base64 (mutually exclusive with reference_image)
scene_description: str = "", # Scene description, default empty
subtitle_enabled: bool = False, # Subtitle toggle, default False
# Prompt mode
prompt: str = "",
vocal_gender: str = "auto",
instrumental: bool = False,
# Custom mode
lyrics: str = "",
style: str = "",
title: str = "",
)Parameter Extraction Rules
- reference_image and reference_image_url: At least one required. Use for asset_id; use
reference_imagefor image URL or base64.reference_image_url - scene_description: Default empty—only fill when the user explicitly mentions "scene", "visual description", or "visual style".
- subtitle_enabled: Default False—only set True when the user explicitly requests subtitles.
- aspect: Use when the user mentions portrait/vertical/9:16; otherwise default
9:16.16:9 - Mode selection: "Describe music / use prompt" → prompt; "Here are my lyrics / lyrics are" → custom;
Examples
Prompt mode:
python
api = MVTrusteeAPI()
result = api.execute_workflow(
music_generate_type="prompt",
aspect="16:9",
project_name="My MV",
reference_image_url="https://example.com/ref.jpg",
prompt="Upbeat pop, sunny beach vibe",
vocal_gender="female"
)Custom mode (user provides lyrics):
python
result = api.execute_workflow(
music_generate_type="custom",
aspect="9:16",
project_name="Lyrics MV",
reference_image="asset_xxx",
lyrics="Verse 1: Spring breeze on my face...",
style="pop",
title="Spring Song"
)With scene description (when user explicitly describes the scene):
python
result = api.execute_workflow(
music_generate_type="prompt",
aspect="16:9",
project_name="Scene MV",
reference_image_url="https://...",
prompt="Electronic dance music",
scene_description="City nightscape, neon lights, flowing traffic"
)Submit Task API Request Example (Prompt Mode)
Submit endpoint () request body:
/api/v1/trustee_mode/mv/submitjson
{
"project_id": "<your-project-id>",
"music_generate_type": "prompt",
"prompt": "A cheerful pop song",
"vocal_gender": "female",
"instrumental": false,
"reference_image_url": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMTEhUT...(base64 image data)",
"scene_description": "A romantic beach walk at sunset, waves gently lapping the shore, pink sky gradient",
"aspect": "16:9",
"subtitle_enabled": false
}Note: (asset_id) and (URL or base64) are mutually exclusive.
reference_imagereference_image_urlCustom mode:
json
{
"project_id": "<your-project-id>",
"music_generate_type": "custom",
"lyrics": "Verse 1:\nStanding by the sea watching the sunset\nMemories rush in like waves\n\nChorus:\nLet the sea breeze blow away all worries\nIn this golden moment\nWe found each other\n",
"style": "pop ballad",
"title": "Seaside Memories",
"reference_image": "<asset_id>",
"scene_description": "A couple walking on the beach at dusk, long shadows, orange-red sky gradient",
"aspect": "9:16",
"subtitle_enabled": false
}Query Progress API Response Example
Query endpoint () response (all steps completed):
/api/v1/trustee_mode/mv/queryjson
{
"code": 200,
"msg": "success",
"uuid": "<response-uuid>",
"data": {
"project_id": "<your-project-id>",
"video_asset": {
"asset_id": "<asset_id>",
"download_url": "https://assets.giggle.pro/private/...",
"thumbnail_url": "https://assets.giggle.pro/private/...",
"signed_url": "https://assets.giggle.pro/private/...",
"duration": 0
},
"shot_count": 0,
"current_step": "editor",
"completed_steps": "music-generate,storyboard,shot,editor",
"pay_status": "paid",
"status": "completed",
"err_msg": "",
"steps": [...]
}
}Note: When is , call the pay endpoint. When all are done, will have a value—return the full signed URL. Correct format:
pay_statuspendingstepsvideo_asset.download_urlhttps://assets.giggle.pro/private/ai_director/348e4956c7bd4f763b/qzjc7gwkpf.mp4?Policy=...&Key-Pair-Id=...&Signature=...&response-content-disposition=attachmentWrong (unsigned URL only):
https://assets.giggle.pro/private/ai_director/348e4956c7bd4f763b/qzjc7gwkpf.mp4Pay API Request and Response
Pay endpoint ():
/api/v1/trustee_mode/mv/payRequest body:
json
{
"project_id": "<your-project-id>"
}Response:
json
{
"code": 200,
"msg": "success",
"uuid": "<response-uuid>",
"data": {
"order_id": "<order-id>",
"price": 580
}
}Retry API Request Example
When a step fails, guide the user to call the retry endpoint to resume from that step:
json
{
"project_id": "<your-project-id>",
"current_step": "shot"
}Note: is the step name to retry (e.g. , , , ).
current_stepmusic-generatestoryboardshoteditorcreate_and_submit (Optional)
If you only need to create the project and submit the task without waiting for completion, use . Never call and separately:
create_and_submitcreate_projectsubmit_mv_taskpython
api = MVTrusteeAPI()
r = api.create_and_submit(
project_name="My MV",
music_generate_type="prompt",
aspect="16:9",
reference_image_url="https://...",
prompt="Upbeat pop"
)
# Returns project_id for manual query/pay laterReturn Value
Success:
json
{
"code": 200,
"msg": "success",
"data": {
"project_id": "...",
"download_url": "https://...",
"video_asset": {...},
"status": "completed"
}
}Returns error message on failure.
Troubleshooting
| Scenario | Cause | Solution |
|---|---|---|
| | Verify the key at Giggle.pro account settings and re-export: |
| API rate limit exceeded | Wait a few minutes and retry; avoid submitting multiple projects in rapid succession |
| Network timeout / connection error | Unstable network or API service temporarily unavailable | The script auto-retries up to 5 times with 5-second intervals; check your network if it still fails |
| The project requires payment before proceeding | The workflow function handles this automatically; if running manually, call the pay endpoint with the |
Task step failed ( | A generation step (e.g. | Use the retry endpoint: |
| Workflow timeout (> 1 hour) | MV generation took too long | Query progress manually with the |