download_civitai_model
Downloads a CivitAI model to ComfyUI's models folder by resolving the model or version ID via the CivitAI API. Supports local streaming or remote dispatch via ComfyUI-Manager.
Instructions
Download a model from CivitAI into the connected ComfyUI's models/ directory. Resolves a CivitAI model id (latest version) or a model-version id to a download URL via the CivitAI REST API. LOCAL ComfyUI (COMFYUI_PATH set): streams the file to disk under /models// and returns the saved absolute path. REMOTE ComfyUI: dispatches the download to the ComfyUI host via the ComfyUI-Manager install-model HTTP API (fetched server-side). Provide at least one of model_id or model_version_id. Gated/early-access models require CIVITAI_API_TOKEN locally (sent as a bearer header, never in the URL); remote Manager-side fetches rely on tokens configured on the ComfyUI host. NOTE (remote): the server-side install requires the host's ComfyUI-Manager to run with network_mode=personal_cloud (or loopback) and a permissive security level; a stricter gate silently rejects the download, and Manager reports the queue task 'done' even on failure — so a remote dispatch does not guarantee the file landed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | No | Override the saved filename (defaults to the CivitAI file name, or the URL basename). | |
| model_id | No | CivitAI model id. The latest version is used unless model_version_id is also provided. | |
| 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. | |
| target_subfolder | Yes | Target subfolder under ComfyUI models/. Standard names: checkpoints, loras, vae, upscale_models, controlnet, embeddings, clip, diffusers, diffusion_models, gligen, hypernetworks, photomaker, style_models, text_encoders, unet. Any other relative subfolder (incl. nested like 'loras/<subdir>') is allowed; absolute paths and '..' escapes are rejected. |