Commit Graph

251 Commits

Author SHA1 Message Date
Adam Ladachowski e776f9846e Phase 1: Core Client (tensors/comfyui.py)
Add ComfyUI API client module with:
- Basic query functions: get_system_stats(), get_queue_status(),
  get_loaded_models(), get_history(), clear_queue(), get_object_info()
- Workflow execution: queue_prompt(), run_workflow() with progress tracking
- Text-to-image: generate_image() with embedded SDXL/Flux workflow template
- Data classes: GenerationResult, WorkflowResult
- Helper: get_image() to download generated images

Follows existing api.py patterns with console: Console | None for optional
Rich progress output, httpx for HTTP requests, and proper error handling.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 16:03:49 +01:00
Adam Ladachowski e9d1745c62 💬 Commit message: Update 2026-02-16 16:00:31, 1 files, 126 lines
📁 Files changed: 1
📝 Lines changed: 126

  • TODO.md
2026-02-16 16:00:31 +01:00
Adam Ladachowski b11b43fc2a ci: add comprehensive GitHub Actions workflow
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 14:39:56 +01:00
Adam Ladachowski 5bdbd6ef5f Rename /deploy to /tensors:deploy and rewrite in Ruby
Move deploy command to tensors namespace and replace bash script with
Ruby for better error handling. Adds API health check after restart.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 13:45:11 +01:00
Adam Ladachowski 74a5136d6e 💬 Commit message: Update 2026-02-16 13:42:41, 2 files, 6 lines
📁 Files changed: 2
📝 Lines changed: 6

  • settings.local.json
  • .coverage
2026-02-16 13:42:41 +01:00
Adam Ladachowski 574cdb6abd Add configurable model paths
- Add [paths] section to config.toml for custom model directories
- Add get_model_paths() function that merges config with defaults
- Update get_default_output_path() to check config first
- Add --set-path option to tsr config command
- Update download_routes.py to use centralized path function
- Add tests for path configuration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 13:40:45 +01:00
Adam Ladachowski 79657a7b1f Fix lint errors in OAuth routes
- Break long SVG path lines in login pages (E501)
- Remove unused request parameter from callbacks (ARG001)
- Add noqa for too-many-returns in OAuth callbacks (PLR0911)
- Remove unused CORSMiddleware import
- Fix type narrowing in logout redirect

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 10:15:34 +01:00
Adam Ladachowski 4c946c9536 Add shared OAuth authentication routes
Support cross-domain auth for tensors-web with return_url parameter.
New endpoints: /auth/login, /auth/github, /auth/callback, /auth/verify

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 00:59:55 +01:00
Adam Ladachowski 8d70723be3 💬 Commit message: Update 2026-02-16 00:45:18, 1 files, 13 lines
📁 Files changed: 1
📝 Lines changed: 13

  • icon.svg
2026-02-16 00:45:18 +01:00
Adam Ladachowski 36b686ba6b 💬 Commit message: Update 2026-02-16 00:44:07, 3 files, 15 lines
📁 Files changed: 3
📝 Lines changed: 15

  • logo.png
  • logo.svg
  • screenshot.png
2026-02-16 00:44:07 +01:00
Adam Ladachowski 27d119f920 Replace username/password auth with GitHub OAuth for ComfyUI proxy
- Add GitHub OAuth flow with /comfy/auth/github and /comfy/auth/callback
- User allowlist via GITHUB_ALLOWED_USERS environment variable
- CSRF protection with state parameter
- Keep same dark mode login page design (saved screenshot)
- Strip Origin header from proxied requests (fixes ComfyUI 403s)
- Add manual CORS headers to proxy responses

Env vars: GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, GITHUB_ALLOWED_USERS

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 00:36:11 +01:00
Adam Ladachowski 4302d76d61 Strip Origin header - ComfyUI blocks CORS requests 2026-02-15 23:57:35 +01:00
Adam Ladachowski 1692789a01 Add debug logging 2026-02-15 23:56:34 +01:00
Adam Ladachowski 3dbd72233b Add manual CORS headers to ComfyUI proxy 2026-02-15 23:56:00 +01:00
Adam Ladachowski 34f683ad56 Disable CORS entirely 2026-02-15 23:54:51 +01:00
Adam Ladachowski ff9736dbe6 Fix CORS: allow_credentials must be False for wildcard origins
CORS spec doesn't allow credentials with wildcard origins.
This was causing 403 for all crossorigin module preloads.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 23:53:53 +01:00
Adam Ladachowski 2ea8bbeafd Allow entire assets/ path without auth for ComfyUI proxy
Simpler approach - just allow all requests to assets/ directory.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 23:40:40 +01:00
Adam Ladachowski 7caed3bbea Allow CORS preflight OPTIONS requests without auth
CORS preflight requests don't send cookies, so they were failing auth.
Now OPTIONS requests are allowed through without authentication.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 23:38:23 +01:00
Adam Ladachowski d589957cf1 Allow static assets without auth for ComfyUI proxy
modulepreload links use crossorigin attribute which doesn't send
cookies, so static assets (JS, CSS, fonts, images, JSON) are now
allowed without session authentication.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 23:35:11 +01:00
Adam Ladachowski ff2319a50e 💬 Commit message: Update 2026-02-15 23:33:18, 3 files, 91 lines
📁 Files changed: 3
📝 Lines changed: 91

  • .coverage
  • CLAUDE.md
  • uv.lock
2026-02-15 23:33:18 +01:00
Adam Ladachowski f1ab0d6f05 Add ComfyUI reverse proxy with session authentication
- New /comfy/* routes that proxy to local ComfyUI instance
- Dark mode login page with session-based auth (HMAC-signed cookies)
- HTTP proxy for all ComfyUI requests
- WebSocket proxy for real-time features
- Environment variables: COMFYUI_URL, COMFYUI_USER, COMFYUI_PASS, SESSION_SECRET
- Added websockets and python-multipart to server dependencies

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 23:29:48 +01:00
Adam Ladachowski 023eae66d7 💬 Commit message: Update 2026-02-15 23:19:02, 1 files, 116 lines
📁 Files changed: 1
📝 Lines changed: 116

  • CLAUDE.md
2026-02-15 23:19:02 +01:00
Adam Ladachowski c9d76dc382 Disable CORS 2026-02-15 21:45:23 +01:00
Adam Ladachowski 08e612ffa0 Add HuggingFace model caching to database
- New tables: hf_models, hf_model_tags, hf_safetensor_files
- Cache HF search results automatically
- Add search_hf_models(), get_hf_model() methods
- Include hf_models in stats

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 21:18:24 +01:00
Adam Ladachowski d79861df53 Remove redundant /api/civitai/search endpoint
Unified search at /api/search handles both CivitAI and HuggingFace.
CivitAI routes now only provide:
- /api/civitai/model/{id} - get model by ID

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 21:15:24 +01:00
Adam Ladachowski 081bb3d371 Update README with unified search and TypeScript client
- Document unified search with --provider flag (civitai, hf, all)
- Add /api/search to server endpoints
- Add TypeScript client section (@saiden/tensors)
- Add public API info (tensors-api.saiden.dev)
- Update search options table with provider column

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 21:09:11 +01:00
Adam Ladachowski a47237e5f7 💬 Commit message: Update 2026-02-15 21:04:01, 1 files, 0 lines
📁 Files changed: 1
📝 Lines changed: 0

  • .coverage
2026-02-15 21:04:01 +01:00
Adam Ladachowski 87ab5c44bb Make console parameter optional in search_civitai
- Console is now optional for headless/server usage
- Progress spinner only shown when console is provided
- Error messages print only when console is provided

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 19:59:55 +01:00
Adam Ladachowski fb27f8a9b0 Fix formatting issues
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 19:57:55 +01:00
Adam Ladachowski 24aaca2a48 Fix lint ignores for test files
- Add PLC0415, ARG001, ARG005, F841 to test file ignores
- Remove now-redundant inline noqa comments

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 19:56:49 +01:00
Adam Ladachowski 9f9f137f68 Unify CivitAI and HuggingFace search into single endpoint
- Add --provider flag to search command (civitai, hf, or all)
- Default to searching both providers simultaneously
- Add /api/search unified REST endpoint
- Map common parameters (sort, author, tag) across providers
- Remove separate `hf search` subcommand (use `search -P hf`)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 19:35:38 +01:00
Adam Ladachowski eb151dac8d Add Hugging Face Hub integration for safetensor files
- Add `tsr hf search` to search HF models with safetensor files
- Add `tsr hf get` to view model info and list safetensor files
- Add `tsr hf files` to list safetensor files in a model
- Add `tsr hf dl` to download safetensor files from HF

Uses official huggingface_hub library for API access.
Only safetensor files are supported (enforced at search and download).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 19:27:23 +01:00
Adam Ladachowski 29d96e2a00 Bump to v0.1.18, add icon and badges to README
- Add SVG icon with red rounded border "T"
- Add PyPI version, coverage, Python version, and license badges
- Remove video embed from README
- Center header with icon

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 19:13:47 +01:00
Adam Ladachowski e4fc392a90 Expand server test coverage from 66% to 73%
Add comprehensive tests for:
- Download routes helper functions (_format_size, _get_output_dir, _resolve_version_id)
- Background download task execution (success, failure, exception handling)
- Progress callback with different sizes (bytes, KB, MB, GB)
- Auto-linking downloaded files to CivitAI
- Database file lookup and linking with CivitAI matches
- CivitAI cache failure handling
- Gallery edge cases and metadata operations
- Server initialization and OpenAPI schema

Server module coverage now:
- auth.py: 100%
- civitai_routes.py: 98%
- db_routes.py: 97%
- download_routes.py: 98%
- gallery_routes.py: 98%
- gallery.py: 95%

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 19:11:25 +01:00
Adam Ladachowski a68ab90025 Bump version to 0.1.17 2026-02-15 18:58:27 +01:00
Adam Ladachowski f2df2bbefa 💬 Commit message: Update 2026-02-15 18:38:39, 2 files, 121 lines
📁 Files changed: 2
📝 Lines changed: 121

  • README.md
  • civitai_routes.py
2026-02-15 18:38:39 +01:00
Adam Ladachowski ab3660a175 💬 Commit message: Update 2026-02-15 18:22:20, 3 files, 101 lines
📁 Files changed: 3
📝 Lines changed: 101

  • config.py
  • __init__.py
  • auth.py
2026-02-15 18:22:20 +01:00
Adam Ladachowski 205e6dbdf2 💬 Commit message: Update 2026-02-15 18:14:49, 1 files, 39 lines
📁 Files changed: 1
📝 Lines changed: 39

  • cli.py
2026-02-15 18:14:49 +01:00
Adam Ladachowski 5f71710298 💬 Commit message: Update 2026-02-15 18:00:36, 4 files, 228 lines
📁 Files changed: 4
📝 Lines changed: 228

  • pyproject.toml
  • api.py
  • cli.py
  • config.py
2026-02-15 18:00:36 +01:00
Adam Ladachowski 1d41f924bf 💬 Commit message: Update 2026-02-15 17:55:57, 7 files, 47 lines
📁 Files changed: 7
📝 Lines changed: 47

  • pyproject.toml
  • __init__.py
  • civitai_routes.py
  • db_routes.py
  • download_routes.py
  • gallery_routes.py
  • uv.lock
2026-02-15 17:55:57 +01:00
Adam Ladachowski 0ce7744324 💬 Commit message: Update 2026-02-15 17:50:28, 6 files, 110 lines
📁 Files changed: 6
📝 Lines changed: 110

  • deploy.md
  • Dockerfile
  • Dockerfile.rocm
  • README.md
  • deploy.sh
  • cli.py
2026-02-15 17:50:28 +01:00
Adam Ladachowski 6fe4c11683 💬 Commit message: Update 2026-02-15 15:58:14, 1 files, 62 lines
📁 Files changed: 1
📝 Lines changed: 62

  • Dockerfile.rocm
2026-02-15 15:58:14 +01:00
Adam Ladachowski f510fa3b78 💬 Commit message: Update 2026-02-15 09:34:30, 1 files, 49 lines
📁 Files changed: 1
📝 Lines changed: 49

  • Dockerfile
2026-02-15 09:34:30 +01:00
Adam Ladachowski e4e733c651 💬 Commit message: Update 2026-02-15 09:11:32, 1 files, 60 lines
📁 Files changed: 1
📝 Lines changed: 60

  • Dockerfile
2026-02-15 09:11:32 +01:00
Adam Ladachowski 71af9f3d4b 💬 Commit message: Update 2026-02-15 08:56:49, 5 files, 971 lines
📁 Files changed: 5
📝 Lines changed: 971

  • package.json
  • comfy-client.ts
  • comfy.ts
  • tsconfig.json
  • tsconfig.node.json
2026-02-15 08:56:49 +01:00
Adam Ladachowski 688d824cac 💬 Commit message: Update 2026-02-15 08:56:42, 5 files, 971 lines
📁 Files changed: 5
📝 Lines changed: 971

  • package.json
  • comfy-client.ts
  • comfy.ts
  • tsconfig.json
  • tsconfig.node.json
2026-02-15 08:56:42 +01:00
Adam Ladachowski 1d1cd36594 💬 Commit message: Update 2026-02-15 08:34:49, 38 files, 4477 lines
📁 Files changed: 38
📝 Lines changed: 4477

  • deploy.md
  • .coverage
  • deploy.sh
  • cli.py
  • comfy.py
  • __init__.py
  • comfy_routes.py
  • index-BEOoAFTp.css
  • index-Wi7i1Rks.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
  • DownloadsPanel.vue
  • 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-15 08:34:49 +01:00
Adam Ladachowski 3638bd7d81 💬 Commit message: Update 2026-02-15 08:03:38, 10 files, 372 lines
📁 Files changed: 10
📝 Lines changed: 372

  • deploy.md
  • .coverage
  • deploy.sh
  • __init__.py
  • comfy_routes.py
  • index-BEOoAFTp.css
  • index-Wi7i1Rks.js
  • index.html
  • GenerateView.vue
  • app.ts
2026-02-15 08:03:38 +01:00
Adam Ladachowski 356d8fd156 💬 Commit message: Update 2026-02-15 06:21:35, 7 files, 1559 lines
📁 Files changed: 7
📝 Lines changed: 1559

  • .coverage
  • cli.py
  • __init__.py
  • conftest.py
  • test_client.py
  • test_generate.py
  • test_server.py
2026-02-15 06:21:35 +01:00
Adam Ladachowski c419e443ae 💬 Commit message: Update 2026-02-15 06:15:02, 11 files, 1240 lines
📁 Files changed: 11
📝 Lines changed: 1240

  • client.py
  • __init__.py
  • _http.py
  • generation.py
  • info.py
  • params.py
  • util.py
  • generate_routes.py
  • models_routes.py
  • routes.py
  • sd_client.py
2026-02-15 06:15:02 +01:00