civitai-orchestration

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Civitai Orchestration

Civitai Orchestration

Interact with the Civitai Orchestration API to query workflows, view job details, and retrieve generation results.
与Civitai Orchestration API交互,查询工作流、查看任务详情并获取生成结果。

Quick Start

快速开始

bash
undefined
bash
undefined

Query workflows for a specific user

查询特定用户的工作流

node .claude/skills/civitai-orchestration/civitai-client.js user 12345
node .claude/skills/civitai-orchestration/civitai-client.js user 12345

Get a specific workflow by ID

通过ID获取特定工作流

node .claude/skills/civitai-orchestration/civitai-client.js workflow <workflowId>
node .claude/skills/civitai-orchestration/civitai-client.js workflow <workflowId>

Get job details with scan results (hive_csam_score, etc.)

获取包含扫描结果的任务详情(如hive_csam_score等)

node .claude/skills/civitai-orchestration/civitai-client.js job <jobId>
node .claude/skills/civitai-orchestration/civitai-client.js job <jobId>

Get step details from a workflow

获取工作流中的步骤详情

node .claude/skills/civitai-orchestration/civitai-client.js step <workflowId> <stepName>
node .claude/skills/civitai-orchestration/civitai-client.js step <workflowId> <stepName>

Download result images/videos from a workflow

下载工作流生成的图像/视频结果

node .claude/skills/civitai-orchestration/civitai-client.js results <workflowId>
undefined
node .claude/skills/civitai-orchestration/civitai-client.js results <workflowId>
undefined

Searching & Filtering

搜索与筛选

By User ID

按用户ID筛选

bash
undefined
bash
undefined

Get workflows for user 12345

获取用户12345的工作流

node civitai-client.js user 12345
node civitai-client.js user 12345

With options

带参数选项

node civitai-client.js user 12345 --take=5 --excludeFailed
undefined
node civitai-client.js user 12345 --take=5 --excludeFailed
undefined

By Workflow ID

按工作流ID筛选

bash
undefined
bash
undefined

Direct lookup by workflow ID

通过工作流ID直接查询

node civitai-client.js workflow 0-019be44b-181e-7a7e-ab1b-b58dc7610dca
undefined
node civitai-client.js workflow 0-019be44b-181e-7a7e-ab1b-b58dc7610dca
undefined

By Date Range

按日期范围筛选

Note: Date filtering may have limited functionality depending on API access level.
bash
undefined
注意: 根据API访问权限,日期筛选功能可能受限。
bash
undefined

Workflows from the last 7 days

查询过去7天的工作流

node civitai-client.js workflows --from=2024-01-15 --to=2024-01-22
node civitai-client.js workflows --from=2024-01-15 --to=2024-01-22

Workflows from a specific day

查询特定一天的工作流

node civitai-client.js workflows --from=2024-01-20 --to=2024-01-20
node civitai-client.js workflows --from=2024-01-20 --to=2024-01-20

Dates are assumed to be UTC. Add Z suffix for explicit UTC:

日期默认采用UTC时区,可添加Z后缀明确指定:

node civitai-client.js workflows --from=2024-01-20T06:00:00Z --to=2024-01-20T12:00:00Z

**Alternative:** Use `--oldest` to get workflows from oldest first, then paginate:
```bash
node civitai-client.js workflows --from=2024-01-20T06:00:00Z --to=2024-01-20T12:00:00Z

**替代方案:** 使用`--oldest`参数按从旧到新排序,然后进行分页:
```bash

Get oldest workflows first

先获取最早的工作流

node civitai-client.js workflows --oldest --take=50
undefined
node civitai-client.js workflows --oldest --take=50
undefined

By Tags

按标签筛选

Tags are set when workflows are created. Common tag patterns:
bash
undefined
标签在创建工作流时设置,常见标签模式:
bash
undefined

Filter by a specific tag

按特定标签筛选

node civitai-client.js workflows --tag=user:12345
node civitai-client.js workflows --tag=user:12345

Note: Multiple tags can be specified (AND logic)

注意:可指定多个标签(逻辑与)

node civitai-client.js workflows --tag=project:myproject --tag=type:image
undefined
node civitai-client.js workflows --tag=project:myproject --tag=type:image
undefined

By Metadata Search

按元数据搜索

The
--query
option searches workflow metadata:
bash
undefined
使用
--query
选项搜索工作流元数据:
bash
undefined

Search metadata for a string

在元数据中搜索"portrait"

node civitai-client.js workflows --query="portrait"
undefined
node civitai-client.js workflows --query="portrait"
undefined

By Status

按状态筛选

The API supports excluding failed workflows but not filtering by specific status:
bash
undefined
API支持排除失败的工作流,但不支持按特定状态筛选:
bash
undefined

Exclude failed/canceled workflows (get only succeeded/processing)

排除失败/已取消的工作流(仅获取成功/处理中的任务)

node civitai-client.js workflows --excludeFailed
node civitai-client.js workflows --excludeFailed

Include all statuses (default behavior)

包含所有状态(默认行为)

node civitai-client.js workflows

**Note:** To find specific statuses, retrieve workflows and filter client-side, or use metadata/tags when creating workflows for better filtering.
node civitai-client.js workflows

**注意:** 如需查找特定状态的任务,可获取工作流后在客户端进行筛选,或在创建工作流时使用元数据/标签以便更好地筛选。

Pagination

分页

bash
undefined
bash
undefined

Get 50 results

获取50条结果

node civitai-client.js workflows --take=50
node civitai-client.js workflows --take=50

Get next page using cursor from previous response

使用上一次响应中的cursor获取下一页

node civitai-client.js workflows --take=20 --cursor=<nextCursor>
undefined
node civitai-client.js workflows --take=20 --cursor=<nextCursor>
undefined

Combined Filters

组合筛选

bash
undefined
bash
undefined

Successful workflows for a specific tag, excluding failures

获取特定标签下的成功工作流,排除失败任务

node civitai-client.js workflows
--tag=user:12345
--excludeFailed
--take=50
node civitai-client.js workflows
--tag=user:12345
--excludeFailed
--take=50

Get workflows with metadata search

结合元数据搜索的工作流

node civitai-client.js workflows
--query="portrait"
--excludeFailed
--take=20
undefined
node civitai-client.js workflows
--query="portrait"
--excludeFailed
--take=20
undefined

Commands Reference

命令参考

test

test

Test API connection and verify credentials.
bash
node civitai-client.js test
测试API连接并验证凭证。
bash
node civitai-client.js test

user

user

Query workflows for a specific user by their Civitai user ID.
bash
node civitai-client.js user <userId> [options]
Options:
OptionDescription
--take=<n>
Number of results (max 10 per API limit)
--tag=<tag>
Filter by tag
--query=<text>
Search workflow metadata
--excludeFailed
Exclude failed/canceled workflows
--oldest
Sort from oldest to newest
通过Civitai用户ID查询特定用户的工作流。
bash
node civitai-client.js user <userId> [options]
选项:
选项描述
--take=<n>
返回结果数量(API限制最多10条)
--tag=<tag>
按标签筛选
--query=<text>
搜索工作流元数据
--excludeFailed
排除失败/已取消的工作流
--oldest
按从旧到新排序

workflows

workflows

List and search workflows with optional filters.
bash
node civitai-client.js workflows [options]
Options:
OptionDescription
--tag=<tag>
Filter by tag (can specify multiple)
--query=<text>
Search workflow metadata
--excludeFailed
Exclude failed/canceled workflows
--oldest
Sort from oldest to newest
--take=<n>
Number of results (default: 20)
--cursor=<cursor>
Pagination cursor
--from=<date>
Start date (may have limited support)
--to=<date>
End date (may have limited support)
列出并搜索工作流,支持可选筛选条件。
bash
node civitai-client.js workflows [options]
选项:
选项描述
--tag=<tag>
按标签筛选(可指定多个)
--query=<text>
搜索工作流元数据
--excludeFailed
排除失败/已取消的工作流
--oldest
按从旧到新排序
--take=<n>
返回结果数量(默认:20)
--cursor=<cursor>
分页游标
--from=<date>
开始日期(支持可能受限)
--to=<date>
结束日期(支持可能受限)

workflow

workflow

Get details of a specific workflow.
bash
node civitai-client.js workflow <workflowId> [--wait]
Options:
OptionDescription
--wait
Wait/poll for completion (with timeout)
获取特定工作流的详情。
bash
node civitai-client.js workflow <workflowId> [--wait]
选项:
选项描述
--wait
等待/轮询工作流完成(带超时)

job

job

Get details of a specific job including scan results from event context.
This is useful for investigating content moderation results - the
lastEvent.context
contains scan scores like
hive_csam_score
and
hive_vlm_summary
.
bash
node civitai-client.js job <jobId> [--raw]
Options:
OptionDescription
--raw
Output raw JSON instead of formatted summary
Example output:
Job Summary:
  ID: 58de87d7-d594-4d71-ae43-dd8fc1bcbd23
  Type: TextToImageV2
  Workflow ID: 8484131-20260121222126332

Prompt Classification: sexual, young, scan

Results (2 blob(s)):
  - JNFDW54JNTATNW42HACYCWSQP0.jpeg (available: true)

Last Event:
  Type: Succeeded
  Provider: ValdiAI

Event Context (scan results, metrics):
  ** hive_csam_score: 0.00 %, 0.00 %
  ** hive_vlm_summary: X, No_Child
获取特定任务的详情,包括事件上下文的扫描结果。
此命令适用于调查内容审核结果 -
lastEvent.context
包含扫描分数,如
hive_csam_score
hive_vlm_summary
bash
node civitai-client.js job <jobId> [--raw]
选项:
选项描述
--raw
输出原始JSON而非格式化摘要
示例输出:
Job Summary:
  ID: 58de87d7-d594-4d71-ae43-dd8fc1bcbd23
  Type: TextToImageV2
  Workflow ID: 8484131-20260121222126332

Prompt Classification: sexual, young, scan

Results (2 blob(s)):
  - JNFDW54JNTATNW42HACYCWSQP0.jpeg (available: true)

Last Event:
  Type: Succeeded
  Provider: ValdiAI

Event Context (scan results, metrics):
  ** hive_csam_score: 0.00 %, 0.00 %
  ** hive_vlm_summary: X, No_Child

step

step

Get details of a specific step within a workflow.
bash
node civitai-client.js step <workflowId> <stepName>
获取工作流中特定步骤的详情。
bash
node civitai-client.js step <workflowId> <stepName>

results

results

Download or view results (images/videos) from a workflow.
bash
node civitai-client.js results <workflowId> [--download] [--dir=<path>]
Options:
OptionDescription
--download
Download result files
--dir=<path>
Download directory (default: ./civitai-downloads)
查看或下载工作流生成的图像/视频结果。
bash
node civitai-client.js results <workflowId> [--download] [--dir=<path>]
选项:
选项描述
--download
下载结果文件
--dir=<path>
下载目录(默认:./civitai-downloads)

blob

blob

Get a blob (image/video) by ID with optional NSFW handling.
bash
node civitai-client.js blob <blobId> [--download] [--nsfw]
通过ID获取二进制对象(图像/视频),支持NSFW内容处理选项。
bash
node civitai-client.js blob <blobId> [--download] [--nsfw]

Environment Variables

环境变量

Stored in
.claude/skills/civitai-orchestration/.env
:
env
CIVITAI_API_TOKEN=your_bearer_token
CIVITAI_API_URL=https://orchestration-new.civitai.com
存储在
.claude/skills/civitai-orchestration/.env
中:
env
CIVITAI_API_TOKEN=your_bearer_token
CIVITAI_API_URL=https://orchestration-new.civitai.com

API Reference

API参考

Workflow Query Parameters

工作流查询参数

The workflows endpoint supports these query parameters:
  • tags
    - Array of tags to filter by
  • query
    - Search workflow metadata
  • fromDate
    /
    toDate
    - Date range (ISO 8601) - may have limited support
  • cursor
    - Pagination cursor
  • take
    - Number of results (default: 100)
  • excludeFailed
    - Exclude failed/expired/canceled workflows (boolean)
  • ascending
    - Sort oldest to newest (boolean)
工作流端点支持以下查询参数:
  • tags
    - 用于筛选的标签数组
  • query
    - 搜索工作流元数据
  • fromDate
    /
    toDate
    - 日期范围(ISO 8601格式)- 支持可能受限
  • cursor
    - 分页游标
  • take
    - 结果数量(默认:100)
  • excludeFailed
    - 是否排除失败/过期/已取消的工作流(布尔值)
  • ascending
    - 按从旧到新排序(布尔值)

Workflow Statuses

工作流状态

StatusDescription
preparing
Workflow being prepared
scheduled
Scheduled for execution
processing
Currently running
succeeded
Completed successfully
failed
Failed with error
canceled
Was canceled
expired
Timed out
deleted
Deleted
状态描述
preparing
工作流准备中
scheduled
已调度待执行
processing
执行中
succeeded
执行成功
failed
执行失败
canceled
已取消
expired
已超时
deleted
已删除

Step Types (Recipes)

步骤类型(任务模板)

Image/Video generation steps you might encounter:
  • textToImage
    - Text to image generation
  • imageGen
    - General image generation
  • videoGen
    - Video generation
  • videoEnhancement
    - Video upscaling/enhancement
  • videoFrameExtraction
    - Extract frames from video
  • videoUpscaler
    - Upscale video
  • videoInterpolation
    - Frame interpolation
  • convertImage
    - Convert image formats
  • comfy
    - ComfyUI workflow execution
你可能会遇到的图像/视频生成步骤:
  • textToImage
    - 文本转图像生成
  • imageGen
    - 通用图像生成
  • videoGen
    - 视频生成
  • videoEnhancement
    - 视频增强/超分
  • videoFrameExtraction
    - 从视频中提取帧
  • videoUpscaler
    - 视频超分
  • videoInterpolation
    - 帧插值
  • convertImage
    - 图像格式转换
  • comfy
    - 执行ComfyUI工作流

Examples

示例

Query a user's recent image generations

查询用户近期的图像生成任务

bash
undefined
bash
undefined

Get user 12345's recent workflows

获取用户12345的近期工作流

node civitai-client.js user 12345
node civitai-client.js user 12345

Exclude failed jobs

排除失败任务

node civitai-client.js user 12345 --excludeFailed
undefined
node civitai-client.js user 12345 --excludeFailed
undefined

Get workflow and view results

获取工作流并查看结果

bash
undefined
bash
undefined

Get workflow details

获取工作流详情

node civitai-client.js workflow abc123-def456
node civitai-client.js workflow abc123-def456

View/download results

查看并下载结果

node civitai-client.js results abc123-def456 --download --dir=./my-images
undefined
node civitai-client.js results abc123-def456 --download --dir=./my-images
undefined

Paginate through workflows

分页查询工作流

bash
undefined
bash
undefined

First page

第一页

node civitai-client.js workflows --take=10
node civitai-client.js workflows --take=10

Next page (use cursor from previous response)

下一页(使用上一次响应中的cursor)

node civitai-client.js workflows --take=10 --cursor=<nextCursor>
undefined
node civitai-client.js workflows --take=10 --cursor=<nextCursor>
undefined

Error Handling

错误处理

Error CodeMeaning
401Invalid or expired token - check CIVITAI_API_TOKEN
404Workflow/Job not found
429Rate limited - wait before retrying
422Invalid parameters
错误码含义
401令牌无效或过期 - 检查CIVITAI_API_TOKEN
404工作流/任务不存在
429请求频率超限 - 稍后重试
422参数无效

Output

输出说明

The
user
command displays workflow summaries including:
  • Workflow ID, status, timestamps
  • Step types (textToImage, videoGen, comfy, etc.)
  • Prompts for text-to-image generations
For raw JSON output, use the workflow command:
bash
node civitai-client.js workflow <workflowId>
user
命令显示的工作流摘要包含:
  • 工作流ID、状态、时间戳
  • 步骤类型(如textToImage等)
  • 文本转图像生成的提示词
如需原始JSON输出,可使用workflow命令:
bash
node civitai-client.js workflow <workflowId>