Python
black start frame support
DeepBeepMeep5da16b9d76c3
diff --git a/README.md b/README.mdindex 5dc6d6b..2576be8 100644--- a/README.md+++ b/README.md@@ -36,7 +36,7 @@ WanGP supports the Wan (and derived models), Hunyuan Video and LTV Video models-----## 🔥 Latest Updates :-### November 21 2025: WanGP v9.51, And there was motion+### November 21 2025: WanGP v9.52, And there was motionIn this release WanGP turns you into a Motion Master:- **Motion Designer**: this new preinstalled home made Graphical Plugin will let you design trajectories for *Vace* and for *Wan 2.2 i2v Time to Move*.@@ -51,7 +51,10 @@ In this release WanGP turns you into a Motion Master:- **Nexus 1.3B**: this is an incredible *Wan 2.1 1.3B* finetune made by @Nexus. It is specialized in *Human Motion* (dance, fights, gym, ...). It is fast as it is already *Causvid* accelerated. Try it with the *Prompt Enhancer* at 720p.+- **Black Start Frames** for Wan 2.1/2.2 i2v: some i2v models can be turned into powerful t2v models by providing a **black frame** as a *Start Frame*. From now on if you dont provide any start frame, WanGP will generate automatically a black start frame of the current output resolution or of the correspondig *End frame resolution* (if any).+*update 9.51*: Fixed Chrono Edit Output, added Temporal Reasoning Video\+*update 9.52*: Black start frames support for Wan i2v models### November 12 2025: WanGP v9.44, Free Lunchdiff --git a/models/wan/wan_handler.py b/models/wan/wan_handler.pyindex baa7912..20aef4a 100644--- a/models/wan/wan_handler.py+++ b/models/wan/wan_handler.py@@ -207,7 +207,7 @@ class family_handler():if i2v:extra_model_def["motion_amplitude"] = True- if base_model_type in ["i2v_2_2"] :+ if base_model_type in ["i2v_2_2"]:extra_model_def["i2v_v2v"] = Trueextra_model_def["extract_guide_from_window_start"] = Trueextra_model_def["guide_custom_choices"] = {@@ -224,6 +224,9 @@ class family_handler():"selection":[ "", "A"],"visible": False}+ if base_model_type in ["i2v_2_2", "i2v", "flf2v_720p"]:+ extra_model_def["black_frame"] = True+if t2v:if not alpha:diff --git a/wgp.py b/wgp.pyindex 9d1f481..e01f1a2 100644--- a/wgp.py+++ b/wgp.py@@ -782,7 +782,16 @@ def process_prompt_and_add_tasks(state, current_gallery_tab, model_choice):image_mask = None++if "S" in image_prompt_type:+ if model_def.get("black_frame", False):+ if "E" in image_prompt_type and len(image_end or []):+ image_end = clean_image_list(image_end)+ image_start = [Image.new("RGB", image.size, (0, 0, 0, 255)) for image in image_end]+ else:+ image_start = [Image.new("RGB", (width, height), (0, 0, 0, 255))]+if image_start == None or isinstance(image_start, list) and len(image_start) == 0:gr.Info("You must provide a Start Image")return ret()@@ -8363,7 +8372,7 @@ def generate_video_tab(update_form = False, state_dict = None, ui_defaults = Nonany_end_image = Trueelse:image_prompt_type_endcheckbox = gr.Checkbox( value =False, show_label= False, visible= False , scale= 1)- image_start_row, image_start, image_start_extra = get_image_gallery(label= "Images as starting points for new Videos in the Generation Queue", value = ui_defaults.get("image_start", None), visible= "S" in image_prompt_type_value )+ image_start_row, image_start, image_start_extra = get_image_gallery(label= "Images as starting points for new Videos in the Generation Queue" + (" (None for Black Frames)" if model_def.get("black_frame", False) else ''), value = ui_defaults.get("image_start", None), visible= "S" in image_prompt_type_value )video_source = gr.Video(label= "Video to Continue", height = gallery_height, visible= "V" in image_prompt_type_value, value= ui_defaults.get("video_source", None), elem_id="video_input")image_end_row, image_end, image_end_extra = get_image_gallery(label= get_image_end_label(ui_defaults.get("multi_prompts_gen_type", 0)), value = ui_defaults.get("image_end", None), visible= any_letters(image_prompt_type_value, "SVL") and ("E" in image_prompt_type_value) )if model_mode_choices is None or image_mode_value not in model_modes_visibility: