fix: pin torch cu126 for GPU compatibility and fix cross-platform bugs

- Pin torch==2.6.0+cu126 and torchvision==0.21.0+cu126 in feature
  manifest to prevent NCCL symbol mismatch on CUDA 12.6 base images
- Move lpips after torch in install order to prevent wrong version
  resolution from PyPI
- Add einops to upscale-enhance common deps (required by SCUNet)
- Update cpu_fallback_packages to handle multi-package CUDA torch
  entries on amd64 without GPU
- Fix gpu.py ONNX CUDA detection: replace hardcoded .so path with
  cross-platform session smoke-test
- Fix os.dup(1) crashes on Windows in upscale, enhance_faces, and
  noise_removal by wrapping in try/except with sys.stderr fallback
- Guard top-level numpy/cv2 imports in colorize.py and restore.py
  with helpful error messages
- Add weights_only=False fallback for torch.load in noise_removal
- Fix integration tests to accept 501 for uninstalled AI features
  and 422 for missing system tools (exiftool, libheif)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ashim
2026-04-20 15:17:08 +08:00
co-authored by Claude Opus 4.6
parent ac5fdfb841
commit 01d30cfb61
10 changed files with 209 additions and 195 deletions
@@ -108,6 +108,8 @@ describe("Format conversion matrix", () => {
body: payload,
});
// HEIC encode/decode requires libheif which may not be installed (Windows, some Linux)
if (res.statusCode === 422 && (inputFmt === "heic" || outputFmt === "heic")) return;
expect(res.statusCode).toBe(200);
const body = JSON.parse(res.body);
expect(body.downloadUrl).toContain(`.${outputFmt}`);
@@ -144,6 +146,8 @@ describe("SVG via convert tool", () => {
body: payload,
});
// HEIC encode/decode requires libheif which may not be installed (Windows, some Linux)
if (res.statusCode === 422 && outputFmt === "heic") return;
expect(res.statusCode).toBe(200);
const body = JSON.parse(res.body);
expect(body.downloadUrl).toContain(`.${outputFmt}`);