From b651b5776975c1470f05f0dff4af19d8a52af930 Mon Sep 17 00:00:00 2001 From: smthemex <138738845+smthemex@users.noreply.github.com> Date: Fri, 29 May 2026 19:19:19 +0800 Subject: [PATCH] Update LongCat_Video_node.py --- LongCat_Video_node.py | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/LongCat_Video_node.py b/LongCat_Video_node.py index 1a67119..c78d7d7 100644 --- a/LongCat_Video_node.py +++ b/LongCat_Video_node.py @@ -166,6 +166,7 @@ class LongCat_Video_SM_Audio(io.ComfyNode): assert isinstance(parsed_p_box, list) and len(parsed_p_box) >= 2 , "p_box must be a list of int ,and must lens >2" else: parsed_p_box = None + au_cond=get_audio_emb(audio_encoder,audio,left_audio,audio_type,save_fps,num_segments,device,p_box=parsed_p_box) clear_comfyui_cache() return io.NodeOutput(au_cond) @@ -190,7 +191,32 @@ class LongCat_Video_SM_Vocal(io.ComfyNode): def execute(cls, audio_encoder,audio,) -> io.NodeOutput: audio_path,audio=get_audio_vocal(audio_encoder,audio2path(audio),folder_paths.get_output_directory()) return io.NodeOutput(audio,audio_path) - + +class LongCat_Video_SM_WhisperModel(io.ComfyNode): + @classmethod + def define_schema(cls): + return io.Schema( + node_id="LongCat_Video_SM_WhisperModel", + display_name="LongCat_Video_SM_WhisperModel", + category="LongCat_Video", + inputs=[ + io.Combo.Input( + "audio_encoder",options=folder_paths.get_filename_list("audio_encoders") , + ), + ], + outputs=[ + io.AudioEncoder.Output(), + ], + ) + @classmethod + def execute(cls, audio_encoder) -> io.NodeOutput: + a_checkpoint_path = folder_paths.get_full_path_or_raise("audio_encoders", audio_encoder) + from .LongCat_Video.longcat_video.audio_process import get_audio_encoder, get_audio_feature_extractor + audio_encoder = get_audio_encoder(a_checkpoint_path, 'avatar-v1.5',os.path.join(node_longcat_path, "LongCat_Video/whisper-large-v3")) + audio_feature_extractor = get_audio_feature_extractor(os.path.join(node_longcat_path, "LongCat_Video/whisper-large-v3"), 'avatar-v1.5') + audio_encoder={"audio_encoder":audio_encoder,"audio_feature_extractor":audio_feature_extractor} + return io.NodeOutput(audio_encoder) + class LongCat_Video_SM_VocalModel(io.ComfyNode): @classmethod def define_schema(cls): @@ -211,4 +237,5 @@ class LongCat_Video_SM_VocalModel(io.ComfyNode): def execute(cls, audio_encoder_vocal) -> io.NodeOutput: vocal_separator_path=folder_paths.get_full_path_or_raise("longcat", audio_encoder_vocal) if audio_encoder_vocal!="none" else None audio_encoder=load_audio_vocal(vocal_separator_path,folder_paths.get_output_directory(),weigths_longcat_current_path) - return io.NodeOutput(audio_encoder) \ No newline at end of file + return io.NodeOutput(audio_encoder) +