skills/chanjing-ai-creation/SKILL.md
Chanjing AI creation Open API client: submit image/video tasks, poll task status, list and get tasks, and optionally download outputs when the user runs download_result.py. Reads and writes local credentials.json; calls open-api.chanjing.cc.
npx skillsauth add chanjing-ai/chan-skills chanjing-ai-creationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
调用蝉镜 AI 创作 Open API:提交任务、轮询状态、列表与单条查询;仅在用户明确要求时用 download_result.py 可选下载输出。需读写本地 credentials.json 并访问 Open API。跨模型文生图/视频等由 submit_task.py 参数与透传体决定。本 skill 脚本不依赖 ffmpeg/ffprobe。
scripts/*.pymanifest.yaml(environment 段)及本文permissions、clientPermissions、agentPolicy:manifest.yamlclawhub run chanjing-ai-creationpython skills/chanjing-ai-creation/scripts/submit_task.py …(见正文 Standard Workflow)主凭据、可选 env、下载信任边界等:以 manifest.yaml 为准。本篇从 When to Use 起写业务能力。
当用户要做这些事时使用本 Skill:
submit_task.py)list_tasks.py、get_task.py)poll_task.py)download_result.py)上述流程依赖读写本地 credentials.json 并调用 open-api.chanjing.cc。
如果需求更接近“文生数字人”,优先使用 chanjing-text-to-digital-person。
如果需求更接近“已有数字人视频合成”,优先使用 chanjing-video-compose。
执行本 Skill 前,必须先通过 chanjing-credentials-guard 完成 AK/SK 与 Token 校验。
本 Skill 与 guard 共用:
~/.chanjing/credentials.jsonhttps://open-api.chanjing.cc无凭证时,脚本会自动打开蝉镜登录页,并提示配置命令。
与 Purpose / Credentials / Persistence、download_result.py 信任边界相关的逐项说明见 manifest.yaml。
运行时范围:本 Skill 的说明与脚本仅服务于已声明用途——读取本地 credentials.json、调用蝉镜 Open API 端点;不在轮询或查询成功时自动落盘生成物,仅在用户显式执行 download_result.py 时下载资源。
_auth.py 与仓库布局:鉴权辅助可能打开系统浏览器,或按相对路径调用同仓库下的 chanjing-credentials-guard 脚本(例如 open_login_page.py)。这假设当前工作区为 chan-skills 式多 Skill 目录结构,或已单独安装并具备等效路径的 guard skill;否则将回退为仅打开登录页 URL。
敏感数据与持久化:预期仅处理 credentials.json 中的 app_id、secret_key、access_token(及与 token 生命周期相关的字段,见 manifest.yaml)。将 access_token 写入磁盘 是有意设计且已文档化,对 API 客户端而言通常可接受;但在多人共用主机、全盘备份/同步到不可信存储等场景下,磁盘上的 token 会扩大泄露面,需按环境自行评估。
AI 创作的主接口是统一提交器:
submit_task.py 提交图片或视频生成任务,得到 unique_idpoll_task.py 轮询直到成功,得到 output_urlget_task.pylist_tasks.pydownload_result.py这个 skill 默认做成“通用任务提交器”:
--body-file 或 --body-json 透传完整请求体本 Skill 当前覆盖:
POST /open/v1/ai_creation/task/submitPOST /open/v1/ai_creation/task/pageGET /open/v1/ai_creation/task脚本目录:
skills/chanjing-ai-creation/scripts/| 脚本 | 说明 |
|------|------|
| _auth.py | 读写 credentials.json、获取或刷新 access_token |
| submit_task.py | 提交 AI 创作任务,输出 unique_id |
| get_task.py | 获取单个任务详情 |
| list_tasks.py | 列出图片或视频任务 |
| poll_task.py | 轮询任务直到完成,默认输出第一个结果地址 |
| download_result.py | 下载图片或视频到 outputs/ai-creation/ |
示例 1:Seedream 3.0 文生图
TASK_ID=$(python3 skills/chanjing-ai-creation/scripts/submit_task.py \
--creation-type 3 \
--model-code "doubao-seedream-3.0-t2i" \
--prompt "赛博朋克城市夜景,霓虹灯,雨夜,电影镜头" \
--aspect-ratio "16:9" \
--clarity 2048 \
--number-of-images 1)
python3 skills/chanjing-ai-creation/scripts/poll_task.py --unique-id "$TASK_ID"
示例 2:腾讯 Kling v2.1 Master 图生视频
TASK_ID=$(python3 skills/chanjing-ai-creation/scripts/submit_task.py \
--creation-type 4 \
--model-code "tx_kling-v2-1-master" \
--ref-img-url "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/start.jpg" \
--ref-img-url "https://res.chanjing.cc/chanjing/res/aigc_creation/photo/end.jpg" \
--prompt "角色从静止到转身,镜头平滑移动,叙事感强" \
--aspect-ratio "9:16" \
--clarity 1080 \
--quality-mode pro \
--video-duration 5)
python3 skills/chanjing-ai-creation/scripts/poll_task.py --unique-id "$TASK_ID"
示例 3:直接透传完整 JSON
python3 skills/chanjing-ai-creation/scripts/submit_task.py \
--body-file ./payload.json
下载是显式动作,不是默认动作:
poll_task.py 成功后应先返回远端 output_urldownload_result.py默认本地输出目录:
outputs/ai-creation/更多接口细节见:
skills/chanjing-ai-creation/reference.mdskills/chanjing-ai-creation/examples.mddevelopment
Use Chanjing video synthesis APIs to create digital human videos from text or audio, with optional background upload, polling, and explicit download.
development
Use Chanjing TTS API to convert text to speech (list voices, create tasks, poll, download from returned URLs).
development
Use Chanjing TTS API to synthesize speech from text with a user-provided cloned voice (reference audio via public URL).
development
Use Chanjing text-to-digital-person APIs for AI portraits, talking videos, optional LoRA training, polling, and explicit downloads when requested.