refactored node mappings

This commit is contained in:
SayanoAI
2024-08-23 18:26:13 -04:00
parent a2e2cec4c4
commit 460f64dfed
3 changed files with 37 additions and 18 deletions
+6 -16
View File
@@ -1,7 +1,7 @@
from .custom_nodes.audio_nodes import NODE_CLASS_MAPPINGS as audio_nodes, NODE_DISPLAY_NAME_MAPPINGS as audio_nodes_name
from .custom_nodes.stt import AudioTranscriptionNode, BatchedTranscriptionEncoderNode, LoadWhisperModelNode
from .custom_nodes.stt import NODE_CLASS_MAPPINGS as stt_nodes, NODE_DISPLAY_NAME_MAPPINGS as stt_nodes_name
from .custom_nodes.uvr import UVR5Node
from .custom_nodes.rvc import LoadHubertModel, LoadPitchExtractionParams, LoadRVCModelNode, RVCNode
from .custom_nodes.rvc import NODE_CLASS_MAPPINGS as rvc_nodes, NODE_DISPLAY_NAME_MAPPINGS as rvc_nodes_name
from .custom_nodes.utility_nodes import NODE_CLASS_MAPPINGS as utility_nodes, NODE_DISPLAY_NAME_MAPPINGS as utility_nodes_name
from .custom_nodes.musetalk_nodes import NODE_CLASS_MAPPINGS as musetalk_nodes, NODE_DISPLAY_NAME_MAPPINGS as musetalk_nodes_name
# Set the web directory, any .js file in that directory will be loaded by the frontend as a frontend extension
@@ -11,13 +11,8 @@ WEB_DIRECTORY = "./web"
# NOTE: names should be globally unique
NODE_CLASS_MAPPINGS = {
"UVR5Node": UVR5Node,
"AudioTranscriptionNode": AudioTranscriptionNode,
"LoadWhisperModelNode": LoadWhisperModelNode,
"LoadRVCModelNode": LoadRVCModelNode,
"RVCNode": RVCNode,
"LoadHubertModel": LoadHubertModel,
"LoadPitchExtractionParams": LoadPitchExtractionParams,
"BatchedTranscriptionEncoderNode": BatchedTranscriptionEncoderNode,
**rvc_nodes,
**stt_nodes,
**audio_nodes,
**musetalk_nodes,
**utility_nodes
@@ -26,13 +21,8 @@ NODE_CLASS_MAPPINGS = {
# A dictionary that contains the friendly/humanly readable titles for the nodes
NODE_DISPLAY_NAME_MAPPINGS = {
"UVR5Node": "🌺Vocal Removal",
"AudioTranscriptionNode": "🌺Transcribe Audio",
"LoadWhisperModelNode": "🌺Load Whisper Model",
"LoadRVCModelNode": "🌺Load RVC Model",
"RVCNode": "🌺Voice Changer",
"LoadHubertModel": "🌺Load Hubert Model",
"LoadPitchExtractionParams": "🌺Load Pitch Extraction Params",
"BatchedTranscriptionEncoderNode": "🌺Batched CLIP Transcription Encode (Prompt)",
**rvc_nodes_name,
**stt_nodes_name,
**audio_nodes_name,
**musetalk_nodes_name,
**utility_nodes_name
+15 -1
View File
@@ -208,6 +208,20 @@ class RVCNode:
preview_file = os.path.join(tempdir,audio_name)
if not os.path.isfile(preview_file): shutil.copyfile(cache_name,preview_file)
return {"ui": {"preview": [{"filename": audio_name, "type": "temp", "subfolder": "preview", "widgetId": widgetId}]}, "result": (lambda:audio_to_bytes(*output_audio),)}
# A dictionary that contains all nodes you want to export with their names
# NOTE: names should be globally unique
NODE_CLASS_MAPPINGS = {
"LoadRVCModelNode": LoadRVCModelNode,
"RVCNode": RVCNode,
"LoadHubertModel": LoadHubertModel,
"LoadPitchExtractionParams": LoadPitchExtractionParams,
}
# A dictionary that contains the friendly/humanly readable titles for the nodes
NODE_DISPLAY_NAME_MAPPINGS = {
"LoadRVCModelNode": "🌺Load RVC Model",
"RVCNode": "🌺Voice Changer",
"LoadHubertModel": "🌺Load Hubert Model",
"LoadPitchExtractionParams": "🌺Load Pitch Extraction Params",
}
+16 -1
View File
@@ -365,4 +365,19 @@ class BatchedTranscriptionEncoderNode:
print(f"{duration_list=}")
print(f"{num_chunks=}, {max_chunks=}, {num_frames=}")
return (conditioning, batch_prompt_text, list(map(int,duration_list)), num_chunks, num_frames, text_list)
return (conditioning, batch_prompt_text, list(map(int,duration_list)), num_chunks, num_frames, text_list)
# A dictionary that contains all nodes you want to export with their names
# NOTE: names should be globally unique
NODE_CLASS_MAPPINGS = {
"AudioTranscriptionNode": AudioTranscriptionNode,
"LoadWhisperModelNode": LoadWhisperModelNode,
"BatchedTranscriptionEncoderNode": BatchedTranscriptionEncoderNode
}
# A dictionary that contains the friendly/humanly readable titles for the nodes
NODE_DISPLAY_NAME_MAPPINGS = {
"AudioTranscriptionNode": "🌺Transcribe Audio",
"LoadWhisperModelNode": "🌺Load Whisper Model",
"BatchedTranscriptionEncoderNode": "🌺Batched CLIP Transcription Encode (Prompt)",
}