From 76954ab1025a595e4d5f6c383f7b6ecba8eb309c Mon Sep 17 00:00:00 2001 From: DeepBeepMeep Date: Mon, 7 Apr 2025 22:04:58 +0200 Subject: [PATCH] temporary workaround for Vace bug --- wgp.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/wgp.py b/wgp.py index d3e2fd5..31c02a4 100644 --- a/wgp.py +++ b/wgp.py @@ -433,14 +433,15 @@ def maybe_start_processing(state, progress=gr.Progress()): if queue and not in_progress: initial_status = "Starting automatic processing..." yield initial_status - try: + if True: + # try: for status_update in process_tasks(state, progress): print(f"*** Yielding from process_tasks: '{status_update}' ***") yield status_update - print(f"*** Finished iterating process_tasks normally. ***") - except Exception as e: - print(f"*** Error during maybe_start_processing -> process_tasks: {e} ***") - yield f"Error during processing: {str(e)}" + # print(f"*** Finished iterating process_tasks normally. ***") + # except Exception as e: + # print(f"*** Error during maybe_start_processing -> process_tasks: {e} ***") + # yield f"Error during processing: {str(e)}" else: last_msg = gen.get("last_msg", "Idle") initial_status = last_msg @@ -1961,7 +1962,8 @@ def generate_video( loaded_image_end_pil = None loaded_image_refs_pil = [] - try: + # try: + if True: if image_start and isinstance(image_start, str) and Path(image_start).is_file(): loaded_image_start_pil = convert_image(Image.open(image_start)) elif image_start: @@ -1973,16 +1975,16 @@ def generate_video( print(f"Warning: End image path not found or invalid: {image_end}") if image_refs and isinstance(image_refs, list): - valid_ref_paths = [p for p in image_refs if p and Path(p).is_file()] + valid_ref_paths = [p[0] for p in image_refs if p and Path(p[0]).is_file()] if len(valid_ref_paths) != len(image_refs): print("Warning: Some VACE reference image paths were invalid.") loaded_image_refs_pil = [convert_image(Image.open(p)) for p in valid_ref_paths] if not loaded_image_refs_pil and "I" in (video_prompt_type or ""): print("Warning: No valid VACE reference images loaded despite type 'I'.") - except Exception as e: - print(f"ERROR loading image file: {e}") - raise gr.Error(f"Failed to load input image: {e}") + # except Exception as e: + # print(f"ERROR loading image file: {e}") + # raise gr.Error(f"Failed to load input image: {e}") loras = state["loras"] if len(loras) > 0: @@ -2061,7 +2063,7 @@ def generate_video( if "Vace" in model_filename: src_video, src_mask, src_ref_images = wan_model.prepare_source([video_guide], [video_mask], - [image_refs], + [loaded_image_refs_pil], video_length, VACE_SIZE_CONFIGS[resolution_reformated], "cpu", trim_video=max_frames) else: