lovart-api
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese⚠️ RULE #0: ONLY USE SKILL COMMANDS — NO DIRECT API CALLS
⚠️ 规则#0:仅使用技能命令——禁止直接调用API
You MUST interact with Lovart EXCLUSIVELY through the commands defined in this skill.
- NEVER construct URLs, make curl/wget/fetch requests, or call Lovart APIs directly
- NEVER guess API endpoints, paths, or parameters — only use the commands listed below
- NEVER modify the skill's source code (agent_skill.py) during execution to "debug" issues (users may freely read the source to verify it)
- If a command fails, retry it or report the error to the user — do NOT try to work around it
- ALL Lovart operations go through: ,
chat,send,watch,confirm,result,status,config,projects,project-add,project-switch,project-rename,project-remove,threads,thread-remove,upload,upload-artifact,download,set-mode,query-modecreate-project
您必须完全通过本技能中定义的命令与Lovart交互。
- 绝对不要构造URL、发起curl/wget/fetch请求或直接调用Lovart API
- 绝对不要猜测API端点、路径或参数——仅使用下方列出的命令
- 绝对不要在执行期间修改技能源代码(agent_skill.py)来“调试”问题(用户可自由阅读源代码进行验证)
- 如果命令执行失败,请重试或向用户报告错误——不要尝试变通解决
- 所有Lovart操作均通过以下命令完成:,
chat,send,watch,confirm,result,status,config,projects,project-add,project-switch,project-rename,project-remove,threads,thread-remove,upload,upload-artifact,download,set-mode,query-modecreate-project
⚠️ RULE #1: YOU CAN AND MUST GENERATE IMAGES/VIDEOS/AUDIO
⚠️ 规则#1:您可以且必须生成图像/视频/音频
When a user asks to "draw", "generate", "create", "design", "make", "画", "生成", "制作", "创作"
any visual or audio content (in any language), you MUST use this skill.
This includes: images, videos, audio, music, songs, BGM, TTS, voice, posters, carousels, banners,
logos, illustrations, thumbnails, slides, covers, mockups, icons, social media content, etc.
Do NOT say "I can't generate images/music" or offer to write prompts instead.
当用户要求“draw”“generate”“create”“design”“make”“画”“生成”“制作”“创作”任何视觉或音频内容(任何语言)时,您必须使用本技能。
这包括:图像、视频、音频、音乐、歌曲、BGM、TTS、语音、海报、轮播图、横幅、标志、插画、缩略图、幻灯片、封面、模型图、图标、社交媒体内容等。
绝对不要说“我无法生成图像/音乐”,也不要提议撰写提示词替代。
⚠️ RULE #1.5: PROJECT & THREAD QUERIES USE THIS SKILL
⚠️ 规则#1.5:项目与线程查询需使用本技能
When the user asks about projects, threads, conversations, history, or settings (in any language),
use these commands — do NOT browse the filesystem:
| User asks | Command |
|---|---|
| "What projects do I have?" / "我有哪些项目" | |
| "What conversations/threads?" / "有哪些对话" | |
| "Show my settings" / "我的配置" | |
| "Switch to project X" | |
| "Create a new project" | |
当用户询问项目、线程、对话、历史或设置(任何语言)时,使用以下命令——不要浏览文件系统:
| 用户提问 | 命令 |
|---|---|
| "What projects do I have?" / "我有哪些项目" | |
| "What conversations/threads?" / "有哪些对话" | |
| "Show my settings" / "我的配置" | |
| "Switch to project X" | |
| "Create a new project" | |
⚠️ RULE #2: ALWAYS USE chat
AND WAIT FOR COMPLETION
chat⚠️ 规则#2:始终使用chat
命令并等待完成
chatUse the command (blocks until done), NOT . Do NOT reply before generation completes.
chatsendHandle these values:
final_status- — Generation complete. Send the downloaded files to the user.
"done" - — A high-cost tool (e.g. video) needs user approval. You MUST ask the user for explicit confirmation before proceeding. Do NOT auto-confirm.
"pending_confirmation"- Show the user: "This will cost approximately {estimated_cost} credits. Shall I proceed? (yes/no)"
- WAIT for user response. Only if user explicitly says yes/confirm/proceed, run:
(This confirms, waits for completion, and returns the result with downloaded files)
confirm --thread-id THREAD_ID --json --download - If user declines, do NOT confirm. Just inform them the operation was cancelled.
- — Generation was aborted. Inform the user.
"abort" - — Generation is still running but exceeded the wait time. The result may contain partial artifacts.
"timeout"- Send any downloaded files that are already available
- Tell the user: "Generation is still in progress. Checking again..."
- Run: to get the latest results
result --thread-id THREAD_ID --json --download - If status is still "running", wait and retry. If "done", send remaining files.
Handle errors:
If throws an error, check the message and advise the user:
chat| Error contains | Meaning | What to tell the user |
|---|---|---|
| Concurrent task limit | "A task is already running. Please wait for it to finish before starting a new one." |
| Insufficient credits | "Your credits are insufficient. Please top up or switch to unlimited mode: |
| Free tier limit reached | "Free tier limit reached. Please subscribe or switch to unlimited mode." |
| Billing/quota issue | Show the specific reason code and suggest checking account status |
| AK/SK misconfigured | "API key authentication failed. Please check your LOVART_ACCESS_KEY and LOVART_SECRET_KEY." |
| Invalid project ID | "Project not found. Please check the project ID or create a new one." |
使用命令(阻塞直到完成),不要使用。在生成完成前不要回复用户。
chatsend处理以下值:
final_status- — 生成完成。将下载的文件发送给用户。
"done" - — 高成本工具(如视频生成)需要用户确认。 您必须在继续前获得用户的明确确认,不要自动确认。
"pending_confirmation"- 告知用户:“此操作大约需要{estimated_cost}积分,是否继续?(是/否)”
- 等待用户回复。只有当用户明确回复是/确认/继续时,执行:
(此命令会确认操作、等待完成,并返回包含已下载文件的结果)
confirm --thread-id THREAD_ID --json --download - 如果用户拒绝,不要执行确认操作,仅告知用户操作已取消。
- — 生成已中止。告知用户。
"abort" - — 生成仍在运行但超出等待时间。结果可能包含部分产物。
"timeout"- 发送所有已下载的可用文件
- 告知用户:“生成仍在进行中,再次检查...”
- 执行:获取最新结果
result --thread-id THREAD_ID --json --download - 如果状态仍为“running”,等待并重试;如果状态为“done”,发送剩余文件。
处理错误:
如果命令抛出错误,检查错误信息并告知用户:
chat| 错误包含内容 | 含义 | 告知用户的内容 |
|---|---|---|
| 并发任务限制 | “已有任务正在运行,请等待当前任务完成后再启动新任务。” |
| 积分不足 | “您的积分不足,请充值或切换至无限模式: |
| 免费额度已用完 | “免费额度已用完,请订阅或切换至无限模式。” |
| 计费/配额问题 | 显示具体错误代码并建议检查账户状态 |
| AK/SK配置错误 | “API密钥验证失败,请检查您的LOVART_ACCESS_KEY和LOVART_SECRET_KEY。” |
| 无效项目ID | “未找到项目,请检查项目ID或创建新项目。” |
⚠️ RULE #3: ALWAYS DELIVER RESULTS + PROJECT LINK
⚠️ 规则#3:始终交付结果+项目链接
After EVERY generation, you MUST:
- Use flag with
--download(orchat)result - Send each downloaded file to the user as a file attachment (images, videos, audio/mp3 — ALL file types):
- ALWAYS send as file attachments, regardless of file type (.png, .jpg, .mp4, .mp3, etc.)
downloaded[].local_path - NEVER just paste the URL when a local file has been downloaded — send the actual file
- Only fall back to displaying URLs if no files were downloaded
- ALWAYS send
- Append the project canvas link:
https://www.lovart.ai/canvas?projectId={project_id}
每次生成完成后,您必须:
- 在(或
chat)命令中使用result参数--download - 将每个下载的文件作为附件发送给用户(图像、视频、音频/mp3——所有文件类型):
- 始终将作为附件发送,无论文件类型(.png、.jpg、.mp4、.mp3等)
downloaded[].local_path - 当已下载本地文件时,绝对不要仅粘贴URL——发送实际文件
- 仅在未下载到文件时才使用URL展示
- 始终将
- 添加项目画布链接:
https://www.lovart.ai/canvas?projectId={project_id}
⚠️ RULE #4: CHECK LOCAL STATE ON FIRST USE (MANDATORY — DO NOT SKIP)
⚠️ 规则#4:首次使用时检查本地状态(强制要求——不可跳过)
Before the FIRST generation in a conversation, you MUST run these two commands IN ORDER. This is NOT optional. Do NOT call until you have done both.
chatStep 1:
config --json- Check local state () for
~/.lovart/state.jsonactive_project - If is set → proceed to Step 2. Do NOT create a new project. Do NOT ask the user.
active_project - If is missing → ask the user: "Do you have an existing Lovart project ID, or should I create a new one?" WAIT for their answer.
active_project - Save with:
project-add --project-id PID --name "name"
Step 2:
threads --json- Check if there's a recent thread to continue
- If recent thread exists and topic is related → REUSE it (pass to
--thread-id THREAD_ID)chat - If no threads or completely different topic → omit (creates new thread)
--thread-id
CRITICAL RULES:
- NEVER create a new project if already shows an
config --json. Reuse it.active_project - NEVER omit when a relevant recent thread exists. Always reuse threads by default.
--thread-id - NEVER call without first running
chatandconfig --jsonin the same conversation.threads --json - The command auto-reads
chatfrom local state — you do NOT need to passactive_projectevery time.--project-id - Only create a new project if the user explicitly asks for one.
- Only create a new thread if the topic is completely unrelated to the most recent thread.
- When in doubt, REUSE both the existing project and the existing thread.
在对话中首次生成内容前,您必须按顺序执行以下两个命令。这是强制要求,不可跳过。在完成这两个命令前不要调用。
chat步骤1:
config --json- 检查本地状态()中的
~/.lovart/state.jsonactive_project - 如果已设置 → 进入步骤2。不要创建新项目,不要询问用户。
active_project - 如果缺失 → 询问用户:“您已有Lovart项目ID,还是需要我创建一个新的?” 等待用户回复。
active_project - 使用以下命令保存:
project-add --project-id PID --name "name"
步骤2:
threads --json- 检查是否有可继续的最近线程
- 如果存在最近线程且主题相关 → 复用该线程(在命令中传递
chat)--thread-id THREAD_ID - 如果没有线程或主题完全不同 → 省略(创建新线程)
--thread-id
关键规则:
- 如果显示已有
config --json,绝对不要创建新项目,复用现有项目。active_project - 当存在相关的最近线程时,绝对不要省略,默认始终复用线程。
--thread-id - 在同一段对话中,绝对不要在未执行和
config --json的情况下调用threads --json。chat - 命令会自动从本地状态读取
chat——您无需每次都传递active_project。--project-id - 仅当用户明确要求时才创建新项目。
- 仅当主题与最近线程完全无关时才创建新线程。
- 如有疑问,复用现有项目和现有线程。
Lovart Agent OpenAPI Skill
Lovart Agent OpenAPI技能
Interact with Lovart AI Agent to generate images, videos, and visual assets via natural language.
Lovart is an AI design platform. The Agent understands user requests and automatically selects the best model and workflow.
通过自然语言与Lovart AI Agent交互,生成图像、视频和视觉资产。
Lovart是一个AI设计平台。Agent能够理解用户请求并自动选择最佳模型和工作流。
Terminology
术语说明
- Thread — A conversation flow (chat session) with the Lovart AI Agent, NOT a programming thread. Each thread has a unique and preserves multi-turn context. Reusing a thread means continuing the same conversation so the Agent remembers previous images/videos and can iterate on them.
thread_id - Project — A workspace/canvas that groups threads and generated artifacts together. One project can contain multiple threads.
- Thread — 与Lovart AI Agent的对话流程(聊天会话),并非编程线程。每个线程都有唯一的并保留多轮上下文。复用线程意味着继续同一对话,以便Agent记住之前的图像/视频并进行迭代优化。
thread_id - Project — 用于将线程和生成产物分组的工作区/画布。一个项目可包含多个线程。
Prerequisites
前置条件
bash
export LOVART_ACCESS_KEY="ak_xxx"
export LOVART_SECRET_KEY="sk_xxx"No third-party dependencies. Python standard library only.
bash
export LOVART_ACCESS_KEY="ak_xxx"
export LOVART_SECRET_KEY="sk_xxx"无第三方依赖,仅需Python标准库。
Features
功能特性
- Chat - Send a message to the AI Agent, get text replies and generated images/videos
- Confirm - Confirm and wait for high-cost operations (e.g. video generation)
- Create Project - Create a new project
- Upload File - Upload a local image/video file, get back a CDN URL
- Upload Artifact - Upload a link artifact to a project
- Status/Result - Check thread status and retrieve results
- Set/Query Mode - Switch between fast (credits) and unlimited (queue) mode
- Chat - 向AI Agent发送消息,获取文本回复和生成的图像/视频
- Confirm - 确认并等待高成本操作(如视频生成)完成
- Create Project - 创建新项目
- Upload File - 上传本地图像/视频文件,获取CDN链接
- Upload Artifact - 将链接产物上传至项目
- Status/Result - 检查线程状态并获取结果
- Set/Query Mode - 在快速(消耗积分)和无限(排队)模式间切换
Usage
使用方法
0. First-time setup (saves to ~/.lovart/state.json)
0. 首次设置(保存至~/.lovart/state.json)
bash
python3 {baseDir}/agent_skill.py project-add --project-id PROJECT_ID --name "My Project"bash
python3 {baseDir}/agent_skill.py project-add --project-id PROJECT_ID --name "My Project"1. Send a message (reads project_id from local state)
1. 发送消息(从本地状态读取project_id)
bash
python3 {baseDir}/agent_skill.py chat --prompt "USER_PROMPT" --json --downloadTo override project: add
To continue a conversation: add
To list saved threads:
--project-id PROJECT_ID--thread-id THREAD_IDpython3 {baseDir}/agent_skill.py threadsbash
python3 {baseDir}/agent_skill.py chat --prompt "USER_PROMPT" --json --download如需覆盖项目:添加
如需继续对话:添加
如需列出已保存线程:
--project-id PROJECT_ID--thread-id THREAD_IDpython3 {baseDir}/agent_skill.py threads2. Create a project
2. 创建项目
bash
python3 {baseDir}/agent_skill.py create-projectbash
python3 {baseDir}/agent_skill.py create-project3. Upload a file (local image/video → CDN URL)
3. 上传文件(本地图像/视频 → CDN链接)
bash
python3 {baseDir}/agent_skill.py upload --file /path/to/image.pngbash
python3 {baseDir}/agent_skill.py upload --file /path/to/image.pngReturns: {"url": "https://assets-persist.lovart.ai/img/{user_uuid}/xxx.png"}
Use this when the user sends an image/video file that needs to be passed as an attachment to chat.
当用户发送需要作为附件传递给chat的图像/视频文件时使用此命令。4. Upload an artifact
4. 上传产物
bash
python3 {baseDir}/agent_skill.py upload-artifact --project-id PROJECT_ID --url "ARTIFACT_URL" --type imagebash
python3 {baseDir}/agent_skill.py upload-artifact --project-id PROJECT_ID --url "ARTIFACT_URL" --type image5. Check status / get result
5. 检查状态 / 获取结果
bash
undefinedbash
undefinedStatus
查看状态
python3 {baseDir}/agent_skill.py status --thread-id THREAD_ID
python3 {baseDir}/agent_skill.py status --thread-id THREAD_ID
Result (auto-syncs to gallery/canvas, idempotent)
获取结果(自动同步至图库/画布,幂等操作)
python3 {baseDir}/agent_skill.py result --thread-id THREAD_ID --json --download
undefinedpython3 {baseDir}/agent_skill.py result --thread-id THREAD_ID --json --download
undefined6. Download artifacts
6. 下载产物
bash
undefinedbash
undefinedDownload during chat
在聊天时下载
python3 {baseDir}/agent_skill.py chat --prompt "draw a cat" --json --download --output-dir /tmp/openclaw
python3 {baseDir}/agent_skill.py chat --prompt "draw a cat" --json --download --output-dir /tmp/openclaw
Download from existing result
从已有结果下载
python3 {baseDir}/agent_skill.py result --thread-id THREAD_ID --download --output-dir /tmp/openclaw
python3 {baseDir}/agent_skill.py result --thread-id THREAD_ID --download --output-dir /tmp/openclaw
Download specific URLs
下载指定URL
python3 {baseDir}/agent_skill.py download --urls URL1 URL2 --output-dir /tmp/openclaw --prefix myimg
undefinedpython3 {baseDir}/agent_skill.py download --urls URL1 URL2 --output-dir /tmp/openclaw --prefix myimg
undefinedTypical Workflows
典型工作流
Scenario 1: Generate images/videos/audio (most common)
场景1:生成图像/视频/音频(最常见)
First, run to check if project_id is set. If not, ask the user and save with .
config --jsonproject-add1. config --json → check local state for active_project
- If not set → ask user, save with project-add
2. threads --json → check if there's a recent thread to continue
- If recent thread exists and topic is related → reuse it (step 3a)
- If no threads or completely new topic → new thread (step 3b)
3a. chat --thread-id THREAD_ID --prompt "user's request" --json --download
3b. chat --prompt "user's request" --json --download
4. Send each downloaded[].local_path file as an IM attachment to the user
5. The chat command auto-syncs artifacts to canvas and galleryIDs are auto-persisted locally ():
~/.lovart/state.json- project_id is saved after first chat, reused automatically
- thread_id + topic are saved after each chat for thread switching
- Only create a new project if the user explicitly asks for one
- Only create a new thread (omit ) when starting a completely new topic
--thread-id - Run to list saved threads for the user to pick from
threads
首先,执行检查是否已设置project_id。如果未设置,询问用户并使用保存。
config --jsonproject-add1. config --json → 检查本地状态中的active_project
- 如果未设置 → 询问用户,使用project-add保存
2. threads --json → 检查是否有可继续的最近线程
- 如果存在最近线程且主题相关 → 复用该线程(步骤3a)
- 如果没有线程或主题全新 → 创建新线程(步骤3b)
3a. chat --thread-id THREAD_ID --prompt "用户的请求" --json --download
3b. chat --prompt "用户的请求" --json --download
4. 将每个downloaded[].local_path文件作为即时通讯附件发送给用户
5. chat命令会自动将产物同步至画布和图库ID会自动本地持久化():
~/.lovart/state.json- project_id在首次聊天后保存,自动复用
- thread_id + 主题在每次聊天后保存,用于线程切换
- 仅当用户明确要求时才创建新项目
- 仅当开始完全全新的主题时才创建新线程(省略)
--thread-id - 执行命令列出已保存线程供用户选择
threads
Scenario 2: Edit with attachments
场景2:带附件的编辑
1. User sends a reference image/video via IM → save to local file
2. upload --file /path/to/image.png → get CDN URL
3. chat --prompt "edit this image to..." --project-id PID --attachments "CDN_URL" --json --download
4. Continue as Scenario 11. 用户通过即时通讯发送参考图像/视频 → 保存至本地文件
2. upload --file /path/to/image.png → 获取CDN链接
3. chat --prompt "将此图像编辑为..." --project-id PID --attachments "CDN_URL" --json --download
4. 按照场景1的流程继续Scenario 3: Follow-up on same topic (continue context)
场景3:同一主题的后续操作(延续上下文)
1. chat --prompt "change the background to a beach" --project-id PROJECT_ID --thread-id THREAD_ID --json --downloadThe Agent remembers the previous conversation and can continue editing based on context.
1. chat --prompt "将背景改为海滩" --project-id PROJECT_ID --thread-id THREAD_ID --json --downloadAgent会记住之前的对话,并可基于上下文继续编辑。
Scenario 4: New topic (new thread)
场景4:新主题(新线程)
1. chat --prompt "completely new request" --project-id PROJECT_ID --json --downloadOmitting creates a new conversation without previous memory.
--thread-id1. chat --prompt "完全全新的请求" --project-id PROJECT_ID --json --download省略会创建无历史记忆的新对话。
--thread-idScenario 5: Streaming / incremental delivery (multiple artifacts)
场景5:流式/增量交付(多产物)
Use when the user's request will produce multiple images/videos and you want to deliver each one to the user as soon as it's ready, rather than waiting for the whole batch.
bash
python3 {baseDir}/agent_skill.py watch --prompt "generate 4 variations of a cyberpunk cat" --jsonwatchartifactlocal_pathjson
{"event": "started", "thread_id": "xxx", "project_id": "yyy"}
{"event": "artifact", "type": "image", "url": "https://...", "local_path": "/tmp/openclaw/lovart_ab12cd.png"}
{"event": "artifact", "type": "image", "url": "https://...", "local_path": "/tmp/openclaw/lovart_ef34gh.png"}
{"event": "pending_confirmation", "thread_id": "xxx", "pending_confirmation": {...}}
{"event": "finished", "thread_id": "xxx", "final_status": "done", "artifact_count": 4}Files are saved with URL-hash filenames so re-running on the same thread won't re-download.
watchYou can also attach to an already-running thread: .
watch --thread-id THREAD_IDWhen NOT to use : single-image requests — use (simpler, one-shot response).
watchchat适用场景:用户请求会生成多个图像/视频,您希望在每个产物就绪后立即交付给用户,而非等待整个批次完成。
bash
python3 {baseDir}/agent_skill.py watch --prompt "generate 4 variations of a cyberpunk cat" --jsonwatchartifactlocal_pathjson
{"event": "started", "thread_id": "xxx", "project_id": "yyy"}
{"event": "artifact", "type": "image", "url": "https://...", "local_path": "/tmp/openclaw/lovart_ab12cd.png"}
{"event": "artifact", "type": "image", "url": "https://...", "local_path": "/tmp/openclaw/lovart_ef34gh.png"}
{"event": "pending_confirmation", "thread_id": "xxx", "pending_confirmation": {...}}
{"event": "finished", "thread_id": "xxx", "final_status": "done", "artifact_count": 4}文件会以URL哈希命名,因此在同一线程上重新执行不会重复下载。
watch您也可以附加到已在运行的线程:。
watch --thread-id THREAD_ID不适用场景:单图像请求——使用命令(更简单,单次响应)。
chatOutput Format
输出格式
chat --json returns:
json
{
"thread_id": "xxx",
"status": "done",
"project_id": "xxx",
"final_status": "done",
"items": [
{"type": "assistant", "text": "Agent's reply"},
{"type": "generator", "name": "artifacts", "artifacts": [
{"type": "image", "content": "https://assets-persist.lovart.ai/artifacts/agent/xxx.png"},
{"type": "video", "content": "https://assets-persist.lovart.ai/artifacts/agent/xxx.mp4"}
]}
],
"downloaded": [
{"type": "image", "url": "https://...", "local_path": "/tmp/openclaw/lovart_01.png"}
]
}chat --json返回结果:
json
{
"thread_id": "xxx",
"status": "done",
"project_id": "xxx",
"final_status": "done",
"items": [
{"type": "assistant", "text": "Agent的回复"},
{"type": "generator", "name": "artifacts", "artifacts": [
{"type": "image", "content": "https://assets-persist.lovart.ai/artifacts/agent/xxx.png"},
{"type": "video", "content": "https://assets-persist.lovart.ai/artifacts/agent/xxx.mp4"}
]}
],
"downloaded": [
{"type": "image", "url": "https://...", "local_path": "/tmp/openclaw/lovart_01.png"}
]
}Core Principle
核心原则
You are a messenger, not a creator. The backend Agent handles understanding requirements, selecting models, and writing prompts. Your job:
- Relay: Pass the user's original description verbatim to chat
- Wait: Poll until generation completes
- Deliver: Send result files to the user
Do NOT rewrite/expand prompts, break down tasks, or add your own style descriptions.
您是信使,而非创作者。后端Agent负责理解需求、选择模型和撰写提示词。您的职责:
- 传递:将用户的原始描述原封不动地传递给chat命令
- 等待:轮询直到生成完成
- 交付:将结果文件发送给用户
绝对不要重写/扩展提示词、拆分任务或添加自己的风格描述。
Lovart Generation Mode (MUST use API, not prompt)
Lovart生成模式(必须使用API,而非提示词)
CRITICAL: "Fast mode" and "unlimited mode" are server-side settings controlled via API calls, NOT prompt keywords.
Do NOT put "快速模式" or "fast mode" in the prompt text. Instead, call the set-mode command:
bash
undefined关键提示:“快速模式”和“无限模式”是通过API调用控制的服务器端设置,而非提示词关键词。
不要在提示文本中加入“快速模式”或“fast mode”。请调用set-mode命令:
bash
undefinedUser says "fast mode" / "快速模式" / "skip queue" / "use credits" → RUN THIS:
用户说"fast mode" / "快速模式" / "skip queue" / "use credits" → 执行此命令:
python3 {baseDir}/agent_skill.py set-mode --fast
python3 {baseDir}/agent_skill.py set-mode --fast
User says "unlimited mode" / "无限模式" / "free mode" / "save credits" → RUN THIS:
用户说"unlimited mode" / "无限模式" / "free mode" / "save credits" → 执行此命令:
python3 {baseDir}/agent_skill.py set-mode --unlimited
python3 {baseDir}/agent_skill.py set-mode --unlimited
Check which mode is active:
检查当前激活的模式:
python3 {baseDir}/agent_skill.py query-mode
**How it works:**
- `set-mode --fast` calls the Lovart backend API to switch the user's account to fast generation (costs credits, no queue)
- `set-mode --unlimited` switches to unlimited generation (free, may queue)
- This is a **persistent server-side setting** — it stays until changed again
- It affects ALL subsequent image/video generations, not just one request
- It has **nothing to do with your (the assistant's) response style or behavior**python3 {baseDir}/agent_skill.py query-mode
**工作原理:**
- `set-mode --fast`调用Lovart后端API将用户账户切换至快速生成模式(消耗积分,无需排队)
- `set-mode --unlimited`切换至无限生成模式(免费,可能需要排队)
- 这是**持久化的服务器端设置**——会保持有效直到再次更改
- 会影响所有后续的图像/视频生成,而非仅单次请求
- 与您(助手)的回复风格或行为**完全无关**Specifying Models
指定模型
Option 1: In the prompt (simple, the Agent routes automatically):
bash
python3 {baseDir}/agent_skill.py chat --prompt "generate ocean waves video using kling" --json --downloadOption 2: Via --prefer-models (precise, same as frontend's model selector):
bash
undefined选项1:在提示词中指定(简单,Agent会自动路由):
bash
python3 {baseDir}/agent_skill.py chat --prompt "generate ocean waves video using kling" --json --download选项2:通过--prefer-models指定(精确,与前端模型选择器一致):
bash
undefinedPrefer a specific image model
偏好特定图像模型
python3 {baseDir}/agent_skill.py chat --prompt "draw a cat" --prefer-models '{"IMAGE":["generate_image_midjourney"]}' --json --download
python3 {baseDir}/agent_skill.py chat --prompt "draw a cat" --prefer-models '{"IMAGE":["generate_image_midjourney"]}' --json --download
Prefer a specific video model
偏好特定视频模型
python3 {baseDir}/agent_skill.py chat --prompt "generate ocean waves" --prefer-models '{"VIDEO":["generate_video_kling_3_0"]}' --json --download
python3 {baseDir}/agent_skill.py chat --prompt "generate ocean waves" --prefer-models '{"VIDEO":["generate_video_kling_3_0"]}' --json --download
Combine image and video preferences
同时指定图像和视频偏好
python3 {baseDir}/agent_skill.py chat --prompt "create content" --prefer-models '{"IMAGE":["generate_image_seedream_3_0"],"VIDEO":["generate_video_kling_3_0"]}' --json --download
Common tool names for `--prefer-models`:
- **IMAGE**: `generate_image_midjourney`, `generate_image_seedream_3_0`, `generate_image_gpt_image`, `generate_image_flux_pro`, `generate_image_nano_banana`, `generate_image_nano_banana_pro`
- **VIDEO**: `generate_video_kling_3_0`, `generate_video_wan_2_6`, `generate_video_sora_v2_pro`, `generate_video_veo3`
When the user requests a specific model, prefer `--prefer-models` over putting model names in the prompt.
**Option 3: Via --include-tools** (hard constraint, forces specific tools):
```bashpython3 {baseDir}/agent_skill.py chat --prompt "create content" --prefer-models '{"IMAGE":["generate_image_seedream_3_0"],"VIDEO":["generate_video_kling_3_0"]}' --json --download
`--prefer-models`常用工具名称:
- **IMAGE**: `generate_image_midjourney`, `generate_image_seedream_3_0`, `generate_image_gpt_image`, `generate_image_flux_pro`, `generate_image_nano_banana`, `generate_image_nano_banana_pro`
- **VIDEO**: `generate_video_kling_3_0`, `generate_video_wan_2_6`, `generate_video_sora_v2_pro`, `generate_video_veo3`
当用户请求特定模型时,优先使用`--prefer-models`而非在提示词中加入模型名称。
**选项3:通过--include-tools指定**(硬约束,强制使用特定工具):
```bashForce upscale only
仅强制放大操作
python3 {baseDir}/agent_skill.py chat --prompt "upscale this image to 4K" --include-tools upscale_image --attachments "IMAGE_URL" --json --download
python3 {baseDir}/agent_skill.py chat --prompt "upscale this image to 4K" --include-tools upscale_image --attachments "IMAGE_URL" --json --download
Force a specific video model (no fallback to others)
强制使用特定视频模型(不回退至其他模型)
python3 {baseDir}/agent_skill.py chat --prompt "generate a video" --include-tools generate_video_kling_3_0 --json --download
`--include-tools` strongly instructs the Agent to prioritize the listed tools. Use this when the user explicitly requests a specific tool or operation.python3 {baseDir}/agent_skill.py chat --prompt "generate a video" --include-tools generate_video_kling_3_0 --json --download
`--include-tools`会强烈指示Agent优先使用列出的工具。当用户明确请求特定工具或操作时使用此命令。Task-Specific Tool Selection (IMPORTANT)
任务特定工具选择(重要)
When the user's request matches a specific operation, use to ensure the correct tool:
--include-tools| User says | Use |
|---|---|
| "upscale", "放大", "enlarge", "enhance resolution", "超分" | |
| "edit image", "modify", "change style" | (let Agent decide) |
| "generate image", "draw", "画" | (let Agent decide, or use |
CRITICAL: When the user asks to "upscale", "enlarge", or increase resolution of an existing image, you MUST use . Do NOT let the Agent use image generation models for upscaling — they will re-generate the image instead of upscaling it.
--include-tools upscale_image当用户请求匹配特定操作时,使用确保使用正确工具:
--include-tools| 用户提问 | 使用 |
|---|---|
| "upscale", "放大", "enlarge", "enhance resolution", "超分" | |
| "edit image", "modify", "change style" | (由Agent决定) |
| "generate image", "draw", "画" | (由Agent决定,或使用 |
关键提示:当用户要求“放大”“enlarge”或提升现有图像分辨率时,您必须使用。不要让Agent使用图像生成模型进行放大——它们会重新生成图像而非进行放大操作。
--include-tools upscale_imageNotes
注意事项
- All APIs use AK/SK HMAC-SHA256 signature authentication
- Video generation takes several minutes; the chat command auto-polls until complete
- Gallery and canvas sync is idempotent — safe to call result multiple times without duplicates
- Connection failures auto-retry 3 times with SSL fallback
- After status becomes "done", waits 5 seconds to re-confirm (guards against sub-agent startup race)
- 所有API均使用AK/SK HMAC-SHA256签名认证
- 视频生成需要数分钟;chat命令会自动轮询直到完成
- 图库和画布同步是幂等操作——多次调用result命令不会产生重复内容
- 连接失败会自动重试3次,并重试时使用SSL fallback
- 当状态变为“done”后,会等待5秒再次确认(防止子Agent启动竞争问题)