download_civitai_model
Download a CivitAI model to your ComfyUI models folder. Resolves model ID or version ID via API and saves to a specified subfolder like checkpoints or loras.
Instructions
Download a model from CivitAI into the local ComfyUI models/ directory and return the saved absolute path. Resolves a CivitAI model id (latest version) or a model-version id to a download URL via the CivitAI REST API, then streams the file to disk. LOCAL-ONLY: writes under <COMFYUI_PATH>/models/<target_subfolder>/ and errors when COMFYUI_PATH is unset (e.g. a remote --comfyui-url target). Provide at least one of model_id or model_version_id. Gated/early-access models require CIVITAI_API_TOKEN (sent as a bearer header, never in the URL); without it they fail.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target_subfolder | Yes | Target subfolder under ComfyUI models/ (e.g. 'checkpoints', 'loras', 'vae'). | |
| model_version_id | No | CivitAI model-version id (from the URL ?modelVersionId=...). If both model_id and model_version_id are given, this selects the specific version of that model. | |
| model_id | No | CivitAI model id. The latest version is used unless model_version_id is also provided. | |
| filename | No | Override the saved filename (defaults to the CivitAI file name, or the URL basename). |