From 71afd3fb6f8a11be628dc42b184af3c8e864561c Mon Sep 17 00:00:00 2001 From: vladmandic Date: Tue, 17 Feb 2026 09:02:42 +0100 Subject: [PATCH] handle missing preview Signed-off-by: vladmandic --- CHANGELOG.md | 23 ++++++++++++----------- modules/ui_extra_networks.py | 3 ++- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6dfe297b..dcc3c4967 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,17 +48,18 @@ TBD - remove requirements: `clip`, `open-clip` - update `requirements` - **Fixes** - - fix: handle `clip` installer doing unwanted `setuptools` update - - fix: cleanup for `uv` installer fallback - - fix: add metadata restore to always-on scripts - - fix: improve wildcard weights parsing, thanks @Tillerz - - fix: ui gallery cache recursive cleanup, thanks @awsr - - fix: main results pane sizing - - fix: `anima` model detection - - fix: lora unwanted unload - - fix: improve preview error handler - - fix: gallery over remote/unsecure connections - - fix: ltx2-i2v + - handle `clip` installer doing unwanted `setuptools` update + - cleanup for `uv` installer fallback + - add metadata restore to always-on scripts + - improve wildcard weights parsing, thanks @Tillerz + - ui gallery cache recursive cleanup, thanks @awsr + - main results pane sizing + - model detection for `anima` + - lora unwanted unload + - improve preview error handler + - gallery over remote/unsecure connections + - ltx2-i2v + - handle missing preview image ## Update for 2026-02-04 diff --git a/modules/ui_extra_networks.py b/modules/ui_extra_networks.py index d98e7a14b..62b97c6c7 100644 --- a/modules/ui_extra_networks.py +++ b/modules/ui_extra_networks.py @@ -60,7 +60,8 @@ def init_api(): if filename is None or len(filename) == 0: return JSONResponse({ "error": "no filename" }, status_code=400) if not os.path.exists(filename) or not os.path.isfile(filename): - return JSONResponse({ "error": f"file {filename}: not found" }, status_code=404) + return FileResponse('html/missing.png', headers={"Accept-Ranges": "bytes"}) + # return JSONResponse({ "error": f"file {filename}: not found" }, status_code=404) if filename.startswith('html/') or filename.startswith('models/'): return FileResponse(filename, headers={"Accept-Ranges": "bytes"}) if not any(Path(folder).absolute() in Path(filename).absolute().parents for folder in allowed_dirs):