New to Claude Skills? Learn how to install them →

civitai on GitHub

Civitai Orchestration

Free

Efficiently manage and analyze Civitai workflows.

Get this skill

Free · Opens the source repo

What Civitai Orchestration does

Civitai Orchestration is a command-line tool designed for developers and designers working with the Civitai Orchestration API. It allows users to query workflows, retrieve job details, and download results from image and video generation tasks. With a straightforward set of commands, you can interact with the API to fetch specific information based on user IDs, workflow IDs, or date ranges. This skill is particularly useful for those who need to analyze the outcomes of various generation jobs or monitor the status of workflows over time.

The tool provides a variety of commands that facilitate searching and filtering workflows. You can easily retrieve workflows associated with a specific user, filter results by tags, and even search through metadata. This makes it easier to manage large datasets and focus on relevant workflows without sifting through unnecessary information. The ability to exclude failed workflows also enhances the utility of this skill, ensuring that you only work with successful jobs.

Additionally, Civitai Orchestration supports pagination, allowing you to handle large results efficiently. You can specify the number of results to return and navigate through pages of data seamlessly. The skill also includes functionality to test API connections and verify credentials, ensuring that users can troubleshoot connectivity issues quickly. This makes it a robust option for developers who need reliable access to Civitai's workflow data.

Overall, Civitai Orchestration is an essential tool for anyone involved in image or video generation projects using the Civitai platform. Its command-line interface and comprehensive querying capabilities provide a powerful way to manage and analyze workflows effectively.

When to use it

Use this skill when you need to query workflows, analyze job results, or manage image/video generation tasks on the Civitai platform.

When not to use it

This skill may not be suitable if you require a graphical user interface or if you are not working with Civitai's orchestration features.

What you can build with it

Analyze Job Results

Use the skill to retrieve and analyze results from image or video generation jobs, helping to assess performance and quality.

Manage User Workflows

Quickly query workflows associated with specific users, making it easier to track their projects and outputs.

Filter Workflows by Tags

Utilize the tagging feature to filter workflows based on specific criteria, enhancing data management and retrieval.

How to install Civitai Orchestration

View source

1. Install with the skills CLI

npx skills add civitai/civitai/civitai-orchestration --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by civitai

Civitai Orchestration

Interact with the Civitai Orchestration API to query workflows, view job details, and retrieve generation results.

Quick Start

# Query workflows for a specific user
node .claude/skills/civitai-orchestration/civitai-client.js user 12345

# Get a specific workflow by ID
node .claude/skills/civitai-orchestration/civitai-client.js workflow <workflowId>

# Get job details with scan results (hive_csam_score, etc.)
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>

# Download result images/videos from a workflow
node .claude/skills/civitai-orchestration/civitai-client.js results <workflowId>

Searching & Filtering

By User ID

# Get workflows for user 12345
node civitai-client.js user 12345

# With options
node civitai-client.js user 12345 --take=5 --excludeFailed

By Workflow ID

# Direct lookup by workflow ID
node civitai-client.js workflow 0-019be44b-181e-7a7e-ab1b-b58dc7610dca

By Date Range

Note: Date filtering may have limited functionality depending on API access level.

# Workflows from the last 7 days
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

# Dates are assumed to be UTC. Add Z suffix for explicit UTC:
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:

# Get oldest workflows first
node civitai-client.js workflows --oldest --take=50

By Tags

Tags are set when workflows are created. Common tag patterns:

# Filter by a specific tag
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

By Metadata Search

The --query option searches workflow metadata:

# Search metadata for a string
node civitai-client.js workflows --query="portrait"

By Status

The API supports excluding failed workflows but not filtering by specific status:

# Exclude failed/canceled workflows (get only succeeded/processing)
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.

Pagination

# Get 50 results
node civitai-client.js workflows --take=50

# Get next page using cursor from previous response
node civitai-client.js workflows --take=20 --cursor=<nextCursor>

Combined Filters

# Successful workflows for a specific tag, excluding failures
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

Commands Reference

test

Test API connection and verify credentials.

node civitai-client.js test

user

Query workflows for a specific user by their Civitai user ID.

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
--excludeFailedExclude failed/canceled workflows
--oldestSort from oldest to newest

workflows

List and search workflows with optional filters.

node civitai-client.js workflows [options]

Options:

OptionDescription
--tag=<tag>Filter by tag (can specify multiple)
--query=<text>Search workflow metadata
--excludeFailedExclude failed/canceled workflows
--oldestSort 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)

workflow

Get details of a specific workflow.

node civitai-client.js workflow <workflowId> [--wait]

Options:

OptionDescription
--waitWait/poll for completion (with timeout)

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.

node civitai-client.js job <jobId> [--raw]

Options:

OptionDescription
--rawOutput 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

step

Get details of a specific step within a workflow.

node civitai-client.js step <workflowId> <stepName>

results

Download or view results (images/videos) from a workflow.

node civitai-client.js results <workflowId> [--download] [--dir=<path>]

Options:

OptionDescription
--downloadDownload result files
--dir=<path>Download directory (default: ./civitai-downloads)

blob

Get a blob (image/video) by ID with optional NSFW handling.

node civitai-client.js blob <blobId> [--download] [--nsfw]

Environment Variables

Stored in .claude/skills/civitai-orchestration/.env:

CIVITAI_API_TOKEN=your_bearer_token
CIVITAI_API_URL=https://orchestration.civitai.com

API Reference

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)

Workflow Statuses

StatusDescription
preparingWorkflow being prepared
scheduledScheduled for execution
processingCurrently running
succeededCompleted successfully
failedFailed with error
canceledWas canceled
expiredTimed out
deletedDeleted

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

Examples

Query a user's recent image generations

# Get user 12345's recent workflows
node civitai-client.js user 12345

# Exclude failed jobs
node civitai-client.js user 12345 --excludeFailed

Get workflow and view results

# Get workflow details
node civitai-client.js workflow abc123-def456

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

Paginate through workflows

# First page
node civitai-client.js workflows --take=10

# Next page (use cursor from previous response)
node civitai-client.js workflows --take=10 --cursor=<nextCursor>

Error Handling

Error CodeMeaning
401Invalid or expired token - check CIVITAI_API_TOKEN
404Workflow/Job not found
429Rate limited - wait before retrying
422Invalid parameters

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:

node civitai-client.js workflow <workflowId>

Frequently asked questions about Civitai Orchestration

Similar skills