Commit Graph

121 Commits

Author SHA1 Message Date
Adam Ladachowski 030af651bd 💬 Commit message: Update 2026-02-14 03:06:20, 1 files, 2 lines
📁 Files changed: 1
📝 Lines changed: 2

  • uv.lock
2026-02-14 03:06:20 +01:00
Adam Ladachowski 1f673497cd Fix lightbox click triggering download 2026-02-14 03:05:50 +01:00
Adam Ladachowski 89386ee12a Bump version to 0.1.9 2026-02-14 03:03:03 +01:00
Adam Ladachowski 29d34ae6ad Add simple web gallery UI
- Mobile-friendly responsive grid
- GLightbox for lightbox functionality (CDN)
- Served at root (/) endpoint

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 03:02:53 +01:00
Adam Ladachowski 29142c7b2b Add --remote support to reload command
Now uses default remote like other commands.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 02:59:21 +01:00
Adam Ladachowski e77bc670d7 💬 Commit message: Update 2026-02-14 02:54:42, 2 files, 2 lines
📁 Files changed: 2
📝 Lines changed: 2

  • .coverage
  • uv.lock
2026-02-14 02:54:42 +01:00
Adam Ladachowski ec3f1afb41 Fix TOML save order: write scalars before sections
TOML sections capture all subsequent keys until the next section.
default_remote was being written after [remotes] section, making
it appear as part of remotes dict instead of top-level config.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 02:51:48 +01:00
Adam Ladachowski 318cc91eb6 Bump version to 0.1.8 2026-02-14 02:38:46 +01:00
Adam Ladachowski 020d98e452 Explicitly inherit environment when spawning sd-server
Ensures HSA_OVERRIDE_GFX_VERSION and other env vars are passed
to sd-server subprocess for ROCm GPU compatibility.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 02:38:37 +01:00
Adam Ladachowski f7a3821f4a Bump version to 0.1.7
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 02:31:34 +01:00
Adam Ladachowski 1a7aa834a5 Fix wait_ready to poll root endpoint instead of /health
sd-server doesn't have a /health endpoint - it returns 404.
The root endpoint (/) returns 200 with "Stable Diffusion Server is running".

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 02:31:18 +01:00
Adam Ladachowski f1b3aa9dd1 Update GitHub URLs from aladac to saiden-dev
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 02:24:21 +01:00
Adam Ladachowski 4a763765af Fix mypy path in CI workflow
Changed from tensors.py to tensors/ directory.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 02:19:05 +01:00
Adam Ladachowski 706cc765e9 Fix TC003: Move Path import to TYPE_CHECKING block
Path was imported at top level but only used in type hints,
causing ruff TC003 error in CI.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 02:17:38 +01:00
Adam Ladachowski 423e475370 Bump version to 0.1.6 2026-02-14 02:06:54 +01:00
Adam Ladachowski 9b0463abe1 Update README with new features documentation
- Add models database commands (tsr db scan/link/cache/list/search/triggers/stats)
- Add image gallery commands (tsr images list/show/download/delete)
- Add model management commands (tsr models list/active/switch/loras)
- Add remote mode documentation (tsr remote add/default/list, --remote flag)
- Add server API endpoints reference table
- Update configuration section with remotes config
- Update default paths to include database and gallery
- Update server wrapper section with status/reload commands

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 02:06:43 +01:00
Adam Ladachowski 7ab968c474 💬 Commit message: Update 2026-02-14 02:04:31, 1 files, 0 lines
📁 Files changed: 1
📝 Lines changed: 0

  • .coverage
2026-02-14 02:04:31 +01:00
Adam Ladachowski e257a029da Phase 6: Tests for database, server, and client modules
- Add tests/test_db.py with 33 tests for Database class:
  - Schema initialization and migrations
  - Local file CRUD operations (scan, list, link)
  - CivitAI model caching (cache_model, tags, versions, files)
  - Query operations (search, get_model, get_triggers)
  - Statistics and context manager

- Extend tests/test_server.py with 27 tests for API endpoints:
  - Gallery endpoints (list, get, meta, edit, delete, stats)
  - Database endpoints (files, models, stats)
  - Gallery class unit tests

- Add tests/test_client.py with 33 tests for TsrClient:
  - Server status operations
  - Gallery image operations (list, get, delete, edit, download)
  - Model management (list, active, switch, loras)
  - Image generation
  - CivitAI download operations
  - Database query operations
  - Error handling and context manager

Total: 191 tests passing with 61% coverage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 01:54:00 +01:00
Adam Ladachowski 7efec1a033 Phase 4: Client Mode for tsr CLI
- Create tensors/client.py with TsrClient HTTP wrapper for all server APIs
- Add remote server configuration to config.py (get_remotes, resolve_remote, save_remote, set_default_remote)
- Add images command group: list, show, delete, download
- Add models command group: list, active, switch, loras
- Add remote command group: list, add, default
- Update generate command with --remote support
- Update dl command with --remote support
- Update status command with --remote support

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 01:47:32 +01:00
Adam Ladachowski 11a289ebd0 Phase 3: Enhanced Server API
Add comprehensive server API for remote operations:

Step 3.1 - Gallery endpoints:
- GET /api/images - List images (paginated, newest first)
- GET /api/images/{id} - Get image file
- GET /api/images/{id}/meta - Get generation metadata
- POST /api/images/{id}/edit - Update metadata (tags, notes)
- DELETE /api/images/{id} - Delete image + sidecar
- Gallery module with image management and sidecar JSON support

Step 3.2 - Model management:
- GET /api/models - List available checkpoints
- GET /api/models/active - Current loaded model info
- POST /api/models/switch - Switch model (hot reload)
- GET /api/models/loras - List available LoRAs
- GET /api/models/scan - Scan all model directories

Step 3.3 - Download proxy:
- POST /api/download - Start background download from CivitAI
- GET /api/download/status/{id} - Check download progress
- GET /api/download/active - List active downloads
- Auto-scan and link files after download

Step 3.4 - Enhanced generation:
- POST /api/generate - Generate with gallery integration
- Saves images to gallery with metadata sidecar
- Supports all sd-server params
- GET /api/samplers, /api/schedulers - List options

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 01:40:25 +01:00
Adam Ladachowski 18b3268738 Phase 2.3: Add /api/db/* endpoints
Add database REST API endpoints to FastAPI server:
- GET /api/db/files - List local files with CivitAI info
- GET /api/db/files/{id} - Get file by ID
- GET /api/db/models - Search cached models
- GET /api/db/models/{civitai_id} - Get model by CivitAI ID
- GET /api/db/triggers - Get triggers by file path
- GET /api/db/triggers/{version_id} - Get triggers by version ID
- GET /api/db/stats - Database statistics
- POST /api/db/scan - Scan directory for safetensors
- POST /api/db/link - Link unlinked files to CivitAI
- POST /api/db/cache - Fetch and cache CivitAI model data

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 01:35:26 +01:00
Adam Ladachowski a92c9fb83a Phase 2.2: Add tsr db CLI commands
Add database management commands to CLI:
- tsr db scan <directory> - Scan safetensors, compute hashes, store metadata
- tsr db link - Match unlinked files to CivitAI by hash lookup
- tsr db cache <model_id> - Fetch and cache full CivitAI model data
- tsr db list - List local files with CivitAI info
- tsr db search - Search cached models offline
- tsr db triggers <file> - Show trigger words for a LoRA
- tsr db stats - Show database statistics

Update API functions to accept optional console for quiet/batch operations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 01:33:56 +01:00
Adam Ladachowski c7c5a4a995 Phase 2.1: Add SQLite database module for models metadata
Create database infrastructure for local model file tracking and CivitAI cache:
- schema.sql: Full schema with local_files, CivitAI cache tables, and views
- db.py: Database class with CRUD operations for file scanning, CivitAI linking,
  model caching, search, and trigger word retrieval
- Update compute_sha256 to support optional console for silent batch operations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 01:31:32 +01:00
Adam Ladachowski 100d31ba86 💬 Commit message: Update 2026-02-14 01:24:45, 2 files, 439 lines
📁 Files changed: 2
📝 Lines changed: 439

  • PLAN.md
  • TODO.md
2026-02-14 01:24:45 +01:00
Adam Ladachowski 854ac6ddaa 💬 Commit message: Update 2026-02-14 00:58:05, 2 files, 298 lines
📁 Files changed: 2
📝 Lines changed: 298

  • models-db.md
  • models.db
2026-02-14 00:58:13 +01:00
Adam Ladachowski ba8d176340 Fix wait_ready crashing after sd-server binds port during model load
Only ConnectError was caught, so once the port opened but the model
was still loading, health check timeouts (ReadTimeout) and connection
resets (ReadError) would crash the polling loop instead of retrying.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 22:05:51 +00:00
Adam Ladachowski bb25c7ce94 Add status and reload client commands for remote wrapper
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 21:49:07 +00:00
Adam Ladachowski 61e68fee15 Turn server wrapper into transparent proxy with /reload
Replace management endpoints (/start, /stop, /restart) with a transparent
reverse proxy and hot-reload architecture. The wrapper now sits in front of
sd-server, forwarding all requests and adding a /reload endpoint for model
swapping without restarting the wrapper itself.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 20:51:16 +00:00
Adam Ladachowski b33fe120fa Update README with generate and serve commands
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 20:24:06 +00:00
Adam Ladachowski 503274a938 [Update] 2026-02-12 20:23:09, 18 files 2026-02-12 20:23:09 +00:00
Adam Ladachowski 7b583c72b0 Update 2026-02-12 16:46:11 +00:00
Adam Ladachowski 0d278faab2 Update 2026-02-12 16:40:49 +00:00
Adam Ladachowski 795cc84122 [Update] 2026-02-12 16:23:37, 3 files 2026-02-12 16:23:37 +00:00
Adam Ladachowski d867822891 💬 Commit message: Update 2026-02-04 07:15:05, 1 files, 2 lines
📁 Files changed: 1
📝 Lines changed: 2

  • README.md
2026-02-04 07:15:05 +01:00
Adam Ladachowski 751fd42026 Add badge for pip installation in README 2026-02-04 07:13:24 +01:00
Adam Ladachowski 77bcf7f4e7 Update README with project assets link
Added a link to the project assets in the README.
2026-02-04 07:06:46 +01:00
Adam Ladachowski 9c0a0766ac chore: bump version to 0.1.5 2026-02-03 23:58:09 +01:00
Adam Ladachowski 38bc0417b4 chore: bump version to 0.1.4 2026-02-03 23:17:11 +01:00
Adam Ladachowski 9f8d8d6fcd Add comprehensive tests, coverage 21% → 74% 2026-02-03 23:10:30 +01:00
Adam Ladachowski 438f2a93f5 Add justfile for dev tasks 2026-02-03 23:07:24 +01:00
Adam Ladachowski 75eccecfba Fix PLR2004/PLR0911: replace magic values with constants, refactor _resolve_version_id 2026-02-03 23:01:33 +01:00
Adam Ladachowski 4bebae00f6 Ignore PLR rules for CLI app 2026-02-03 22:58:44 +01:00
Adam Ladachowski 5588370a43 [Update] [2026-02-03 22:57:52] 10 files 2026-02-03 22:57:52 +01:00
Adam Ladachowski d8bf867042 💬 Commit message: Update 2026-02-03 22:24:47, 2 files, 206 lines
📁 Files changed: 2
📝 Lines changed: 206

  • publish.yml
  • RELEASE.md
2026-02-03 22:24:47 +01:00
Adam Ladachowski e8d9fba7d8 💬 Commit message: Update 2026-02-03 22:22:59, 1 files, 3 lines
📁 Files changed: 1
📝 Lines changed: 3

  • tensors.py
2026-02-03 22:22:59 +01:00
Adam Ladachowski 6df2b1da2e 💬 Commit message: Update 2026-02-03 22:19:25, 2 files, 81 lines
📁 Files changed: 2
📝 Lines changed: 81

  • settings.local.json
  • tensors.py
2026-02-03 22:19:25 +01:00
Adam Ladachowski 5c44ec987e [Update] [2026-02-03 22:10:04] 2 files 2026-02-03 22:10:04 +01:00
Adam Ladachowski 53a7adfa0e Add macOS code signing and notarization (requires secrets) 2026-02-03 21:53:59 +01:00
Adam Ladachowski 3117534cb8 Fix macOS runner (use macos-15-large for Intel) 2026-02-03 21:28:41 +01:00
Adam Ladachowski cf4c58db62 Add Nuitka binary builds for all platforms 2026-02-03 21:28:00 +01:00