bizyengine 1.2.76__py3-none-any.whl → 1.2.78__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bizyengine/bizy_server/api_client.py +53 -66
- bizyengine/bizy_server/errno.py +10 -0
- bizyengine/bizy_server/server.py +19 -0
- bizyengine/bizyair_extras/third_party_api/__init__.py +1 -0
- bizyengine/bizyair_extras/third_party_api/nodes_doubao.py +32 -16
- bizyengine/bizyair_extras/third_party_api/nodes_flux.py +9 -6
- bizyengine/bizyair_extras/third_party_api/nodes_gemini.py +26 -10
- bizyengine/bizyair_extras/third_party_api/nodes_gpt.py +6 -6
- bizyengine/bizyair_extras/third_party_api/nodes_hailuo.py +6 -6
- bizyengine/bizyair_extras/third_party_api/nodes_kling.py +308 -21
- bizyengine/bizyair_extras/third_party_api/nodes_sora.py +6 -6
- bizyengine/bizyair_extras/third_party_api/nodes_veo3.py +9 -9
- bizyengine/bizyair_extras/third_party_api/nodes_vidu.py +269 -0
- bizyengine/bizyair_extras/third_party_api/nodes_wan_api.py +222 -6
- bizyengine/bizyair_extras/third_party_api/trd_nodes_base.py +3 -2
- bizyengine/misc/utils.py +18 -4
- bizyengine/version.txt +1 -1
- {bizyengine-1.2.76.dist-info → bizyengine-1.2.78.dist-info}/METADATA +1 -1
- {bizyengine-1.2.76.dist-info → bizyengine-1.2.78.dist-info}/RECORD +21 -20
- {bizyengine-1.2.76.dist-info → bizyengine-1.2.78.dist-info}/WHEEL +0 -0
- {bizyengine-1.2.76.dist-info → bizyengine-1.2.78.dist-info}/top_level.txt +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import io
|
|
2
|
+
|
|
1
3
|
from bizyairsdk import tensor_to_bytesio
|
|
2
4
|
|
|
3
5
|
from .trd_nodes_base import BizyAirTrdApiBaseNode
|
|
@@ -5,8 +7,8 @@ from .trd_nodes_base import BizyAirTrdApiBaseNode
|
|
|
5
7
|
|
|
6
8
|
class Kling_2_1_T2V_API(BizyAirTrdApiBaseNode):
|
|
7
9
|
NODE_DISPLAY_NAME = "Kling 2.1 Text To Video"
|
|
8
|
-
RETURN_TYPES = ("VIDEO",)
|
|
9
|
-
RETURN_NAMES = ("video",)
|
|
10
|
+
RETURN_TYPES = ("VIDEO", """{"kling-v2-1-master": "kling-v2-1"}""")
|
|
11
|
+
RETURN_NAMES = ("video", "bizyair_model_name")
|
|
10
12
|
CATEGORY = "☁️BizyAir/External APIs/Kling"
|
|
11
13
|
|
|
12
14
|
@classmethod
|
|
@@ -55,13 +57,16 @@ class Kling_2_1_T2V_API(BizyAirTrdApiBaseNode):
|
|
|
55
57
|
return data, "kling-v2-1"
|
|
56
58
|
|
|
57
59
|
def handle_outputs(self, outputs):
|
|
58
|
-
return (outputs[0][0],)
|
|
60
|
+
return (outputs[0][0], "")
|
|
59
61
|
|
|
60
62
|
|
|
61
63
|
class Kling_2_1_I2V_API(BizyAirTrdApiBaseNode):
|
|
62
64
|
NODE_DISPLAY_NAME = "Kling 2.1 Image To Video"
|
|
63
|
-
RETURN_TYPES = (
|
|
64
|
-
|
|
65
|
+
RETURN_TYPES = (
|
|
66
|
+
"VIDEO",
|
|
67
|
+
"""{"kling-v2-1-std": "kling-v2-1","kling-v2-1-pro": "kling-v2-1","kling-v2-1-master": "kling-v2-1"}""",
|
|
68
|
+
)
|
|
69
|
+
RETURN_NAMES = ("video", "bizyair_model_name")
|
|
65
70
|
CATEGORY = "☁️BizyAir/External APIs/Kling"
|
|
66
71
|
|
|
67
72
|
@classmethod
|
|
@@ -133,7 +138,7 @@ class Kling_2_1_I2V_API(BizyAirTrdApiBaseNode):
|
|
|
133
138
|
return data, "kling-v2-1"
|
|
134
139
|
|
|
135
140
|
def handle_outputs(self, outputs):
|
|
136
|
-
return (outputs[0][0],)
|
|
141
|
+
return (outputs[0][0], "")
|
|
137
142
|
|
|
138
143
|
|
|
139
144
|
# class Kling_2_1_PRO_I2V_API(BizyAirTrdApiBaseNode):
|
|
@@ -213,8 +218,8 @@ class Kling_2_1_I2V_API(BizyAirTrdApiBaseNode):
|
|
|
213
218
|
|
|
214
219
|
class Kling_2_5_I2V_API(BizyAirTrdApiBaseNode):
|
|
215
220
|
NODE_DISPLAY_NAME = "Kling 2.5 Image To Video"
|
|
216
|
-
RETURN_TYPES = ("VIDEO",)
|
|
217
|
-
RETURN_NAMES = ("video",)
|
|
221
|
+
RETURN_TYPES = ("VIDEO", """{"kling-v2-5-turbo": "kling-v2-5"}""")
|
|
222
|
+
RETURN_NAMES = ("video", "bizyair_model_name")
|
|
218
223
|
CATEGORY = "☁️BizyAir/External APIs/Kling"
|
|
219
224
|
|
|
220
225
|
@classmethod
|
|
@@ -280,13 +285,13 @@ class Kling_2_5_I2V_API(BizyAirTrdApiBaseNode):
|
|
|
280
285
|
return data, "kling-v2-5"
|
|
281
286
|
|
|
282
287
|
def handle_outputs(self, outputs):
|
|
283
|
-
return (outputs[0][0],)
|
|
288
|
+
return (outputs[0][0], "")
|
|
284
289
|
|
|
285
290
|
|
|
286
291
|
class Kling_2_6_T2V_API(BizyAirTrdApiBaseNode):
|
|
287
292
|
NODE_DISPLAY_NAME = "Kling 2.6 Text To Video"
|
|
288
|
-
RETURN_TYPES = ("VIDEO",)
|
|
289
|
-
RETURN_NAMES = ("video",)
|
|
293
|
+
RETURN_TYPES = ("VIDEO", """{"kling-v2-6": "kling-v2-6"}""")
|
|
294
|
+
RETURN_NAMES = ("video", "bizyair_model_name")
|
|
290
295
|
CATEGORY = "☁️BizyAir/External APIs/Kling"
|
|
291
296
|
|
|
292
297
|
@classmethod
|
|
@@ -331,13 +336,13 @@ class Kling_2_6_T2V_API(BizyAirTrdApiBaseNode):
|
|
|
331
336
|
return data, "kling-v2-6"
|
|
332
337
|
|
|
333
338
|
def handle_outputs(self, outputs):
|
|
334
|
-
return (outputs[0][0],)
|
|
339
|
+
return (outputs[0][0], "")
|
|
335
340
|
|
|
336
341
|
|
|
337
342
|
class Kling_2_6_I2V_API(BizyAirTrdApiBaseNode):
|
|
338
343
|
NODE_DISPLAY_NAME = "Kling 2.6 Image To Video"
|
|
339
|
-
RETURN_TYPES = ("VIDEO",)
|
|
340
|
-
RETURN_NAMES = ("video",)
|
|
344
|
+
RETURN_TYPES = ("VIDEO", """{"kling-v2-6": "kling-v2-6"}""")
|
|
345
|
+
RETURN_NAMES = ("video", "bizyair_model_name")
|
|
341
346
|
CATEGORY = "☁️BizyAir/External APIs/Kling"
|
|
342
347
|
|
|
343
348
|
@classmethod
|
|
@@ -390,13 +395,13 @@ class Kling_2_6_I2V_API(BizyAirTrdApiBaseNode):
|
|
|
390
395
|
return data, "kling-v2-6"
|
|
391
396
|
|
|
392
397
|
def handle_outputs(self, outputs):
|
|
393
|
-
return (outputs[0][0],)
|
|
398
|
+
return (outputs[0][0], "")
|
|
394
399
|
|
|
395
400
|
|
|
396
401
|
class Kling_2_T2I_API(BizyAirTrdApiBaseNode):
|
|
397
402
|
NODE_DISPLAY_NAME = "Kling 2 Text To Image"
|
|
398
|
-
RETURN_TYPES = ("IMAGE",)
|
|
399
|
-
RETURN_NAMES = ("images",)
|
|
403
|
+
RETURN_TYPES = ("IMAGE", """{"kling-v2": "kling-v2"}""")
|
|
404
|
+
RETURN_NAMES = ("images", "bizyair_model_name")
|
|
400
405
|
CATEGORY = "☁️BizyAir/External APIs/Kling"
|
|
401
406
|
|
|
402
407
|
@classmethod
|
|
@@ -456,13 +461,13 @@ class Kling_2_T2I_API(BizyAirTrdApiBaseNode):
|
|
|
456
461
|
|
|
457
462
|
def handle_outputs(self, outputs):
|
|
458
463
|
images = self.combine_images(outputs[1])
|
|
459
|
-
return (images,)
|
|
464
|
+
return (images, "")
|
|
460
465
|
|
|
461
466
|
|
|
462
467
|
class Kling_2_I2I_API(BizyAirTrdApiBaseNode):
|
|
463
468
|
NODE_DISPLAY_NAME = "Kling 2 Image To Image"
|
|
464
|
-
RETURN_TYPES = ("IMAGE",)
|
|
465
|
-
RETURN_NAMES = ("images",)
|
|
469
|
+
RETURN_TYPES = ("IMAGE", """{"kling-v2": "kling-v2"}""")
|
|
470
|
+
RETURN_NAMES = ("images", "bizyair_model_name")
|
|
466
471
|
CATEGORY = "☁️BizyAir/External APIs/Kling"
|
|
467
472
|
|
|
468
473
|
@classmethod
|
|
@@ -522,4 +527,286 @@ class Kling_2_I2I_API(BizyAirTrdApiBaseNode):
|
|
|
522
527
|
|
|
523
528
|
def handle_outputs(self, outputs):
|
|
524
529
|
images = self.combine_images(outputs[1])
|
|
525
|
-
return (images,)
|
|
530
|
+
return (images, "")
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
class Kling_O1_T2V_API(BizyAirTrdApiBaseNode):
|
|
534
|
+
NODE_DISPLAY_NAME = "Kling O1 Text To Video"
|
|
535
|
+
RETURN_TYPES = ("VIDEO", """{"kling-o1-t2v": "kling-o1"}""")
|
|
536
|
+
RETURN_NAMES = ("video", "bizyair_model_name")
|
|
537
|
+
CATEGORY = "☁️BizyAir/External APIs/Kling"
|
|
538
|
+
|
|
539
|
+
@classmethod
|
|
540
|
+
def INPUT_TYPES(cls):
|
|
541
|
+
return {
|
|
542
|
+
"required": {
|
|
543
|
+
"prompt": (
|
|
544
|
+
"STRING",
|
|
545
|
+
{
|
|
546
|
+
"multiline": True,
|
|
547
|
+
"default": "",
|
|
548
|
+
},
|
|
549
|
+
),
|
|
550
|
+
"duration": ([5, 10], {"default": 5}),
|
|
551
|
+
"aspect_ratio": (["16:9", "9:16", "1:1"], {"default": "16:9"}),
|
|
552
|
+
},
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
def handle_inputs(self, headers, prompt_id, **kwargs):
|
|
556
|
+
prompt = kwargs.get("prompt", "")
|
|
557
|
+
duration = kwargs.get("duration", 5)
|
|
558
|
+
aspect_ratio = kwargs.get("aspect_ratio", "16:9")
|
|
559
|
+
data = {
|
|
560
|
+
"prompt": prompt,
|
|
561
|
+
"duration": duration,
|
|
562
|
+
"aspect_ratio": aspect_ratio,
|
|
563
|
+
"model": "kling-o1-t2v",
|
|
564
|
+
}
|
|
565
|
+
return data, "kling-o1"
|
|
566
|
+
|
|
567
|
+
def handle_outputs(self, outputs):
|
|
568
|
+
return (outputs[0][0], "")
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
class Kling_O1_I2V_API(BizyAirTrdApiBaseNode):
|
|
572
|
+
NODE_DISPLAY_NAME = "Kling O1 Image To Video"
|
|
573
|
+
RETURN_TYPES = ("VIDEO", """{"kling-o1-i2v": "kling-o1"}""")
|
|
574
|
+
RETURN_NAMES = ("video", "bizyair_model_name")
|
|
575
|
+
CATEGORY = "☁️BizyAir/External APIs/Kling"
|
|
576
|
+
|
|
577
|
+
@classmethod
|
|
578
|
+
def INPUT_TYPES(cls):
|
|
579
|
+
return {
|
|
580
|
+
"required": {
|
|
581
|
+
"prompt": (
|
|
582
|
+
"STRING",
|
|
583
|
+
{
|
|
584
|
+
"multiline": True,
|
|
585
|
+
"default": "",
|
|
586
|
+
},
|
|
587
|
+
),
|
|
588
|
+
"first_frame_image": ("IMAGE",),
|
|
589
|
+
"duration": ([5, 10], {"default": 5}),
|
|
590
|
+
"aspect_ratio": (["16:9", "9:16", "1:1"], {"default": "16:9"}),
|
|
591
|
+
},
|
|
592
|
+
"optional": {
|
|
593
|
+
"last_frame_image": ("IMAGE",),
|
|
594
|
+
},
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
def handle_inputs(self, headers, prompt_id, **kwargs):
|
|
598
|
+
prompt = kwargs.get("prompt", "")
|
|
599
|
+
duration = kwargs.get("duration", 5)
|
|
600
|
+
aspect_ratio = kwargs.get("aspect_ratio", "16:9")
|
|
601
|
+
first_frame_image = kwargs.get("first_frame_image", None)
|
|
602
|
+
last_frame_image = kwargs.get("last_frame_image", None)
|
|
603
|
+
if first_frame_image is None:
|
|
604
|
+
raise ValueError("First frame image is required")
|
|
605
|
+
# 上传图片
|
|
606
|
+
first_frame_image_url = self.upload_file(
|
|
607
|
+
tensor_to_bytesio(image=first_frame_image, total_pixels=4096 * 4096),
|
|
608
|
+
f"{prompt_id}_first.png",
|
|
609
|
+
headers,
|
|
610
|
+
)
|
|
611
|
+
|
|
612
|
+
data = {
|
|
613
|
+
"prompt": prompt,
|
|
614
|
+
"duration": duration,
|
|
615
|
+
"aspect_ratio": aspect_ratio,
|
|
616
|
+
"model": "kling-o1-i2v",
|
|
617
|
+
"first_frame_image": first_frame_image_url,
|
|
618
|
+
}
|
|
619
|
+
if last_frame_image is not None:
|
|
620
|
+
# 上传末帧图片
|
|
621
|
+
last_frame_image_url = self.upload_file(
|
|
622
|
+
tensor_to_bytesio(image=last_frame_image, total_pixels=4096 * 4096),
|
|
623
|
+
f"{prompt_id}_last.png",
|
|
624
|
+
headers,
|
|
625
|
+
)
|
|
626
|
+
data["last_frame_image"] = last_frame_image_url
|
|
627
|
+
return data, "kling-o1"
|
|
628
|
+
|
|
629
|
+
def handle_outputs(self, outputs):
|
|
630
|
+
return (outputs[0][0], "")
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
class Kling_O1_VI2V_REF_API(BizyAirTrdApiBaseNode):
|
|
634
|
+
NODE_DISPLAY_NAME = "Kling O1 Reference Video/Images To Video"
|
|
635
|
+
RETURN_TYPES = ("VIDEO", """{"kling-o1-ref2v": "kling-o1"}""")
|
|
636
|
+
RETURN_NAMES = ("video", "bizyair_model_name")
|
|
637
|
+
CATEGORY = "☁️BizyAir/External APIs/Kling"
|
|
638
|
+
|
|
639
|
+
@classmethod
|
|
640
|
+
def INPUT_TYPES(cls):
|
|
641
|
+
return {
|
|
642
|
+
"required": {
|
|
643
|
+
"prompt": (
|
|
644
|
+
"STRING",
|
|
645
|
+
{
|
|
646
|
+
"multiline": True,
|
|
647
|
+
"default": "",
|
|
648
|
+
},
|
|
649
|
+
),
|
|
650
|
+
"duration": ("INT", {"default": 5, "min": 3, "max": 10}),
|
|
651
|
+
"aspect_ratio": (["16:9", "9:16", "1:1"], {"default": "16:9"}),
|
|
652
|
+
"keep_original_sound": (
|
|
653
|
+
"BOOLEAN",
|
|
654
|
+
{"default": False, "tooltip": "选择是否通过参数保留视频原始声音"},
|
|
655
|
+
),
|
|
656
|
+
},
|
|
657
|
+
"optional": {
|
|
658
|
+
"ref_image_1": ("IMAGE",),
|
|
659
|
+
"ref_image_2": ("IMAGE",),
|
|
660
|
+
"ref_image_3": ("IMAGE",),
|
|
661
|
+
"ref_image_4": ("IMAGE",),
|
|
662
|
+
"ref_image_5": ("IMAGE",),
|
|
663
|
+
"ref_image_6": ("IMAGE",),
|
|
664
|
+
"ref_image_7": ("IMAGE",),
|
|
665
|
+
"ref_video": ("VIDEO",),
|
|
666
|
+
},
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
def handle_inputs(self, headers, prompt_id, **kwargs):
|
|
670
|
+
prompt = kwargs.get("prompt", "")
|
|
671
|
+
duration = kwargs.get("duration", 5)
|
|
672
|
+
aspect_ratio = kwargs.get("aspect_ratio", "16:9")
|
|
673
|
+
keep_original_sound = kwargs.get("keep_original_sound", False)
|
|
674
|
+
ref_video = kwargs.get("ref_video", None)
|
|
675
|
+
# 上传图片
|
|
676
|
+
images = []
|
|
677
|
+
for i, img in enumerate(
|
|
678
|
+
[
|
|
679
|
+
kwargs.get("ref_image_1", None),
|
|
680
|
+
kwargs.get("ref_image_2", None),
|
|
681
|
+
kwargs.get("ref_image_3", None),
|
|
682
|
+
kwargs.get("ref_image_4", None),
|
|
683
|
+
kwargs.get("ref_image_5", None),
|
|
684
|
+
kwargs.get("ref_image_6", None),
|
|
685
|
+
kwargs.get("ref_image_7", None),
|
|
686
|
+
],
|
|
687
|
+
1,
|
|
688
|
+
):
|
|
689
|
+
if img is not None:
|
|
690
|
+
url = self.upload_file(
|
|
691
|
+
tensor_to_bytesio(image=img, total_pixels=4096 * 4096),
|
|
692
|
+
f"{prompt_id}_ref_{i+1}.png",
|
|
693
|
+
headers,
|
|
694
|
+
)
|
|
695
|
+
images.append(url)
|
|
696
|
+
|
|
697
|
+
data = {
|
|
698
|
+
"prompt": prompt,
|
|
699
|
+
"duration": duration,
|
|
700
|
+
"aspect_ratio": aspect_ratio,
|
|
701
|
+
"keep_original_sound": keep_original_sound,
|
|
702
|
+
"model": "kling-o1-ref2v",
|
|
703
|
+
}
|
|
704
|
+
if len(images) > 0:
|
|
705
|
+
data["images"] = images
|
|
706
|
+
|
|
707
|
+
if ref_video is not None:
|
|
708
|
+
video_bytes_io = io.BytesIO()
|
|
709
|
+
format_to_use = getattr(ref_video, "container", "mp4")
|
|
710
|
+
codec_to_use = getattr(ref_video, "codec", "h264")
|
|
711
|
+
ref_video.save_to(video_bytes_io, format=format_to_use, codec=codec_to_use)
|
|
712
|
+
video_bytes_io.seek(0)
|
|
713
|
+
ref_video_url = self.upload_file(
|
|
714
|
+
video_bytes_io,
|
|
715
|
+
f"{prompt_id}_ref_video.{format_to_use}",
|
|
716
|
+
headers,
|
|
717
|
+
)
|
|
718
|
+
data["video"] = ref_video_url
|
|
719
|
+
return data, "kling-o1"
|
|
720
|
+
|
|
721
|
+
def handle_outputs(self, outputs):
|
|
722
|
+
return (outputs[0][0], "")
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
class Kling_O1_VIDEO_EDIT_API(BizyAirTrdApiBaseNode):
|
|
726
|
+
NODE_DISPLAY_NAME = "Kling O1 Video Edit"
|
|
727
|
+
RETURN_TYPES = ("VIDEO", """{"kling-o1-video-edit": "kling-o1"}""")
|
|
728
|
+
RETURN_NAMES = ("video", "bizyair_model_name")
|
|
729
|
+
CATEGORY = "☁️BizyAir/External APIs/Kling"
|
|
730
|
+
|
|
731
|
+
@classmethod
|
|
732
|
+
def INPUT_TYPES(cls):
|
|
733
|
+
return {
|
|
734
|
+
"required": {
|
|
735
|
+
"prompt": (
|
|
736
|
+
"STRING",
|
|
737
|
+
{
|
|
738
|
+
"multiline": True,
|
|
739
|
+
"default": "",
|
|
740
|
+
},
|
|
741
|
+
),
|
|
742
|
+
"ref_video": ("VIDEO",),
|
|
743
|
+
"aspect_ratio": (["16:9", "9:16", "1:1"], {"default": "16:9"}),
|
|
744
|
+
"keep_original_sound": (
|
|
745
|
+
"BOOLEAN",
|
|
746
|
+
{"default": False, "tooltip": "选择是否通过参数保留视频原始声音"},
|
|
747
|
+
),
|
|
748
|
+
"fast_mode": (
|
|
749
|
+
"BOOLEAN",
|
|
750
|
+
{"default": False, "tooltip": "选择是否使用快速模式"},
|
|
751
|
+
),
|
|
752
|
+
},
|
|
753
|
+
"optional": {
|
|
754
|
+
"ref_image_1": ("IMAGE",),
|
|
755
|
+
"ref_image_2": ("IMAGE",),
|
|
756
|
+
"ref_image_3": ("IMAGE",),
|
|
757
|
+
"ref_image_4": ("IMAGE",),
|
|
758
|
+
},
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
def handle_inputs(self, headers, prompt_id, **kwargs):
|
|
762
|
+
prompt = kwargs.get("prompt", "")
|
|
763
|
+
fast_mode = kwargs.get("fast_mode", False)
|
|
764
|
+
aspect_ratio = kwargs.get("aspect_ratio", "16:9")
|
|
765
|
+
keep_original_sound = kwargs.get("keep_original_sound", False)
|
|
766
|
+
ref_video = kwargs.get("ref_video", None)
|
|
767
|
+
if ref_video is None:
|
|
768
|
+
raise ValueError("Reference video is required")
|
|
769
|
+
# 上传图片
|
|
770
|
+
images = []
|
|
771
|
+
for i, img in enumerate(
|
|
772
|
+
[
|
|
773
|
+
kwargs.get("ref_image_1", None),
|
|
774
|
+
kwargs.get("ref_image_2", None),
|
|
775
|
+
kwargs.get("ref_image_3", None),
|
|
776
|
+
kwargs.get("ref_image_4", None),
|
|
777
|
+
],
|
|
778
|
+
1,
|
|
779
|
+
):
|
|
780
|
+
if img is not None:
|
|
781
|
+
url = self.upload_file(
|
|
782
|
+
tensor_to_bytesio(image=img, total_pixels=4096 * 4096),
|
|
783
|
+
f"{prompt_id}_ref_{i+1}.png",
|
|
784
|
+
headers,
|
|
785
|
+
)
|
|
786
|
+
images.append(url)
|
|
787
|
+
# 上传视频
|
|
788
|
+
video_bytes_io = io.BytesIO()
|
|
789
|
+
format_to_use = getattr(ref_video, "container", "mp4")
|
|
790
|
+
codec_to_use = getattr(ref_video, "codec", "h264")
|
|
791
|
+
ref_video.save_to(video_bytes_io, format=format_to_use, codec=codec_to_use)
|
|
792
|
+
video_bytes_io.seek(0)
|
|
793
|
+
ref_video_url = self.upload_file(
|
|
794
|
+
video_bytes_io,
|
|
795
|
+
f"{prompt_id}_ref_video.{format_to_use}",
|
|
796
|
+
headers,
|
|
797
|
+
)
|
|
798
|
+
|
|
799
|
+
data = {
|
|
800
|
+
"prompt": prompt,
|
|
801
|
+
"aspect_ratio": aspect_ratio,
|
|
802
|
+
"keep_original_sound": keep_original_sound,
|
|
803
|
+
"fast_mode": fast_mode,
|
|
804
|
+
"model": "kling-o1-video-edit",
|
|
805
|
+
"video": ref_video_url,
|
|
806
|
+
}
|
|
807
|
+
if len(images) > 0:
|
|
808
|
+
data["images"] = images
|
|
809
|
+
return data, "kling-o1"
|
|
810
|
+
|
|
811
|
+
def handle_outputs(self, outputs):
|
|
812
|
+
return (outputs[0][0], "")
|
|
@@ -5,8 +5,8 @@ from .trd_nodes_base import BizyAirTrdApiBaseNode
|
|
|
5
5
|
|
|
6
6
|
class Sora_V2_I2V_API(BizyAirTrdApiBaseNode):
|
|
7
7
|
NODE_DISPLAY_NAME = "Sora2 Image To Video"
|
|
8
|
-
RETURN_TYPES = ("VIDEO",)
|
|
9
|
-
RETURN_NAMES = ("video",)
|
|
8
|
+
RETURN_TYPES = ("VIDEO", """{"sora-2": "sora-2","sora-2-pro": "sora-2-pro"}""")
|
|
9
|
+
RETURN_NAMES = ("video", "bizyair_model_name")
|
|
10
10
|
CATEGORY = "☁️BizyAir/External APIs/Sora"
|
|
11
11
|
|
|
12
12
|
@classmethod
|
|
@@ -61,13 +61,13 @@ class Sora_V2_I2V_API(BizyAirTrdApiBaseNode):
|
|
|
61
61
|
return data, model
|
|
62
62
|
|
|
63
63
|
def handle_outputs(self, outputs):
|
|
64
|
-
return (outputs[0][0],)
|
|
64
|
+
return (outputs[0][0], "")
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
class Sora_V2_T2V_API(BizyAirTrdApiBaseNode):
|
|
68
68
|
NODE_DISPLAY_NAME = "Sora2 Text To Video"
|
|
69
|
-
RETURN_TYPES = ("VIDEO",)
|
|
70
|
-
RETURN_NAMES = ("video",)
|
|
69
|
+
RETURN_TYPES = ("VIDEO", """{"sora-2": "sora-2","sora-2-pro": "sora-2-pro"}""")
|
|
70
|
+
RETURN_NAMES = ("video", "bizyair_model_name")
|
|
71
71
|
CATEGORY = "☁️BizyAir/External APIs/Sora"
|
|
72
72
|
|
|
73
73
|
@classmethod
|
|
@@ -109,7 +109,7 @@ class Sora_V2_T2V_API(BizyAirTrdApiBaseNode):
|
|
|
109
109
|
return data, model
|
|
110
110
|
|
|
111
111
|
def handle_outputs(self, outputs):
|
|
112
|
-
return (outputs[0][0],)
|
|
112
|
+
return (outputs[0][0], "")
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
# class Sora_V2_PRO_I2V_API(BizyAirTrdApiBaseNode):
|
|
@@ -28,8 +28,8 @@ class Veo_V3_1_I2V_API(BizyAirTrdApiBaseNode):
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
NODE_DISPLAY_NAME = "Veo3.1 Image To Video"
|
|
31
|
-
RETURN_TYPES = ("VIDEO",)
|
|
32
|
-
RETURN_NAMES = ("video",)
|
|
31
|
+
RETURN_TYPES = ("VIDEO", """{"veo3.1-fast": "veo3.1","veo3.1-pro": "veo3.1"}""")
|
|
32
|
+
RETURN_NAMES = ("video", "bizyair_model_name")
|
|
33
33
|
CATEGORY = "☁️BizyAir/External APIs/Veo"
|
|
34
34
|
|
|
35
35
|
def handle_inputs(self, headers, prompt_id, **kwargs):
|
|
@@ -68,7 +68,7 @@ class Veo_V3_1_I2V_API(BizyAirTrdApiBaseNode):
|
|
|
68
68
|
return data, "veo3.1"
|
|
69
69
|
|
|
70
70
|
def handle_outputs(self, outputs):
|
|
71
|
-
return (outputs[0][0],)
|
|
71
|
+
return (outputs[0][0], "")
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
class Veo_V3_1_I2V_REF_API(BizyAirTrdApiBaseNode):
|
|
@@ -94,8 +94,8 @@ class Veo_V3_1_I2V_REF_API(BizyAirTrdApiBaseNode):
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
NODE_DISPLAY_NAME = "Veo3.1 Image To Video (Reference Images)"
|
|
97
|
-
RETURN_TYPES = ("VIDEO",)
|
|
98
|
-
RETURN_NAMES = ("video",)
|
|
97
|
+
RETURN_TYPES = ("VIDEO", """{"veo3.1-fast": "veo3.1"}""")
|
|
98
|
+
RETURN_NAMES = ("video", "bizyair_model_name")
|
|
99
99
|
CATEGORY = "☁️BizyAir/External APIs/Veo"
|
|
100
100
|
FUNCTION = "api_call"
|
|
101
101
|
|
|
@@ -145,7 +145,7 @@ class Veo_V3_1_I2V_REF_API(BizyAirTrdApiBaseNode):
|
|
|
145
145
|
return data, "veo3.1"
|
|
146
146
|
|
|
147
147
|
def handle_outputs(self, outputs):
|
|
148
|
-
return (outputs[0][0],)
|
|
148
|
+
return (outputs[0][0], "")
|
|
149
149
|
|
|
150
150
|
|
|
151
151
|
class Veo_V3_1_T2V_API(BizyAirTrdApiBaseNode):
|
|
@@ -171,8 +171,8 @@ class Veo_V3_1_T2V_API(BizyAirTrdApiBaseNode):
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
NODE_DISPLAY_NAME = "Veo3.1 Text To Video"
|
|
174
|
-
RETURN_TYPES = ("VIDEO",)
|
|
175
|
-
RETURN_NAMES = ("video",)
|
|
174
|
+
RETURN_TYPES = ("VIDEO", """{"veo3.1-fast": "veo3.1","veo3.1-pro": "veo3.1"}""")
|
|
175
|
+
RETURN_NAMES = ("video", "bizyair_model_name")
|
|
176
176
|
CATEGORY = "☁️BizyAir/External APIs/Veo"
|
|
177
177
|
|
|
178
178
|
def handle_inputs(self, headers, prompt_id, **kwargs):
|
|
@@ -190,4 +190,4 @@ class Veo_V3_1_T2V_API(BizyAirTrdApiBaseNode):
|
|
|
190
190
|
return data, "veo3.1"
|
|
191
191
|
|
|
192
192
|
def handle_outputs(self, outputs):
|
|
193
|
-
return (outputs[0][0],)
|
|
193
|
+
return (outputs[0][0], "")
|