IMA model generation with exactly two Sevio models: Ima Sevio 1.0 and Ima Sevio 1.0-Fast. Supports text-to-video, image-to-video, first-last-frame, and reference-image workflows. Keeps the same API flow, reflection retry mechanism, and interface contract as ima-video-ai. Requires IMA API key.
本技能是 Ima Sevio 视频生成专用入口。对外不是“模型 ID 映射器”,而是两档清晰的视频生成能力:
在公开视频能力维度上,Sevio 系列可按以下能力理解(用于用户预期管理):
text_to_videoimage_to_video:以首帧图驱动动态生成。first_last_frame_to_video:以首尾帧约束过渡与收束。reference_image_to_video:以参考图约束风格/主体特征。prompt 负责主体、动作、镜头、风格与节奏描述。--input-images 支持单个/多个输入,统一以字符串数组语义处理。| 模型(用户展示) | 典型耗时 |
|---|---|
| Ima Sevio 1.0(IMA Video Pro) | 120~300s |
| Ima Sevio 1.0-Fast(IMA Video Pro Fast) | 60~120s |
轮询超时上限:40 分钟(2400s)。
User-facing rule: In user messages, always use Ima Sevio 1.0 / Ima Sevio 1.0-Fast names.
Do not expose raw model_id unless the user explicitly asks for technical details.
CRITICAL: When calling the script, you MUST use exact model_id values. For ima-sevio-ai, only these two are allowed:
| Friendly Name | model_id | Notes |
|---|---|---|
| IMA Pro | ima-pro | Default quality model |
| IMA Pro Fast | ima-pro-fast | Faster / lower-latency model |
| Ima Sevio 1.0 | ima-pro | Display-name alias |
| Ima Sevio 1.0-Fast | ima-pro-fast | Display-name alias |
IMA Video Pro(Ima Sevio 1.0)
面向高质量视频创作的主力模型。
在时序一致性、镜头语言控制、多模态条件理解等核心维度上,能力定位达到行业同级高水平视频模型能力。
适合对质感、稳定性和镜头可控性要求更高的生产任务。
核心优势(公开可查)
IMA Video Pro Fast(Ima Sevio 1.0-Fast)
面向高频迭代场景的加速模型版本。
在保持主体可辨识与镜头可控的基础上,优先缩短生成时延,适合提案打样、快速试风格和实时创作流程。
Rules:
Ima Sevio 1.0 is auto-mapped to ima-pro.Ima Sevio 1.0-Fast is auto-mapped to ima-pro-fast.This skill is fully runnable as a standalone package.
If ima-knowledge-ai is installed, the agent may read its references for better mode selection and consistency guidance.
Recommended optional reads:
ima-knowledge-ai/references/video-modes.md:image_to_video = input image becomes frame 1reference_image_to_video = input image is visual reference, not frame 1ima-knowledge-ai/references/visual-consistency.md if user mentions:Why this matters:
task_type| User intent | task_type |
|---|---|
| Only text | text_to_video |
| One image as first frame | image_to_video |
| One image as reference | reference_image_to_video |
| Two images as first+last frame | first_last_frame_to_video |
model_idNormalize case-insensitively and ignore spaces:
| User says | model_id |
|---|---|
ima-pro, pro, 专业版, 高质量 | ima-pro |
ima-pro-fast, fast, 极速, 快速 | ima-pro-fast |
Ima Sevio 1.0 | ima-pro |
Ima Sevio 1.0-Fast | ima-pro-fast |
| "默认" / "推荐" / "自动" | ima-pro |
If user explicitly asks "faster", prefer ima-pro-fast.
If user explicitly asks "best quality", prefer ima-pro.
| User says | Parameter | Normalized value |
|---|---|---|
| 5秒 / 5s | duration | 5 |
| 10秒 / 10s | duration | 10 |
| 15秒 / 15s | duration | 15 |
| 横屏 / 16:9 | aspect_ratio | 16:9 |
| 竖屏 / 9:16 | aspect_ratio | 9:16 |
| 方形 / 1:1 | aspect_ratio | 1:1 |
| 720P / 720p | resolution | 720P |
| 1080P / 1080p | resolution | 1080P |
| 4K / 4k | resolution | 4K (only if model/rule supports) |
If unspecified, use product form_config defaults.
This skill uses bundled script scripts/ima_video_create.py and keeps original API workflow:
| Domain | Purpose | What's Sent |
|---|---|---|
api.imastudio.com | task create + status polling | prompt, model params, task IDs, API key |
imapi.liveme.com | image upload (when image input exists) | image bytes, API key |
Privacy notes:
--user-id is local-only and not sent to IMA servers.~/.openclaw.# Text to video
python3 {baseDir}/scripts/ima_video_create.py \
--api-key $IMA_API_KEY \
--task-type text_to_video \
--model-id ima-pro \
--prompt "a puppy runs across a sunny meadow, cinematic" \
--user-id {user_id} \
--output-json
# Image to video
python3 {baseDir}/scripts/ima_video_create.py \
--api-key $IMA_API_KEY \
--task-type image_to_video \
--model-id ima-pro-fast \
--prompt "camera slowly zooms in" \
--input-images https://example.com/photo.jpg \
--user-id {user_id} \
--output-json
# First-last frame to video
python3 {baseDir}/scripts/ima_video_create.py \
--api-key $IMA_API_KEY \
--task-type first_last_frame_to_video \
--model-id ima-pro \
--prompt "smooth transition" \
--input-images https://example.com/first.jpg https://example.com/last.jpg \
--user-id {user_id} \
--output-json
--input-images accepts remote HTTP(S) links and local file paths.
Local image files are uploaded to OSS first; non-local HTTP(S) links are assigned directly.
CLI form is space-separated arguments; equivalent JSON form is:
["https://example.com/ref1.jpg","https://example.com/ref2.jpg"].
Always send remote URL directly:
video_url = json_output["url"]
message(action="send", media=video_url, caption="✅ 视频生成成功")
Do NOT download to local file before sending.
Storage: ~/.openclaw/memory/ima_prefs.json
{
"user_{user_id}": {
"text_to_video": {"model_id": "ima-pro", "model_name": "Ima Sevio 1.0", "credit": 0, "last_used": "..."},
"image_to_video": {"model_id": "ima-pro-fast", "model_name": "Ima Sevio 1.0-Fast", "credit": 0, "last_used": "..."},
"first_last_frame_to_video": {"model_id": "ima-pro", "model_name": "Ima Sevio 1.0", "credit": 0, "last_used": "..."},
"reference_image_to_video": {"model_id": "ima-pro", "model_name": "Ima Sevio 1.0", "credit": 0, "last_used": "..."}
}
}
Model selection priority:
ima-pro)| Task | Default | Alt (fast) |
|---|---|---|
| text_to_video | ima-pro | ima-pro-fast |
| image_to_video | ima-pro | ima-pro-fast |
| first_last_frame_to_video | ima-pro | ima-pro-fast |
| reference_image_to_video | ima-pro | ima-pro-fast |
| Model | Estimated Time | Poll Every | Send Progress Every |
|---|---|---|---|
| ima-pro | 120~300s | 8s | 45s |
| ima-pro-fast | 60~120s | 8s | 30s |
Polling timeout upper bound: 40 minutes (2400s).
Use:
Progress formula:
P = min(95, floor(elapsed_seconds / estimated_max_seconds * 100))
Translate technical errors to user language. For 401/4008 include links:
The script keeps the same reflection mechanism (up to 3 retries):
500 → parameter degradation6009 → auto-complete missing params from matched rules6010 → reselect matching credit rule| Failed model | First alt | Second alt |
|---|---|---|
ima-pro | ima-pro-fast | ima-pro (retry with downgraded params) |
ima-pro-fast | ima-pro | ima-pro-fast (retry with defaults) |
| unknown | ima-pro | ima-pro-fast |
Only two models are exposed by this skill:
ima-proima-pro-fastSupported categories:
text_to_videoimage_to_videofirst_last_frame_to_videoreference_image_to_videoAttribute rules, points, and exact parameter combinations must be queried at runtime from product list.
Base URL: https://api.imastudio.com
Required headers:
Authorization: Bearer ima_your_api_key_herex-app-source: ima_skillsx_app_language: en (or zh)You MUST call /open/v1/product/list before creating tasks.
attribute_id and credit must match current rule set.
Common failures if skipped:
6006, 60101) GET /open/v1/product/list
2) (if image input) upload image(s) -> HTTPS CDN URL(s)
3) POST /open/v1/tasks/create
4) POST /open/v1/tasks/detail (poll every 8s)
For image tasks, source images must resolve to public HTTPS URLs. Bundled script supports local file path and uploads automatically.
GET /open/v1/product/list?app=ima&platform=web&category=<task_type>
Use type=3 leaf nodes to read:
model_idid (model_version)credit_rules[]form_config[]POST /open/v1/tasks/create
{
"task_type": "text_to_video",
"enable_multi_model": false,
"src_img_url": [],
"parameters": [
{
"attribute_id": 1234,
"model_id": "ima-pro",
"model_name": "Ima Sevio 1.0",
"model_version": "ima-pro",
"app": "ima",
"platform": "web",
"category": "text_to_video",
"credit": 25,
"parameters": {
"prompt": "a puppy dancing happily",
"duration": 5,
"resolution": "1080P",
"aspect_ratio": "16:9",
"n": 1,
"input_images": [],
"cast": {"points": 25, "attribute_id": 1234}
}
}
]
}
For image tasks, keep top-level src_img_url and nested input_images consistent.
POST /open/v1/tasks/detail with { "task_id": "..." }
Status interpretation:
resource_status: 0/null processing, 1 ready, 2 failed, 3 deletedresource_status == 1 and none failedprompt, cast, n)6006 / 6010)src_img_url and input_imagesimage_to_video vs reference_image_to_video)import time
import requests
BASE_URL = "https://api.imastudio.com"
API_KEY = "ima_your_key_here"
HEADERS = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
"x-app-source": "ima_skills",
"x_app_language": "en",
}
ALLOWED = {"ima-pro", "ima-pro-fast"}
def get_products(category: str) -> list:
r = requests.get(
f"{BASE_URL}/open/v1/product/list",
headers=HEADERS,
params={"app": "ima", "platform": "web", "category": category},
)
r.raise_for_status()
nodes = r.json().get("data", [])
leaves = []
def walk(items):
for n in items:
if n.get("type") == "3" and n.get("model_id") in ALLOWED:
leaves.append(n)
walk(n.get("children") or [])
walk(nodes)
return leaves
def create_video_task(task_type: str, prompt: str, product: dict, src_img_url=None, **extra) -> str:
src_img_url = src_img_url or []
rule = product["credit_rules"][0]
defaults = {f["field"]: f["value"] for f in product.get("form_config", []) if f.get("value") is not None}
params = {
"prompt": prompt,
"n": 1,
"input_images": src_img_url,
"cast": {"points": rule["points"], "attribute_id": rule["attribute_id"]},
**defaults,
}
params.update(extra)
payload = {
"task_type": task_type,
"enable_multi_model": False,
"src_img_url": src_img_url,
"parameters": [{
"attribute_id": rule["attribute_id"],
"model_id": product["model_id"],
"model_name": product["name"],
"model_version": product["id"],
"app": "ima",
"platform": "web",
"category": task_type,
"credit": rule["points"],
"parameters": params,
}],
}
r = requests.post(f"{BASE_URL}/open/v1/tasks/create", headers=HEADERS, json=payload)
r.raise_for_status()
return r.json()["data"]["id"]
def poll(task_id: str, interval: int = 8, timeout: int = 600) -> dict:
deadline = time.time() + timeout
while time.time() < deadline:
r = requests.post(f"{BASE_URL}/open/v1/tasks/detail", headers=HEADERS, json={"task_id": task_id})
r.raise_for_status()
task = r.json().get("data", {})
medias = task.get("medias", [])
if medias:
rs = lambda m: m.get("resource_status") if m.get("resource_status") is not None else 0
if any(rs(m) in (2, 3) or (m.get("status") == "failed") for m in medias):
raise RuntimeError(f"Task failed: {task_id}")
if all(rs(m) == 1 for m in medias):
return task
time.sleep(interval)
raise TimeoutError(f"Task timed out: {task_id}")