Add Wan Animate advanced feature settings, reference voices, Kling character orientation, and video advanced feature inputs with use toggles
This commit is contained in:
@@ -8,36 +8,59 @@ class videoAdvancedFeatureInputs:
|
||||
return {
|
||||
"required": {},
|
||||
"optional": {
|
||||
"useVideoCFGScale": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include videoCFGScale parameter in API request.",
|
||||
"default": False,
|
||||
}),
|
||||
"videoCFGScale": ("FLOAT", {
|
||||
"tooltip": "CFG scale for video generation.",
|
||||
"tooltip": "CFG scale for video generation. Only used when 'Use Video CFG Scale' is enabled.",
|
||||
"default": None,
|
||||
"min": 0.0,
|
||||
"max": 30.0,
|
||||
"step": 0.1,
|
||||
}),
|
||||
"useAudioCFGScale": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include audioCFGScale parameter in API request.",
|
||||
"default": False,
|
||||
}),
|
||||
"audioCFGScale": ("FLOAT", {
|
||||
"tooltip": "CFG scale for audio generation.",
|
||||
"tooltip": "CFG scale for audio generation. Only used when 'Use Audio CFG Scale' is enabled.",
|
||||
"default": None,
|
||||
"min": 0.0,
|
||||
"max": 30.0,
|
||||
"step": 0.1,
|
||||
}),
|
||||
"useVideoNegativePrompt": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include videoNegativePrompt parameter in API request.",
|
||||
"default": False,
|
||||
}),
|
||||
"videoNegativePrompt": ("STRING", {
|
||||
"tooltip": "Negative prompt for video generation.",
|
||||
"tooltip": "Negative prompt for video generation. Only used when 'Use Video Negative Prompt' is enabled.",
|
||||
"multiline": True,
|
||||
"default": "",
|
||||
}),
|
||||
"useAudioNegativePrompt": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include audioNegativePrompt parameter in API request.",
|
||||
"default": False,
|
||||
}),
|
||||
"audioNegativePrompt": ("STRING", {
|
||||
"tooltip": "Negative prompt for audio generation.",
|
||||
"tooltip": "Negative prompt for audio generation. Only used when 'Use Audio Negative Prompt' is enabled.",
|
||||
"multiline": True,
|
||||
"default": "",
|
||||
}),
|
||||
"useSlgLayer": ("BOOLEAN", {
|
||||
"tooltip": "Enable to include slgLayer parameter in API request.",
|
||||
"default": False,
|
||||
}),
|
||||
"slgLayer": ("INT", {
|
||||
"tooltip": "SLG layer setting.",
|
||||
"tooltip": "SLG layer setting. Only used when 'Use SLG Layer' is enabled.",
|
||||
"default": None,
|
||||
"min": 0,
|
||||
"max": 100,
|
||||
}),
|
||||
"Advanced Feature Settings": ("RUNWAREWANANIMATEADVANCEDFEATURESETTINGS", {
|
||||
"tooltip": "Connect Runware Wan Animate Advanced Feature Settings node to provide Wan Animate configuration for character animation and replacement.",
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,27 +73,41 @@ class videoAdvancedFeatureInputs:
|
||||
def create_advanced_feature_inputs(self, **kwargs) -> tuple[Dict[str, Any]]:
|
||||
"""Create video advanced feature inputs dictionary"""
|
||||
|
||||
# Get parameters
|
||||
# Get use parameters
|
||||
useVideoCFGScale = kwargs.get("useVideoCFGScale", False)
|
||||
useAudioCFGScale = kwargs.get("useAudioCFGScale", False)
|
||||
useVideoNegativePrompt = kwargs.get("useVideoNegativePrompt", False)
|
||||
useAudioNegativePrompt = kwargs.get("useAudioNegativePrompt", False)
|
||||
useSlgLayer = kwargs.get("useSlgLayer", False)
|
||||
|
||||
# Get actual parameters
|
||||
videoCFGScale = kwargs.get("videoCFGScale", None)
|
||||
audioCFGScale = kwargs.get("audioCFGScale", None)
|
||||
videoNegativePrompt = kwargs.get("videoNegativePrompt", None)
|
||||
audioNegativePrompt = kwargs.get("audioNegativePrompt", None)
|
||||
slgLayer = kwargs.get("slgLayer", None)
|
||||
wanAnimateSettings = kwargs.get("Advanced Feature Settings", None)
|
||||
|
||||
# Build advanced feature inputs dictionary - only include non-None values
|
||||
# Build advanced feature inputs dictionary - only include when use* is enabled
|
||||
advanced_inputs = {}
|
||||
|
||||
if videoCFGScale is not None:
|
||||
if useVideoCFGScale and videoCFGScale is not None:
|
||||
advanced_inputs["videoCFGScale"] = videoCFGScale
|
||||
if audioCFGScale is not None:
|
||||
if useAudioCFGScale and audioCFGScale is not None:
|
||||
advanced_inputs["audioCFGScale"] = audioCFGScale
|
||||
if videoNegativePrompt is not None and videoNegativePrompt.strip() != "":
|
||||
if useVideoNegativePrompt and videoNegativePrompt is not None and videoNegativePrompt.strip() != "":
|
||||
advanced_inputs["videoNegativePrompt"] = videoNegativePrompt.strip()
|
||||
if audioNegativePrompt is not None and audioNegativePrompt.strip() != "":
|
||||
if useAudioNegativePrompt and audioNegativePrompt is not None and audioNegativePrompt.strip() != "":
|
||||
advanced_inputs["audioNegativePrompt"] = audioNegativePrompt.strip()
|
||||
if slgLayer is not None:
|
||||
if useSlgLayer and slgLayer is not None:
|
||||
advanced_inputs["slgLayer"] = slgLayer
|
||||
|
||||
# Merge advanced feature settings if provided (similar to how providerSettings are merged)
|
||||
if wanAnimateSettings is not None and isinstance(wanAnimateSettings, dict) and len(wanAnimateSettings) > 0:
|
||||
# Merge the settings dictionary directly into advanced_inputs
|
||||
# The settings dict should already contain the correct structure (e.g., {"wanAnimate": {...}})
|
||||
advanced_inputs.update(wanAnimateSettings)
|
||||
|
||||
return (advanced_inputs,)
|
||||
|
||||
# Node class mappings
|
||||
|
||||
Reference in New Issue
Block a user