Refactor model configuration structure and update README

- Changed the configuration format to use a single 'models' list with entries containing 'url' and 'type'.
- Updated validation logic to ensure 'models' entries are correctly structured.
- Modified download logic to check for existing directories before downloading.
- Revised README to reflect new configuration format and usage instructions.

Signed-off-by: Daniel Henry <iamdanhenry@gmail.com>
This commit is contained in:
2026-01-31 15:09:12 -06:00
parent 139b299070
commit 93e53ad838
5 changed files with 55 additions and 49 deletions

View File

@@ -20,7 +20,7 @@ Copy the example config and edit it:
cp config.example.yaml config.yaml
```
Edit `config.yaml`: set `huggingface_token`, `civitai_token`, `comfyui_base_dir`, and add model URLs under the right keys. **Do not commit `config.yaml`** (it is gitignored).
Edit `config.yaml`: set `huggingface_token`, `civitai_token`, `comfyui_base_dir`, and add entries under `models` with `url` and `type` for each model. **Do not commit `config.yaml`** (it is gitignored).
## Run
@@ -30,17 +30,11 @@ python -m model_downloader
- `--config PATH` config file (default: `config.yaml` in current directory).
- `--dry-run` print what would be downloaded and where; no writes.
- `--only TYPE ...` only process these model types (e.g. `--only diffusion_models loras`).
- `--only TYPE ...` only process these model types (e.g. `--only loras diffusion_models`).
## Config keys and ComfyUI folders
## Config and ComfyUI folders
| Config key | ComfyUI subdir (under `comfyui_base_dir/models/`) |
|--------------------|--------------------------------------------------|
| diffusion_models | diffusion_models |
| text_encoders | text_encoders |
| vaes | vae |
| upscale_models | upscale_models |
| loras | loras |
Each model entry has `url` and `type`. The `type` value is the subdirectory name under `comfyui_base_dir/models/` (e.g. `type: loras``models/loras/`). Each `models/<type>` directory must already exist under your ComfyUI base; the tool does not create these directories and will fail if a directory is missing.
Tokens stay in your local `config.yaml` only; keep them out of git.