mirror of
https://github.com/Wan-Video/Wan2.1.git
synced 2025-11-05 06:29:14 +00:00
restored validation wizard
This commit is contained in:
parent
74d3f42c18
commit
b44229a529
@ -139,11 +139,15 @@ def process_prompt_and_add_tasks(
|
|||||||
state_arg,
|
state_arg,
|
||||||
image2video
|
image2video
|
||||||
):
|
):
|
||||||
|
|
||||||
|
if state_arg.get("validate_success",0) != 1:
|
||||||
|
print("Validation failed, not adding tasks.")
|
||||||
|
return
|
||||||
if len(prompt) ==0:
|
if len(prompt) ==0:
|
||||||
return
|
return
|
||||||
prompt, errors = prompt_parser.process_template(prompt)
|
prompt, errors = prompt_parser.process_template(prompt)
|
||||||
if len(errors) > 0:
|
if len(errors) > 0:
|
||||||
gr.Info("Error processing prompt template: " + errors)
|
print("Error processing prompt template: " + errors)
|
||||||
return
|
return
|
||||||
prompts = prompt.replace("\r", "").split("\n")
|
prompts = prompt.replace("\r", "").split("\n")
|
||||||
prompts = [prompt.strip() for prompt in prompts if len(prompt.strip())>0 and not prompt.startswith("#")]
|
prompts = [prompt.strip() for prompt in prompts if len(prompt.strip())>0 and not prompt.startswith("#")]
|
||||||
@ -1223,8 +1227,6 @@ def generate_video(
|
|||||||
gr.Info(f"You have selected attention mode '{attention_mode}'. However it is not installed or supported on your system. You should either install it or switch to the default 'sdpa' attention.")
|
gr.Info(f"You have selected attention mode '{attention_mode}'. However it is not installed or supported on your system. You should either install it or switch to the default 'sdpa' attention.")
|
||||||
return
|
return
|
||||||
|
|
||||||
#if state.get("validate_success",0) != 1:
|
|
||||||
# return
|
|
||||||
raw_resolution = resolution
|
raw_resolution = resolution
|
||||||
width, height = resolution.split("x")
|
width, height = resolution.split("x")
|
||||||
width, height = int(width), int(height)
|
width, height = int(width), int(height)
|
||||||
@ -1546,6 +1548,7 @@ def generate_video(
|
|||||||
gen_in_progress = False
|
gen_in_progress = False
|
||||||
offload.unload_loras_from_model(trans)
|
offload.unload_loras_from_model(trans)
|
||||||
|
|
||||||
|
|
||||||
def get_new_preset_msg(advanced = True):
|
def get_new_preset_msg(advanced = True):
|
||||||
if advanced:
|
if advanced:
|
||||||
return "Enter here a Name for a Lora Preset or Choose one in the List"
|
return "Enter here a Name for a Lora Preset or Choose one in the List"
|
||||||
@ -2285,10 +2288,9 @@ def generate_video_tab(image2video=False):
|
|||||||
download_loras_btn.click(fn=download_loras, inputs=[], outputs=[download_status_row, download_status, presets_column, loras_column]).then(fn=refresh_lora_list, inputs=[state, lset_name,loras_choices], outputs=[lset_name, loras_choices])
|
download_loras_btn.click(fn=download_loras, inputs=[], outputs=[download_status_row, download_status, presets_column, loras_column]).then(fn=refresh_lora_list, inputs=[state, lset_name,loras_choices], outputs=[lset_name, loras_choices])
|
||||||
output.select(select_video, state, None )
|
output.select(select_video, state, None )
|
||||||
|
|
||||||
#generate_btn.click(
|
|
||||||
# fn=validate_wizard_prompt, inputs =[state, wizard_prompt_activated_var, wizard_variables_var, prompt, wizard_prompt, *prompt_vars] , outputs= [prompt]
|
|
||||||
#).then(
|
|
||||||
generate_btn.click(
|
generate_btn.click(
|
||||||
|
fn=validate_wizard_prompt, inputs =[state, wizard_prompt_activated_var, wizard_variables_var, prompt, wizard_prompt, *prompt_vars] , outputs= [prompt]
|
||||||
|
).then(
|
||||||
fn=process_prompt_and_add_tasks,
|
fn=process_prompt_and_add_tasks,
|
||||||
inputs=[
|
inputs=[
|
||||||
prompt,
|
prompt,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user