Files
Runware-ComfyUI-Runware/modules/providerSettings/runwayProviderSettings.py
T
Sirshendu Ganguly 056ade0661 Refactor: Use librosa instead of torchaudio, Add dedicated handlers for all use parameters and fix widget ordering
- Use librosa instead of torchaudio for mediaStorage
- Created dedicated toggle handlers for Image Inference, Video Inference, Upscaler, Audio Inference, Accelerator Options, Bytedance Provider Settings, and OpenAI Provider Settings
- Fixed Audio Inference widget ordering (use parameters now appear before their corresponding parameters)
- All handlers use the same proven pattern from videoInferenceDimensionsHandler
- Improved widget disabling/enabling functionality across all nodes
2025-11-05 22:31:15 -05:00

58 lines
1.8 KiB
Python

"""
Runware Runway Provider Settings Node
Provides Runway-specific settings for video generation
"""
from typing import Optional, Dict, Any
class RunwareRunwayProviderSettings:
"""Runware Runway Provider Settings Node"""
@classmethod
def INPUT_TYPES(cls):
return {
"required": {},
"optional": {
"publicFigureThreshold": ("STRING", {
"tooltip": "Public figure threshold for content moderation (provider key: contentModeration.publicFigureThreshold).",
"default": None,
}),
}
}
RETURN_TYPES = ("RUNWAREPROVIDERSETTINGS",)
RETURN_NAMES = ("Provider Settings",)
FUNCTION = "createProviderSettings"
CATEGORY = "Runware"
DESCRIPTION = "Configure Runway-specific provider settings for video generation including content moderation options."
def createProviderSettings(self, **kwargs) -> tuple[Dict[str, Any]]:
"""Create Runway provider settings"""
publicFigureThreshold = kwargs.get("publicFigureThreshold", None)
runwaySettings: Dict[str, Any] = {}
# Build contentModeration if publicFigureThreshold is provided
if publicFigureThreshold is not None and publicFigureThreshold.strip():
contentModeration: Dict[str, Any] = {}
contentModeration["publicFigureThreshold"] = publicFigureThreshold.strip()
runwaySettings["contentModeration"] = contentModeration
# Remove unset values
runwaySettings = {k: v for k, v in runwaySettings.items() if v is not None}
return (runwaySettings,)
# Node class mappings
NODE_CLASS_MAPPINGS = {
"RunwareRunwayProviderSettings": RunwareRunwayProviderSettings,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"RunwareRunwayProviderSettings": "Runware Runway Provider Settings",
}