Install
openclaw skills install @chatart-ai/chatart-skillUse when user wants to generate videos, create images from text prompts, edit existing images with AI, or replace characters in videos. Simply describe your vision to create videos and images--zero manual operations.
openclaw skills install @chatart-ai/chatart-skillModular Python toolkit for the chatart AI API.
✨ Generate. Edit. Collaborate. — All in One Place. ✨
Always use the Python scripts in
scripts/. Do NOT usecurlor direct HTTP calls.
⚠️ HIGHEST PRIORITY — every user-facing reply MUST follow ALL rules below.
Most users are non-technical. Many chat from Feishu, WeChat, or similar apps and cannot see local browser popups or terminals.
URL: ... from auth.py login output and use the login template below. Never say "browser opened" or similar. If the URL is not found in the output, re-run auth.py login to get a new link. Never skip sending the link.auth.py accountswitch and remind the user to log out of their current ChatArt web account or log in with the new account on the website first. After the switch, wait for user confirmation before proceeding.auth.py login and send the link. Don't ask "which method do you prefer?" or present multiple options. The user asked you to do something — login is just an intermediate step, handle it.Estimated Generation Time
Tell the user the estimated wait time after submitting a task. Match the user's language.
| Task Type | Model | Estimated Time |
|---|---|---|
| Video | Standard / Fast (Seedance 2.0) | ~5–10 min |
| Video | All other video models (Kling, HappyHorse etc.) | ~3–5 min |
| Image | image models (Nano Banana 2, Seedream etc.) | ~30s–1 min |
| Character Replace | Kling V3.0, Seedance 2.0, Wan 2.2 | ~3–5 min |
Example messages after submitting:
Required login message template
Replace <LOGIN_URL> with the actual link. Follow the user's language (Chinese template for Chinese users, English for English users).
中文模板:
安装完成,ChatArt Skill 已连接到你的智能助手。
复制下方链接到浏览器中登录,登录后将解锁以下能力:
<LOGIN_URL>
🎬 视频生成
文字转视频、图片转视频、参考视频生成,自动配音配乐。
视频模型:Seedance 2.0 · Seedance 2.0 Fast · Seedance 2.0 Mini · Seedance 1.5 Pro · Kling 3 · HappyHorse 1.0 · PixVerse V6
🖼️ AI 图片生成与编辑
文字生图、AI 修图、风格转换,最高支持 4K。
图片模型:Nano Banana · Nano Banana 2 · Nano Banana Pro · Seedream 4.0 · Seedream 4.5 · Seedream 5.0
✂️ 角色替换(动作模仿)
上传一张角色照片 + 动作视频,视频中的人物替换成图片中的角色或者照片中的人物会模仿视频中的动作
视频模型: Kling V3.0 · Wan 2.2
登录完成后回我一句"好了",我马上继续。
English template:
Installation complete. ChatArt Skill is now connected to your agent.
Copy the link below into your browser to sign in. After signing in, the following capabilities will be unlocked.
<LOGIN_URL>
🎬 Video Generation
Text-to-video, image-to-video, reference-based generation with auto sound & music.
Models: Seedance 2.0 · Seedance 2.0 Fast · Seedance 2.0 Mini · Seedance 1.5 Pro · Kling V3.0 · HappyHorse1.0 · PixVerse V6
🖼️ AI Image Generation & Editing
Text-to-image, AI retouching, style transfer — up to 4K resolution.
Models: Nano Banana 2 · Nano Banana Pro · Gpt Image 2 · Seedream 5.0
✂️ Character Replace
Upload a character photo along with an action video. In the video, replace the characters with those from the picture or the characters in the picture will imitate the actions shown in the video.
Models: Kling V3.0 · Wan 2.2
Once you've signed in, just reply "done" and I'll continue right away.
Banned phrases (including any variations):
Fallback when login URL is not captured:
If
auth.py loginoutput does not contain aURL:line (e.g. background execution missed the output), re-runauth.py loginto get a fresh link. NEVER fall back to telling the user to "check the browser popup" or "go operate on the agent's computer". The user cannot see it.
python {baseDir}/scripts/auth.py loginpython {baseDir}/scripts/auth.py status to check current login stateCHATARTPRO_UID + CHATARTPRO_API_KEY are handled automatically after login; manual setup is only for CI/internal usepip install -r {baseDir}/scripts/requirements.txt
These rules apply to ALL generation modules (video_gen, ai_image, video_mimic).
run — it submits the task and polls automatically until done. This is the default and correct choice in almost all situations.query when run has already timed out and you have a taskId to resume, or when the user explicitly provides an existing taskId.query polls continuously — it keeps checking every --interval seconds until status is completed or failed, or --timeout expires. It does not stop after one check.query also times out (exit code 2), increase --timeout and try again with the same taskId. Do not resubmit unless the task has actually failed.Decision tree:
→ New request? use `run`
→ run timed out? use `query --task-id <id>`
→ query timed out? use `query --task-id <id> --timeout 1200`
→ task status=fail? ❌ DO NOT resubmit automatically
→ Return error to user, ask if they want to retry
→ If user says yes → go back to Step 1 (re-estimate, re-confirm)
Task Status:
| Status | Description |
|---|---|
init | Task is queued, waiting to be processed |
working | Task is actively being processed |
completed | Task completed successfully |
failed | Task failed |
CRITICAL: Before EVERY generation task, you MUST follow these steps WITHOUT EXCEPTION.
DO NOT proceed with any generation task until the user explicitly confirms the parameters.
video_gen.py estimate-cost --model <model> --resolution <res> --duration <dur> --count <count>ai_image.py estimate-costUse list-models to ensure model, aspect ratio, resolution, and duration are compatible:
python scripts/video_gen.py list-models --type <t2v|i2v|omni|extend>
| Module | Script | Reference | Description |
|---|---|---|---|
| Auth | scripts/auth.py | auth.md | OAuth 2.0 Device Flow — generate login link, wait for authorization, save credentials; supports account switching via accountswitch command |
| Video Gen | scripts/video_gen.py | video_gen.md | Image-to-video (2 modes), text-to-video, video extension |
| AI Image | scripts/ai_image.py | ai_image.md | Text-to-image and AI image editing (10+ models) |
| Character Replace | scripts/video_mimic.py | video_mimic.md | Character Replace in Videos with Scene Consistency using ChatArt Common Task APIs. |
| User | scripts/user.py | user.md | Credit balance and usage history |
Read individual reference docs for usage, options, and code examples. Local files (image/audio/video) are auto-uploaded when passed as arguments — no manual upload step needed.
The i2v (Image-to-Video) task supports two modes:
1. Omni Reference Mode (Recommended, Default)
--ref-images WITHOUT explicit "first/last frame" keywords--ref-images <image1> [image2]python video_gen.py run --type i2v --model "Seedance 2.0" \
--ref-images photo1.jpg photo2.jpg \
--prompt "Animate these characters dancing"
2. First-Last Frame Mode
--first-frame <image> and/or --end-frame <image> (1-2 images)python video_gen.py run --type i2v --model "Seedance 2.0" \
--first-frame start.jpg --end-frame end.jpg \
--prompt "Smooth transition from start to end"
3. Omni Type (--type omni) — MANDATORY for 3+ Images
--type omni (NOT --type i2v)--ref-images <image1> <image2> <image3> ... [up to 9 images]python video_gen.py run --type omni --model "Seedance 2.0" \
--ref-images char1.jpg char2.jpg char3.jpg \
--prompt "Create a video with these characters interacting"
Mode Selection Rules:
--type omni --ref-images (CRITICAL)--ref-images → Use --type i2v --ref-images--first-frame/--end-frame:
--type i2v --first-frame/--end-frame--type i2v --ref-images (better quality)The image_edit task also supports two reference modes:
1. Multi-Image Reference Mode (Full Function, Recommended)
When to use: User provides 1-14 reference images for complex editing tasks
Parameter: --input-images <image1> [image2] ... [image14]
Capabilities: Supports up to 14 reference images, enables complex compositions like merging multiple people, style transfer, background replacement with multiple references
API Structure: Uses reference_image array in request body
Example:
python ai_image.py run --type image_edit --model "Nano Banana" \
--input-images person1.jpg person2.jpg \
--prompt "生成两人的自拍合照,背景是长城,表情自然,一起比心" \
--aspect-ratio "16:9"
Request Body Example:
{
"description": "修改图片,生成图1和图2的自拍合照,背景是长城,两人表情自然,举止亲密, 他们两个一起比心手势",
"style": 0,
"picture_scale": 3,
"gpt_type": "nano-banana-2",
"picture_counts": 1,
"reference_image": [
"https://files.chatartpro.com/chat-web-image/image_home/chat/image-editor.png",
"https://files.chatartpro.com/chat-web-image/image_home/chat/chat_demo/mask.jpg"
],
"content": {"text": "", "site_url": ""},
"gen_content": "",
"scene_id": 13
}
2. Single Image Edit Mode
--input-images <single_image>python ai_image.py run --type image_edit --model "Nano Banana" \
--input-images photo.jpg \
--prompt "将背景改为海滩" \
--aspect-ratio "16:9"
Mode Selection Guide for Image Edit:
--input-images (single image mode)--input-images img1 img2 ... (multi-image reference mode)Core Principle: Start from the user's intent, not from the API. Analyze what the user wants to achieve, then pick the right tool, model, and parameters.
Every time a user requests content, identify:
| Dimension | Ask Yourself | Fallback |
|---|---|---|
| Output Type | Image? Video? Audio? Composite? | Must ask |
| Purpose | Marketing? Education? Social media? Personal? | General social media |
| Source Material | What does the user have? What's missing? | Must ask |
| Style / Tone | Professional? Casual? Playful? Authoritative? | Professional & friendly |
| Duration | How long should the output be? | 5–15s for clips |
| Language | What language? Need captions? | Match user's language |
| Channel | Where will it be published? | General purpose |
What does the user need?
│
├─ An image animated into a video clip?
│ → video_gen --type i2v
│
├─ A video generated purely from text?
│ → video_gen --type t2v
│
├─ Generate a new video based on the extended version of the original video
│ → video_gen --type extend
│
├─ An image generated from a text prompt?
│ → ai_image --type text2image
│
├─ An existing image edited / modified with AI?
│ → ai_image --type image_edit
│
├─ Replace the video characters with photo characters
│ → Character Replace
│
├─ Photo characters imitate the ations of the video characters
│ → Character Replace
│
├─ view user all results?
│ → user logs
│
└─ Outside current capabilities?
→ See Capability Boundaries below
Quick-reference routing table:
| User says... | Script & Type |
|---|---|
| "Animate this image / image-to-video" | video_gen.py --type i2v --ref-images <image> (omni mode, default) |
| "用3+张图生成视频 / 3+ images to video" | video_gen.py --type omni --ref-images <img1> <img2> <img3> ... (MANDATORY) |
| "用首尾帧生成视频 / use first last frame" | video_gen.py --type i2v --first-frame <img> --end-frame <img> |
| "Generate a video about..." | video_gen.py --type t2v |
| "Extend the original videoo" | video_gen.py --type extend |
| "Generate an image / text-to-image" | ai_image.py --type text2image |
| "Modify this image / change background / Merge these photos" | ai_image.py --type image_edit --input-images <img1> [img2] ... |
| "生成两人的合照 / Create group photo" | ai_image.py --type image_edit --input-images person1.jpg person2.jpg |
| "Character Replace / Action imitation" | video_mimic.py |
| "View my creation history / check what was generated" | user.py logs --type image or user.py logs --type video |
| "Check how many credits I have left" | user.py credit |
Image-to-Video Mode Selection Guide:
When user wants to animate images into video:
Count the images (CRITICAL RULE):
--type omni --ref-images — This is mandatory for multi-image scenarios--type i2v --first-frame/--end-frame--type i2v --ref-images (default omni mode)Check user's intent:
video_gen.py --type i2v --ref-images photo.jpgvideo_gen.py --type omni --ref-images img1.jpg img2.jpg img3.jpgvideo_gen.py --type i2v --first-frame start.jpg --end-frame end.jpgvideo_gen.py --type i2v --first-frame start.jpg --end-frame end.jpgType selection rules:
--type i2v: For single image or first/last frame (1-2 images)--type omni: For multi-image composition (3+ images, MANDATORY)--type i2v --ref-imagesImage Edit Mode Selection Guide:
When user wants to edit or modify images:
Count the reference images:
--input-images photo.jpg (simple edit)--input-images img1.jpg img2.jpg ... (complex composition)Common scenarios:
--input-images photo.jpg --prompt "将背景改为海滩"--input-images person1.jpg person2.jpg --prompt "生成两人的自拍合照"--input-images img1.jpg img2.jpg img3.jpg --prompt "将这些元素合成为一张图"--input-images photo.jpg style.jpg --prompt "应用style.jpg的艺术风格"Best practices:
--input-images for all image edit tasks (supports 1-14 images)Video model selection — see references/video_gen.md § Model Recommendation.
⚠️ CRITICAL: Model Input Mode Compatibility
Different models support different image input modes. You MUST verify compatibility before submitting:
Model Single Image ( single_image)First/End Frame ( first_last_frames)Omni Reference ( omni_reference)Notes Seedance 2.0 ❌ ✅ ✅ Even 1 image uses omni_referenceSeedance 2.0 Fast ❌ ✅ ✅ Even 1 image uses omni_referenceSeedance 2.0 Mini ❌ ✅ ✅ Even 1 image uses omni_referenceSeedance 1.5 Pro ✅ ❌ ❌ Only supports single image HappyHorse 1.0 ❌* ❌ ✅ *Must use --type omniKling V3 ✅ ✅ ❌ Best for single/first-end frames Rules:
- 1 image with
--type i2v→ Use Kling V3 or Seedance 1.5 Pro- 1 image with
--type omni→ Use HappyHorse 1.0, Seedance 2.0, Seedance 2.0 Fast, Seedance 2.0 Mini- 2 images → Seedance 2.0/Fast or Kling V3
- 3+ images → MUST use
--type omniwith Seedance 2.0, Seedance 2.0 Fast, Seedance 2.0 Mini or HappyHorse 1.0- Script will validate and reject incompatible combinations
Image model tip: For all image tasks, default to Nano Banana — strongest all-round model with best quality, 7 aspect ratios, and 14 reference images for editing. See references/ai_image.md § Model Recommendation.
Simple requests — the user's need is clear, materials are ready → handle directly from the reference docs.
Complex requests — the user gives a goal (e.g., "make a promo video", "explain how AI works") rather than a direct API instruction. Follow this universal workflow:
video_gen --type i2v.video_gen --type t2v.Follow this before EVERY generation task.
video_gen.py estimate-cost for video tasks, ai_image.py estimate-cost for image taskslist-models to check)CRITICAL: Before executing any generation task, present the full plan in a structured confirmation page so the user can review and optionally switch models before credits are spent.
Confirmation Page Template:
🎬 视频生成确认 / 🖼️ 图片生成确认 / ✂️ 角色替换确认
• 类型:<type>(<type label>)
• 模型:<current model>(推荐)✓
• 可选模型:<all other available models, separated by " / ">
• 分辨率:<resolution>p
• 时长:<duration>秒
• 画幅:<aspect ratio>
• 预估消耗:<estimated cost> credits
如需更换模型,请直接告诉我想要哪个。
确认无误请回复"确认",或告诉我需要修改的参数。
English Confirmation Page Template:
🎬 Video Generation / 🖼️ Image Generation / ✂️ Character Replace — Confirm
• Type: <type>(<type label>)
• Model: <current model>(Recommended)✓
• Available models: <all available models, separated by " / ">
• Resolution: <resolution>p
• Duration: <duration>s
• Aspect ratio: <aspect ratio>
• Estimated cost: <estimated cost> credits
To switch models, just tell me which one you'd prefer.
Reply "confirm" to proceed, or let me know what you'd like to change.
Optional Model List (Source: output of list-models; models outside the list are not allowed to be displayed):
| Module | Type | Optional Models | Current Selection (Recommended) |
|---|---|---|---|
| video_gen | i2v / t2v | Seedance 2.0 / Seedance 2.0 Fast / Seedance 2.0 Mini / Seedance 1.5 Pro / Kling V3.0 / HappyHorse1.0 | Seedance 2.0 |
| video_gen | extend | PixVerse V6 / Seedance 2.0 / Seedance 2.0 Fast / Kling V3.0 | PixVerse V6 |
| video_mimic | Full_Scene | Kling V3.0 / Wan 2.2 | Kling V3.0 |
| video_mimic | Body_Only | Wan 2.2 | Wan 2.2 |
| ai_image | text2image / image_edit | Gpt Image 2 / Nano Banana 2 / Nano Banana Pro / Seedream 5.0 | Nano Banana 2 |
When there is only a single model (e.g., extend, Body_Only):
• Model: <model> (the only supported option)
User Response Handling:
| User Response | Agent Action |
|---|---|
"Confirm" / "ok" / "Yes" | Execute immediately |
"Switch to <model>" / "Use <model>" | Update model → Re-estimate cost → Re-display confirmation page |
"Change to <param>" | Update parameters → Re-verify → Re-estimate → Re-display confirmation page |
"Skip confirmation" / "Generate directly" | Set automatic session confirmation flag; bypass confirmation page for subsequent tasks |
| Subsequent tasks | Still display confirmation page (with parameters), omit the "Confirm or not" prompt; users may still make modifications by replying with model names |
t2v / i2v / omni — Multiple models available:
🎬 视频生成确认
• 类型:文生视频(t2v)
• 模型:Seedance 2.0(推荐)✓
• 可选模型:Seedance 2.0 Fast / Seedance 2.0 Mini / Seedance 1.5 Pro / Kling V3.0 / HappyHorse1.0
• 分辨率:1080p
• 时长:5秒
• 画幅:16:9
• 预估消耗:10 credits
如需更换模型,请直接告诉我想要哪个。
确认无误请回复"确认",或告诉我需要修改的参数。
English t2v / i2v / omni — Multiple models available:
🎬 Video Generation — Confirm
• Type: Text-to-Video (t2v)
• Model: Seedance 2.0 (Recommended) ✓
• Available models: Seedance 2.0 Fast / Seedance 2.0 Mini / Seedance 1.5 Pro / Kling V3.0 / HappyHorse1.0
• Resolution: 1080p
• Duration: 5s
• Aspect ratio: 16:9
• Estimated cost: 10 credits
To switch models, just tell me which one you'd prefer.
Reply "confirm" to proceed, or let me know what you'd like to change.
extend — Multiple models available:
🎬 视频扩展确认
• 类型:视频扩展(extend)
• 模型:PixVerse V6 / Seedance 2.0 / Seedance 2.0 Fast / Kling V3.0
• 预估消耗:XX credits
如需更换模型,请直接告诉我想要哪个。
确认无误请回复"确认",或告诉我需要修改的参数。
English extend — Multiple models available:
🎬 Video Extension — Confirm
• Type: Video Extension (extend)
• Model: PixVerse V6 / Seedance 2.0 / Seedance 2.0 Fast / Kling V3.0
• Estimated cost: XX credits
To switch models, just tell me which one you'd prefer.
Reply "confirm" to proceed, or let me know what you'd like to change.
Full_Scene — Multiple models available:
✂️ 角色替换确认
• 类型:全场景替换(Full_Scene)
• 模型:Kling V3.0(推荐)✓
• 可选模型:Wan 2.2
• 分辨率:720p
• 预估消耗:XX credits
如需更换模型,请直接告诉我想要哪个。
确认无误请回复"确认",或告诉我需要修改的参数。
English Full_Scene — Multiple models available:
✂️ Character Replace — Confirm
• Type: Full Scene Replace (Full_Scene)
• Model: Kling V3.0 (Recommended) ✓
• Available models: Wan 2.2
• Resolution: 720p
• Estimated cost: XX credits
To switch models, just tell me which one you'd prefer.
Reply "confirm" to proceed, or let me know what you'd like to change.
Body_Only — single model:
✂️ 角色替换确认
• 类型:仅身体替换(Body_Only)
• 模型:Wan 2.2(唯一支持)
• 分辨率:720p
• 预估消耗:XX credits
确认无误请回复"确认",或告诉我需要修改的参数。
English Body_Only — single model:
✂️ Character Replace — Confirm
• Type: Body Only (Body_Only)
• Model: Wan 2.2 (Only option)
• Resolution: 720p
• Estimated cost: XX credits
Reply "confirm" to proceed, or let me know what you'd like to change.
text2image / image_edit — Multiple models available:
🖼️ AI 图片生成确认
• 类型:文字生图(text2image)/ 图片编辑(image_edit)
• 模型:Nano Banana 2(推荐)✓
• 可选模型:Gpt Image 2 / Nano Banana Pro / Seedream 5.0
• 分辨率:2K
• 品质:<Gpt Image 2:低 / 中 / 高(默认低);其他模型:无>
• 画幅:16:9
• 预估消耗:XX credits
如需更换模型,请直接告诉我想要哪个。
确认无误请回复"确认",或告诉我需要修改的参数。
English text2image / image_edit — Multiple models available:
🖼️ AI Image Generation Confirmation
• Type: Text-to-Image (text2image) / Image Editing (image_edit)
• Model: Nano Banana 2 (Recommended) ✓
• Available models: Gpt Image 2 / Nano Banana Pro / Seedream 5.0
• Resolution: 2K
• Quality: <Gpt Image 2: Low / Medium / High (default: Low); other models: N/A>
• Aspect Ratio: 16:9
• Estimated cost: XX credits
To switch models, just tell me which one you'd prefer.
Reply "confirm" to proceed, or let me know what you'd like to change.
---
## Agent Behavior Protocol
### During Execution
1. **Pass local paths directly** — scripts auto-upload local files to OSS before submitting tasks
2. **Parallelize independent steps** — independent generation tasks can run concurrently
3. **Keep consistency across segments** — when generating multiple segments, use identical parameters
### After Execution
> **Use the structured result templates below.** The user should see the output link first, then key metadata. Keep it clean and scannable.
**Video result template:**
```text
🎬 视频已生成完成
🔗视频地址:<VIDEO_URL>
• 时长:<DURATION>
• 画幅:<ASPECT_RATIO>
• 模型:<MODEL_NAME>
• 消耗:<COST> credits
不满意的话可以告诉我,我帮你调整后重新生成。
Image result template:
🖼️ 图片已生成完成
🔗 图片地址:<IMAGE_URL>
• 分辨率:<RESOLUTION>
• 模型:<MODEL_NAME>
• 消耗:<COST> credits
不满意的话可以告诉我,我帮你调整后重新生成。
English video result template:
🎬 Video generated
🔗 Video: <VIDEO_URL>
• Duration: <DURATION>
• Aspect ratio: <ASPECT_RATIO>
• Model: <MODEL_NAME>
• Cost: <COST> credits
View, edit, and download in the project.
Not happy with the result? Let me know and I'll adjust and regenerate.
English image result template:
🖼️ Image generated
🔗 Image: <IMAGE_URL>
• Resolution: <RESOLUTION>
• Model: <MODEL_NAME>
• Cost: <COST> credits
Not happy with the result? Let me know and I'll adjust and regenerate.
Rules:
See references/error_handling.md for error codes, task-level failures, and recovery decision tree.
🚨 CRITICAL: NO automatic model switching on failure.
When a task fails or times out:
- DO NOT resubmit automatically — never switch to a different model and resubmit without the user's knowledge
- Return the error to the user — tell them in plain language what went wrong (e.g. "生成失败了,积分可能不足")
- Ask if they want to retry — if yes, go back to Step 1 of Pre-Execution Protocol (re-estimate, re-confirm)
- Only the user decides whether to try a different model — the agent must never unilaterally change the confirmed model
The only exception: if
querytimes out (exit code 2), it is safe to resume polling with the same taskId usingquery --task-id <id> --timeout 1200. This is not a resubmission — it just continues waiting for the same task.
| Capability | Status | Script |
|---|---|---|
| Credit management | Available | scripts/user.py |
| Image-to-video (i2v) | Available | scripts/video_gen.py --type i2v |
| Text-to-video (t2v) | Available | scripts/video_gen.py --type t2v |
| Video Extension (extend) | Available | scripts/video_gen.py --type extend |
| Text-to-image | Available | scripts/ai_image.py --type text2image |
| Image editing | Available | scripts/ai_image.py --type image_edit |
| Character Replace | Available | scripts/video_mimic.py |
| Creation history browsing | Available | scripts/user.py logs --type image or scripts/user.py logs --type video |
| Marketing video (m2v) | No module | Suggest chatartpro.com web UI |
Never promise capabilities that don't exist as modules.