From 133ddef181a213c0446a6d8b09ca70a23aafd6a6 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Thu, 7 May 2026 15:13:23 +0200 Subject: [PATCH] Add runtime check and detailed error handling for failed model loading --- generate_equirect.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/generate_equirect.py b/generate_equirect.py index 5f3540d..515e52c 100644 --- a/generate_equirect.py +++ b/generate_equirect.py @@ -664,6 +664,14 @@ def generate( "install accelerate for low_cpu_mem_usage: pip install accelerate. " f"Errors: {load_errors}" ) from (last_err or Exception("No pipeline loaded")) + if gen_pipe is None: + mode = "offline/local-cache" if local_files_only() else "online" + raise RuntimeError( + f"Failed to load model '{model_path}' in {mode} mode. " + "The local single-file checkpoint needs the bundled SDXL config and locally cached " + "tokenizer/text-encoder metadata. " + f"Errors: {load_errors}" + ) if gen_pipe.vae is None and is_sdxl: try: vae = vae or AutoencoderKL.from_pretrained(