Function description
Text-to-image, image-to-talking-video, optional LoRA training and polling; download generated artifacts when the user explicitly requests it. For credentials and permissions, see manifest.yaml. Scriptdoes notdepend on ffmpeg/ffprobe.
Runtime dependencies
- python3 and the same-repository
scripts/*.py(including_auth.py、_task_api.py) - no ffmpeg/ffprobe gating
Environment variables and machine-readable declarations
- Environment variable key names and descriptions:
manifest.yaml(environmentsection) and this document - variables, credential model, compliance
permissions、clientPermissions、agentPolicy:manifest.yaml
Usage commands
- ClawHub(slug is subject to the registry):
clawhub run chanjing-text-to-digital-person - this repository:
python skills/chanjing-text-to-digital-person/scripts/create_photo_task.py …(see Standard Workflow)
Registration and review (single source of truth)
Path,primaryEnv omitted,persistAccessTokenOnDisk, sensitive fields,agentPolicy, optional env, etc.:is governed by manifest.yaml .. In implementation, this is handled by _auth.py、_task_api.py and the individual CLI scripts; this document describes the flow starting from When to Use .
When to Use This Skill
Use this Skill when the user wants to do these things:
- Generate a digital human portrait image based on a character prompt
- Convert a generated character image into a short talking video
- Query the status of text-to-image / image-to-video / LoRA tasks
- Download generated images or videos locally when the user explicitly requests it
If the requirement is "upload real-person material to train a custom digital human", prefer using chanjing-customised-person。
If the requirement is "use an existing digital human for voice-over video composition", prefer using chanjing-video-compose。
Preconditions
Before executing this Skill, you must first complete AK/SK and Token verification through chanjing-credentials-guard .
This Skill shares the following with guard:
~/.chanjing/credentials.jsonhttps://open-api.chanjing.cc
When there are no credentials, the script will automatically open the Chanjing login page (if it exists in the same repository, execute chanjing-credentials-guard/scripts/open_login_page.py, otherwise webbrowser.open), and prompt for local execution of chanjing_config.py。
Review and security (credentials)
and Purpose / Credentials / Persistence -related item-by-item descriptions are in manifest.yaml(for behaviors such as subprocess calls to guard's open_login_page.py when credentials are missing, see clientPermissions)。
Standard Workflow
The main flow is usually divided into two stages, and both are asynchronous tasks:
- Call
create_photo_task.pyto create a text-to-image task and obtainphoto_unique_id - Call
poll_photo_task.pyto poll until success, select an imagephoto_path - Call
create_motion_task.pyto create an image-to-video task and obtainmotion_unique_id - Call
poll_motion_task.pyto poll until success and obtain the finalvideo_url - Only when the user explicitly requests saving locally, call
download_result.py
Optional extensions:
- If the user wants to do LoRA training, call
create_lora_task.pyandpoll_lora_task.py poll_lora_task.pyon success will return aphoto_task_id, and you can continue to usepoll_photo_task.pyto get images
Covered APIs
This Skill currently covers:
POST /open/v1/aigc/photoGET /open/v1/aigc/photo/taskGET /open/v1/aigc/photo/task/pagePOST /open/v1/aigc/motionGET /open/v1/aigc/motion/taskGET /open/v1/aigc/motion/task/pagePOST /open/v1/aigc/lora/task/createGET /open/v1/aigc/lora/taskGET /open/v1/aigc/lora/task/page
Scripts
Script directory:
skills/chanjing-text-to-digital-person/scripts/
Files included in this repository (do not confuse with the minimal package containing only _auth.py )
The complete package contains _auth.py、_task_api.py(for reuse by task scripts) and the following .py CLI; please use python3 <路径>/<脚本名>.py to call it (consistent with the conventions of other Chanjing skills in the repository).
| File name (in repository) | Description |
|---|---|
_auth.py |
Read credentials.json, refresh and write back access_token / expire_in; when AK/SK is missing, try open_login_page.py |
_task_api.py |
Shared task API logic (imported by each CLI) |
create_photo_task.py |
Create text-to-image task → photo_unique_id |
get_photo_task.py |
Single text-to-image task details |
list_tasks.py |
By `--kind=photo |
list_tasks.py |
Task list (type=1 photo,type=2 motion) |
poll_photo_task.py |
Poll text-to-image until complete → first image URL by default |
create_motion_task.py |
Create image-to-video → motion_unique_id |
get_motion_task.py |
Single image-to-video task details |
poll_motion_task.py |
Poll image-to-video until complete → video URL by default |
create_lora_task.py |
Create LoRA training → lora_id |
get_lora_task.py |
LoRA task details |
poll_lora_task.py |
Poll LoRA until complete → first entry by default photo_task_id |
download_result.py |
Only when saving to disk is needed: download to outputs/text-to-digital-person/(or --output) |
If in the environment missing any entry in the table above or _task_api.py, it is distribution/packaging incomplete。
Usage Examples
Example 1: Text-to-image followed directly by image-to-video
PHOTO_TASK_ID=$(python3 skills/chanjing-text-to-digital-person/scripts/create_photo_task.py \
--age "Young adult" \
--gender Female \
--number-of-images 1 \
--industry "教育培训" \
--background "现代直播间背景" \
--detail "短发,亲和力强,职业装" \
--talking-pose "上半身特写,站立讲解")
PHOTO_URL=$(python3 skills/chanjing-text-to-digital-person/scripts/poll_photo_task.py \
--unique-id "$PHOTO_TASK_ID")
MOTION_TASK_ID=$(python3 skills/chanjing-text-to-digital-person/scripts/create_motion_task.py \
--photo-unique-id "$PHOTO_TASK_ID" \
--photo-path "$PHOTO_URL" \
--emotion "自然播报,语气清晰自信" \
--gesture)
python3 skills/chanjing-text-to-digital-person/scripts/poll_motion_task.py \
--unique-id "$MOTION_TASK_ID"
Example 2: LoRA training
LORA_ID=$(python3 skills/chanjing-text-to-digital-person/scripts/create_lora_task.py \
--name "演示LoRA" \
--photo-url https://example.com/1.jpg \
--photo-url https://example.com/2.jpg \
--photo-url https://example.com/3.jpg \
--photo-url https://example.com/4.jpg \
--photo-url https://example.com/5.jpg)
python3 skills/chanjing-text-to-digital-person/scripts/poll_lora_task.py \
--lora-id "$LORA_ID"
Download Rule
Downloading is an explicit action, not a default action:
poll_photo_task.pyandpoll_motion_task.pyshould first return the remote URL after success- Do not automatically download result files
- Only when the user explicitly says "download to local", "save to outputs", "save to disk for me" should you execute
download_result.py
Output Convention
Default local output directory:
outputs/text-to-digital-person/
Additional Resources
For more API details, see:
skills/chanjing-text-to-digital-person/reference.mdskills/chanjing-text-to-digital-person/examples.md