36 Commits

Author SHA1 Message Date
aladac c911abfe69 feat(generate): accept YAML in --input alongside JSON
`tsr generate --input <file>` previously only understood JSON, which was
awkward for hand-authored template libraries (e.g. ~/Projects/draw/templates/
ships *.yml scene files with embedded newlines and unquoted keys that mirror
the `tsr template` output shape).

Behavior:
- Files with .yml / .yaml extension parse as YAML; .json (or unknown
  extensions whose first non-whitespace char is '{' or '[') parse as JSON.
- Inline strings starting with '{' still parse as JSON (regression-safe).
- Inline strings without leading '{' now parse as YAML, enabling
  `tsr generate --input 'prompt: foo\nmodel: bar.safetensors'` without
  shell-quoting a JSON object.
- All downstream key-mapping / CLI-override / character / scene / lora
  / count handling is identical to the JSON path — parsing only differs.

Implementation:
- New `_parse_generate_input(value)` helper in tensors/cli.py centralizes
  source detection (file vs inline), format selection (extension or
  content sniff), and rich-formatted error reporting via typer.Exit(1).
- The pre-existing inline JSON merge block in `generate` is reduced to a
  single call to the helper.
- Adds pyyaml>=6.0 as a runtime dep. It was already transitively pulled
  in by huggingface_hub, but we depend on it directly so the surface
  contract is explicit and survives a hub re-pin.
- mypy override added for the yaml module (no upstream stubs in tree).

Tests:
- 20 new tests in tests/test_generate_input.py covering inline JSON,
  inline YAML, file by extension (.json/.yml/.yaml), unknown extension
  content sniffing, non-mapping rejection, malformed input handling,
  CLI-flag-wins-over-input precedence, and a full smoke against the
  exact draw template shape (with embedded newlines in the scene list).
- 359 -> 379 total tests. Lint clean on changed lines.

Co-Authored-By: OpenCode <noreply@anomaly.co>
2026-05-18 21:16:11 +02:00
Adam Ladachowski 65cbd372f5 Add hash-suffixed versioning and git-based reinstall command 2026-02-18 17:33:31 +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 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 c9d76dc382 Disable CORS 2026-02-15 21:45:23 +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 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 a68ab90025 Bump version to 0.1.17 2026-02-15 18:58:27 +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 e016c01370 💬 Commit message: Update 2026-02-15 06:14:53, 5 files, 260 lines
📁 Files changed: 5
📝 Lines changed: 260

  • output.png
  • pyproject.toml
  • cli.py
  • comfy.py
  • uv.lock
2026-02-15 06:14:53 +01:00
Adam Ladachowski c156f6826b 💬 Commit message: Update 2026-02-14 09:01:09, 7 files, 66 lines
📁 Files changed: 7
📝 Lines changed: 66

  • pyproject.toml
  • screenshot.png
  • client.ts
  • GalleryView.vue
  • SearchView.vue
  • index.ts
  • uv.lock
2026-02-14 09:01:09 +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 89386ee12a Bump version to 0.1.9 2026-02-14 03:03:03 +01:00
Adam Ladachowski 318cc91eb6 Bump version to 0.1.8 2026-02-14 02:38:46 +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 423e475370 Bump version to 0.1.6 2026-02-14 02:06:54 +01:00
Adam Ladachowski 503274a938 [Update] 2026-02-12 20:23:09, 18 files 2026-02-12 20:23:09 +00: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 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 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
Adam Ladachowski 7626389831 Enable PyPI publish, bump to v0.1.1 2026-02-03 21:25:46 +01:00
Adam Ladachowski 2b62987a0c 💬 Commit message: Update 2026-02-03 20:55:19, 5 files 2026-02-03 20:55:19 +01:00
Adam Ladachowski da5bdc5a06 💬 Commit message: Update 2026-02-03 20:53:31, 12 files 2026-02-03 20:53:31 +01:00
Adam Ladachowski 4a6b7bcb4e 💬 Commit message: Update 2026-02-03 20:32:52, 1 files, 2 lines
📁 Files changed: 1
📝 Lines changed: 2

  • pyproject.toml
2026-02-03 20:32:52 +01:00
Adam Ladachowski ec253245c8 💬 Commit message: Update 2026-01-26 22:34:40, 2 files, 42 lines
📁 Files changed: 2
📝 Lines changed: 42

  • pyproject.toml
  • tensors.py
2026-01-26 22:34:40 +01:00
Adam Ladachowski 0ee55a9db5 💬 Commit message: Update 2026-01-26 09:45:57, 5 files, 18 lines
📁 Files changed: 5
📝 Lines changed: 18

  • build.py
  • check.py
  • pyproject.toml
  • tensors.py
  • uv.lock
2026-01-26 09:45:57 +01:00
Adam Ladachowski eeb55b2540 💬 Commit message: Update 2026-01-24 19:22:34, 7 files, 1285 lines
📁 Files changed: 7
📝 Lines changed: 1285

  • build.py
  • check.py
  • civit.md
  • main.py
  • pyproject.toml
  • sft_get.py
  • uv.lock
2026-01-24 19:22:34 +01:00
Adam Ladachowski 749bd59e99 💬 Commit message: Update 2026-01-24 19:06:06, 6 files, 32 lines
📁 Files changed: 6
📝 Lines changed: 32

  • .gitignore
  • .python-version
  • README.md
  • main.py
  • pyproject.toml
  • uv.lock
2026-01-24 19:06:06 +01:00