Python
Merge branch 'main' into queue_editor
Chris Malone665c05a76edb
diff --cc wgp.pyindex eaa69cb,5bf0558..8fe9ff6--- a/wgp.py+++ b/wgp.py@@@ -7612,7 -7454,26 +7718,26 @@@ def get_default_value(choices, current_return current_valuereturn default_value+ def download_lora(state, lora_url, progress=gr.Progress(track_tqdm=True),):+ if lora_url is None or not lora_url.startswith("http"):+ gr.Info("Please provide a URL for a Lora to Download")+ return gr.update()+ model_type = state["model_type"]+ lora_short_name = os.path.basename(lora_url)+ lora_dir = get_lora_dir(model_type)+ local_path = os.path.join(lora_dir, lora_short_name)+ try:+ download_file(lora_url, local_path)+ except Exception as e:+ gr.Info(f"Error downloading Lora {lora_short_name}: {e}")+ return gr.update()+ update_loras_url_cache(lora_dir, [lora_url])+ gr.Info(f"Lora {lora_short_name} has been succesfully downloaded")+ return ""+++-def generate_video_tab(update_form = False, state_dict = None, ui_defaults = None, model_family = None, model_choice = None, header = None, main = None, main_tabs= None):+def generate_video_tab(update_form = False, state_dict = None, ui_defaults = None, model_family = None, model_choice = None, header = None, main = None, main_tabs= None, tab_id='generate'):global inputs_names #, advancedif update_form:@@@ -7679,13 -7529,13 +7793,13 @@@with gr.Row():with gr.Column():with gr.Column(visible=False, elem_id="image-modal-container") as modal_container:- with gr.Row(elem_id="image-modal-close-button-row"): #+ with gr.Row(elem_id="image-modal-close-button-row"):close_modal_button = gr.Button("❌", size="sm", scale=1)- # modal_image_display = gr.Image(label="Full Resolution Image", interactive=False, show_label=False)- modal_image_display = gr.HTML(label="Full Resolution Image")- preview_column_no = gr.Text(visible=False, value=-1, elem_id="preview_column_no")+ modal_html_display = gr.HTML()+ modal_action_input = gr.Text(elem_id="modal_action_input", visible=False)+ modal_action_trigger = gr.Button(elem_id="modal_action_trigger", visible=False)with gr.Row(visible= True): #len(loras)>0) as presets_column:- lset_choices = compute_lset_choices(loras_presets) + [(get_new_preset_msg(advanced_ui), "")]+ lset_choices = compute_lset_choices(model_type, loras_presets) + [(get_new_preset_msg(advanced_ui), "")]with gr.Column(scale=6):lset_name = gr.Dropdown(show_label=False, allow_custom_value= True, scale=5, filterable=True, choices= lset_choices, value=launch_preset)with gr.Column(scale=1):