Merge pull request #63 from Runware/feature-WanAdditionalParam

Add Wan 2.6 model and Alibaba provider settings parameters
This commit is contained in:
Sirshendu Ganguly
2025-12-17 15:51:16 -05:00
committed by GitHub
4 changed files with 131 additions and 2 deletions
+79 -1
View File
@@ -1709,6 +1709,7 @@ function videoModelSearchFilterHandler(videoModelSearchNode) {
"Wan": [
"runware:200@1 (Wan 2.1 1.3B)", "runware:200@2 (Wan 2.1 14B)",
"runware:200@6 (Wan 2.2)",
"alibaba:wan@2.6 (Wan 2.6)",
],
"OpenAI": [
"openai:3@1 (OpenAI Sora 3.1)", "openai:3@0 (OpenAI Sora 3.0)",
@@ -1778,6 +1779,7 @@ function videoModelSearchFilterHandler(videoModelSearchNode) {
"runware:200@1": {"width": 853, "height": 480},
"runware:200@2": {"width": 853, "height": 480},
"runware:200@6": {"width": 1280, "height": 720},
"alibaba:wan@2.6": {"width": 1280, "height": 720},
"openai:3@1": {"width": 1280, "height": 720},
"openai:3@0": {"width": 1280, "height": 720},
"lightricks:2@0": {"width": 1920, "height": 1080},
@@ -1836,6 +1838,7 @@ function videoModelSearchFilterHandler(videoModelSearchNode) {
"runware:200@1": "480p",
"runware:200@2": "480p",
"runware:200@6": "720p",
"alibaba:wan@2.6": "720p",
"openai:3@1": "720p",
"openai:3@0": "720p",
"lightricks:2@0": "1080p",
@@ -2185,6 +2188,12 @@ function alibabaProviderSettingsToggleHandler(alibabaNode) {
// Find all "use" parameter widgets for Alibaba Provider Settings
const usePromptEnhancerWidget = alibabaNode.widgets.find(w => w.name === "usePromptEnhancer");
const promptEnhancerWidget = alibabaNode.widgets.find(w => w.name === "promptEnhancer");
const usePromptExtendWidget = alibabaNode.widgets.find(w => w.name === "usePromptExtend");
const promptExtendWidget = alibabaNode.widgets.find(w => w.name === "promptExtend");
const useAudioWidget = alibabaNode.widgets.find(w => w.name === "useAudio");
const audioWidget = alibabaNode.widgets.find(w => w.name === "audio");
const useShotTypeWidget = alibabaNode.widgets.find(w => w.name === "useShotType");
const shotTypeWidget = alibabaNode.widgets.find(w => w.name === "shotType");
// Helper function to toggle widget enabled state
function toggleWidgetState(useWidget, paramWidget, paramName) {
@@ -2228,10 +2237,79 @@ function alibabaProviderSettingsToggleHandler(alibabaNode) {
setTimeout(toggleEnabled, 100);
}
// Set up toggle handler
// Special handler for shotType - depends on both usePromptExtend AND promptExtend being true
function toggleShotTypeEnabled() {
if (!useShotTypeWidget || !shotTypeWidget || !usePromptExtendWidget || !promptExtendWidget) return;
const usePromptExtendEnabled = usePromptExtendWidget.value === true;
const promptExtendValue = promptExtendWidget.value === true;
const useShotTypeEnabled = useShotTypeWidget.value === true;
// shotType is enabled only if: useShotType is enabled AND usePromptExtend is enabled AND promptExtend is true
const enabled = useShotTypeEnabled && usePromptExtendEnabled && promptExtendValue;
if (shotTypeWidget.inputEl) {
shotTypeWidget.inputEl.disabled = !enabled;
shotTypeWidget.inputEl.style.opacity = enabled ? "1" : "0.5";
shotTypeWidget.inputEl.style.cursor = enabled ? "text" : "not-allowed";
shotTypeWidget.inputEl.readOnly = !enabled;
}
shotTypeWidget.disabled = !enabled;
if (!shotTypeWidget.inputEl) {
const nodeElement = alibabaNode.htmlElements?.widgetsContainer || alibabaNode.htmlElements;
if (nodeElement) {
const input = nodeElement.querySelector(`input[name="shotType"], select[name="shotType"]`);
if (input) {
input.disabled = !enabled;
input.style.opacity = enabled ? "1" : "0.5";
input.style.cursor = enabled ? "text" : "not-allowed";
input.readOnly = !enabled;
if (input.tagName === "SELECT") {
input.style.pointerEvents = enabled ? "auto" : "none";
}
}
}
}
alibabaNode.setDirtyCanvas(true);
}
// Set up toggle handlers
if (usePromptEnhancerWidget && promptEnhancerWidget) {
toggleWidgetState(usePromptEnhancerWidget, promptEnhancerWidget, "promptEnhancer");
}
if (usePromptExtendWidget && promptExtendWidget) {
toggleWidgetState(usePromptExtendWidget, promptExtendWidget, "promptExtend");
// Also listen to promptExtend value changes to update shotType
appendWidgetCB(promptExtendWidget, () => {
setTimeout(toggleShotTypeEnabled, 50);
});
}
if (useAudioWidget && audioWidget) {
toggleWidgetState(useAudioWidget, audioWidget, "audio");
}
if (useShotTypeWidget && shotTypeWidget) {
// Listen to useShotType changes
appendWidgetCB(useShotTypeWidget, () => {
setTimeout(toggleShotTypeEnabled, 50);
});
// Also listen to usePromptExtend changes
if (usePromptExtendWidget) {
appendWidgetCB(usePromptExtendWidget, () => {
setTimeout(toggleShotTypeEnabled, 50);
});
}
// Initial state
setTimeout(toggleShotTypeEnabled, 100);
}
}
function lumaProviderSettingsToggleHandler(lumaNode) {
@@ -24,6 +24,34 @@ class RunwareAlibabaProviderSettings:
"label_on": "Enabled",
"label_off": "Disabled",
}),
"usePromptExtend": ("BOOLEAN", {
"tooltip": "Enable to include promptExtend parameter in provider settings",
"default": False,
}),
"promptExtend": ("BOOLEAN", {
"tooltip": "Enable LLM prompt rewriting. If enabled, a large language model (LLM) rewrites the input prompt. This can significantly improve the generation quality for shorter prompts but increases the time required. Only used when 'Use Prompt Extend' is enabled.",
"default": True,
"label_on": "Enabled",
"label_off": "Disabled",
}),
"useAudio": ("BOOLEAN", {
"tooltip": "Enable to include audio parameter in provider settings",
"default": False,
}),
"audio": ("BOOLEAN", {
"tooltip": "Automatically add audio (ignored if audio_url is set). Only used when 'Use Audio' is enabled.",
"default": True,
"label_on": "Enabled",
"label_off": "Disabled",
}),
"useShotType": ("BOOLEAN", {
"tooltip": "Enable to include shotType parameter in provider settings. Only applicable if promptExtend is enabled.",
"default": False,
}),
"shotType": (["single", "multi"], {
"tooltip": "Shot type for generation. Only applicable if promptExtend is true. Only used when 'Use Shot Type' is enabled.",
"default": "single",
}),
}
}
@@ -31,16 +59,22 @@ class RunwareAlibabaProviderSettings:
RETURN_NAMES = ("Provider Settings",)
FUNCTION = "createProviderSettings"
CATEGORY = "Runware/Provider Settings"
DESCRIPTION = "Configure Alibaba-specific provider settings for image/video generation including prompt enhancement."
DESCRIPTION = "Configure Alibaba-specific provider settings for image/video generation including prompt enhancement, prompt extension, audio, and shot type."
def createProviderSettings(self, **kwargs) -> tuple[Dict[str, Any]]:
"""Create Alibaba provider settings"""
# Get control parameters
usePromptEnhancer = kwargs.get("usePromptEnhancer", False)
usePromptExtend = kwargs.get("usePromptExtend", False)
useAudio = kwargs.get("useAudio", False)
useShotType = kwargs.get("useShotType", False)
# Get value parameters
promptEnhancer = kwargs.get("promptEnhancer", False)
promptExtend = kwargs.get("promptExtend", True)
audio = kwargs.get("audio", True)
shotType = kwargs.get("shotType", "single")
# Build settings dictionary - only include what is enabled
alibabaSettings: Dict[str, Any] = {}
@@ -49,6 +83,19 @@ class RunwareAlibabaProviderSettings:
if usePromptEnhancer:
alibabaSettings["promptEnhancer"] = promptEnhancer
# Add promptExtend only if usePromptExtend is enabled
if usePromptExtend:
alibabaSettings["promptExtend"] = promptExtend
# Add audio only if useAudio is enabled
if useAudio:
alibabaSettings["audio"] = audio
# Add shotType only if useShotType is enabled and promptExtend is enabled
if useShotType and usePromptExtend and promptExtend:
if shotType is not None and shotType != "None":
alibabaSettings["shotType"] = shotType
# Clean up None values
alibabaSettings = {k: v for k, v in alibabaSettings.items() if v is not None}
+3
View File
@@ -57,6 +57,7 @@ class videoModelSearch:
"runware:200@1 (Wan 2.1 1.3B)",
"runware:200@2 (Wan 2.1 14B)",
"runware:200@6 (Wan 2.2)",
"alibaba:wan@2.6 (Wan 2.6)",
],
"OpenAI": [
"openai:3@1 (OpenAI Sora 3.1)",
@@ -142,6 +143,7 @@ class videoModelSearch:
"runware:200@1": {"width": 853, "height": 480},
"runware:200@2": {"width": 853, "height": 480},
"runware:200@6": {"width": 1280, "height": 720},
"alibaba:wan@2.6": {"width": 1280, "height": 720},
# OpenAI Models
"openai:3@1": {"width": 1280, "height": 720},
@@ -226,6 +228,7 @@ class videoModelSearch:
"runware:200@1": "480p",
"runware:200@2": "480p",
"runware:200@6": "720p",
"alibaba:wan@2.6": "720p",
# OpenAI Models
"openai:3@1": "720p",
File diff suppressed because one or more lines are too long