bizyengine 1.2.5__py3-none-any.whl → 1.2.7__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 +24 -12
- bizyengine/bizyair_extras/__init__.py +1 -0
- bizyengine/bizyair_extras/nodes_wan_i2v.py +222 -0
- bizyengine/version.txt +1 -1
- {bizyengine-1.2.5.dist-info → bizyengine-1.2.7.dist-info}/METADATA +1 -1
- {bizyengine-1.2.5.dist-info → bizyengine-1.2.7.dist-info}/RECORD +8 -7
- {bizyengine-1.2.5.dist-info → bizyengine-1.2.7.dist-info}/WHEEL +1 -1
- {bizyengine-1.2.5.dist-info → bizyengine-1.2.7.dist-info}/top_level.txt +0 -0
|
@@ -65,13 +65,16 @@ class APIClient:
|
|
|
65
65
|
async with session.get(url, headers=headers) as response:
|
|
66
66
|
resp_json = await response.json()
|
|
67
67
|
if response.status != 200:
|
|
68
|
+
isJson = isinstance(resp_json, dict)
|
|
68
69
|
return None, ErrorNo(
|
|
69
70
|
response.status,
|
|
70
|
-
resp_json.get("code", response.status),
|
|
71
|
+
resp_json.get("code", response.status) if isJson else resp_json,
|
|
71
72
|
None,
|
|
72
73
|
{
|
|
73
|
-
user_profile.getLang():
|
|
74
|
-
"message", await response.text()
|
|
74
|
+
user_profile.getLang(): (
|
|
75
|
+
resp_json.get("message", await response.text())
|
|
76
|
+
if isJson
|
|
77
|
+
else resp_json
|
|
75
78
|
)
|
|
76
79
|
},
|
|
77
80
|
)
|
|
@@ -82,13 +85,16 @@ class APIClient:
|
|
|
82
85
|
async with session.post(url, json=data, headers=headers) as response:
|
|
83
86
|
resp_json = await response.json()
|
|
84
87
|
if response.status != 200:
|
|
88
|
+
isJson = isinstance(resp_json, dict)
|
|
85
89
|
return None, ErrorNo(
|
|
86
90
|
response.status,
|
|
87
|
-
resp_json.get("code", response.status),
|
|
91
|
+
resp_json.get("code", response.status) if isJson else resp_json,
|
|
88
92
|
None,
|
|
89
93
|
{
|
|
90
|
-
user_profile.getLang():
|
|
91
|
-
"message", await response.text()
|
|
94
|
+
user_profile.getLang(): (
|
|
95
|
+
resp_json.get("message", await response.text())
|
|
96
|
+
if isJson
|
|
97
|
+
else resp_json
|
|
92
98
|
)
|
|
93
99
|
},
|
|
94
100
|
)
|
|
@@ -99,13 +105,16 @@ class APIClient:
|
|
|
99
105
|
async with session.put(url, json=data, headers=headers) as response:
|
|
100
106
|
resp_json = await response.json()
|
|
101
107
|
if response.status != 200:
|
|
108
|
+
isJson = isinstance(resp_json, dict)
|
|
102
109
|
return None, ErrorNo(
|
|
103
110
|
response.status,
|
|
104
|
-
resp_json.get("code", response.status),
|
|
111
|
+
resp_json.get("code", response.status) if isJson else resp_json,
|
|
105
112
|
None,
|
|
106
113
|
{
|
|
107
|
-
user_profile.getLang():
|
|
108
|
-
"message", await response.text()
|
|
114
|
+
user_profile.getLang(): (
|
|
115
|
+
resp_json.get("message", await response.text())
|
|
116
|
+
if isJson
|
|
117
|
+
else resp_json
|
|
109
118
|
)
|
|
110
119
|
},
|
|
111
120
|
)
|
|
@@ -116,13 +125,16 @@ class APIClient:
|
|
|
116
125
|
async with session.delete(url, json=data, headers=headers) as response:
|
|
117
126
|
resp_json = await response.json()
|
|
118
127
|
if response.status != 200:
|
|
128
|
+
isJson = isinstance(resp_json, dict)
|
|
119
129
|
return None, ErrorNo(
|
|
120
130
|
response.status,
|
|
121
|
-
resp_json.get("code", response.status),
|
|
131
|
+
resp_json.get("code", response.status) if isJson else resp_json,
|
|
122
132
|
None,
|
|
123
133
|
{
|
|
124
|
-
user_profile.getLang():
|
|
125
|
-
"message", await response.text()
|
|
134
|
+
user_profile.getLang(): (
|
|
135
|
+
resp_json.get("message", await response.text())
|
|
136
|
+
if isJson
|
|
137
|
+
else resp_json
|
|
126
138
|
)
|
|
127
139
|
},
|
|
128
140
|
)
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import time
|
|
3
|
+
import warnings
|
|
4
|
+
|
|
5
|
+
import requests
|
|
6
|
+
|
|
7
|
+
try:
|
|
8
|
+
from comfy_api_nodes.apinode_utils import (
|
|
9
|
+
download_url_to_video_output,
|
|
10
|
+
tensor_to_base64_string,
|
|
11
|
+
)
|
|
12
|
+
except ModuleNotFoundError as e:
|
|
13
|
+
download_url_to_video_output = None
|
|
14
|
+
tensor_to_base64_string = None
|
|
15
|
+
|
|
16
|
+
ERROR_MSG = f"Error {e} ComfyUI API nodes module not found. Please ensure you have ComfyUI version 0.3.36 or later installed."
|
|
17
|
+
|
|
18
|
+
warnings.warn(ERROR_MSG)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
from ..core.common import client
|
|
22
|
+
from ..core.common.env_var import BIZYAIR_DEBUG
|
|
23
|
+
from ..core.nodes_base import BizyAirBaseNode
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class WanApiNodeBase:
|
|
27
|
+
MODEL_ENDPOINTS = {
|
|
28
|
+
"Wan-AI/Wan2.1-I2V-14B-480P-Diffusers": "https://bizyair-api.siliconflow.cn/x/v1/supernode/faas-wan-i2v-14b-480p-server"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class Wan_LoraLoader(BizyAirBaseNode):
|
|
33
|
+
|
|
34
|
+
@classmethod
|
|
35
|
+
def INPUT_TYPES(cls):
|
|
36
|
+
return {
|
|
37
|
+
"required": {
|
|
38
|
+
"lora_name": (
|
|
39
|
+
"STRING",
|
|
40
|
+
{
|
|
41
|
+
"multiline": True,
|
|
42
|
+
"default": "https://huggingface.co/Remade-AI/Squish/resolve/main/squish_18.safetensors",
|
|
43
|
+
"tooltip": "LoRA 模型下载地址",
|
|
44
|
+
},
|
|
45
|
+
),
|
|
46
|
+
},
|
|
47
|
+
"optional": {
|
|
48
|
+
"lora_weight": (
|
|
49
|
+
"FLOAT",
|
|
50
|
+
{
|
|
51
|
+
"default": 1,
|
|
52
|
+
"min": 0.0,
|
|
53
|
+
"max": 1.0,
|
|
54
|
+
"step": 0.05,
|
|
55
|
+
"tooltip": "LoRA权重强度",
|
|
56
|
+
},
|
|
57
|
+
)
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
RETURN_TYPES = ("LORA_CONFIG",)
|
|
62
|
+
RETURN_NAMES = ("lora_config",)
|
|
63
|
+
FUNCTION = "apply_lora"
|
|
64
|
+
CATEGORY = "Diffusers/WAN Video Generation"
|
|
65
|
+
|
|
66
|
+
def apply_lora(self, lora_name, lora_weight=0.75):
|
|
67
|
+
return ([(lora_name, lora_weight)],)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class Wan_ImageToVideoPipeline(WanApiNodeBase, BizyAirBaseNode):
|
|
71
|
+
|
|
72
|
+
POLLING_INTERVAL = 10 # sec
|
|
73
|
+
MAX_POLLING_TIME = 60 * 20 # sec
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def INPUT_TYPES(s):
|
|
77
|
+
return {
|
|
78
|
+
"required": {
|
|
79
|
+
"image": (
|
|
80
|
+
"IMAGE",
|
|
81
|
+
{
|
|
82
|
+
"default": None,
|
|
83
|
+
"tooltip": "Optional reference image to guide video generation",
|
|
84
|
+
},
|
|
85
|
+
),
|
|
86
|
+
"model_id": (["Wan-AI/Wan2.1-I2V-14B-480P-Diffusers"],),
|
|
87
|
+
"prompt": (
|
|
88
|
+
"STRING",
|
|
89
|
+
{
|
|
90
|
+
"multiline": True,
|
|
91
|
+
"default": "",
|
|
92
|
+
"tooltip": "Text description of the video",
|
|
93
|
+
},
|
|
94
|
+
),
|
|
95
|
+
},
|
|
96
|
+
"optional": {
|
|
97
|
+
"negative_prompt": (
|
|
98
|
+
"STRING",
|
|
99
|
+
{
|
|
100
|
+
"multiline": True,
|
|
101
|
+
"default": "",
|
|
102
|
+
"tooltip": "Negative text prompt to guide what to avoid in the video",
|
|
103
|
+
},
|
|
104
|
+
),
|
|
105
|
+
"steps": ("INT", {"default": 30, "min": 1, "max": 40}),
|
|
106
|
+
"cfg": (
|
|
107
|
+
"FLOAT",
|
|
108
|
+
{
|
|
109
|
+
"default": 6.0,
|
|
110
|
+
"min": 0.0,
|
|
111
|
+
"max": 100.0,
|
|
112
|
+
"step": 0.1,
|
|
113
|
+
"round": 0.01,
|
|
114
|
+
},
|
|
115
|
+
),
|
|
116
|
+
"seed": (
|
|
117
|
+
"INT",
|
|
118
|
+
{
|
|
119
|
+
"default": 0,
|
|
120
|
+
"min": 0,
|
|
121
|
+
"max": 0xFFFFFFFF,
|
|
122
|
+
"step": 1,
|
|
123
|
+
"display": "number",
|
|
124
|
+
"control_after_generate": True,
|
|
125
|
+
"tooltip": "Seed for video generation (0 for random)",
|
|
126
|
+
},
|
|
127
|
+
),
|
|
128
|
+
"use_teacache": (["enable", "disable"],),
|
|
129
|
+
"lora_config": ("LORA_CONFIG", {}),
|
|
130
|
+
},
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
RETURN_TYPES = ("VIDEO",)
|
|
134
|
+
|
|
135
|
+
FUNCTION = "generate_video"
|
|
136
|
+
CATEGORY = "Diffusers/WAN Video Generation"
|
|
137
|
+
|
|
138
|
+
def _encode_image(self, image_tensor):
|
|
139
|
+
# https://docs.comfy.org/custom-nodes/backend/snippets
|
|
140
|
+
tensor_to_base64_string(image_tensor=image_tensor, mime_type="image/webp")
|
|
141
|
+
base64_str = "data:image/webp;base64," + tensor_to_base64_string(
|
|
142
|
+
image_tensor=image_tensor, mime_type="image/webp"
|
|
143
|
+
)
|
|
144
|
+
return base64_str
|
|
145
|
+
|
|
146
|
+
def _prepare_headers(self):
|
|
147
|
+
headers = client._headers()
|
|
148
|
+
headers["X-Fn-Task-Mode"] = "non-blocking"
|
|
149
|
+
return headers
|
|
150
|
+
|
|
151
|
+
def _send_initial_request(self, endpoint, request_data):
|
|
152
|
+
headers = self._prepare_headers()
|
|
153
|
+
response = client.send_request(
|
|
154
|
+
url=endpoint,
|
|
155
|
+
data=json.dumps({"prompt": request_data}).encode(),
|
|
156
|
+
headers=headers,
|
|
157
|
+
)
|
|
158
|
+
return response["query_url"]
|
|
159
|
+
|
|
160
|
+
def _poll_for_completion(self, query_url):
|
|
161
|
+
start_time = time.time()
|
|
162
|
+
headers = self._prepare_headers()
|
|
163
|
+
|
|
164
|
+
while time.time() - start_time < self.MAX_POLLING_TIME:
|
|
165
|
+
response = requests.get(query_url, headers=headers)
|
|
166
|
+
try:
|
|
167
|
+
response_data = response.json()
|
|
168
|
+
if response_data["data_status"] == "COMPLETED":
|
|
169
|
+
return response_data
|
|
170
|
+
time.sleep(self.POLLING_INTERVAL)
|
|
171
|
+
except (json.JSONDecodeError, KeyError) as e:
|
|
172
|
+
if BIZYAIR_DEBUG:
|
|
173
|
+
print(
|
|
174
|
+
f"Response parsing error: {e} | Raw response: {response.text}"
|
|
175
|
+
)
|
|
176
|
+
time.sleep(self.POLLING_INTERVAL)
|
|
177
|
+
|
|
178
|
+
raise TimeoutError("Task processing timeout")
|
|
179
|
+
|
|
180
|
+
def _process_result(self, result_data):
|
|
181
|
+
video_url = result_data["data"]["payload"]
|
|
182
|
+
return (download_url_to_video_output(video_url),)
|
|
183
|
+
|
|
184
|
+
def generate_video(
|
|
185
|
+
self,
|
|
186
|
+
model_id: str,
|
|
187
|
+
prompt: str,
|
|
188
|
+
negative_prompt: str = "",
|
|
189
|
+
seed: int = 0,
|
|
190
|
+
image=None,
|
|
191
|
+
lora_config=[],
|
|
192
|
+
use_teacache="enable",
|
|
193
|
+
**kwargs,
|
|
194
|
+
):
|
|
195
|
+
if download_url_to_video_output is None or tensor_to_base64_string is None:
|
|
196
|
+
raise ImportError(ERROR_MSG)
|
|
197
|
+
|
|
198
|
+
req_dict = {}
|
|
199
|
+
req_dict["guidance_scale"] = kwargs.pop("cfg", 6.0)
|
|
200
|
+
req_dict["num_inference_steps"] = kwargs.pop("steps", 30)
|
|
201
|
+
req_dict["prompt"] = prompt
|
|
202
|
+
req_dict["negative_prompt"] = negative_prompt
|
|
203
|
+
req_dict["seed"] = seed
|
|
204
|
+
if lora_config:
|
|
205
|
+
if len(lora_config) > 1:
|
|
206
|
+
raise NotImplementedError(f"TODO, tmp only support one lora")
|
|
207
|
+
req_dict["lora_name_list"] = [x[0] for x in lora_config]
|
|
208
|
+
req_dict["lora_weight_list"] = [x[1] for x in lora_config]
|
|
209
|
+
else:
|
|
210
|
+
req_dict["lora_name_list"] = []
|
|
211
|
+
req_dict["lora_weight_list"] = []
|
|
212
|
+
|
|
213
|
+
if use_teacache == "enable":
|
|
214
|
+
req_dict["teacache"] = 0.3
|
|
215
|
+
else:
|
|
216
|
+
req_dict["teacache"] = 0
|
|
217
|
+
|
|
218
|
+
req_dict["image"] = self._encode_image(image_tensor=image)
|
|
219
|
+
endpoint = self.MODEL_ENDPOINTS[model_id]
|
|
220
|
+
query_url = self._send_initial_request(endpoint, request_data=req_dict)
|
|
221
|
+
result = self._poll_for_completion(query_url)
|
|
222
|
+
return self._process_result(result)
|
bizyengine/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.2.
|
|
1
|
+
1.2.7
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bizyengine
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.7
|
|
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,7 +1,7 @@
|
|
|
1
1
|
bizyengine/__init__.py,sha256=GP9V-JM07fz7uv_qTB43QEA2rKdrVJxi5I7LRnn_3ZQ,914
|
|
2
|
-
bizyengine/version.txt,sha256=
|
|
2
|
+
bizyengine/version.txt,sha256=2ejoQpxqfQuWXk-sJqXv_3ED8FX6qYzOtb1HMf0kYDo,6
|
|
3
3
|
bizyengine/bizy_server/__init__.py,sha256=SP9oSblnPo4KQyh7yOGD26YCskFAcQHAZy04nQBNRIw,200
|
|
4
|
-
bizyengine/bizy_server/api_client.py,sha256=
|
|
4
|
+
bizyengine/bizy_server/api_client.py,sha256=urdV6GBXRcm-i3yNzjLKQoiN_5CC66Fd1QzXCGSa9CE,40496
|
|
5
5
|
bizyengine/bizy_server/errno.py,sha256=nEr_A6ARwgIwlr1PFP8eg-HNAzz9r7l00fTKaq-ipxM,15826
|
|
6
6
|
bizyengine/bizy_server/error_handler.py,sha256=MGrfO1AEqbfEgMWPL8B6Ypew_zHiQAdYGlhN9bZohrY,167
|
|
7
7
|
bizyengine/bizy_server/execution.py,sha256=ayaEf6eGJKQsVZV-1_UlGlvwwmlH7FEek31Uq-MbUjA,1644
|
|
@@ -10,7 +10,7 @@ bizyengine/bizy_server/resp.py,sha256=iOFT5Ud7VJBP2uqkojJIgc3y2ifMjjEXoj0ewneL9l
|
|
|
10
10
|
bizyengine/bizy_server/server.py,sha256=V67smRHnVRy_vS4o3D1_uSO7to5_3ie8gVEvcIlj6QU,46439
|
|
11
11
|
bizyengine/bizy_server/stream_response.py,sha256=H2XHqlVRtQMhgdztAuG7l8-iV_Pm42u2x6WJ0gNVIW0,9654
|
|
12
12
|
bizyengine/bizy_server/utils.py,sha256=C5tnMhvdtrrvwuCex3oERIGWrTWVb5dkXD1Txb5sJaE,2568
|
|
13
|
-
bizyengine/bizyair_extras/__init__.py,sha256=
|
|
13
|
+
bizyengine/bizyair_extras/__init__.py,sha256=oaKC7QzFbgJ_BWuc3o05gmIq-8ZhUB7VEzYXnlWjGv8,951
|
|
14
14
|
bizyengine/bizyair_extras/nodes_advanced_refluxcontrol.py,sha256=cecfjrtnjJAty9aNkhz8BlmHUC1NImkFlUDiA0COEa4,2242
|
|
15
15
|
bizyengine/bizyair_extras/nodes_cogview4.py,sha256=Ni0TDOycczyDhYPvSR68TxGV_wE2uhaxd8MIj-J4-3o,2031
|
|
16
16
|
bizyengine/bizyair_extras/nodes_comfyui_detail_daemon.py,sha256=i71it24tiGvZ3h-XFWISr4CpZszUtPuz3UrZARYluLk,6169
|
|
@@ -34,6 +34,7 @@ bizyengine/bizyair_extras/nodes_testing_utils.py,sha256=qeJHlSq-c21Vx8H0oZw878Q0
|
|
|
34
34
|
bizyengine/bizyair_extras/nodes_trellis.py,sha256=QU2dQsN_zKA91vTVtR4Af4kJXDJA8CDSf1PyIu_ywZc,7421
|
|
35
35
|
bizyengine/bizyair_extras/nodes_ultimatesdupscale.py,sha256=6IZCDZ_9PhrKwJzCZGvKNxcRYwwkPRMNovF17nwzFqw,4130
|
|
36
36
|
bizyengine/bizyair_extras/nodes_upscale_model.py,sha256=lrzA1BFI2w5aEPCmNPMh07s-WDzG-xTT49uU6WCnlP8,1151
|
|
37
|
+
bizyengine/bizyair_extras/nodes_wan_i2v.py,sha256=mQaZsgjapXMyfmce7_sKI_nZH6A7-cwokdWTEmQVCa0,7345
|
|
37
38
|
bizyengine/bizyair_extras/nodes_wan_video.py,sha256=d1mCcW9jCj-5Oymmymy0Vz-nwWv36FMGE5Gn-E7Rul4,1632
|
|
38
39
|
bizyengine/bizyair_extras/route_bizyair_tools.py,sha256=QdgfiKeF6c4-5Bx5Pmz9RKlaAHreypy9SIg_krmLk-o,2079
|
|
39
40
|
bizyengine/bizyair_extras/nodes_ipadapter_plus/__init__.py,sha256=ECKATm_EKi_4G47-FJI4-3rHO3iiF9FVakfSTE-pooE,36
|
|
@@ -74,7 +75,7 @@ bizyengine/misc/route_sam.py,sha256=-bMIR2QalfnszipGxSxvDAHGJa5gPSrjkYPb5baaRg4,
|
|
|
74
75
|
bizyengine/misc/segment_anything.py,sha256=RRm8FOfDY9VxdVrLjcdzJRh2pSM-kmNcCySuYnx9l7w,8677
|
|
75
76
|
bizyengine/misc/supernode.py,sha256=MPoJN6H_oCV00lmv1LWtGdQwTlyQPI6gXdMDXgkFd7g,4197
|
|
76
77
|
bizyengine/misc/utils.py,sha256=_aO1lHtfDf7Bv0K4xvnZ1Fu5Y9MfMkuhkiS_g8687ng,6461
|
|
77
|
-
bizyengine-1.2.
|
|
78
|
-
bizyengine-1.2.
|
|
79
|
-
bizyengine-1.2.
|
|
80
|
-
bizyengine-1.2.
|
|
78
|
+
bizyengine-1.2.7.dist-info/METADATA,sha256=qo-32z-1Ony-F42-qUOCU0bbmPIfsbBqIrH0-0Cbu10,574
|
|
79
|
+
bizyengine-1.2.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
80
|
+
bizyengine-1.2.7.dist-info/top_level.txt,sha256=2zapzqxX-we5cRyJkGf9bd5JinRtXp3-_uDI-xCAnc0,11
|
|
81
|
+
bizyengine-1.2.7.dist-info/RECORD,,
|
|
File without changes
|