fix: Frame images and API endpoint updates

- Added KlingAI 6@1 (KlingAI 2.5 Turbo Pro) to video models
- Fixed frame images to always use base64 data URIs (not UUIDs)
- Added convertTensor2IMGBase64Only function for consistent frame image handling
- Fixed videoInputsFrame to use correct 'inputImage' key
- Updated API endpoint from runware.dev to runware.ai
- Ensured both frameImages.py and videoInputsFrame.py use consistent format
This commit is contained in:
Sirshendu Ganguly
2025-11-17 21:07:50 -05:00
parent 8c4cbd5ee6
commit 2000fb5163
5 changed files with 22 additions and 3 deletions
+3
View File
@@ -1347,6 +1347,7 @@ function videoInferenceDimensionsHandler(videoInferenceNode) {
"klingai:3@1": {width: 1280, height: 720}, "klingai:3@2": {width: 1920, height: 1080},
"klingai:4@3": {width: 1280, height: 720}, "klingai:5@1": {width: 1280, height: 720},
"klingai:5@2": {width: 1920, height: 1080}, "klingai:5@3": {width: 1920, height: 1080},
"klingai:6@1": {width: 1920, height: 1080},
"klingai:7@1": {width: 0, height: 0},
"google:2@0": {width: 1280, height: 720}, "google:3@0": {width: 1280, height: 720},
"google:3@1": {width: 1280, height: 720}, "google:3@2": {width: 1280, height: 720},
@@ -1568,6 +1569,7 @@ function videoModelSearchFilterHandler(videoModelSearchNode) {
"klingai:3@1 (KlingAI V1.6 Standard)", "klingai:3@2 (KlingAI V1.6 Pro)",
"klingai:4@3 (KlingAI V2.1 Master)", "klingai:5@1 (KlingAI V2.1 Standard (I2V))",
"klingai:5@2 (KlingAI V2.1 Pro (I2V))", "klingai:5@3 (KlingAI V2.0 Master)",
"klingai:6@1 (KlingAI 2.5 Turbo Pro)",
"klingai:7@1 (KlingAI Lip-Sync)",
],
"Veo": [
@@ -1626,6 +1628,7 @@ function videoModelSearchFilterHandler(videoModelSearchNode) {
"klingai:5@1": {"width": 1280, "height": 720},
"klingai:5@2": {"width": 1920, "height": 1080},
"klingai:5@3": {"width": 1920, "height": 1080},
"klingai:6@1": {"width": 1920, "height": 1080},
"klingai:7@1": {"width": 0, "height": 0},
"google:2@0": {"width": 1280, "height": 720},
"google:3@0": {"width": 1280, "height": 720},
+1 -1
View File
@@ -50,7 +50,7 @@ class RunwareFrameImages:
def _createFrameData(self, image, position):
"""Create frame data object from image and position"""
imageData = rwUtils.convertTensor2IMG(image)
imageData = rwUtils.convertTensor2IMGBase64Only(image)
frameData = {"inputImage": imageData}
if position != "auto":
+14
View File
@@ -467,6 +467,20 @@ def convertTensor2IMG(tensorImage):
def convertTensor2IMGBase64Only(tensorImage):
"""Convert tensor to base64 data URI without caching - for frame images"""
imageNP = (tensorImage.squeeze().numpy() * 255).astype(np.uint8)
image = Image.fromarray(imageNP)
with io.BytesIO() as buffer:
image.save(buffer, format="PNG")
imageRawData = buffer.getvalue()
imgb64 = base64.b64encode(imageRawData).decode("utf-8")
imgDataUri = f"data:image/png;base64,{imgb64}"
return imgDataUri
def convertTensor2IMGForVideo(tensorImage):
"""Convert tensor to image and force upload to get UUID for video frame images"""
imageNP = (tensorImage.squeeze().numpy() * 255).astype(np.uint8)
+2 -2
View File
@@ -49,8 +49,8 @@ class RunwareVideoInputsFrameImages:
return (frameImages,)
def _createFrameEntry(self, image, frameLabel):
imageData = rwUtils.convertTensor2IMG(image)
entry = {"image": imageData}
imageData = rwUtils.convertTensor2IMGBase64Only(image)
entry = {"inputImage": imageData}
if isinstance(frameLabel, str) and frameLabel.strip() != "":
if frameLabel.strip().isdigit():
+2
View File
@@ -14,6 +14,7 @@ class videoModelSearch:
"klingai:5@1 (KlingAI V2.1 Standard (I2V))",
"klingai:5@2 (KlingAI V2.1 Pro (I2V))",
"klingai:5@3 (KlingAI V2.0 Master)",
"klingai:6@1 (KlingAI 2.5 Turbo Pro)",
"klingai:7@1 (KlingAI Lip-Sync)",
],
"Veo": [
@@ -89,6 +90,7 @@ class videoModelSearch:
"klingai:5@1": {"width": 1280, "height": 720},
"klingai:5@2": {"width": 1920, "height": 1080},
"klingai:5@3": {"width": 1920, "height": 1080},
"klingai:6@1": {"width": 1920, "height": 1080},
"klingai:7@1": {"width": 0, "height": 0},
# Veo Models