Commit Graph

242 Commits

Author SHA1 Message Date
Adam Ladachowski de8bdf4825 Add explicit cmd to app.yml 2026-02-14 08:55:08 +01:00
Adam Ladachowski a20ec2885e Add custom Dockerfile for Tengu build 2026-02-14 08:54:39 +01:00
Adam Ladachowski c6da517b08 Add requirements.txt for Tengu build 2026-02-14 08:54:02 +01:00
Adam Ladachowski ab2ef4258b Add Tengu deployment config and LoRA support
- Add app.yml for Tengu PaaS deployment
- Fix LoRA parameter passing (separate param, not in prompt)
- Add default quality/negative prompts
- Update UI for LoRA selection

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 08:53:08 +01:00
Adam Ladachowski 120c4c68b0 💬 Commit message: Update 2026-02-14 07:13:36, 9 files, 312 lines
📁 Files changed: 9
📝 Lines changed: 312

  • api.py
  • download_routes.py
  • index-BIJHSBBO.js
  • index-D2fa7i11.css
  • index-Dd0b3iAi.js
  • index-lqI0My76.css
  • index.html
  • client.ts
  • ModelCard.vue
2026-02-14 07:13:36 +01:00
Adam Ladachowski c2f915c59c 💬 Commit message: Update 2026-02-14 07:10:06, 4 files, 12 lines
📁 Files changed: 4
📝 Lines changed: 12

  • index-D2fa7i11.css
  • index-Dd0b3iAi.js
  • index.html
  • GenerateView.vue
2026-02-14 07:10:06 +01:00
Adam Ladachowski bfe73808b8 💬 Commit message: Update 2026-02-14 07:04:24, 5 files, 12 lines
📁 Files changed: 5
📝 Lines changed: 12

  • screenshot.png
  • index-BsfOJ0lW.js
  • index-DUfzPzFk.css
  • index.html
  • GenerateView.vue
2026-02-14 07:04:24 +01:00
Adam Ladachowski 26e5b44c68 Fix Vue reactivity: use reactive() for message objects 2026-02-14 06:55:46 +01:00
Adam Ladachowski 374d3a0bee Add console logging to debug generation 2026-02-14 06:54:21 +01:00
Adam Ladachowski 8906bb8deb Rebuild UI assets 2026-02-14 06:53:51 +01:00
Adam Ladachowski e9480a18c2 Remove internal sd-server management, proxy to external sd-server
- Remove ProcessManager and process.py
- Add get_sd_server_url() config (env/config/default)
- Update routes to proxy to external sd-server URL
- Remove model switching (handled by external sd-server)
- Update CLI serve command
- Update tests for new architecture

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 06:39:35 +01:00
Adam Ladachowski be7cf0b6e7 💬 Commit message: Update 2026-02-14 05:32:51, 3 files, 113 lines
📁 Files changed: 3
📝 Lines changed: 113

  • reinstall.md
  • pyproject.toml
  • reinstall.py
2026-02-14 05:32:51 +01:00
Adam Ladachowski 9abb06abf4 💬 Commit message: Update 2026-02-14 05:02:03, 19 files, 158 lines
📁 Files changed: 19
📝 Lines changed: 158

  • tensors-3rows.png
  • tensors-all-sizes.png
  • tensors-final.png
  • tensors-fixed-align.png
  • tensors-fresh.png
  • tensors-labeled-rows.png
  • tensors-left-align.png
  • tensors-ratio-buttons.png
  • tensors-ratio-updated.png
  • tensors-ratio-v3.png
  • tensors-table-align.png
  • index-BPC1k--a.js
  • index-BvuF0jag.css
  • index-CP6ArsWF.css
  • index-CX4x_bxc.js
  • index.html
  • GenerateView.vue
  • app.ts
  • index.ts
2026-02-14 05:02:03 +01:00
Adam Ladachowski 5721ce223b 💬 Commit message: Update 2026-02-14 04:18:54, 32 files, 4255 lines
📁 Files changed: 32
📝 Lines changed: 4255

  • .coverage
  • __init__.py
  • index-BvuF0jag.css
  • index-CX4x_bxc.js
  • materialdesignicons-webfont-B7mPwVP_.ttf
  • materialdesignicons-webfont-CSr8KVlo.eot
  • materialdesignicons-webfont-Dp5v-WZN.woff2
  • materialdesignicons-webfont-PXm3-2wK.woff
  • index.html
  • vite.svg
  • .gitignore
  • extensions.json
  • README.md
  • index.html
  • package-lock.json
  • package.json
  • vite.svg
  • App.vue
  • client.ts
  • vue.svg
  • GalleryView.vue
  • GenerateView.vue
  • ModelCard.vue
  • SearchView.vue
  • main.ts
  • app.ts
  • index.ts
  • vite-env.d.ts
  • tsconfig.app.json
  • tsconfig.json
  • tsconfig.node.json
  • vite.config.ts
2026-02-14 04:18:54 +01:00
Adam Ladachowski 52b39a4f6b 💬 Commit message: Update 2026-02-14 03:41:07, 1 files, 278 lines
📁 Files changed: 1
📝 Lines changed: 278

  • index.html
2026-02-14 03:41:07 +01:00
Adam Ladachowski 1cad0fea94 💬 Commit message: Update 2026-02-14 03:29:49, 1 files, 21 lines
📁 Files changed: 1
📝 Lines changed: 21

  • index.html
2026-02-14 03:29:49 +01:00
Adam Ladachowski 24e39ed225 💬 Commit message: Update 2026-02-14 03:24:57, 4 files, 682 lines
📁 Files changed: 4
📝 Lines changed: 682

  • .coverage
  • __init__.py
  • civitai_routes.py
  • index.html
2026-02-14 03:24:57 +01:00
Adam Ladachowski af4fc5be4c 💬 Commit message: Update 2026-02-14 03:16:43, 1 files, 0 lines
📁 Files changed: 1
📝 Lines changed: 0

  • .coverage
2026-02-14 03:16:43 +01:00
Adam Ladachowski c1f5a7ce37 Apply tengu.to color scheme and styling
- Background: #0f0f0f
- Cards: #1a1a1a with #333 borders
- Accent: #4ade80 (green) for active/code
- Primary button: #dc2626 (red)
- Text: #e5e5e5, muted #888/#666
- Monospace font for prompts
- 8px border-radius on all components

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 03:14:53 +01:00
Adam Ladachowski 181710dc24 💬 Commit message: Update 2026-02-14 03:12:16, 1 files, 6 lines
📁 Files changed: 1
📝 Lines changed: 6

  • index.html
2026-02-14 03:12:16 +01:00
Adam Ladachowski 19541f610e Add chat-like generate UI with sidebar navigation
- Sidebar with Generate and Gallery icons
- Chat-style generate interface with prompt history
- Images tile in rows as they generate
- Spinner while generating
- Steps input (default 20)
- Mobile responsive
- Lightbox for all images

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-14 03:08:44 +01:00
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