跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
视频与音频

ultimate-ai-media-generator-skill

Generate and monitor CyberBara Public API v1 image, video, audio, and music tasks end-to-end. Use when work involves CyberBara `/api/v1` endpoints for listing models, uploading reference media, quoting credits, creating generation tasks, polling task status, checking credits balance and usage, or saving final media outputs.

ZeroLu · 已有 AI 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add ZeroLu/Ultimate-AI-Media-Generator-Skill --skill ultimate-ai-media-generator-skill

技能说明


name: ultimate-ai-media-generator-skill description: Generate and monitor CyberBara Public API v1 image, video, audio, and music tasks end-to-end. Use when work involves CyberBara /api/v1 endpoints for listing models, uploading reference media, quoting credits, creating generation tasks, polling task status, checking credits balance and usage, or saving final media outputs.

Ultimate-AI-Media-Generator-Skill

Overview

Use this skill to call CyberBara APIs reliably, create image, video, audio, and music generation tasks, and return final media URLs with credit-aware flow.

For Chinese article or repo-promo title images, default to model nano-banana-2-lite unless the user requests a different image model. Prefer generating a text-free cover background first, then add the final Chinese headline locally so the published title is exact and readable.

Implementation Architecture

The runtime uses a layered Python architecture:

  • scripts/cyberbara_api.py: thin entrypoint only
  • src/cyberbara_cli/cli.py: command parsing and command routing
  • src/cyberbara_cli/usecases/: flow orchestration (generation + polling)
  • src/cyberbara_cli/policies/: safety and policy rules (credits quote + formal confirmation)
  • src/cyberbara_cli/gateways/: raw CyberBara API client
  • src/cyberbara_cli/config.py: API key discovery and local persistence
  • src/cyberbara_cli/constants.py: fixed base URL and shared constants

When extending behavior, keep business rules in usecases/ or policies/, not in scripts/.

Set Up Runtime Inputs

The script uses fixed base URL:

https://cyberbara.com

API key lookup order:

  1. --api-key
  2. environment variable CYBERBARA_API_KEY
  3. local cache file ~/.config/cyberbara/api_key
  4. interactive prompt (if running in terminal)

Recommended one-time setup command:

python3 scripts/cyberbara_api.py setup-api-key "<api-key>"

Or save from environment variable:

export CYBERBARA_API_KEY="<api-key>"
python3 scripts/cyberbara_api.py setup-api-key --from-env

If API key is missing, the script immediately asks for it and shows where to get one:

https://cyberbara.com/settings/apikeys

When you provide API key via --api-key or interactive prompt, it is saved to:

~/.config/cyberbara/api_key

Future runs reuse this cached key, so users do not need to provide it every time.

Run The Standard Generation Flow

  1. Discover available models.
  2. Upload reference images or videos when task scene needs local media inputs.
  3. Quote credits before creating a generation task.
  4. Create image or video generation task and wait for final output.
  5. Automatically save generated media locally and open it.
  6. Check usage records when needed.

Reference commands:

# 1) List video models
python3 scripts/cyberbara_api.py models --media-type video

# Also available: image, audio, and music models
python3 scripts/cyberbara_api.py models --media-type audio
python3 scripts/cyberbara_api.py models --media-type music

# 2) Upload local reference images
python3 scripts/cyberbara_api.py upload-images ./frame.png ./style.jpg

# Upload local reference videos
python3 scripts/cyberbara_api.py upload-videos ./clip.mp4

# 3) Estimate credits
python3 scripts/cyberbara_api.py quote --json '{
  "model":"sora-2",
  "media_type":"video",
  "scene":"text-to-video",
  "options":{"duration":"10"}
}'

# 4) Create a video task (default behavior: wait for success, save outputs to ./media_outputs, auto-open)
python3 scripts/cyberbara_api.py generate-video --json '{
  "model":"sora-2",
  "prompt":"A calm drone shot over snowy mountains at sunrise",
  "scene":"text-to-video",
  "options":{"duration":"10","resolution":"standard"}
}'

# 5) Existing task: wait + save/open outputs
python3 scripts/cyberbara_api.py wait --task-id <TASK_ID> --interval 5 --timeout 900

Image and video generation are confirmation-gated by default:

# Single image request: script auto-quotes, then asks you to type CONFIRM
python3 scripts/cyberbara_api.py generate-image --json '{
  "model":"nano-banana-pro",
  "prompt":"A cinematic portrait under neon rain",
  "scene":"text-to-image",
  "options":{"resolution":"1k"}
}'

# Batch image requests (JSON array): script auto-quotes each request and prints total estimated credits
python3 scripts/cyberbara_api.py generate-image --file ./image-requests.json

image-requests.json format:

[
  {
    "model": "nano-banana-pro",
    "prompt": "A cinematic portrait under neon rain",
    "scene": "text-to-image",
    "options": { "resolution": "1k" }
  },
  {
    "model": "nano-banana-pro",
    "prompt": "A product still life with dramatic side light",
    "scene": "text-to-image",
    "options": { "resolution": "1k" }
  }
]

Only use --yes after explicit user approval has been obtained:

python3 scripts/cyberbara_api.py generate-image --file ./image-requests.json --yes
python3 scripts/cyberbara_api.py generate-video --json '{
  "model":"sora-2",
  "prompt":"A calm drone shot over snowy mountains at sunrise",
  "scene":"text-to-video",
  "options":{"duration":"10","resolution":"standard"}
}' --yes

python3 scripts/cyberbara_api.py generate-audio --json '{
  "model":"suno-sound-v5-5",
  "prompt":"A short cinematic whoosh with soft digital sparkle",
  "scene":"text-to-audio",
  "options":{"loop":false}
}' --yes

python3 scripts/cyberbara_api.py generate-music --json '{
  "model":"suno-music-v5",
  "prompt":"Warm lo-fi study music with mellow keys",
  "scene":"text-to-music",
  "options":{"instrumental":true}
}' --yes

Control auto-save and open behavior:

# keep waiting but do not auto-open media
python3 scripts/cyberbara_api.py generate-image --file ./image-requests.json --yes --no-open

# custom output directory
python3 scripts/cyberbara_api.py generate-video --json '{...}' --yes --output-dir ./downloads

# submit only (no wait/save/open)
python3 scripts/cyberbara_api.
阅读完整来源 ↗