Commit Graph

240 Commits

Author SHA1 Message Date
Adam Ladachowski 1ad0a09474 Add separate VAE loader for SDXL/Illustrious/Pony models
- 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>
2026-03-03 16:09:42 +01:00
Adam Ladachowski 3d08d6c5e5 Enable CORS for local development
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 16:03:32 +01:00
github-actions[bot] 39551f7f05 format: auto-format code [skip ci] 2026-02-22 06:23:52 +00:00
github-actions[bot] 762b3f4eac style: auto-fix ruff warnings [skip ci] 2026-02-22 06:23:38 +00:00
Adam Ladachowski 82eb0d3b5c Update 2026-02-22 06:23:25 +00:00
Adam Ladachowski 5ddfb07448 Add WebSocket-based progress tracking for ComfyUI generation
- 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>
2026-02-22 04:07:07 +00:00
Adam Ladachowski 3888558214 💬 Commit message: Update 2026-02-21 20:16:00, 1 files, 103 lines
📁 Files changed: 1
📝 Lines changed: 103

  • setup-comfyui.sh
2026-02-21 20:16:00 +01:00
Adam Ladachowski b1995cb0e4 Add key.txt to gitignore for local API key storage
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 05:37:54 +01:00
Adam Ladachowski d8d788c9b3 💬 Commit message: Update 2026-02-21 05:22:37, 2 files, 299 lines
📁 Files changed: 2
📝 Lines changed: 299

  • .gitignore
  • models-db.md
2026-02-21 05:22:37 +01:00
Adam Ladachowski e5a7977e83 💬 Commit message: Update 2026-02-21 05:21:45, 1 files, 0 lines
📁 Files changed: 1
📝 Lines changed: 0

  • models.db
2026-02-21 05:21:45 +01:00
Adam Ladachowski 987ce1a3a1 💬 Commit message: Update 2026-02-21 05:21:26, 3 files, 126 lines
📁 Files changed: 3
📝 Lines changed: 126

  • .gitignore
  • cli.py
  • comfyui.py
2026-02-21 05:21:26 +01:00
Adam Ladachowski 5da4005c4a Version 0.1.18+b7e8512 2026-02-19 05:37:37 +01:00
Adam Ladachowski b7e85129b1 Version 0.1.18+9883929 2026-02-19 05:37:31 +01:00
Adam Ladachowski 1ed40a3142 Add LoRA support and model family quality defaults to comfy generate 2026-02-19 05:37:31 +01:00
github-actions[bot] 91c5c1e0a7 format: auto-format code [skip ci] 2026-02-18 17:08:10 +00:00
Adam Ladachowski 7616671a59 Version 0.1.18+f07a1e6 2026-02-18 18:07:46 +01:00
Adam Ladachowski f07a1e601d Add --count option for batch image generation 2026-02-18 18:07:32 +01:00
Adam Ladachowski 26c08f247f Version 0.1.18+43a76b0 2026-02-18 18:07:32 +01:00
github-actions[bot] 9350075ebf format: auto-format code [skip ci] 2026-02-18 16:34:25 +00:00
github-actions[bot] 92e2148081 style: auto-fix ruff warnings [skip ci] 2026-02-18 16:34:09 +00:00
Adam Ladachowski 43a76b068b Version 0.1.18+65cbd37 2026-02-18 17:33:55 +01:00
Adam Ladachowski 65cbd372f5 Add hash-suffixed versioning and git-based reinstall command 2026-02-18 17:33:31 +01:00
Adam Ladachowski 2364580742 Version 0.1.18+82570e7 2026-02-18 17:32:54 +01:00
Adam Ladachowski 82570e783d Version 0.1.18+1c884d2 2026-02-18 17:32:25 +01:00
Adam Ladachowski 1c884d2c97 Version 0.1.18+98bb467 2026-02-18 17:32:07 +01:00
Adam Ladachowski 98bb467790 Version 0.1.18+e2f7a7c 2026-02-18 17:31:41 +01:00
Adam Ladachowski e2f7a7c49b Version 0.1.18+066756f 2026-02-18 17:26:16 +01:00
Adam Ladachowski 066756f931 Version 0.1.18+8bdd319 2026-02-18 17:25:41 +01:00
Adam Ladachowski 8bdd31927e Version 0.1.18+093179c 2026-02-18 17:24:42 +01:00
Adam Ladachowski 093179cb3b Add /api/comfyui/image endpoint for fetching generated images
Allows web clients to retrieve images by filename after generation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 01:46:26 +01:00
Adam Ladachowski e8667617dd Fix OpenAPI schema: exclude proxy routes from schema
The /comfy/{path} proxy route was generating duplicate operationIds
for each HTTP method, causing OpenAPI validation to fail.

Exclude all ComfyUI proxy/auth routes from schema - they're not meant
to be used by API clients.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 01:43:35 +01:00
Adam Ladachowski 9fde26fb83 💬 Commit message: Update 2026-02-17 00:06:05, 2 files, 414 lines
📁 Files changed: 2
📝 Lines changed: 414

  • pyproject.toml
  • uv.lock
2026-02-17 00:06:05 +01:00
Adam Ladachowski 90f2fdd494 💬 Commit message: Update 2026-02-16 18:14:33, 1 files, 8 lines
📁 Files changed: 1
📝 Lines changed: 8

  • deploy.rb
2026-02-16 18:14:33 +01:00
Adam Ladachowski ca1aa5d8d7 docs: Add ComfyUI integration to README
- Add ComfyUI CLI commands (tsr comfy status/models/generate/etc.)
- Add ComfyUI API endpoints documentation
- Add ComfyUI generate options table
- Add ComfyUI configuration section
- Update features list and description
- Update coverage badge to 50%

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 16:59:50 +01:00
Adam Ladachowski 279e66a276 2026-02-16_16:40:53 Update 2026-02-16 16:40:53 +01:00
Adam Ladachowski 2e5d7058c5 💬 Commit message: Update 2026-02-16 16:40:44, 1 files, 0 lines
📁 Files changed: 1
📝 Lines changed: 0

  • .coverage
2026-02-16 16:40:44 +01:00
Adam Ladachowski 87ec0bef6a Phase 4: Configuration (config.py)
Add ComfyUI configuration functions:
- `get_comfyui_url()` - URL resolution (env var -> config -> default)
- `get_comfyui_defaults()` - Default generation parameters from config

Config section in config.toml:
    [comfyui]
    url = "http://127.0.0.1:8188"
    default_model = "flux1-dev-fp8.safetensors"
    width = 1024
    height = 1024
    steps = 20
    cfg = 7.0
    sampler = "euler"
    scheduler = "normal"

Updated comfyui.py to use config functions instead of hardcoded values.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 16:20:25 +01:00
Adam Ladachowski 484c52faf3 Phase 3: Server API Routes (/api/comfyui/*)
Add FastAPI routes for ComfyUI programmatic API:

Query endpoints:
- GET /api/comfyui/status - System stats (GPU, RAM, etc.)
- GET /api/comfyui/queue - Queue status (running/pending)
- DELETE /api/comfyui/queue - Clear the queue
- GET /api/comfyui/models - List available models
- GET /api/comfyui/history - List generation history
- GET /api/comfyui/history/{prompt_id} - Get specific result

Generation endpoints:
- POST /api/comfyui/generate - Text-to-image with full params
- POST /api/comfyui/workflow - Queue arbitrary API-format workflow

All endpoints protected with API key auth (X-API-Key header).
Pydantic models for request/response validation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 16:11:19 +01:00
Adam Ladachowski c8c93596c8 Phase 2: CLI Commands (tsr comfy)
Add ComfyUI CLI subcommand group with:
- `tsr comfy status` - System stats (GPU, RAM, PyTorch, queue)
- `tsr comfy queue` - Show queue status (running/pending)
- `tsr comfy queue --clear` - Clear the queue
- `tsr comfy models` - List available checkpoints, LoRAs, VAE, etc.
- `tsr comfy history [ID]` - View generation history
- `tsr comfy generate` - Text-to-image with full parameter control
  - prompt, negative, model, width, height, steps, cfg, seed
  - sampler, scheduler selection
  - optional --output to save locally
- `tsr comfy run workflow.json` - Run arbitrary API-format workflows

All commands support --json output and --url for custom server.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-16 16:07:49 +01:00
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