Python
fixed model loras downloaded to the wrong place
deepbeepmeep230b3632a323
diff --git a/README.md b/README.mdindex 940f123..c320857 100644--- a/README.md+++ b/README.md@@ -21,7 +21,7 @@ WanGP supports the Wan (and derived models), Hunyuan Video and LTV Video models**Follow DeepBeepMeep on Twitter/X to get the Latest News**: https://x.com/deepbeepmeep## 🔥 Latest Updates :-### October 20 2025: WanGP v9.0 - 0.001 Later+### October 20 2025: WanGP v9.01 - 0.001 LaterWhat else will you ever need after this one ?diff --git a/wgp.py b/wgp.pyindex eacb36f..2731338 100644--- a/wgp.py+++ b/wgp.py@@ -74,7 +74,7 @@ global_queue_ref = []AUTOSAVE_FILENAME = "queue.zip"PROMPT_VARS_MAX = 10target_mmgp_version = "3.6.6"-WanGP_version = "9.0"+WanGP_version = "9.01"settings_version = 2.39max_source_video_frames = 3000prompt_enhancer_image_caption_model, prompt_enhancer_image_caption_processor, prompt_enhancer_llm_model, prompt_enhancer_llm_tokenizer = None, None, None, None@@ -2963,7 +2963,7 @@ def download_models(model_filename = None, model_type= None, module_type = Falseif module_type: returnmodel_filename = None- for prop in ["preload_URLs", "loras", "text_encoder_URLs"]:+ for prop in ["preload_URLs", "text_encoder_URLs"]:preload_URLs = get_model_recursive_prop(model_type, prop, return_list= True)if prop in ["text_encoder_URLs"]:preload_URLs = [get_model_filename(model_type=model_type, quantization= text_encoder_quantization, dtype_policy = transformer_dtype_policy, URLs=preload_URLs)] if len(preload_URLs) > 0 else []@@ -2979,7 +2979,19 @@ def download_models(model_filename = None, model_type= None, module_type = Falseexcept Exception as e:if os.path.isfile(filename): os.remove(filename)raise Exception(f"{prop} '{url}' is invalid: {str(e)}'")-++ model_loras = get_model_recursive_prop(model_type, "loras", return_list= True)+ for url in model_loras:+ filename = os.path.join(get_lora_dir(model_type), url.split("/")[-1])+ if not os.path.isfile(filename ):+ if not url.startswith("http"):+ raise Exception(f"Lora '{filename}' was not found in the Loras Folder and no URL was provided to download it. Please add an URL in the model definition file.")+ try:+ download_file(url, filename)+ except Exception as e:+ if os.path.isfile(filename): os.remove(filename)+ raise Exception(f"Lora URL '{url}' is invalid: {str(e)}'")+if module_type: returnmodel_files = model_type_handler.query_model_files(computeList, base_model_type, model_filename, text_encoder_quantization)if not isinstance(model_files, list): model_files = [model_files]