Python
form input fixes
DeepBeepMeepda3989c7ee8b
diff --cc README.mdindex 1f929c3,1f929c3..25d9d37--- a/README.md+++ b/README.md@@@ -26,7 -26,7 +26,7 @@@ WanGP supports the Wan (and derived mod## 🔥 Latest Updates :--### January 19th 2026: WanGP v10.42, The Cost Saver++### January 20th 2026: WanGP v10.43, The Cost Saver*GPUs are expensive, RAM is expensive, SSD are expensive, sadly we live now in a GPU & RAM poor.*WanGP comes again to the rescue:@@@ -44,12 -44,12 +44,15 @@@- **Flux 2 Klein 4B & 9B**: try these distilled models as fast as Z_Image if not faster but with out of the box image edition capabiltities++- **Flux 2 & Qwen Outpainting + Lanpaint**: the inpaint mode of these models support now *outpainting* + more combination possible with *Lanpaint*++- **RAM Optimizations for multi minutes Videos**: processing, saving, spatial & Temporal upsampling very long videos should require much less RAM.- **Text Encoder Cache**: if you are asking a Text prompt already used recently with the current model, it will be taken straight from a cache. The cache is optimized to consume little RAM. It wont work with certain models such as Qwen where the Text Prompt is combined internally with an Image.*update 10.41*: added Flux 2 klein\--*update 10.42*: added RAM optimizations & Text Encoder Cache++*update 10.42*: added RAM optimizations & Text Encoder Cache\++*update 10.43*: added outpainting for Qwen & Flux 2, Lanpaint for Flux 2### January 15th 2026: WanGP v10.30, The Need for Speed ...diff --cc wgp.pyindex dc8f7ec,fffc5ff..4fe1650--- a/wgp.py+++ b/wgp.py@@@ -85,7 -85,7 +85,7 @@@ AUTOSAVE_TEMPLATE_PATH = AUTOSAVE_FILENCONFIG_FILENAME = "wgp_config.json"PROMPT_VARS_MAX = 10target_mmgp_version = "3.7.0"--WanGP_version = "10.42"++WanGP_version = "10.43"settings_version = 2.43max_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@@@ -598,11 -598,11 +598,17 @@@ def validate_settings(state, model_typevideo_guide_outpainting = inputs["video_guide_outpainting"]spatial_upsampling = inputs["spatial_upsampling"]motion_amplitude = inputs["motion_amplitude"]++ model_mode = inputs["model_mode"]medium = "Videos" if image_mode == 0 else "Images"if image_start is not None and not isinstance(image_start, list): image_start = [image_start]outpainting_dims = get_outpainting_dims(video_guide_outpainting)++ model_modes_visibility = [0,1,2]++ model_mode_choices = model_def.get("model_modes", None)++ if model_mode_choices is not None: model_modes_visibility= model_mode_choices.get("image_modes", model_modes_visibility)++ if model_mode is not None and image_mode not in model_modes_visibility:++ model_mode = Noneif server_config.get("fit_canvas", 0) == 2 and outpainting_dims is not None and any_letters(video_prompt_type, "VKF"):gr.Info("Output Resolution Cropping will be not used for this Generation as it is not compatible with Video Outpainting")@@@ -909,6 -909,6 +915,7 @@@"skip_steps_cache_type": skip_steps_cache_type,"model_switch_phase": model_switch_phase,"motion_amplitude": motion_amplitude,++ "model_mode": model_mode,}return override_inputs, prompts, image_start, image_end@@@ -9015,11 -8979,11 +9022,11 @@@ def generate_video_tab(update_form = Fainput_video_strength_label = model_def.get("input_video_strength", "")input_video_strength = gr.Slider(0, 1, value=ui_get("input_video_strength", 1.0), step=0.01, label=input_video_strength_label, visible = len(input_video_strength_label) and any_letters(image_prompt_type_value, "SVL"), show_reset_button= False)image_end_row, image_end, image_end_extra = get_image_gallery(label= get_image_end_label(ui_get("multi_prompts_gen_type")), 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:- model_mode = gr.Dropdown(value=None, label="model mode", visible=False) #, allow_custom_value= False- model_mode = gr.Dropdown(value=None, label="model mode", visible=False, allow_custom_value= True)++ if model_mode_choices is None:++ model_mode = gr.Dropdown(value=None, label="model mode", visible=False)else:model_mode_value = get_default_value(model_mode_choices["choices"], ui_get("model_mode", None), model_mode_choices["default"] )-- model_mode = gr.Dropdown(choices=model_mode_choices["choices"], value=model_mode_value, label=model_mode_choices["label"], visible=True)++ model_mode = gr.Dropdown(choices=model_mode_choices["choices"], value=model_mode_value, label=model_mode_choices["label"], visible=image_mode_value in model_modes_visibility)keep_frames_video_source = gr.Text(value=ui_get("keep_frames_video_source") , visible= len(filter_letters(image_prompt_type_value, "VL"))>0 , scale = 2, label= "Truncate Video beyond this number of resampled Frames (empty=Keep All, negative truncates from End)" )any_control_video = any_control_image = False