hid audio if image mode

This commit is contained in:
deepbeepmeep 2025-07-27 00:52:45 +02:00
parent bc9e54a3ee
commit a1970bb4b6

9
wgp.py
View File

@ -291,6 +291,9 @@ def process_prompt_and_add_tasks(state, model_choice):
gr.Info("Mag Cache maximum number of steps is 50") gr.Info("Mag Cache maximum number of steps is 50")
return return
if image_mode == 1:
audio_prompt_type = ""
if "B" in audio_prompt_type or "X" in audio_prompt_type: if "B" in audio_prompt_type or "X" in audio_prompt_type:
from wan.multitalk.multitalk import parse_speakers_locations from wan.multitalk.multitalk import parse_speakers_locations
speakers_bboxes, error = parse_speakers_locations(speakers_locations) speakers_bboxes, error = parse_speakers_locations(speakers_locations)
@ -7044,15 +7047,15 @@ def generate_video_tab(update_form = False, state_dict = None, ui_defaults = Non
("Two speakers, Speakers Audio sources are assumed to be played in Parallel", "PAB"), ("Two speakers, Speakers Audio sources are assumed to be played in Parallel", "PAB"),
], ],
value= filter_letters(audio_prompt_type_value, "XCPAB"), value= filter_letters(audio_prompt_type_value, "XCPAB"),
label="Voices", scale = 3, visible = multitalk label="Voices", scale = 3, visible = multitalk and not image_outputs
) )
else: else:
audio_prompt_type_sources = gr.Dropdown( choices= [""], value = "", visible=False) audio_prompt_type_sources = gr.Dropdown( choices= [""], value = "", visible=False)
with gr.Row(visible = any_audio_voices_support) as audio_guide_row: with gr.Row(visible = any_audio_voices_support and not image_outputs) as audio_guide_row:
audio_guide = gr.Audio(value= ui_defaults.get("audio_guide", None), type="filepath", label="Voice to follow", show_download_button= True, visible= any_audio_voices_support and "A" in audio_prompt_type_value ) audio_guide = gr.Audio(value= ui_defaults.get("audio_guide", None), type="filepath", label="Voice to follow", show_download_button= True, visible= any_audio_voices_support and "A" in audio_prompt_type_value )
audio_guide2 = gr.Audio(value= ui_defaults.get("audio_guide2", None), type="filepath", label="Voice to follow #2", show_download_button= True, visible= any_audio_voices_support and "B" in audio_prompt_type_value ) audio_guide2 = gr.Audio(value= ui_defaults.get("audio_guide2", None), type="filepath", label="Voice to follow #2", show_download_button= True, visible= any_audio_voices_support and "B" in audio_prompt_type_value )
with gr.Row(visible = any_audio_voices_support and ("B" in audio_prompt_type_value or "X" in audio_prompt_type_value) ) as speakers_locations_row: with gr.Row(visible = any_audio_voices_support and ("B" in audio_prompt_type_value or "X" in audio_prompt_type_value) and not image_outputs ) as speakers_locations_row:
speakers_locations = gr.Text( ui_defaults.get("speakers_locations", "0:45 55:100"), label="Speakers Locations separated by a Space. Each Location = Left:Right or a BBox Left:Top:Right:Bottom", visible= True) speakers_locations = gr.Text( ui_defaults.get("speakers_locations", "0:45 55:100"), label="Speakers Locations separated by a Space. Each Location = Left:Right or a BBox Left:Top:Right:Bottom", visible= True)
advanced_prompt = advanced_ui advanced_prompt = advanced_ui