bizyengine 1.2.79__py3-none-any.whl → 1.2.81__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/bizyair_extras/third_party_api/nodes_doubao.py +212 -0
- bizyengine/bizyair_extras/third_party_api/trd_nodes_base.py +48 -24
- bizyengine/core/common/client.py +27 -32
- bizyengine/core/nodes_base.py +23 -7
- bizyengine/version.txt +1 -1
- {bizyengine-1.2.79.dist-info → bizyengine-1.2.81.dist-info}/METADATA +1 -1
- {bizyengine-1.2.79.dist-info → bizyengine-1.2.81.dist-info}/RECORD +9 -9
- {bizyengine-1.2.79.dist-info → bizyengine-1.2.81.dist-info}/WHEEL +0 -0
- {bizyengine-1.2.79.dist-info → bizyengine-1.2.81.dist-info}/top_level.txt +0 -0
|
@@ -585,3 +585,215 @@ class Seedance_1_0_I2V_API(BizyAirTrdApiBaseNode):
|
|
|
585
585
|
|
|
586
586
|
def handle_outputs(self, outputs):
|
|
587
587
|
return (outputs[0][0], "")
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
class Seedance_1_5_T2V_API(BizyAirTrdApiBaseNode):
|
|
591
|
+
RETURN_TYPES = (
|
|
592
|
+
"VIDEO",
|
|
593
|
+
"""{"doubao-seedance-1-5-pro-251215": "doubao-seedance-1-5-pro"}""",
|
|
594
|
+
)
|
|
595
|
+
RETURN_NAMES = ("video", "bizyair_model_name")
|
|
596
|
+
CATEGORY = "☁️BizyAir/External APIs/Doubao"
|
|
597
|
+
NODE_DISPLAY_NAME = "Seedance 1.5 Pro Text To Video"
|
|
598
|
+
|
|
599
|
+
@classmethod
|
|
600
|
+
def INPUT_TYPES(cls):
|
|
601
|
+
return {
|
|
602
|
+
"required": {
|
|
603
|
+
"prompt": (
|
|
604
|
+
"STRING",
|
|
605
|
+
{
|
|
606
|
+
"multiline": True,
|
|
607
|
+
"default": "",
|
|
608
|
+
},
|
|
609
|
+
),
|
|
610
|
+
"model": (
|
|
611
|
+
["doubao-seedance-1-5-pro-251215"],
|
|
612
|
+
{"default": "doubao-seedance-1-5-pro-251215"},
|
|
613
|
+
),
|
|
614
|
+
"resolution": (
|
|
615
|
+
["480p", "720p", "1080p"],
|
|
616
|
+
{
|
|
617
|
+
"default": "1080p",
|
|
618
|
+
"tooltip": "分辨率+比例共同决定视频尺寸,具体尺寸请参考官方文档说明",
|
|
619
|
+
},
|
|
620
|
+
),
|
|
621
|
+
"ratio": (
|
|
622
|
+
["16:9", "4:3", "1:1", "3:4", "9:16", "21:9", "adaptive"],
|
|
623
|
+
{
|
|
624
|
+
"default": "adaptive",
|
|
625
|
+
"tooltip": "比例+分辨率共同决定视频尺寸,具体尺寸请参考官方文档说明",
|
|
626
|
+
},
|
|
627
|
+
),
|
|
628
|
+
"duration": ("INT", {"default": 12, "min": 2, "max": 12}),
|
|
629
|
+
"fps": (
|
|
630
|
+
[24],
|
|
631
|
+
{
|
|
632
|
+
"default": 24,
|
|
633
|
+
"tooltip": "帧率固定24",
|
|
634
|
+
},
|
|
635
|
+
),
|
|
636
|
+
"camerafixed": (
|
|
637
|
+
"BOOLEAN",
|
|
638
|
+
{
|
|
639
|
+
"default": False,
|
|
640
|
+
"tooltip": "平台可能在提示词中追加固定摄像机指令(效果不保证) ",
|
|
641
|
+
},
|
|
642
|
+
),
|
|
643
|
+
"generate_audio": (
|
|
644
|
+
"BOOLEAN",
|
|
645
|
+
{
|
|
646
|
+
"default": False,
|
|
647
|
+
"tooltip": "影响计费。控制生成的视频是否包含与画面同步的声音,Seedance 1.5 pro 能够基于文本提示词与视觉内容,自动生成与之匹配的人声、音效及背景音乐。建议将对话部分置于双引号内,以优化音频生成效果。例如:男人叫住女人说:“你记住,以后不可以用手指指月亮。”",
|
|
648
|
+
},
|
|
649
|
+
),
|
|
650
|
+
"seed": ("INT", {"default": -1, "min": -1, "max": 2147483647}),
|
|
651
|
+
},
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
def handle_inputs(self, headers, prompt_id, **kwargs):
|
|
655
|
+
model = kwargs.get("model", "doubao-seedance-1-5-pro-251215")
|
|
656
|
+
prompt = kwargs.get("prompt", "")
|
|
657
|
+
resolution = kwargs.get("resolution", "1080p")
|
|
658
|
+
ratio = kwargs.get("ratio", "adaptive")
|
|
659
|
+
duration = kwargs.get("duration", 12)
|
|
660
|
+
camerafixed = kwargs.get("camerafixed", False)
|
|
661
|
+
generate_audio = kwargs.get("generate_audio", False)
|
|
662
|
+
seed = kwargs.get("seed", -1)
|
|
663
|
+
if prompt is None or prompt.strip() == "":
|
|
664
|
+
raise ValueError("Prompt is required")
|
|
665
|
+
data = {
|
|
666
|
+
"prompt": prompt,
|
|
667
|
+
"model": model,
|
|
668
|
+
"resolution": resolution,
|
|
669
|
+
"ratio": ratio,
|
|
670
|
+
"duration": duration,
|
|
671
|
+
"camerafixed": camerafixed,
|
|
672
|
+
"seed": seed,
|
|
673
|
+
"watermark": False,
|
|
674
|
+
"fps": 24,
|
|
675
|
+
"generate_audio": generate_audio,
|
|
676
|
+
}
|
|
677
|
+
return data, "doubao-seedance-1-5-pro"
|
|
678
|
+
|
|
679
|
+
def handle_outputs(self, outputs):
|
|
680
|
+
return (outputs[0][0], "")
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
class Seedance_1_5_I2V_API(BizyAirTrdApiBaseNode):
|
|
684
|
+
RETURN_TYPES = (
|
|
685
|
+
"VIDEO",
|
|
686
|
+
"""{"doubao-seedance-1-5-pro-251215": "doubao-seedance-1-5-pro"}""",
|
|
687
|
+
)
|
|
688
|
+
RETURN_NAMES = ("video", "bizyair_model_name")
|
|
689
|
+
CATEGORY = "☁️BizyAir/External APIs/Doubao"
|
|
690
|
+
NODE_DISPLAY_NAME = "Seedance 1.5 Pro Image To Video"
|
|
691
|
+
|
|
692
|
+
@classmethod
|
|
693
|
+
def INPUT_TYPES(cls):
|
|
694
|
+
return {
|
|
695
|
+
"required": {
|
|
696
|
+
"first_frame_image": ("IMAGE",),
|
|
697
|
+
"prompt": (
|
|
698
|
+
"STRING",
|
|
699
|
+
{
|
|
700
|
+
"multiline": True,
|
|
701
|
+
"default": "",
|
|
702
|
+
},
|
|
703
|
+
),
|
|
704
|
+
"model": (
|
|
705
|
+
["doubao-seedance-1-5-pro-251215"],
|
|
706
|
+
{"default": "doubao-seedance-1-5-pro-251215"},
|
|
707
|
+
),
|
|
708
|
+
"resolution": (
|
|
709
|
+
["480p", "720p", "1080p"],
|
|
710
|
+
{
|
|
711
|
+
"default": "1080p",
|
|
712
|
+
"tooltip": "分辨率+比例共同决定视频尺寸,具体尺寸请参考官方文档说明",
|
|
713
|
+
},
|
|
714
|
+
),
|
|
715
|
+
"ratio": (
|
|
716
|
+
["16:9", "4:3", "1:1", "3:4", "9:16", "21:9", "adaptive"],
|
|
717
|
+
{
|
|
718
|
+
"default": "adaptive",
|
|
719
|
+
"tooltip": "比例+分辨率共同决定视频尺寸,具体尺寸请参考官方文档说明",
|
|
720
|
+
},
|
|
721
|
+
),
|
|
722
|
+
"duration": ("INT", {"default": 12, "min": 2, "max": 12}),
|
|
723
|
+
"fps": (
|
|
724
|
+
[24],
|
|
725
|
+
{
|
|
726
|
+
"default": 24,
|
|
727
|
+
"tooltip": "帧率固定24",
|
|
728
|
+
},
|
|
729
|
+
),
|
|
730
|
+
"camerafixed": (
|
|
731
|
+
"BOOLEAN",
|
|
732
|
+
{
|
|
733
|
+
"default": False,
|
|
734
|
+
"tooltip": "平台可能在提示词中追加固定摄像机指令(效果不保证) ",
|
|
735
|
+
},
|
|
736
|
+
),
|
|
737
|
+
"generate_audio": (
|
|
738
|
+
"BOOLEAN",
|
|
739
|
+
{
|
|
740
|
+
"default": False,
|
|
741
|
+
"tooltip": "影响计费。控制生成的视频是否包含与画面同步的声音,Seedance 1.5 pro 能够基于文本提示词与视觉内容,自动生成与之匹配的人声、音效及背景音乐。建议将对话部分置于双引号内,以优化音频生成效果。例如:男人叫住女人说:“你记住,以后不可以用手指指月亮。”",
|
|
742
|
+
},
|
|
743
|
+
),
|
|
744
|
+
"seed": ("INT", {"default": -1, "min": -1, "max": 2147483647}),
|
|
745
|
+
},
|
|
746
|
+
"optional": {
|
|
747
|
+
"last_frame_image": ("IMAGE",),
|
|
748
|
+
},
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
def handle_inputs(self, headers, prompt_id, **kwargs):
|
|
752
|
+
model = kwargs.get("model", "doubao-seedance-1-5-pro-251215")
|
|
753
|
+
prompt = kwargs.get("prompt", "")
|
|
754
|
+
resolution = kwargs.get("resolution", "1080p")
|
|
755
|
+
ratio = kwargs.get("ratio", "adaptive")
|
|
756
|
+
duration = kwargs.get("duration", 12)
|
|
757
|
+
camerafixed = kwargs.get("camerafixed", False)
|
|
758
|
+
generate_audio = kwargs.get("generate_audio", False)
|
|
759
|
+
seed = kwargs.get("seed", -1)
|
|
760
|
+
first_frame_image = kwargs.get("first_frame_image", None)
|
|
761
|
+
last_frame_image = kwargs.get("last_frame_image", None)
|
|
762
|
+
if first_frame_image is None:
|
|
763
|
+
raise ValueError("First frame image is required")
|
|
764
|
+
if (
|
|
765
|
+
last_frame_image is not None
|
|
766
|
+
and model == "doubao-seedance-1-0-pro-fast-251015"
|
|
767
|
+
):
|
|
768
|
+
raise ValueError(
|
|
769
|
+
"Last frame image is not supported for doubao-seedance-1-0-pro-fast-251015"
|
|
770
|
+
)
|
|
771
|
+
first_frame_image_url = self.upload_file(
|
|
772
|
+
tensor_to_bytesio(image=first_frame_image, total_pixels=4096 * 4096),
|
|
773
|
+
f"{prompt_id}_first.png",
|
|
774
|
+
headers,
|
|
775
|
+
)
|
|
776
|
+
data = {
|
|
777
|
+
"prompt": prompt,
|
|
778
|
+
"model": model,
|
|
779
|
+
"resolution": resolution,
|
|
780
|
+
"ratio": ratio,
|
|
781
|
+
"duration": duration,
|
|
782
|
+
"camerafixed": camerafixed,
|
|
783
|
+
"seed": seed,
|
|
784
|
+
"watermark": False,
|
|
785
|
+
"fps": 24,
|
|
786
|
+
"first_frame_image": first_frame_image_url,
|
|
787
|
+
"generate_audio": generate_audio,
|
|
788
|
+
}
|
|
789
|
+
if last_frame_image is not None:
|
|
790
|
+
last_frame_image_url = self.upload_file(
|
|
791
|
+
tensor_to_bytesio(image=last_frame_image, total_pixels=4096 * 4096),
|
|
792
|
+
f"{prompt_id}_last.png",
|
|
793
|
+
headers,
|
|
794
|
+
)
|
|
795
|
+
data["last_frame_image"] = last_frame_image_url
|
|
796
|
+
return data, "doubao-seedance-1-5-pro"
|
|
797
|
+
|
|
798
|
+
def handle_outputs(self, outputs):
|
|
799
|
+
return (outputs[0][0], "")
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import abc
|
|
2
|
+
import asyncio
|
|
2
3
|
import io
|
|
3
4
|
import json
|
|
4
5
|
import logging
|
|
5
6
|
import time
|
|
6
7
|
from typing import List, Tuple
|
|
7
8
|
|
|
8
|
-
import
|
|
9
|
+
import aiohttp
|
|
9
10
|
import torch
|
|
10
11
|
from bizyairsdk import bytesio_to_image_tensor, common_upscale
|
|
11
12
|
from comfy_api.latest._input_impl import VideoFromFile
|
|
@@ -16,7 +17,7 @@ from bizyengine.core import (
|
|
|
16
17
|
register_node,
|
|
17
18
|
)
|
|
18
19
|
from bizyengine.core.common import client
|
|
19
|
-
from bizyengine.core.common.client import send_request
|
|
20
|
+
from bizyengine.core.common.client import async_send_request, send_request
|
|
20
21
|
from bizyengine.core.common.env_var import BIZYAIR_X_SERVER
|
|
21
22
|
from bizyengine.core.nodes_base import PREFIX
|
|
22
23
|
|
|
@@ -45,24 +46,24 @@ class BizyAirTrdApiBaseNode(BizyAirMiscBaseNode, TrdBase):
|
|
|
45
46
|
super().__init_subclass__(**kwargs)
|
|
46
47
|
register_node(cls, PREFIX)
|
|
47
48
|
|
|
48
|
-
def api_call(self, **kwargs):
|
|
49
|
+
async def api_call(self, **kwargs):
|
|
49
50
|
extra_data = pop_api_key_and_prompt_id(kwargs)
|
|
50
51
|
headers = client.headers(api_key=extra_data["api_key"])
|
|
51
52
|
prompt_id = extra_data["prompt_id"]
|
|
52
53
|
headers["X-BIZYAIR-PROMPT-ID"] = prompt_id
|
|
53
54
|
|
|
54
55
|
data, model = self.handle_inputs(headers, prompt_id, **kwargs)
|
|
55
|
-
outputs = self.create_task_and_wait_for_completion(data, model, headers)
|
|
56
|
+
outputs = await self.create_task_and_wait_for_completion(data, model, headers)
|
|
56
57
|
return self.handle_outputs(outputs)
|
|
57
58
|
|
|
58
|
-
def create_task_and_wait_for_completion(
|
|
59
|
+
async def create_task_and_wait_for_completion(
|
|
59
60
|
self, data, model, headers
|
|
60
61
|
) -> Tuple[List[VideoFromFile], List[torch.Tensor], List[str]]:
|
|
61
62
|
# 创建任务
|
|
62
63
|
create_task_url = f"{BIZYAIR_X_SERVER}/trd_api/{model}"
|
|
63
64
|
json_payload = json.dumps(data).encode("utf-8")
|
|
64
65
|
logging.debug(f"json_payload: {json_payload}")
|
|
65
|
-
create_api_resp =
|
|
66
|
+
create_api_resp = await async_send_request(
|
|
66
67
|
url=create_task_url,
|
|
67
68
|
data=json_payload,
|
|
68
69
|
headers=headers,
|
|
@@ -73,6 +74,9 @@ class BizyAirTrdApiBaseNode(BizyAirMiscBaseNode, TrdBase):
|
|
|
73
74
|
|
|
74
75
|
# 检查任务创建是否成功
|
|
75
76
|
if "data" not in create_api_resp or "request_id" not in create_api_resp["data"]:
|
|
77
|
+
logging.error(
|
|
78
|
+
f"[BizyAir-Async] {self.NODE_DISPLAY_NAME} 任务创建失败: {create_api_resp}"
|
|
79
|
+
)
|
|
76
80
|
raise ValueError(f"Invalid response: {create_api_resp}")
|
|
77
81
|
|
|
78
82
|
# 轮询获取结果,最多等待1小时
|
|
@@ -80,32 +84,39 @@ class BizyAirTrdApiBaseNode(BizyAirMiscBaseNode, TrdBase):
|
|
|
80
84
|
logging.info(f"{self.NODE_DISPLAY_NAME} task created, request_id: {request_id}")
|
|
81
85
|
start_time = time.time()
|
|
82
86
|
status_url = f"{BIZYAIR_X_SERVER}/trd_api/{request_id}"
|
|
87
|
+
|
|
83
88
|
while time.time() - start_time < 3600:
|
|
84
|
-
|
|
89
|
+
await asyncio.sleep(10)
|
|
90
|
+
|
|
85
91
|
try:
|
|
86
|
-
status_api_resp =
|
|
92
|
+
status_api_resp = await async_send_request(
|
|
87
93
|
method="GET",
|
|
88
94
|
url=status_url,
|
|
89
95
|
headers=headers,
|
|
90
96
|
)
|
|
91
97
|
except Exception as e:
|
|
92
98
|
logging.error(
|
|
93
|
-
f"{self.NODE_DISPLAY_NAME} task {request_id} status api error: {e}"
|
|
99
|
+
f"[BizyAir-Async] {self.NODE_DISPLAY_NAME} task {request_id} status api error: {e}"
|
|
94
100
|
)
|
|
95
101
|
continue
|
|
96
102
|
|
|
97
103
|
if "data" not in status_api_resp:
|
|
98
104
|
logging.error(
|
|
99
|
-
f"{self.NODE_DISPLAY_NAME} task {request_id} status api resp no data: {status_api_resp}"
|
|
105
|
+
f"[BizyAir-Async] {self.NODE_DISPLAY_NAME} task {request_id} status api resp no data: {status_api_resp}"
|
|
100
106
|
)
|
|
101
107
|
continue
|
|
102
108
|
if "status" not in status_api_resp["data"]:
|
|
103
109
|
logging.error(
|
|
104
|
-
f"{self.NODE_DISPLAY_NAME} task {request_id} status api resp no status: {status_api_resp}"
|
|
110
|
+
f"[BizyAir-Async] {self.NODE_DISPLAY_NAME} task {request_id} status api resp no status: {status_api_resp}"
|
|
105
111
|
)
|
|
106
112
|
continue
|
|
107
113
|
status = status_api_resp["data"]["status"]
|
|
114
|
+
logging.debug(f"{self.NODE_DISPLAY_NAME} task {request_id} 状态: {status}")
|
|
115
|
+
|
|
108
116
|
if status == "failed":
|
|
117
|
+
logging.error(
|
|
118
|
+
f"[BizyAir-Async] {self.NODE_DISPLAY_NAME} task {request_id} 失败: {status_api_resp}"
|
|
119
|
+
)
|
|
109
120
|
raise ValueError(
|
|
110
121
|
f"{self.NODE_DISPLAY_NAME} task {request_id} failed: {status_api_resp}"
|
|
111
122
|
)
|
|
@@ -114,6 +125,9 @@ class BizyAirTrdApiBaseNode(BizyAirMiscBaseNode, TrdBase):
|
|
|
114
125
|
|
|
115
126
|
# 成功,获取输出结果
|
|
116
127
|
if "outputs" not in status_api_resp["data"]:
|
|
128
|
+
logging.error(
|
|
129
|
+
f"[BizyAir-Async] {self.NODE_DISPLAY_NAME} task {request_id} 无输出: {status_api_resp}"
|
|
130
|
+
)
|
|
117
131
|
raise ValueError(
|
|
118
132
|
f"{self.NODE_DISPLAY_NAME} task {request_id} no outputs: {status_api_resp}"
|
|
119
133
|
)
|
|
@@ -126,24 +140,31 @@ class BizyAirTrdApiBaseNode(BizyAirMiscBaseNode, TrdBase):
|
|
|
126
140
|
texts = []
|
|
127
141
|
outputs = status_api_resp["data"]["outputs"]
|
|
128
142
|
try:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
videos
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
)
|
|
143
|
+
async with aiohttp.ClientSession(
|
|
144
|
+
timeout=aiohttp.ClientTimeout(total=3600)
|
|
145
|
+
) as session:
|
|
146
|
+
if "videos" in outputs:
|
|
147
|
+
for idx, video_url in enumerate(outputs["videos"]):
|
|
148
|
+
async with session.get(video_url) as video_resp:
|
|
149
|
+
video_resp.raise_for_status()
|
|
150
|
+
video_content = await video_resp.read()
|
|
151
|
+
videos.append(VideoFromFile(io.BytesIO(video_content)))
|
|
152
|
+
|
|
153
|
+
if "images" in outputs:
|
|
154
|
+
for idx, image_url in enumerate(outputs["images"]):
|
|
155
|
+
async with session.get(image_url) as image_resp:
|
|
156
|
+
image_resp.raise_for_status()
|
|
157
|
+
image_content = await image_resp.read()
|
|
158
|
+
images.append(
|
|
159
|
+
bytesio_to_image_tensor(io.BytesIO(image_content))
|
|
160
|
+
)
|
|
161
|
+
|
|
141
162
|
if "texts" in outputs:
|
|
142
163
|
for text in outputs["texts"]:
|
|
143
164
|
texts.append(text)
|
|
144
165
|
except Exception as e:
|
|
145
166
|
logging.error(
|
|
146
|
-
f"{self.NODE_DISPLAY_NAME} task {request_id} handle outputs error: {e}"
|
|
167
|
+
f"[BizyAir-Async] {self.NODE_DISPLAY_NAME} task {request_id} handle outputs error: {e}"
|
|
147
168
|
)
|
|
148
169
|
raise ValueError(
|
|
149
170
|
f"{self.NODE_DISPLAY_NAME} task {request_id} handle outputs error: {e}, please download the outputs manually, outputs: {outputs}"
|
|
@@ -151,6 +172,9 @@ class BizyAirTrdApiBaseNode(BizyAirMiscBaseNode, TrdBase):
|
|
|
151
172
|
|
|
152
173
|
return (videos, images, texts)
|
|
153
174
|
|
|
175
|
+
logging.error(
|
|
176
|
+
f"[BizyAir-Async] {self.NODE_DISPLAY_NAME} task {request_id} 超时"
|
|
177
|
+
)
|
|
154
178
|
raise ValueError(
|
|
155
179
|
f"{self.NODE_DISPLAY_NAME} task timed out, request ID: {request_id}"
|
|
156
180
|
)
|
bizyengine/core/common/client.py
CHANGED
|
@@ -250,38 +250,33 @@ async def async_send_request(
|
|
|
250
250
|
**kwargs,
|
|
251
251
|
) -> dict:
|
|
252
252
|
headers = kwargs.pop("headers") if "headers" in kwargs else _headers()
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
return json.loads(response_data)
|
|
279
|
-
|
|
280
|
-
logging.error(f"Error fetching data: {e}")
|
|
281
|
-
return {}
|
|
282
|
-
except Exception as e:
|
|
283
|
-
logging.error(f"Error fetching data: {str(e)}")
|
|
284
|
-
return {}
|
|
253
|
+
async with aiohttp.ClientSession(
|
|
254
|
+
timeout=aiohttp.ClientTimeout(total=600)
|
|
255
|
+
) as session:
|
|
256
|
+
async with session.request(
|
|
257
|
+
method, url, data=data, headers=headers, **kwargs
|
|
258
|
+
) as response:
|
|
259
|
+
response_data = await response.text()
|
|
260
|
+
if response.status != 200:
|
|
261
|
+
error_message = (
|
|
262
|
+
f"HTTP Status {response.status}, response body: {response_data}"
|
|
263
|
+
)
|
|
264
|
+
logging.error(f"Error encountered: {error_message}")
|
|
265
|
+
if response.status == 401:
|
|
266
|
+
raise PermissionError(
|
|
267
|
+
"Key is invalid, please refer to https://cloud.siliconflow.cn to get the API key.\n"
|
|
268
|
+
"If you have the key, please click the 'BizyAir Key' button at the bottom right to set the key."
|
|
269
|
+
)
|
|
270
|
+
else:
|
|
271
|
+
raise ConnectionError(
|
|
272
|
+
f"Failed to connect to the server: {error_message}.\n"
|
|
273
|
+
+ "Please check your API key and ensure the server is reachable.\n"
|
|
274
|
+
+ "Also, verify your network settings and disable any proxies if necessary.\n"
|
|
275
|
+
+ "After checking, please restart the ComfyUI service."
|
|
276
|
+
)
|
|
277
|
+
if callback:
|
|
278
|
+
return callback(json.loads(response_data))
|
|
279
|
+
return json.loads(response_data)
|
|
285
280
|
|
|
286
281
|
|
|
287
282
|
def fetch_models_by_type(
|
bizyengine/core/nodes_base.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import importlib
|
|
2
|
+
import inspect
|
|
2
3
|
import logging
|
|
3
4
|
import warnings
|
|
4
5
|
from functools import wraps
|
|
@@ -117,13 +118,28 @@ def register_node(cls, prefix):
|
|
|
117
118
|
|
|
118
119
|
|
|
119
120
|
def ensure_unique_id(org_func, original_has_unique_id=False):
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
# 检测原函数是否是异步函数
|
|
122
|
+
is_async = inspect.iscoroutinefunction(org_func)
|
|
123
|
+
|
|
124
|
+
if is_async:
|
|
125
|
+
# 异步函数包装
|
|
126
|
+
@wraps(org_func)
|
|
127
|
+
async def new_func(self, **kwargs):
|
|
128
|
+
if original_has_unique_id:
|
|
129
|
+
self._assigned_id = kwargs.get("unique_id", "UNIQUE_ID")
|
|
130
|
+
elif "unique_id" in kwargs:
|
|
131
|
+
self._assigned_id = kwargs.pop("unique_id")
|
|
132
|
+
return await org_func(self, **kwargs)
|
|
133
|
+
|
|
134
|
+
else:
|
|
135
|
+
# 同步函数包装(保持原有逻辑)
|
|
136
|
+
@wraps(org_func)
|
|
137
|
+
def new_func(self, **kwargs):
|
|
138
|
+
if original_has_unique_id:
|
|
139
|
+
self._assigned_id = kwargs.get("unique_id", "UNIQUE_ID")
|
|
140
|
+
elif "unique_id" in kwargs:
|
|
141
|
+
self._assigned_id = kwargs.pop("unique_id")
|
|
142
|
+
return org_func(self, **kwargs)
|
|
127
143
|
|
|
128
144
|
return new_func
|
|
129
145
|
|
bizyengine/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.2.
|
|
1
|
+
1.2.81
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bizyengine
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.81
|
|
4
4
|
Summary: [a/BizyAir](https://github.com/siliconflow/BizyAir) Comfy Nodes that can run in any environment.
|
|
5
5
|
Author-email: SiliconFlow <yaochi@siliconflow.cn>
|
|
6
6
|
Project-URL: Repository, https://github.com/siliconflow/BizyAir
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
bizyengine/__init__.py,sha256=GP9V-JM07fz7uv_qTB43QEA2rKdrVJxi5I7LRnn_3ZQ,914
|
|
2
|
-
bizyengine/version.txt,sha256=
|
|
2
|
+
bizyengine/version.txt,sha256=BIxqlk4qFX0rTxoaGz3szRCvEYArsAjvUAs_-d5c1oU,6
|
|
3
3
|
bizyengine/bizy_server/__init__.py,sha256=SP9oSblnPo4KQyh7yOGD26YCskFAcQHAZy04nQBNRIw,200
|
|
4
4
|
bizyengine/bizy_server/api_client.py,sha256=vNBUkFNMjPI_F_wAGiN-ydCZO8oLdgyWBlMY1DQbHOk,43685
|
|
5
5
|
bizyengine/bizy_server/errno.py,sha256=8dzmtlqq0wBJguHAXKEDb_uUYUQ7qlZQK6FxOpMxqLg,17328
|
|
@@ -46,7 +46,7 @@ bizyengine/bizyair_extras/nodes_ipadapter_plus/nodes_ipadapter_plus.py,sha256=lO
|
|
|
46
46
|
bizyengine/bizyair_extras/nodes_kolors_mz/__init__.py,sha256=HsCCCphW8q0SrWEiFlZKK_W2lQr1T0UJIJL7gEn37ME,3729
|
|
47
47
|
bizyengine/bizyair_extras/oauth_callback/main.py,sha256=KQOZWor3kyNx8xvUNHYNMoHfCF9g_ht13_iPk4K_5YM,3633
|
|
48
48
|
bizyengine/bizyair_extras/third_party_api/__init__.py,sha256=jAZrTdBSVg3TielWoAUWUqWonBwoKZQ-jLQ07JzOHx8,339
|
|
49
|
-
bizyengine/bizyair_extras/third_party_api/nodes_doubao.py,sha256=
|
|
49
|
+
bizyengine/bizyair_extras/third_party_api/nodes_doubao.py,sha256=TrFDCRkyF6LRJ2QxRmlqiIX_ebeHI5KvKWpVfQxa3Qg,30256
|
|
50
50
|
bizyengine/bizyair_extras/third_party_api/nodes_flux.py,sha256=iv9V7-ijKGgR5_n8BlIe4E7QjWSGvWkIIUDMOn_3t1s,6339
|
|
51
51
|
bizyengine/bizyair_extras/third_party_api/nodes_gemini.py,sha256=tRjAGNJsJkYPXhlBREJd3jxPr4lF533Q_XMMHNIeXNM,17910
|
|
52
52
|
bizyengine/bizyair_extras/third_party_api/nodes_gpt.py,sha256=IwIvMiKU1h917w42NNCXM7o7VF1Bjm7hPEhwGeWGTOw,3220
|
|
@@ -56,7 +56,7 @@ bizyengine/bizyair_extras/third_party_api/nodes_sora.py,sha256=_-O37uRi5QHqJZqlJ
|
|
|
56
56
|
bizyengine/bizyair_extras/third_party_api/nodes_veo3.py,sha256=LzZl-9iLMe5IzEAXYUVkb8RUPLAfZloTPxRgGcY7Hsg,6703
|
|
57
57
|
bizyengine/bizyair_extras/third_party_api/nodes_vidu.py,sha256=-Eo2su0-t9qNPa5J4Qt3fx8xM9NjFHmgl19gMcTU7nM,10012
|
|
58
58
|
bizyengine/bizyair_extras/third_party_api/nodes_wan_api.py,sha256=GNc616NNsXcZYtojO2XTHwU3AFiprX6tFJ7qu3s2jgc,14508
|
|
59
|
-
bizyengine/bizyair_extras/third_party_api/trd_nodes_base.py,sha256=
|
|
59
|
+
bizyengine/bizyair_extras/third_party_api/trd_nodes_base.py,sha256=TeT6orrXv-G8sHzR9q8HqC4hPEgsbtUOJYJpX6-aM1g,9061
|
|
60
60
|
bizyengine/bizyair_extras/utils/aliyun_oss.py,sha256=H6wGZq1DqP7BHJ_frBJVvUVttgXprJprOnxytePIuos,3050
|
|
61
61
|
bizyengine/bizyair_extras/utils/audio.py,sha256=cCmX080jtxsHFa7mCgn13R6cyfqE-1Gq37ZnRJdZNU8,3183
|
|
62
62
|
bizyengine/bizybot/__init__.py,sha256=NINN_7QECKQwtAwKPBTrrSiAK6KbxaZCkIvJ-e1J1xk,262
|
|
@@ -73,7 +73,7 @@ bizyengine/bizybot/mcp/routing.py,sha256=COgeao02y-oIiHpcXEZGl2cccgcR1u343BEcJ95
|
|
|
73
73
|
bizyengine/core/__init__.py,sha256=EygpO-kvl5-4rk44rP8_s0GBDd_TF7FMvrl2exBSWWM,378
|
|
74
74
|
bizyengine/core/data_types.py,sha256=2f7QqqZvhKmXw3kZV1AvXuPTda34b4wXQE9tyO8nUSM,1595
|
|
75
75
|
bizyengine/core/image_utils.py,sha256=vJt42FcEDD8-fQumuogZM1XXwgYseSQ79_9Qzu9YTQk,409
|
|
76
|
-
bizyengine/core/nodes_base.py,sha256=
|
|
76
|
+
bizyengine/core/nodes_base.py,sha256=tq6TZpko3SxdnCasMoRxoI1qSFmMPTxaONNgx7bOo48,9679
|
|
77
77
|
bizyengine/core/nodes_io.py,sha256=VhwRwYkGp0g3Mh0hx1OSwNZbV06NEV13w2aODSiAm5M,2832
|
|
78
78
|
bizyengine/core/commands/__init__.py,sha256=82yRdMT23RTiZPkFW_G3fVa-fj3-TUAXnj6cnGA3xRA,22
|
|
79
79
|
bizyengine/core/commands/base.py,sha256=TYH9lhr033B2roBLPkWkxcvoz_fW3cdzx_bvP_FI7dg,635
|
|
@@ -84,7 +84,7 @@ bizyengine/core/commands/servers/model_server.py,sha256=47DEQpj8HBSa-_TImW-5JCeu
|
|
|
84
84
|
bizyengine/core/commands/servers/prompt_server.py,sha256=5R4a5EU5z5lqGNoDlGRtUGGHRojFWAtm3rdslqxpebU,11366
|
|
85
85
|
bizyengine/core/common/__init__.py,sha256=GicZw6YeAZk1PsKmFDt9dm1F75zPUlpia9Q_ki5vW1Y,179
|
|
86
86
|
bizyengine/core/common/caching.py,sha256=hRNsSrfNxgc1zzvBzLVjMY0iMkKqA0TBCr-iYhEpzik,6946
|
|
87
|
-
bizyengine/core/common/client.py,sha256=
|
|
87
|
+
bizyengine/core/common/client.py,sha256=CXhcNALGae1lLt5OhPvMg7RUhzgMz8ClFPYoiy6H22g,10394
|
|
88
88
|
bizyengine/core/common/env_var.py,sha256=1EAW3gOXY2bKouCqrGa583vTJRdDasQ1IsFTnzDg7Dk,3450
|
|
89
89
|
bizyengine/core/common/utils.py,sha256=Jxk4tCURbUhjYBFuHTiQgeUo2w13TYj4upnPTKNNucM,4215
|
|
90
90
|
bizyengine/core/configs/conf.py,sha256=D_UWG9SSJnK5EhbrfNFryJQ8hUwwdvhOGlq1TielwpI,3830
|
|
@@ -104,7 +104,7 @@ bizyengine/misc/route_sam.py,sha256=-bMIR2QalfnszipGxSxvDAHGJa5gPSrjkYPb5baaRg4,
|
|
|
104
104
|
bizyengine/misc/segment_anything.py,sha256=wNKYwlYPMszfwj23524geFZJjZaG4eye65SGaUnh77I,8941
|
|
105
105
|
bizyengine/misc/supernode.py,sha256=STN9gaxfTSErH8OiHeZa47d8z-G9S0I7fXuJvHQOBFM,4532
|
|
106
106
|
bizyengine/misc/utils.py,sha256=GMRWKhOP-MCueVyCO-doflb7dH5dM32DyLcSPEVOXWA,13333
|
|
107
|
-
bizyengine-1.2.
|
|
108
|
-
bizyengine-1.2.
|
|
109
|
-
bizyengine-1.2.
|
|
110
|
-
bizyengine-1.2.
|
|
107
|
+
bizyengine-1.2.81.dist-info/METADATA,sha256=gjscZH-NEPlq8K8hNENZabddgt27l3uqdYSNAhr6zGE,735
|
|
108
|
+
bizyengine-1.2.81.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
109
|
+
bizyengine-1.2.81.dist-info/top_level.txt,sha256=2zapzqxX-we5cRyJkGf9bd5JinRtXp3-_uDI-xCAnc0,11
|
|
110
|
+
bizyengine-1.2.81.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|