civitai

Query and download models from Civitai using the public REST API.

Updated Nov 7, 2024
One-click install
npx skills add https://github.com/jeremysball/dotfiles --skill civitai-jeremysball
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: civitai
Source: https://github.com/jeremysball/dotfiles/tree/main/.pi/skills-archive/civitai
Command: npx skills add https://github.com/jeremysball/dotfiles --skill civitai-jeremysball

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Finding and downloading AI models from Civitai requires manual browsing and clicking through the website. This Skill lets you search models, inspect versions, list images, and download model files directly via the Civitai REST API using curl. ## Core Features & Use Cases - Model Search & Details: Query models by keyword, fetch model details, and retrieve specific model version metadata via the v1 REST API. - Direct Downloads: Download .safetensors checkpoint and LoRA files with authenticated curl requests for use in local tools like ComfyUI or Automatic1111. - Use Case: You want a specific LoRA for local image generation. Search the API for the model, get its version ID, download the .safetensors file, and load it into ComfyUI with its trigger word. ## Quick Start Set the CIVITAI_API_KEY environment variable and ask the AI to search Civitai for a model and download it for local use.

Frequently Asked Questions about civitai

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I download a model from Civitai using the API?

Send an authenticated curl request to https://civitai.com/api/download/models/{versionId} with your API key as a Bearer token. Use the -L flag to follow redirects and save the output as a .safetensors file.

How do I search for models on Civitai programmatically?

Query the GET /v1/models endpoint with parameters like query and limit, passing your CIVITAI_API_KEY as a Bearer token. The response returns matching models with their versions and metadata.

Can I generate images through the Civitai API?

No, the Civitai REST API v1 is read-only and has no generation endpoints. To generate images, use the Civitai website generator or download models and run them locally in ComfyUI or Automatic1111.

Where do I get a Civitai API key?

Generate an API key from your Civitai account settings at civitai.com/user/account#api. Set it as the CIVITAI_API_KEY environment variable so requests can authenticate with the Bearer token header.

What tools can run downloaded Civitai models locally?

Downloaded .safetensors checkpoints and LoRAs run in ComfyUI and Automatic1111 locally with a GPU. Cloud options include fal.ai, Replicate, and RunPod, which accept downloaded Civitai models.