Merge pull request #168 from Runware/feature-lora-video
Added support for Lora in Video Inference
This commit is contained in:
@@ -33,6 +33,7 @@ from .modules.imageRegionalPromptingAdvancedFeature import RunwareRegionalPrompt
|
||||
from .modules.imageRegionalPromptingAdvancedFeatureRegions import RunwareRegionalPromptingAdvancedFeatureRegions
|
||||
from .modules.videoInference import txt2vid
|
||||
from .modules.videoInferenceSpeechInput import RunwareVideoInferenceSpeechInput
|
||||
from .modules.videoInferenceLora import RunwareVideoInferenceLora
|
||||
from .modules.videoModelSearch import videoModelSearch
|
||||
from .modules.videoSettings import RunwareVideoSettings
|
||||
from .modules.videoInferenceSettingsTts import RunwareVideoInferenceSettingsTts
|
||||
@@ -225,6 +226,7 @@ NODE_CLASS_MAPPINGS = {
|
||||
"Runware Video Inference Elements": RunwareVideoInferenceElements,
|
||||
"Runware Video Inference Elements Combine": RunwareVideoInferenceElementsCombine,
|
||||
"Runware Video Inference Speech Input": RunwareVideoInferenceSpeechInput,
|
||||
"Runware Video Inference Lora": RunwareVideoInferenceLora,
|
||||
"Runware Video Inference Settings": RunwareVideoSettings,
|
||||
"Runware Video Inference Settings TTS": RunwareVideoInferenceSettingsTts,
|
||||
"Runware Video Inference Settings Active Speaker Detection": RunwareVideoInferenceSettingsActiveSpeakerDetection,
|
||||
|
||||
@@ -124,6 +124,7 @@ const RUNWARE_NODE_TYPES = {
|
||||
VIDEOINFERENCEELEMENTS: "Runware Video Inference Elements",
|
||||
VIDEOINFERENCEELEMENTSCOMBINE: "Runware Video Inference Elements Combine",
|
||||
VIDEOINFERENCESPEECHINPUT: "Runware Video Inference Speech Input",
|
||||
VIDEOINFERENCELORA: "Runware Video Inference Lora",
|
||||
VIDEOSETTINGS: "Runware Video Inference Settings",
|
||||
VIDEOINFERENCESETTINGSTTS: "Runware Video Inference Settings TTS",
|
||||
VIDEOINFERENCESETTINGSACTIVESPEAKERDETECTION: "Runware Video Inference Settings Active Speaker Detection",
|
||||
@@ -390,6 +391,10 @@ const RUNWARE_NODE_PROPS = {
|
||||
[RUNWARE_NODE_TYPES.VIDEOINFERENCESPEECHINPUT]: {
|
||||
bgColor: DEFAULT_BGCOLOR,
|
||||
},
|
||||
[RUNWARE_NODE_TYPES.VIDEOINFERENCELORA]: {
|
||||
bgColor: DEFAULT_BGCOLOR,
|
||||
colorModeOnly: true,
|
||||
},
|
||||
[RUNWARE_NODE_TYPES.REGIONALPROMPTINGADVFEATURE]: {
|
||||
bgColor: DEFAULT_BGCOLOR,
|
||||
colorModeOnly: true,
|
||||
|
||||
@@ -2921,6 +2921,7 @@ function videoModelSearchFilterHandler(videoModelSearchNode) {
|
||||
"lightricks:2@0 (LTX Fast)", "lightricks:2@1 (LTX Pro)",
|
||||
"lightricks:3@1 (LTX-2 Retake)", "lightricks:ltx@2 (LTX-2)",
|
||||
"lightricks:ltx@2.3 (LTX 2.3)", "lightricks:ltx@2.3-fast (LTX 2.3 Fast)",
|
||||
"lightricks:ltx@2.3-open (LTX-2.3 Open)",
|
||||
],
|
||||
"Ovi": [
|
||||
"runware:190@1 (Ovi)",
|
||||
@@ -3051,6 +3052,7 @@ function videoModelSearchFilterHandler(videoModelSearchNode) {
|
||||
"lightricks:ltx@2": {"width": 1024, "height": 1024},
|
||||
"lightricks:ltx@2.3": {"width": 1920, "height": 1080},
|
||||
"lightricks:ltx@2.3-fast": {"width": 1920, "height": 1080},
|
||||
"lightricks:ltx@2.3-open": {"width": 1024, "height": 1024},
|
||||
"runware:190@1": {"width": 0, "height": 0},
|
||||
"runway:aleph@2.0": {"width": 0, "height": 0},
|
||||
"runway:2@1": {"width": 1280, "height": 720},
|
||||
@@ -3154,6 +3156,7 @@ function videoModelSearchFilterHandler(videoModelSearchNode) {
|
||||
"lightricks:ltx@2": null, // No resolution support (fixed 1024x1024)
|
||||
"lightricks:ltx@2.3": "1080p",
|
||||
"lightricks:ltx@2.3-fast": "1080p",
|
||||
"lightricks:ltx@2.3-open": null, // No resolution support (fixed 1024x1024)
|
||||
"runware:190@1": null, // No resolution support
|
||||
"runway:aleph@2.0": null, // Output ratio matches input video
|
||||
"runway:2@1": "720p",
|
||||
|
||||
@@ -226,6 +226,9 @@ class txt2vid:
|
||||
"settings": ("RUNWAREVIDEOSETTINGS", {
|
||||
"tooltip": "Connect a Runware Video Inference Settings node to configure draft, audio, voicePrompt, safetyFilter, promptUpsampling, voiceDescription, style, thinking, multiClip, shotType, promptExtend, syncMode, mode, emotion, temperature, occlusionDetection, tts, activeSpeakerDetection, segments, etc.",
|
||||
}),
|
||||
"lora": ("RUNWAREVIDEOINFERENCELORA", {
|
||||
"tooltip": "Connect a Runware Video Inference Lora node to apply LoRA models (e.g. for LTX video models).",
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,6 +266,7 @@ class txt2vid:
|
||||
videoAdvancedFeatureInputs = kwargs.get("videoAdvancedFeatureInputs", None)
|
||||
runwareAccelerator = kwargs.get("Accelerator", None)
|
||||
settings = kwargs.get("settings", None)
|
||||
lora = kwargs.get("lora", None)
|
||||
useDuration = kwargs.get("useDuration", False)
|
||||
duration = kwargs.get("duration", 5)
|
||||
fps = kwargs.get("fps", 24)
|
||||
@@ -436,6 +440,9 @@ class txt2vid:
|
||||
# Add settings if provided (draft, audio, promptUpsampling, voiceDescription, ...)
|
||||
if settings is not None and isinstance(settings, dict) and len(settings) > 0:
|
||||
genConfig[0]["settings"] = settings
|
||||
|
||||
if lora and lora.get("model"):
|
||||
genConfig[0]["lora"] = [lora]
|
||||
|
||||
# Add acceleration if not "none"
|
||||
if acceleration and acceleration != "none":
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
class RunwareVideoInferenceLora:
|
||||
"""LoRA config for Runware Video Inference."""
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"model": ("STRING", {
|
||||
"default": "",
|
||||
"tooltip": "LoRA model AIR code (e.g. lvs:mayflower@lora-test).",
|
||||
}),
|
||||
"weight": ("FLOAT", {
|
||||
"tooltip": "LoRA strength for video generation.",
|
||||
"default": 0.7,
|
||||
"min": -4.0,
|
||||
"max": 4.0,
|
||||
"step": 0.1,
|
||||
}),
|
||||
},
|
||||
}
|
||||
|
||||
DESCRIPTION = (
|
||||
"Configure a LoRA for Runware Video Inference. Connect the output to "
|
||||
"Runware Video Inference → lora."
|
||||
)
|
||||
FUNCTION = "createLora"
|
||||
RETURN_TYPES = ("RUNWAREVIDEOINFERENCELORA",)
|
||||
RETURN_NAMES = ("lora",)
|
||||
CATEGORY = "Runware"
|
||||
|
||||
def createLora(self, model, weight):
|
||||
return ({
|
||||
"model": model.strip(),
|
||||
"weight": round(weight, 2),
|
||||
},)
|
||||
@@ -92,6 +92,7 @@ class videoModelSearch:
|
||||
"lightricks:ltx@2 (LTX-2)",
|
||||
"lightricks:ltx@2.3 (LTX 2.3)",
|
||||
"lightricks:ltx@2.3-fast (LTX 2.3 Fast)",
|
||||
"lightricks:ltx@2.3-open (LTX-2.3 Open)",
|
||||
],
|
||||
"Ovi": [
|
||||
"runware:190@1 (Ovi)",
|
||||
@@ -240,6 +241,7 @@ class videoModelSearch:
|
||||
"lightricks:ltx@2": {"width": 1024, "height": 1024},
|
||||
"lightricks:ltx@2.3": {"width": 1920, "height": 1080},
|
||||
"lightricks:ltx@2.3-fast": {"width": 1920, "height": 1080},
|
||||
"lightricks:ltx@2.3-open": {"width": 1024, "height": 1024},
|
||||
|
||||
# Ovi Models
|
||||
"runware:190@1": {"width": 0, "height": 0},
|
||||
@@ -387,6 +389,7 @@ class videoModelSearch:
|
||||
"lightricks:ltx@2": None, # No resolution support (fixed 1024x1024)
|
||||
"lightricks:ltx@2.3": "1080p",
|
||||
"lightricks:ltx@2.3-fast": "1080p",
|
||||
"lightricks:ltx@2.3-open": None, # No resolution support (fixed 1024x1024)
|
||||
|
||||
# Ovi Models
|
||||
"runware:190@1": None, # No resolution support
|
||||
|
||||
Reference in New Issue
Block a user