Skip to content

Commit 16b08b5

Browse files
authored
Merge pull request #170 from Runware/feature-p-try-on
Added support for P-try-on and Kling 3
2 parents 1c9aa7a + 89f3ea3 commit 16b08b5

5 files changed

Lines changed: 33 additions & 2 deletions

File tree

clientlibs/utils.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2871,6 +2871,7 @@ function videoModelSearchFilterHandler(videoModelSearchNode) {
28712871
"klingai:kling-video@2.6-pro (Kling VIDEO 2.6 Pro)",
28722872
"klingai:kling-video@3-pro (Kling VIDEO 3.0 Pro)",
28732873
"klingai:kling-video@3-standard (Kling VIDEO 3.0 Standard)",
2874+
"klingai:kling-video@3.0-turbo (Kling VIDEO 3.0 Turbo)",
28742875
"klingai:kling-video@3-4k (Kling VIDEO 3.0 4K)",
28752876
"klingai:kling-video@o3-pro (Kling VIDEO O3 Pro)",
28762877
"klingai:kling-video@o3-standard (Kling VIDEO O3 Standard)",
@@ -2996,6 +2997,7 @@ function videoModelSearchFilterHandler(videoModelSearchNode) {
29962997
"klingai:kling-video@2.6-pro": {"width": 1920, "height": 1080},
29972998
"klingai:kling-video@3-pro": {"width": 1920, "height": 1080},
29982999
"klingai:kling-video@3-standard": {"width": 1920, "height": 1080},
3000+
"klingai:kling-video@3.0-turbo": {"width": 1920, "height": 1080},
29993001
"klingai:kling-video@3-4k": {"width": 3840, "height": 2160},
30003002
"klingai:kling-video@o3-pro": {"width": 1920, "height": 1080},
30013003
"klingai:kling-video@o3-standard": {"width": 1920, "height": 1080},
@@ -3100,6 +3102,7 @@ function videoModelSearchFilterHandler(videoModelSearchNode) {
31003102
"klingai:kling-video@2.6-pro": "1080p",
31013103
"klingai:kling-video@3-pro": "1080p",
31023104
"klingai:kling-video@3-standard": "1080p",
3105+
"klingai:kling-video@3.0-turbo": "1080p",
31033106
"klingai:kling-video@3-4k": null, // No 4K option in current resolution dropdown
31043107
"klingai:kling-video@o3-pro": "1080p",
31053108
"klingai:kling-video@o3-standard": "1080p",
@@ -5472,6 +5475,8 @@ function settingsToggleHandler(settingsNode) {
54725475
const scoringPromptWidget = settingsNode.widgets.find(w => w.name === "scoringPrompt");
54735476
const useCopyrightDetectionWidget = settingsNode.widgets.find(w => w.name === "useCopyrightDetection");
54745477
const copyrightDetectionWidget = settingsNode.widgets.find(w => w.name === "copyrightDetection");
5478+
const usePreserveInputSizeWidget = settingsNode.widgets.find(w => w.name === "usePreserveInputSize");
5479+
const preserveInputSizeWidget = settingsNode.widgets.find(w => w.name === "preserveInputSize");
54755480

54765481
// Helper function to toggle widget enabled state
54775482
function toggleWidgetState(useWidget, paramWidget, paramName) {
@@ -5588,6 +5593,9 @@ function settingsToggleHandler(settingsNode) {
55885593
if (useCopyrightDetectionWidget && copyrightDetectionWidget) {
55895594
toggleWidgetState(useCopyrightDetectionWidget, copyrightDetectionWidget, "copyrightDetection");
55905595
}
5596+
if (usePreserveInputSizeWidget && preserveInputSizeWidget) {
5597+
toggleWidgetState(usePreserveInputSizeWidget, preserveInputSizeWidget, "preserveInputSize");
5598+
}
55915599
}
55925600

55935601
function outpaintSettingsToggleHandler(settingsNode) {

modules/settings.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
magicPrompt (AUTO/ON/OFF), autoCrop, dilatePixels, creativity (raw/low/medium/high), colorPalette,
88
moodboards (from Runware Image Inference Settings Moodboards),
99
structuredPrompt (from Runware Image Inference Settings Structured Prompt; Ideogram 4.0),
10-
and promptEnhance (from Runware Image Inference Settings Prompt Enhance).
10+
and promptEnhance (from Runware Image Inference Settings Prompt Enhance),
11+
preserveInputSize (return output at original input resolution).
1112
"""
1213

1314
import json
@@ -283,6 +284,19 @@ def INPUT_TYPES(cls):
283284
"Only used when 'Use Copyright Detection' is enabled."
284285
),
285286
}),
287+
"usePreserveInputSize": ("BOOLEAN", {
288+
"tooltip": "Enable to include preserveInputSize in settings.",
289+
"default": False,
290+
}),
291+
"preserveInputSize": ("BOOLEAN", {
292+
"default": False,
293+
"label_on": "true",
294+
"label_off": "false",
295+
"tooltip": (
296+
"Return the output at the original input resolution. "
297+
"Only used when 'Use Preserve Input Size' is enabled."
298+
),
299+
}),
286300
}
287301
}
288302

@@ -295,7 +309,7 @@ def INPUT_TYPES(cls):
295309
"backgroundMode (original/transparent/solid), backgroundColor, enhancePrompt, scoringPrompt, background, style, search, "
296310
"promptExtend, editRegions (JSON), thinking (boolean), thinkingLevel (low/medium/high/xhigh), sequential, "
297311
"renderingSpeed (TURBO/DEFAULT/QUALITY), magicPrompt (AUTO/ON/OFF), autoCrop, dilatePixels, "
298-
"creativity (raw/low/medium/high), and optional colorPalette, moodboards, structuredPrompt, promptEnhance, "
312+
"creativity (raw/low/medium/high), preserveInputSize, and optional colorPalette, moodboards, structuredPrompt, promptEnhance, "
299313
"and scoringRubric from dedicated settings nodes."
300314
)
301315

@@ -322,6 +336,7 @@ def createSettings(self, **kwargs) -> tuple[Dict[str, Any]]:
322336
useEnhancePrompt = kwargs.get("useEnhancePrompt", False)
323337
useScoringPrompt = kwargs.get("useScoringPrompt", False)
324338
useCopyrightDetection = kwargs.get("useCopyrightDetection", False)
339+
usePreserveInputSize = kwargs.get("usePreserveInputSize", False)
325340
useSequential = kwargs.get("useSequential", False)
326341
useRenderingSpeed = kwargs.get("useRenderingSpeed", False)
327342
useMagicPrompt = kwargs.get("useMagicPrompt", False)
@@ -403,6 +418,9 @@ def createSettings(self, **kwargs) -> tuple[Dict[str, Any]]:
403418
if useCopyrightDetection:
404419
settings["copyrightDetection"] = bool(kwargs.get("copyrightDetection", False))
405420

421+
if usePreserveInputSize:
422+
settings["preserveInputSize"] = bool(kwargs.get("preserveInputSize", False))
423+
406424
if useSequential:
407425
settings["sequential"] = bool(kwargs.get("sequential", False))
408426

modules/videoModelSearch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class videoModelSearch:
2020
"klingai:kling-video@2.6-pro (Kling VIDEO 2.6 Pro)",
2121
"klingai:kling-video@3-pro (Kling VIDEO 3.0 Pro)",
2222
"klingai:kling-video@3-standard (Kling VIDEO 3.0 Standard)",
23+
"klingai:kling-video@3.0-turbo (Kling VIDEO 3.0 Turbo)",
2324
"klingai:kling-video@3-4k (Kling VIDEO 3.0 4K)",
2425
"klingai:kling-video@o3-pro (Kling VIDEO O3 Pro)",
2526
"klingai:kling-video@o3-standard (Kling VIDEO O3 Standard)",
@@ -169,6 +170,7 @@ class videoModelSearch:
169170
"klingai:kling-video@2.6-pro": {"width": 1920, "height": 1080},
170171
"klingai:kling-video@3-pro": {"width": 1920, "height": 1080},
171172
"klingai:kling-video@3-standard": {"width": 1920, "height": 1080},
173+
"klingai:kling-video@3.0-turbo": {"width": 1920, "height": 1080},
172174
"klingai:kling-video@3-4k": {"width": 3840, "height": 2160},
173175
"klingai:kling-video@o3-pro": {"width": 1920, "height": 1080},
174176
"klingai:kling-video@o3-standard": {"width": 1920, "height": 1080},
@@ -317,6 +319,7 @@ class videoModelSearch:
317319
"klingai:kling-video@2.6-pro": "1080p",
318320
"klingai:kling-video@3-pro": "1080p",
319321
"klingai:kling-video@3-standard": "1080p",
322+
"klingai:kling-video@3.0-turbo": "1080p",
320323
"klingai:kling-video@3-4k": None, # No 4K option in current resolution dropdown
321324
"klingai:kling-video@o3-pro": "1080p",
322325
"klingai:kling-video@o3-standard": "1080p",

workflows/Runware_Image_Inference_Pruna_Try_On.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"id":"f2a29525-d19b-4e83-817c-ec49ebb4b30f","revision":0,"last_node_id":3,"last_link_id":2,"nodes":[{"id":3,"type":"SaveVideo","pos":[456.00404914193695,140.2935163852804],"size":[270,249.875],"flags":{},"order":2,"mode":0,"inputs":[{"localized_name":"video","name":"video","type":"VIDEO","link":1},{"localized_name":"filename_prefix","name":"filename_prefix","type":"STRING","widget":{"name":"filename_prefix"},"link":null},{"localized_name":"format","name":"format","type":"COMBO","widget":{"name":"format"},"link":null},{"localized_name":"codec","name":"codec","type":"COMBO","widget":{"name":"codec"},"link":null}],"outputs":[],"properties":{"cnr_id":"comfy-core","ver":"0.22.0"},"widgets_values":["video/ComfyUI","auto","auto"]},{"id":1,"type":"Runware Video Inference","pos":[-74.45022793290552,77.28715525726491],"size":[400,838],"flags":{},"order":1,"mode":0,"inputs":[{"localized_name":"Model","name":"Model","type":"RUNWAREVIDEOMODEL","link":2},{"localized_name":"frameImages","name":"frameImages","shape":7,"type":"RUNWAREFRAMEIMAGES","link":null},{"localized_name":"referenceImages","name":"referenceImages","shape":7,"type":"RUNWAREREFERENCEIMAGES","link":null},{"localized_name":"providerSettings","name":"providerSettings","shape":7,"type":"RUNWAREPROVIDERSETTINGS","link":null},{"localized_name":"inputAudios","name":"inputAudios","shape":7,"type":"RUNWAREINPUTAUDIOS","link":null},{"localized_name":"referenceVideos","name":"referenceVideos","shape":7,"type":"RUNWAREREFERENCEVIDEOS","link":null},{"localized_name":"speech","name":"speech","shape":7,"type":"RUNWAREVIDEOINFERENCESPEECHINPUT","link":null},{"localized_name":"inputs","name":"inputs","shape":7,"type":"RUNWAREVIDEOINFERENCEINPUTS","link":null},{"localized_name":"safetyInputs","name":"safetyInputs","shape":7,"type":"RUNWARESAFETYINPUTS","link":null},{"localized_name":"videoAdvancedFeatureInputs","name":"videoAdvancedFeatureInputs","shape":7,"type":"RUNWAREVIDEOADVANCEDFEATUREINPUTS","link":null},{"localized_name":"Accelerator","name":"Accelerator","shape":7,"type":"RUNWAREACCELERATOR","link":null},{"localized_name":"settings","name":"settings","shape":7,"type":"RUNWAREVIDEOSETTINGS","link":null},{"localized_name":"lora","name":"lora","shape":7,"type":"RUNWAREVIDEOINFERENCELORA","link":null},{"localized_name":"Multi Inference Mode","name":"Multi Inference Mode","type":"BOOLEAN","widget":{"name":"Multi Inference Mode"},"link":null},{"localized_name":"Prompt Weighting","name":"Prompt Weighting","type":"COMBO","widget":{"name":"Prompt Weighting"},"link":null},{"localized_name":"useDuration","name":"useDuration","type":"BOOLEAN","widget":{"name":"useDuration"},"link":null},{"localized_name":"duration","name":"duration","type":"INT","widget":{"name":"duration"},"link":null},{"localized_name":"useFps","name":"useFps","type":"BOOLEAN","widget":{"name":"useFps"},"link":null},{"localized_name":"fps","name":"fps","type":"INT","widget":{"name":"fps"},"link":null},{"localized_name":"outputFormat","name":"outputFormat","type":"COMBO","widget":{"name":"outputFormat"},"link":null},{"localized_name":"useSeed","name":"useSeed","type":"BOOLEAN","widget":{"name":"useSeed"},"link":null},{"localized_name":"seed","name":"seed","type":"INT","widget":{"name":"seed"},"link":null},{"localized_name":"useSteps","name":"useSteps","type":"BOOLEAN","widget":{"name":"useSteps"},"link":null},{"localized_name":"steps","name":"steps","type":"INT","widget":{"name":"steps"},"link":null},{"localized_name":"useBatchSize","name":"useBatchSize","type":"BOOLEAN","widget":{"name":"useBatchSize"},"link":null},{"localized_name":"batchSize","name":"batchSize","type":"INT","widget":{"name":"batchSize"},"link":null},{"localized_name":"useSchedulers","name":"useSchedulers","type":"BOOLEAN","widget":{"name":"useSchedulers"},"link":null},{"localized_name":"scheduler","name":"scheduler","type":"COMBO","widget":{"name":"scheduler"},"link":null},{"localized_name":"useCFGScale","name":"useCFGScale","type":"BOOLEAN","widget":{"name":"useCFGScale"},"link":null},{"localized_name":"cfgScale","name":"cfgScale","type":"FLOAT","widget":{"name":"cfgScale"},"link":null},{"localized_name":"acceleration","name":"acceleration","type":"COMBO","widget":{"name":"acceleration"},"link":null},{"localized_name":"positivePrompt","name":"positivePrompt","shape":7,"type":"STRING","widget":{"name":"positivePrompt"},"link":null},{"localized_name":"negativePrompt","name":"negativePrompt","shape":7,"type":"STRING","widget":{"name":"negativePrompt"},"link":null}],"outputs":[{"localized_name":"VIDEO","name":"VIDEO","type":"VIDEO","links":[1]},{"localized_name":"RW-Task","name":"RW-Task","type":"RUNWARETASK","links":null},{"localized_name":"OUTPUT","name":"OUTPUT","type":"RUNWARETASK","links":null}],"properties":{"cnr_id":"ComfyUI-Runware","ver":"1c9aa7ae55812257c561eaffcefff36a7bda3b45","Node name for S&R":"Runware Video Inference"},"widgets_values":[false,"Disabled",true,3,false,24,"mp4",false,243648776,"randomize",false,20,false,1,false,"euler",false,5,"none"," majestic eagle soaring through mountain clouds",""],"bgcolor":"#5345bf"},{"id":2,"type":"Runware Video Model Search","pos":[-519.6777293104071,156.62077185051174],"size":[294.16015625,250],"flags":{},"order":0,"mode":0,"inputs":[{"localized_name":"Model Search","name":"Model Search","type":"STRING","widget":{"name":"Model Search"},"link":null},{"localized_name":"Model Architecture","name":"Model Architecture","type":"COMBO","widget":{"name":"Model Architecture"},"link":null},{"localized_name":"VideoList","name":"VideoList","type":"COMBO","widget":{"name":"VideoList"},"link":null},{"localized_name":"Use Search Value","name":"Use Search Value","type":"BOOLEAN","widget":{"name":"Use Search Value"},"link":null},{"localized_name":"useCustomDimensions","name":"useCustomDimensions","type":"COMBO","widget":{"name":"useCustomDimensions"},"link":null},{"localized_name":"Width","name":"Width","type":"INT","widget":{"name":"Width"},"link":null},{"localized_name":"Height","name":"Height","type":"INT","widget":{"name":"Height"},"link":null},{"localized_name":"useResolution","name":"useResolution","type":"BOOLEAN","widget":{"name":"useResolution"},"link":null},{"localized_name":"resolution","name":"resolution","type":"COMBO","widget":{"name":"resolution"},"link":null}],"outputs":[{"localized_name":"Runware Video Model","name":"Runware Video Model","type":"RUNWAREVIDEOMODEL","links":[2]}],"properties":{"cnr_id":"ComfyUI-Runware","ver":"1c9aa7ae55812257c561eaffcefff36a7bda3b45","Node name for S&R":"Runware Video Model Search"},"widgets_values":["","KlingAI","klingai:kling-video@3.0-turbo (Kling VIDEO 3.0 Turbo)",false,"Model Default",1920,1080,false,"720p"],"bgcolor":"#5345bf"}],"links":[[1,1,0,3,0,"VIDEO"],[2,2,0,1,0,"RUNWAREVIDEOMODEL"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.505529313703492,"offset":[1329.7472652309389,258.6011548450222]}},"version":0.4}

0 commit comments

Comments
 (0)