使用 RunComfy 的 API 运行 wan-ai/wan-2-1/lora。 可接受的输入与输出请参阅模型的 数据结构说明。
curl --request POST \
--url https://model-api.runcomfy.net/v1/models/wan-ai/wan-2-1/lora \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"prompt": "A vast circular library of glowing memory orbs stretches in all directions, with tall curved shelves extending upward. Each orb contains a different memory, glowing in various colors - yellow for joy, blue for sadness, red for anger, purple for fear, and green for disgust. In the foreground, two characters - a small blue figure with glasses and a tall slender yellow figure with bright blue hair - are examining a particularly bright memory orb. Light streams cascade through the enormous room, creating dramatic beams between the shelves. The space has a warm ambient glow with dramatic shadows. Small maintenance worker characters in uniform can be seen in the background, carefully organizing orbs on distant shelves. The rendering features Pixar's characteristic polished surfaces with subtle reflections and depth-of-field blur for distant elements.",
"lora_url": "https://playgrounds-storage-public.runcomfy.net/models/wan2.1/lora/Remade-AI/Pixar/pixar_10_epochs.safetensors"
}'将 YOUR_API_TOKEN 环境变量设置为您的 API 密钥(在 个人资料中管理密钥),并在每个请求的 Authorization 标头中以 Bearer 令牌形式携带: Authorization: Bearer $YOUR_API_TOKEN。
提交异步生成任务,将立即获得 request_id 以及用于查询状态、获取结果和取消的 URL。
curl --request POST \
--url https://model-api.runcomfy.net/v1/models/wan-ai/wan-2-1/lora \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"prompt": "A vast circular library of glowing memory orbs stretches in all directions, with tall curved shelves extending upward. Each orb contains a different memory, glowing in various colors - yellow for joy, blue for sadness, red for anger, purple for fear, and green for disgust. In the foreground, two characters - a small blue figure with glasses and a tall slender yellow figure with bright blue hair - are examining a particularly bright memory orb. Light streams cascade through the enormous room, creating dramatic beams between the shelves. The space has a warm ambient glow with dramatic shadows. Small maintenance worker characters in uniform can be seen in the background, carefully organizing orbs on distant shelves. The rendering features Pixar's characteristic polished surfaces with subtle reflections and depth-of-field blur for distant elements.",
"lora_url": "https://playgrounds-storage-public.runcomfy.net/models/wan2.1/lora/Remade-AI/Pixar/pixar_10_epochs.safetensors"
}'根据 request_id 获取当前状态("in_queue"、"in_progress"、"completed" 或 "cancelled")。
curl --request GET \
--url https://model-api.runcomfy.net/v1/requests/{request_id}/status \
--header "Authorization: Bearer <token>"获取指定 request_id 的最终输出与元数据;若任务未完成,响应会返回当前状态,便于继续轮询。
curl --request GET \
--url https://model-api.runcomfy.net/v1/requests/{request_id}/result \
--header "Authorization: Bearer <token>"通过 request_id 取消排队中的任务;进行中的任务无法取消。
curl --request POST \
--url https://model-api.runcomfy.net/v1/requests/{request_id}/cancel \
--header "Authorization: Bearer <token>"请提供可公网访问的 HTTPS 地址。确保目标主机允许服务端拉取(无需登录或 Cookie)、未被限流或拦截爬虫。建议:图片 ≤ 50 MB(约 4K),视频 ≤ 100 MB(约 720p 下 2–5 分钟)。私有资源请使用稳定或预签名 URL。
{
"type": "object",
"title": "输入结构",
"required": [
"prompt",
"lora_url"
],
"properties": {
"lora_url": {
"title": "Wan 2.1 LoRA URL",
"description": "必填的 Hugging Face 或 Civitai 链接。每次生成只能使用一个 LoRA。",
"type": "string",
"default": "https://playgrounds-storage-public.runcomfy.net/models/wan2.1/lora/Remade-AI/Pixar/pixar_10_epochs.safetensors"
},
"model": {
"title": "Wan 2.1 基础模型",
"description": "可选择 1.3b 或 14b,默认值为 14b。",
"type": "string",
"enum": [
"1.3b",
"14b"
],
"default": "14b"
},
"prompt": {
"title": "提示词",
"description": "必填。描述视频主体、场景、动作、风格与镜头运动。",
"type": "string",
"default": "A vast circular library of glowing memory orbs stretches in all directions, with tall curved shelves extending upward. Each orb contains a different memory, glowing in various colors - yellow for joy, blue for sadness, red for anger, purple for fear, and green for disgust. In the foreground, two characters - a small blue figure with glasses and a tall slender yellow figure with bright blue hair - are examining a particularly bright memory orb. Light streams cascade through the enormous room, creating dramatic beams between the shelves. The space has a warm ambient glow with dramatic shadows. Small maintenance worker characters in uniform can be seen in the background, carefully organizing orbs on distant shelves. The rendering features Pixar's characteristic polished surfaces with subtle reflections and depth-of-field blur for distant elements."
},
"image": {
"title": "输入图片",
"description": "可选。用于图生视频的源图片;仅根据文本生成时请留空。",
"type": "string"
},
"resolution": {
"title": "分辨率",
"description": "可选择 480p 或 720p,默认值为 480p。",
"type": "string",
"enum": [
"480p",
"720p"
],
"default": "480p"
},
"aspect_ratio": {
"title": "宽高比(宽:高)",
"description": "可选择 16:9、1:1 或 9:16,默认值为 16:9。",
"type": "string",
"enum": [
"16:9",
"1:1",
"9:16"
],
"default": "16:9"
},
"negative_prompt": {
"title": "反向提示词",
"description": "可选。描述不希望出现在视频中的视觉元素。",
"type": "string",
"default": ""
},
"sample_guide_scale": {
"title": "提示词强度",
"description": "控制输出遵循提示词的程度。范围为 0–10,默认值为 5。",
"maximum": 10,
"minimum": 0,
"type": "float",
"default": 5
},
"lora_strength_model": {
"title": "LoRA 强度",
"description": "控制 LoRA 对结果的影响。数值越高,效果越强。范围为 0–1,默认值为 1。",
"maximum": 1,
"minimum": 0,
"type": "float",
"default": 1
},
"sample_steps": {
"title": "采样步数",
"description": "可设为 1–60,默认值为 30。增加步数会提高积分费用。",
"type": "integer",
"default": 30,
"maximum": 60,
"minimum": 1
},
"seed": {
"title": "种子",
"description": "用于复现相近结果或生成不同版本的整数,默认值为 80682279。",
"type": "integer",
"default": 80682279
},
"frames": {
"title": "帧数",
"description": "可选择 17、33、49、65 或 81 帧。",
"type": "integer",
"enum": [
17,
33,
49,
65,
81
]
},
"sample_shift": {
"title": "采样偏移",
"description": "范围为 0–10 的采样偏移设置。",
"maximum": 10,
"minimum": 0,
"type": "float"
},
"fast_mode": {
"title": "快速模式",
"description": "可选择 Off、Balanced 或 Fast。提高处理速度可能会降低准确度。",
"type": "string",
"enum": [
"Off",
"Balanced",
"Fast"
]
}
}
}{
"output": {
"type": "object",
"properties": {
"image": {
"type": "string",
"format": "uri",
"description": "单张图片 URL"
},
"video": {
"type": "string",
"format": "uri",
"description": "单个视频 URL"
},
"images": {
"type": "array",
"description": "多张图片 URL",
"items": {
"type": "string",
"format": "uri"
}
},
"videos": {
"type": "array",
"description": "多个视频 URL",
"items": {
"type": "string",
"format": "uri"
}
}
}
}
}RunComfy 是首选的 ComfyUI 平台,提供 ComfyUI 在线 环境和服务,以及 ComfyUI 工作流 具有惊艳的视觉效果。 RunComfy还提供 AI Models, 帮助艺术家利用最新的AI工具创作出令人惊叹的艺术作品。