Added inputs-referenceAudios support
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
from typing import List
|
||||
|
||||
|
||||
class referenceAudios:
|
||||
"""Reference Audios node for configuring reference audio inputs"""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {},
|
||||
"optional": {
|
||||
"Audio1": ("STRING", {
|
||||
"tooltip": "MediaUUID for the first reference audio from Runware Media Upload node.",
|
||||
}),
|
||||
"Audio2": ("STRING", {
|
||||
"tooltip": "MediaUUID for the second reference audio from Runware Media Upload node.",
|
||||
}),
|
||||
"Audio3": ("STRING", {
|
||||
"tooltip": "MediaUUID for the third reference audio from Runware Media Upload node.",
|
||||
}),
|
||||
"Audio4": ("STRING", {
|
||||
"tooltip": "MediaUUID for the fourth reference audio from Runware Media Upload node.",
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
DESCRIPTION = "Configure multiple reference audios (mediaUUIDs) for video inference inputs."
|
||||
FUNCTION = "createReferenceAudios"
|
||||
RETURN_TYPES = ("RUNWAREINPUTAUDIOS",)
|
||||
RETURN_NAMES = ("Reference Audios",)
|
||||
CATEGORY = "Runware"
|
||||
|
||||
def createReferenceAudios(self, **kwargs) -> tuple[List[str]]:
|
||||
"""Create list of reference audio UUIDs from provided parameters"""
|
||||
audioList = []
|
||||
|
||||
for i in range(1, 5):
|
||||
audioKey = f"Audio{i}"
|
||||
audioUuid = kwargs.get(audioKey)
|
||||
|
||||
if audioUuid and audioUuid.strip() != "":
|
||||
audioList.append(audioUuid.strip())
|
||||
|
||||
return (audioList,)
|
||||
@@ -41,12 +41,15 @@ class videoInferenceInputs:
|
||||
"Background": ("IMAGE", {
|
||||
"tooltip": "Background image for video generation. Connect a Load Image node to provide the background.",
|
||||
}),
|
||||
"References": ("RUNWAREVIDEOINPUTSREFERENCEIMAGES", {
|
||||
"References Images": ("RUNWAREVIDEOINPUTSREFERENCEIMAGES", {
|
||||
"tooltip": "Connect the Video Inputs References node to provide reference images."
|
||||
}),
|
||||
"Reference Videos": ("RUNWAREREFERENCEVIDEOS", {
|
||||
"tooltip": "Connect the Reference Videos node to provide reference video mediaUUIDs."
|
||||
}),
|
||||
"Reference Audios": ("RUNWAREINPUTAUDIOS", {
|
||||
"tooltip": "Connect the Runware Video Inference Inputs Reference Audios node to provide reference audio mediaUUIDs."
|
||||
}),
|
||||
"Reference Voices": ("RUNWAREREFERENCEVOICES", {
|
||||
"tooltip": "Connect the Reference Voices node to provide reference voice URLs or mediaUUIDs."
|
||||
}),
|
||||
@@ -86,8 +89,9 @@ class videoInferenceInputs:
|
||||
frame = kwargs.get("Frame", None)
|
||||
background = kwargs.get("Background", None)
|
||||
frameImages = kwargs.get("Frame Images", None)
|
||||
references = kwargs.get("References", None)
|
||||
references = kwargs.get("References Images", None)
|
||||
referenceVideos = kwargs.get("Reference Videos", None)
|
||||
referenceAudios = kwargs.get("Reference Audios", None)
|
||||
referenceVoices = kwargs.get("Reference Voices", None)
|
||||
draftId = kwargs.get("draftId", "")
|
||||
videoId = kwargs.get("videoId", "")
|
||||
@@ -143,6 +147,9 @@ class videoInferenceInputs:
|
||||
if referenceVideos is not None and len(referenceVideos) > 0:
|
||||
inputs["referenceVideos"] = referenceVideos
|
||||
|
||||
if referenceAudios is not None and len(referenceAudios) > 0:
|
||||
inputs["referenceAudios"] = referenceAudios
|
||||
|
||||
if referenceVoices is not None and len(referenceVoices) > 0:
|
||||
inputs["referenceVoices"] = referenceVoices
|
||||
|
||||
|
||||
@@ -63,5 +63,5 @@ NODE_CLASS_MAPPINGS = {
|
||||
}
|
||||
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"RunwareVideoInputsReferences": "Runware Video Inputs Reference Images",
|
||||
"RunwareVideoInputsReferences": "Runware Video Inference Inputs Reference Images",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user