The CLI download flow only set civitai_model_id/version_id on local_files
without caching the full model payload, so 'tsr db list' joined against
empty models/versions/creators tables and showed every linked file as
'unlinked'. The server's _auto_link_file path had additional bugs:
resolved-vs-unresolved path comparison after rescan, redundant CivitAI
hash lookup, and silent failure swallowed by 'completed' status.
- New Database.register_downloaded_file() consolidates hashing, metadata
storage, FK linking, and cache_model() into a single idempotent call
shared by both CLI and server paths.
- Server _do_download now passes version_info straight through and
surfaces db_file_id/db_linked/db_cached/db_error onto _active_downloads.
- Drops the broken _auto_link_file rescan helper.
Family detection was force-injecting a default VAE (e.g. sdxl_vae.safetensors)
when a model was specified without an explicit --vae. If that VAE file didn't
exist on the ComfyUI server, the workflow was silently rejected. Now only
overrides VAE when the user explicitly passes --vae.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add `tsr generate` and `tsr models` as top-level CLI commands that call
ComfyUI library functions directly or HTTP to a remote tensors server.
Add `--remote` flag to existing `tsr search` and `tsr dl` commands.
New file `tensors/remote.py` provides HTTP client functions for all four
operations against the remote tensors API (generate, models, search,
download with progress polling).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replaces hardcoded localhost origins with env-driven config.
Accepts comma-separated origins or wildcard (*). Defaults to
["*"] for backward compatibility.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add sampler/scheduler/steps/vae to MODEL_FAMILY_DEFAULTS for all families
- Add zimage family detection for ZImageTurbo models
- Flux and zimage families use ae.safetensors VAE
- SD 1.5 families use checkpoint built-in VAE
- SDXL families use sdxl_vae.safetensors
- API auto-applies family defaults when request uses default values
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Log prompt, model, size, steps on generate request
- Log completion with prompt_id and image count
- Log warnings/errors on failures
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use sdxl_vae.safetensors by default instead of checkpoint VAE
- Add vae parameter to generate_image and API endpoint
- Better quality for modern SDXL-based models
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace polling with WebSocket connection for real-time progress
- Show step-by-step progress during sampling (Step 1/20, etc.)
- Display progress bar with actual completion percentage
- Fall back to polling if WebSocket connection fails
- Import websocket-client for sync WebSocket support
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>