9 Commits

Author SHA1 Message Date
Vladimir Mandic 4cf2854c93 update ruff and lint
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-24 18:20:41 +02:00
QualiaRain 148a7883a2 Fix assorted small typos: dead __str__, unformatted messages, preview min-height, tooltip
- processing.py: __str___ misspelled dunder never dispatched; rename to __str__
- demofusion.py: missing f-prefix printed literal {width}x{height} in user-facing error
- sparse_backend.py: missing f-prefix printed literal {size} in ValueError
- generation_parameters_copypaste.py: debug message typo 'Not not registered'
- progressBar.ts: live-preview gallery minHeight computed from naturalWidth; mirrors the adjacent maxHeight line (naturalHeight)
- settings.ts: stray } in settings-tab tooltip
2026-06-11 01:42:29 -04:00
awsr 82886ba9a3 Update Pillow support to 12.2.0
- Update "constraints.txt" and "requirements.txt".
- Migrate removed `ImageCms.FLAGS` to `ImageCms.Flags` enum.
- Update typing.
- Simplify getting path in `apply_srgb`.
2026-05-13 18:37:12 -07:00
Vladimir Mandic feeafc6286 strict ruff without exclude
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-11 08:36:49 +02:00
Vladimir Mandic c8d6fd5cf8 Revert "much stricter ruff linting"
This reverts commit 310dbf1574.
2026-05-11 08:13:57 +02:00
Vladimir Mandic 310dbf1574 much stricter ruff linting
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-11 07:15:37 +02:00
vladmandic 3ae9909b2a update sharpfin usage
Signed-off-by: vladmandic <mandic00@live.com>
2026-02-11 09:57:37 +01:00
CalamitousFelicitousness 162651cbdb refactor: address PR #4640 review comments
Changes based on vladmandic and Disty0 feedback:

- Fix logging: use direct `from installer import log` instead of lazy _get_log()
- Remove unused is_available() function
- Remove defensive getattr() calls in _resolve_kernel/_resolve_linearize
- Simplify _get_device_dtype() to use devices module directly
- Refactor to_pil() with single Image.fromarray() call and explicit mode
- Add cross-platform fallback: sharpfin only runs on CUDA, falls back to
  PIL/F.interpolate for other devices (CPU, MPS, OpenVINO)
- Replace lambdas with functools.partial in functional.py for torch.compile safety
- Add modules/sharpfin to pylint ignore-paths (vendored code)
2026-02-11 09:57:37 +01:00
CalamitousFelicitousness 76aa949a26 refactor: integrate sharpfin for high-quality image resize
Vendor sharpfin library (Apache 2.0) and add centralized wrapper
module (images_sharpfin.py) replacing torchvision tensor/PIL
conversion and resize operations throughout the codebase.

- Add modules/sharpfin/ vendored library with MKS2021, Lanczos3,
  Mitchell, Catmull-Rom kernels and optional Triton sparse acceleration
- Add modules/images_sharpfin.py wrapper with to_tensor(), to_pil(),
  pil_to_tensor(), normalize(), resize(), resize_tensor()
- Add resize_quality and resize_linearize_srgb settings
- Add MKS2021 and Lanczos3 upscaler entries
- Replace torchvision.transforms.functional imports across 18 files
- to_pil() auto-detects HWC/BHWC layout, adds .round() before uint8
- Sparse Triton path falls back to dense GPU on compilation failure
- Mixed-axis resize splits into two single-axis scale() calls
- Masks and non-sRGB data always use linearize=False
2026-02-11 09:57:37 +01:00