Python
added i2v Enhanced Lightning v2 support
DeepBeepMeep72df285c5a1f
diff --git a/README.md b/README.mdindex bf5c830..bb60662 100644--- a/README.md+++ b/README.md@@ -36,13 +36,18 @@ WanGP supports the Wan (and derived models), Hunyuan Video and LTV Video models-----## 🔥 Latest Updates :-### November 5 2025: WanGP v9.35, How many bananas are too many bananas ?+### November 6 2025: WanGP v9.35, How many bananas are too many bananas ?**Chrono Edit**: a new original way to edit an Image. This one will generate a Video will that performs the full edition work and return the last Image. It can be hit or a miss but when it works it is quite impressive. Please note you must absolutely use the *Prompt Enhancer* on your *Prompt Instruction* because this model expects a very specific format. The Prompt Enhancer for this model has a specific System Prompt to generate the right Chrono Edit Prompt.**LyCoris** support: preliminary basic Lycoris support for this Lora format. At least Qwen Multi Camera should work (https://huggingface.co/dx8152/Qwen-Edit-2509-Multiple-angles). If you have a Lycoris that does not work and it may be interesting please mention it in the Request Channel-*update 9.35*: Added a Sample PlugIn App that shows how to collect and modify settings from a PlugIn+**i2v Enhanced Lightning v2** (update 9.37): added this impressive *Finetune* in the default selection of models, not only it is accelerated (4 steps), but it is very good at following camera and timing instructions.++This finetune loves long prompts. Therefore to increase the prompt readability WanGP supports now multilines prompts (in option).++*update 9.35*: Added a Sample PlugIn App that shows how to collect and modify settings from a PlugIn\+*update 9.37*: Added i2v Enhanced Lightning### October 29 2025: WanGP v9.21, Why isn't all my VRAM used ?@@ -62,7 +67,7 @@ pip install torch==2.7.1 torchvision torchaudio --index-url https://download.pyt```You will need to reinstall SageAttention FlashAttnetion, ...-*update v9.21*: Got FastWan to work with Ovi: it is now 10 times faster ! (not including the VAE)+*update v9.21*: Got FastWan to work with Ovi: it is now 10 times faster ! (not including the VAE)\*update v9.25*: added Chroma Radiance october edition + reverted to pytorch 2.7### October 24 2025: WanGP v9.10, What else will you ever need after this one ?@@ -134,10 +139,10 @@ Not enough Space left on your SSD to download more models ? Would like to reuseLast but not least the Lora's documentation has been updated.-*update 8.991*: full power of *Vace Lynx* unleashed with new combinations such as Landscape + Face / Clothes + Face / Injectd Frame (Start/End frames/...) + Face-*update 8.992*: optimized gen with Lora, should be 10% faster if many loras-*update 8.993*: Support for *Scaled FP8* format and samples *Paligenesis* finetunes, merged Loras Accelerators and Non Accelerators-*update 8.994*: Added custom checkpoints folders+*update 8.991*: full power of *Vace Lynx* unleashed with new combinations such as Landscape + Face / Clothes + Face / Injectd Frame (Start/End frames/...) + Face\+*update 8.992*: optimized gen with Lora, should be 10% faster if many loras\+*update 8.993*: Support for *Scaled FP8* format and samples *Paligenesis* finetunes, merged Loras Accelerators and Non Accelerators\+*update 8.994*: Added custom checkpoints folders\*update 8.999*: fixed a lora + fp8 bug and version sync for the jump to the unknown### September 30 2025: WanGP v8.9 - Combinatoricsdiff --git a/defaults/i2v_2_2_Enhanced_Lightning_v2.json b/defaults/i2v_2_2_Enhanced_Lightning_v2.jsonnew file mode 100644index 0000000..a09edf6--- /dev/null+++ b/defaults/i2v_2_2_Enhanced_Lightning_v2.json@@ -0,0 +1,24 @@+{+ "model":+ {+ "name": "Wan2.2 Image2video Enhanced Lightning v2 14B",+ "architecture" : "i2v_2_2",+ "description": "This custom version of WAN 2.2 I2V has been updated to deliver better prompt comprehension and improved handling of camera angles and cinematic movements. It provides more accurate scene interpretation, smoother transitions, and enhanced control over dynamic.",+ "URLs": [+ "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/wan22EnhancedLightning_v2I2VFP8HIGH.safetensors"+ ],+ "URLs2": [+ "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/wan22EnhancedLightning_v2I2VFP8LOW.safetensors"+ ],+ "author": "https://civitai.com/models/2053259",+ "profile_dirs": [""]+ },+ "guidance_phases": 2,+ "switch_threshold" : 900,+ "guidance_scale" : 1,+ "guidance2_scale" : 1,+ "flow_shift" : 5,+ "num_inference_steps": 4,+ "multi_prompts_gen_type": 2,+ "prompt": "(at 0 seconds: wide frontal shot of a man standing in front of an open fridge, cinematic lighting, subtle ambient kitchen reflections, the fridge contents visible, camera static).\n(at 1 second: medium shot from the front as he opens the fridge fully, reaches for a can, slight zoom-in to emphasize the action, cinematic framing).\n(at 2 seconds: camera shifts to a side medium shot, tracking him as he lifts the can to his mouth, fluid movement, maintaining lighting and reflections).\n(at 3 seconds: camera starts a smooth 360-degree orbit around the man, following him as he drinks from the can, motion fluid, background slightly blurred for cinematic effect).\n(at 4 seconds: close-up on his face and upper body while drinking, orbit continues subtly, fridge reflections accentuating realism, cinematic polish).\n(at 5 seconds: final wide shot as he lowers the can, camera completes orbit to original angle, showcasing the kitchen space, lighting, and dynamic movement)."+}\ No newline at end of filediff --git a/wgp.py b/wgp.pyindex 0a62919..a75b38f 100644--- a/wgp.py+++ b/wgp.py@@ -78,7 +78,7 @@ global_queue_ref = []AUTOSAVE_FILENAME = "queue.zip"PROMPT_VARS_MAX = 10target_mmgp_version = "3.6.7"-WanGP_version = "9.35"+WanGP_version = "9.37"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@@ -795,7 +795,7 @@ def process_prompt_and_add_tasks(state, current_gallery_tab, model_choice):if image_start == None :gr.Info("Start Image should be an Image")return ret()- if multi_prompts_gen_type == 1 and len(image_start) > 1:+ if multi_prompts_gen_type in (1,2) and len(image_start) > 1:gr.Info("Only one Start Image is supported")return ret()else:@@ -847,9 +847,12 @@ def process_prompt_and_add_tasks(state, current_gallery_tab, model_choice):gr.Info("Filtering Frames with this model is not supported")return ret()- if inputs["multi_prompts_gen_type"] != 0:+ if multi_prompts_gen_type != 0:if image_start != None and len(image_start) > 1:- gr.Info("Only one Start Image must be provided if multiple prompts are used for different windows")+ if multi_prompts_gen_type == 1:+ gr.Info("Only one Start Image must be provided if multiple prompts are used for different windows")+ else:+ gr.Info("Only one Start Image must be provided if there is a single Prompt")return ret()# if image_end != None and len(image_end) > 1:@@ -879,7 +882,7 @@ def process_prompt_and_add_tasks(state, current_gallery_tab, model_choice):"model_switch_phase": model_switch_phase,}- if inputs["multi_prompts_gen_type"] == 0:+ if multi_prompts_gen_type == 0:if image_start != None and len(image_start) > 0:if inputs["multi_images_gen_type"] == 0:new_prompts = []@@ -3517,6 +3520,7 @@ def refresh_gallery(state): #, msgprompt = task["prompt"]params = task["params"]model_type = params["model_type"]+ multi_prompts_gen_type = params["multi_prompts_gen_type"]base_model_type = get_base_model_type(model_type)model_def = get_model_def(model_type)onemorewindow_visible = test_any_sliding_window(base_model_type) and params.get("image_mode",0) == 0 and not params.get("mode","").startswith("edit_")@@ -3525,7 +3529,9 @@ def refresh_gallery(state): #, msgenhanced = Trueprompt = prompt[len("!enhanced!\n"):]prompt = html.escape(prompt)- if "\n" in prompt :+ if multi_prompts_gen_type == 2:+ prompt = prompt.replace("\n", "<BR>")+ elif "\n" in prompt :prompts = prompt.split("\n")window_no= gen.get("window_no",1)if window_no > len(prompts):@@ -3755,7 +3761,7 @@ def select_video(state, current_gallery_tab, input_file_list, file_selected, audvalues +=[video_creation_date]labels +=["Creation Date"]else:- video_prompt = html.escape(configs.get("prompt", "")[:1024])+ video_prompt = html.escape(configs.get("prompt", "")[:1024]).replace("\n", "<BR>")video_video_prompt_type = configs.get("video_prompt_type", "")video_image_prompt_type = configs.get("image_prompt_type", "")video_audio_prompt_type = configs.get("audio_prompt_type", "")@@ -5011,8 +5017,11 @@ def generate_video(trans2 = get_transformer_model(wan_model, 2)audio_sampling_rate = 16000- prompts = prompt.split("\n")- prompts = [part for part in prompts if len(prompt)>0]+ if multi_prompts_gen_type == 2:+ prompts = [prompt]+ else:+ prompts = prompt.split("\n")+ prompts = [part.strip() for part in prompts if len(prompt)>0]parsed_keep_frames_video_source= max_source_video_frames if len(keep_frames_video_source) ==0 else int(keep_frames_video_source)transformer_loras_filenames, transformer_loras_multipliers = get_transformer_loras(model_type)if guidance_phases < 1: guidance_phases = 1@@ -7821,7 +7830,13 @@ def show_modal_image(state, action_string):return gr.HTML(value=html_content), gr.Column(visible=True)def get_prompt_labels(multi_prompts_gen_type, image_outputs = False, audio_only = False):- new_line_text = "each new line of prompt will be used for a window" if multi_prompts_gen_type != 0 else "each new line of prompt will generate " + ("a new image" if image_outputs else ("a new audio file" if audio_only else "a new video"))+ if multi_prompts_gen_type == 1:+ new_line_text = "each Line of Prompt will be used for a Sliding Window"+ elif multi_prompts_gen_type == 0:+ new_line_text = "each Line of Prompt will generate " + ("a new Image" if image_outputs else ("a new Audio File" if audio_only else "a new Video"))+ else:+ new_line_text = "all the Lines are Parts of the Same Prompt"+return "Prompts (" + new_line_text + ", # lines = comments, ! lines = macros)", "Prompts (" + new_line_text + ", # lines = comments)"def get_image_end_label(multi_prompts_gen_type):@@ -8172,7 +8187,7 @@ def generate_video_tab(update_form = False, state_dict = None, ui_defaults = Nonhunyuan_video_avatar = "hunyuan_video_avatar" in model_filenameimage_outputs = model_def.get("image_outputs", False)sliding_window_enabled = test_any_sliding_window(model_type)- multi_prompts_gen_type_value = ui_defaults.get("multi_prompts_gen_type_value",0)+ multi_prompts_gen_type_value = ui_defaults.get("multi_prompts_gen_type",0)prompt_label, wizard_prompt_label = get_prompt_labels(multi_prompts_gen_type_value, image_outputs, audio_only)any_video_source = Falsefps = get_model_fps(base_model_type)@@ -8204,6 +8219,12 @@ def generate_video_tab(update_form = False, state_dict = None, ui_defaults = Nonwith gr.Tab("Image Inpainting", id = "inpaint", elem_classes="compact_tab", visible=inpaint_support) as tab_inpaint:pass+ if audio_only:+ medium = "Audio"+ elif image_outputs:+ medium = "Image"+ else:+ medium = "Video"image_prompt_types_allowed = model_def.get("image_prompt_types_allowed", "")model_mode_choices = model_def.get("model_modes", None)model_modes_visibility = [0,1,2]@@ -8678,6 +8699,21 @@ def generate_video_tab(update_form = False, state_dict = None, ui_defaults = Non("Match images and text prompts", 1),], visible= test_class_i2v(model_type), label= "Multiple Images as Texts Prompts")++ with gr.Row():+ multi_prompts_gen_choices = [(f"Each New Line Will Add a new {medium} Request to the Generation Queue", 0)]+ if sliding_window_enabled:+ multi_prompts_gen_choices += [("Each Line Will be used for a new Sliding Window of the same Video Generation", 1)]+ multi_prompts_gen_choices += [("All the Lines are Part of the Same Prompt", 2)]++ multi_prompts_gen_type = gr.Dropdown(+ choices=multi_prompts_gen_choices,+ value=ui_defaults.get("multi_prompts_gen_type",0),+ visible=True,+ scale = 1,+ label= "How to Process each Line of the Text Prompt"+ )+with gr.Tab("Loras", visible= not audio_only) as loras_tab:with gr.Column(visible = True): #as loras_column:gr.Markdown("<B>Loras can be used to create special effects on the video by mentioning a trigger word in the Prompt. You can save Loras combinations in presets.</B>")@@ -8912,16 +8948,6 @@ def generate_video_tab(update_form = False, state_dict = None, ui_defaults = Nonvisible = vace or ltxv or t2v or infinitetalk)- multi_prompts_gen_type = gr.Dropdown(- choices=[- ("Will create a new generated Video added to the Generation Queue", 0),- ("Will be used for a new Sliding Window of the same Video Generation", 1),- ],- value=ui_defaults.get("multi_prompts_gen_type",0),- visible=True,- scale = 1,- label="Images & Text Prompts separated by a Carriage Return" if (any_start_image or any_end_image) else "Text Prompts separated by a Carriage Return"- )with gr.Tab("Misc.", visible = not audio_only) as misc_tab:with gr.Column(visible = not (recammaster or ltxv or diffusion_forcing)) as RIFLEx_setting_col: