bizyengine 1.2.9__py3-none-any.whl → 1.2.11__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/nodes_wan_i2v.py +18 -6
- bizyengine/core/common/caching.py +23 -1
- bizyengine/core/nodes_base.py +1 -1
- bizyengine/core/path_utils/__init__.py +1 -1
- bizyengine/core/path_utils/utils.py +42 -1
- bizyengine/misc/llm.py +30 -6
- bizyengine/version.txt +1 -1
- {bizyengine-1.2.9.dist-info → bizyengine-1.2.11.dist-info}/METADATA +1 -1
- {bizyengine-1.2.9.dist-info → bizyengine-1.2.11.dist-info}/RECORD +11 -11
- {bizyengine-1.2.9.dist-info → bizyengine-1.2.11.dist-info}/WHEEL +0 -0
- {bizyengine-1.2.9.dist-info → bizyengine-1.2.11.dist-info}/top_level.txt +0 -0
|
@@ -21,6 +21,7 @@ except ModuleNotFoundError as e:
|
|
|
21
21
|
from ..core.common import client
|
|
22
22
|
from ..core.common.env_var import BIZYAIR_DEBUG
|
|
23
23
|
from ..core.nodes_base import BizyAirBaseNode
|
|
24
|
+
from ..core.path_utils import compose_model_name
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
class WanApiNodeBase:
|
|
@@ -30,17 +31,19 @@ class WanApiNodeBase:
|
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
class Wan_LoraLoader(BizyAirBaseNode):
|
|
33
|
-
|
|
34
34
|
@classmethod
|
|
35
35
|
def INPUT_TYPES(cls):
|
|
36
36
|
return {
|
|
37
37
|
"required": {
|
|
38
38
|
"lora_name": (
|
|
39
|
+
[
|
|
40
|
+
"to choose",
|
|
41
|
+
],
|
|
42
|
+
),
|
|
43
|
+
"model_version_id": (
|
|
39
44
|
"STRING",
|
|
40
45
|
{
|
|
41
|
-
"
|
|
42
|
-
"default": "https://huggingface.co/Remade-AI/Squish/resolve/main/squish_18.safetensors",
|
|
43
|
-
"tooltip": "LoRA 模型下载地址",
|
|
46
|
+
"default": "",
|
|
44
47
|
},
|
|
45
48
|
),
|
|
46
49
|
},
|
|
@@ -54,7 +57,7 @@ class Wan_LoraLoader(BizyAirBaseNode):
|
|
|
54
57
|
"step": 0.05,
|
|
55
58
|
"tooltip": "LoRA权重强度",
|
|
56
59
|
},
|
|
57
|
-
)
|
|
60
|
+
),
|
|
58
61
|
},
|
|
59
62
|
}
|
|
60
63
|
|
|
@@ -63,7 +66,16 @@ class Wan_LoraLoader(BizyAirBaseNode):
|
|
|
63
66
|
FUNCTION = "apply_lora"
|
|
64
67
|
CATEGORY = "Diffusers/WAN Video Generation"
|
|
65
68
|
|
|
66
|
-
|
|
69
|
+
@classmethod
|
|
70
|
+
def VALIDATE_INPUTS(cls, lora_name, model_version_id):
|
|
71
|
+
if lora_name == "to choose":
|
|
72
|
+
return False
|
|
73
|
+
if model_version_id is not None and model_version_id != "":
|
|
74
|
+
return True
|
|
75
|
+
return True
|
|
76
|
+
|
|
77
|
+
def apply_lora(self, lora_name, lora_weight=0.75, model_version_id="", **kwargs):
|
|
78
|
+
lora_name = compose_model_name(model_version_id, fallback_name=lora_name)
|
|
67
79
|
return ([(lora_name, lora_weight)],)
|
|
68
80
|
|
|
69
81
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import glob
|
|
2
|
+
import hashlib
|
|
2
3
|
import json
|
|
3
4
|
import os
|
|
5
|
+
import threading
|
|
4
6
|
import time
|
|
5
7
|
from abc import ABC, abstractmethod
|
|
6
8
|
from collections import OrderedDict
|
|
@@ -47,7 +49,23 @@ class CacheManager(ABC):
|
|
|
47
49
|
pass
|
|
48
50
|
|
|
49
51
|
|
|
50
|
-
class
|
|
52
|
+
class ConfigSingleton:
|
|
53
|
+
_instance_lock = threading.Lock()
|
|
54
|
+
_instances = {}
|
|
55
|
+
|
|
56
|
+
def __new__(cls, config, *args, **kwargs):
|
|
57
|
+
config_str = str(config)
|
|
58
|
+
config_key = hashlib.sha256(config_str.encode()).hexdigest()
|
|
59
|
+
if config_key not in cls._instances:
|
|
60
|
+
with cls._instance_lock:
|
|
61
|
+
if config_key not in cls._instances:
|
|
62
|
+
instance = super().__new__(cls)
|
|
63
|
+
cls._instances[config_key] = instance
|
|
64
|
+
|
|
65
|
+
return cls._instances[config_key]
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class BizyAirTaskCache(ConfigSingleton, CacheManager):
|
|
51
69
|
def __init__(self, config: CacheConfig):
|
|
52
70
|
self.config = config
|
|
53
71
|
self.cache = OrderedDict()
|
|
@@ -180,6 +198,10 @@ class BizyAirTaskCache(CacheManager):
|
|
|
180
198
|
if __name__ == "__main__":
|
|
181
199
|
cache_config = CacheConfig(max_size=12, expiration=10, cache_dir="./cache")
|
|
182
200
|
cache = BizyAirTaskCache(cache_config)
|
|
201
|
+
assert (
|
|
202
|
+
BizyAirTaskCache(CacheConfig(max_size=12, expiration=10, cache_dir="./cache"))
|
|
203
|
+
is cache
|
|
204
|
+
)
|
|
183
205
|
|
|
184
206
|
# Set some cache values
|
|
185
207
|
cache.set("key1", "This is the value for key1")
|
bizyengine/core/nodes_base.py
CHANGED
|
@@ -1,9 +1,50 @@
|
|
|
1
1
|
import os
|
|
2
2
|
from collections.abc import Collection
|
|
3
|
-
from typing import Dict, Union
|
|
3
|
+
from typing import Dict, Optional, Union
|
|
4
4
|
|
|
5
5
|
import yaml
|
|
6
6
|
from bizyengine.core.common.env_var import BIZYAIR_SERVER_ADDRESS
|
|
7
|
+
from bizyengine.core.configs.conf import config_manager
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def compose_model_name(
|
|
11
|
+
model_version_id: str = "", fallback_name: Optional[str] = None
|
|
12
|
+
) -> str:
|
|
13
|
+
"""Generate standardized model name from version ID.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
model_version_id: Model version identifier (empty string or None treated as missing)
|
|
17
|
+
fallback_name: Default name to use when version ID is missing
|
|
18
|
+
|
|
19
|
+
Returns:
|
|
20
|
+
Formatted model name (either prefixed ID or default)
|
|
21
|
+
|
|
22
|
+
Raises:
|
|
23
|
+
ValueError: If both model_version_id and default are missing
|
|
24
|
+
RuntimeError: If configuration manager fails to provide prefix
|
|
25
|
+
"""
|
|
26
|
+
# Handle missing version ID case
|
|
27
|
+
if not model_version_id: # Covers None, empty string, etc.
|
|
28
|
+
if fallback_name is None:
|
|
29
|
+
raise ValueError("Missing model_version_id with no default provided")
|
|
30
|
+
return fallback_name
|
|
31
|
+
|
|
32
|
+
# Validate ID format (adjust regex pattern as needed)
|
|
33
|
+
if not isinstance(model_version_id, str):
|
|
34
|
+
raise TypeError(
|
|
35
|
+
f"model_version_id must be string, got {type(model_version_id)}"
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
# Safely retrieve configuration prefix
|
|
39
|
+
try:
|
|
40
|
+
prefix = config_manager.get_model_version_id_prefix()
|
|
41
|
+
except AttributeError as e:
|
|
42
|
+
raise RuntimeError("Configuration manager missing required method") from e
|
|
43
|
+
except Exception as e:
|
|
44
|
+
raise RuntimeError(f"Failed to retrieve model prefix: {str(e)}") from e
|
|
45
|
+
|
|
46
|
+
# Construct final model name
|
|
47
|
+
return f"{prefix}{model_version_id}"
|
|
7
48
|
|
|
8
49
|
|
|
9
50
|
def filter_files_extensions(
|
bizyengine/misc/llm.py
CHANGED
|
@@ -318,6 +318,29 @@ class BizyAirJoyCaption2(BizyAirMiscBaseNode):
|
|
|
318
318
|
|
|
319
319
|
CATEGORY = "☁️BizyAir/AI Assistants"
|
|
320
320
|
|
|
321
|
+
def resize_if_large(self, image, max_size=384):
|
|
322
|
+
import torch.nn.functional as F
|
|
323
|
+
|
|
324
|
+
_, h, w, _ = image.shape
|
|
325
|
+
|
|
326
|
+
if h <= max_size and w <= max_size:
|
|
327
|
+
return image
|
|
328
|
+
|
|
329
|
+
if h > w:
|
|
330
|
+
new_h = max_size
|
|
331
|
+
new_w = int(w * (max_size / h))
|
|
332
|
+
else:
|
|
333
|
+
new_w = max_size
|
|
334
|
+
new_h = int(h * (max_size / w))
|
|
335
|
+
|
|
336
|
+
image = image.permute(0, 3, 1, 2)
|
|
337
|
+
resized_image = F.interpolate(
|
|
338
|
+
image, size=(new_h, new_w), mode="bilinear", align_corners=False
|
|
339
|
+
)
|
|
340
|
+
resized_image = resized_image.permute(0, 2, 3, 1)
|
|
341
|
+
|
|
342
|
+
return resized_image
|
|
343
|
+
|
|
321
344
|
def joycaption2(
|
|
322
345
|
self,
|
|
323
346
|
image,
|
|
@@ -333,12 +356,7 @@ class BizyAirJoyCaption2(BizyAirMiscBaseNode):
|
|
|
333
356
|
):
|
|
334
357
|
extra_data = pop_api_key_and_prompt_id(kwargs)
|
|
335
358
|
headers = client.headers(api_key=extra_data["api_key"])
|
|
336
|
-
|
|
337
|
-
SIZE_LIMIT = 1536
|
|
338
|
-
_, w, h, c = image.shape
|
|
339
|
-
assert (
|
|
340
|
-
w <= SIZE_LIMIT and h <= SIZE_LIMIT
|
|
341
|
-
), f"width and height must be less than {SIZE_LIMIT}x{SIZE_LIMIT}, but got {w} and {h}"
|
|
359
|
+
image = self.resize_if_large(image)
|
|
342
360
|
|
|
343
361
|
payload = {
|
|
344
362
|
"image": None,
|
|
@@ -380,15 +398,21 @@ class BizyAirJoyCaption2(BizyAirMiscBaseNode):
|
|
|
380
398
|
return (caption,)
|
|
381
399
|
|
|
382
400
|
|
|
401
|
+
class BizyAirJoyCaption3(BizyAirJoyCaption2):
|
|
402
|
+
API_URL = f"{BIZYAIR_SERVER_ADDRESS}/supernode/joycaption3"
|
|
403
|
+
|
|
404
|
+
|
|
383
405
|
NODE_CLASS_MAPPINGS = {
|
|
384
406
|
"BizyAirSiliconCloudLLMAPI": SiliconCloudLLMAPI,
|
|
385
407
|
"BizyAirSiliconCloudVLMAPI": SiliconCloudVLMAPI,
|
|
386
408
|
"BizyAirJoyCaption": BizyAirJoyCaption,
|
|
387
409
|
"BizyAirJoyCaption2": BizyAirJoyCaption2,
|
|
410
|
+
"BizyAirJoyCaption3": BizyAirJoyCaption3,
|
|
388
411
|
}
|
|
389
412
|
NODE_DISPLAY_NAME_MAPPINGS = {
|
|
390
413
|
"BizyAirSiliconCloudLLMAPI": "☁️BizyAir SiliconCloud LLM API",
|
|
391
414
|
"BizyAirSiliconCloudVLMAPI": "☁️BizyAir SiliconCloud VLM API",
|
|
392
415
|
"BizyAirJoyCaption": "☁️BizyAir Joy Caption",
|
|
393
416
|
"BizyAirJoyCaption2": "☁️BizyAir Joy Caption2",
|
|
417
|
+
"BizyAirJoyCaption3": "☁️BizyAir Joy Caption3",
|
|
394
418
|
}
|
bizyengine/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.2.
|
|
1
|
+
1.2.11
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bizyengine
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.11
|
|
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=NzEMfzSBZRIsy59KhUwpSFOVuzrwZZulp3vgZsFRFnk,7
|
|
3
3
|
bizyengine/bizy_server/__init__.py,sha256=SP9oSblnPo4KQyh7yOGD26YCskFAcQHAZy04nQBNRIw,200
|
|
4
4
|
bizyengine/bizy_server/api_client.py,sha256=F2kSe5FVQz5b47-QzSH5kB9S-wP921MPWrtVbbQ3nEY,43623
|
|
5
5
|
bizyengine/bizy_server/errno.py,sha256=Q-U96XnZQCuPH_44Om8wnc2-Kh7qFqwLKtox27msU54,16095
|
|
@@ -34,7 +34,7 @@ bizyengine/bizyair_extras/nodes_testing_utils.py,sha256=qeJHlSq-c21Vx8H0oZw878Q0
|
|
|
34
34
|
bizyengine/bizyair_extras/nodes_trellis.py,sha256=BTpFfar_Byge-WNTdIrkHaIX3VMmfoQgxUnoYTl_OnA,7431
|
|
35
35
|
bizyengine/bizyair_extras/nodes_ultimatesdupscale.py,sha256=effgVSPOjEDXOjdZpQ7-tJrkxcKPRXxfKtq0KDmNUqI,4132
|
|
36
36
|
bizyengine/bizyair_extras/nodes_upscale_model.py,sha256=lrzA1BFI2w5aEPCmNPMh07s-WDzG-xTT49uU6WCnlP8,1151
|
|
37
|
-
bizyengine/bizyair_extras/nodes_wan_i2v.py,sha256=
|
|
37
|
+
bizyengine/bizyair_extras/nodes_wan_i2v.py,sha256=yGOq20YsqTAy8BpOWMnXZaeiXAO9Wdsqxtg3By9HSNw,7718
|
|
38
38
|
bizyengine/bizyair_extras/nodes_wan_video.py,sha256=d1mCcW9jCj-5Oymmymy0Vz-nwWv36FMGE5Gn-E7Rul4,1632
|
|
39
39
|
bizyengine/bizyair_extras/route_bizyair_tools.py,sha256=QdgfiKeF6c4-5Bx5Pmz9RKlaAHreypy9SIg_krmLk-o,2079
|
|
40
40
|
bizyengine/bizyair_extras/nodes_ipadapter_plus/__init__.py,sha256=ECKATm_EKi_4G47-FJI4-3rHO3iiF9FVakfSTE-pooE,36
|
|
@@ -44,7 +44,7 @@ bizyengine/bizyair_extras/oauth_callback/main.py,sha256=KQOZWor3kyNx8xvUNHYNMoHf
|
|
|
44
44
|
bizyengine/core/__init__.py,sha256=EV9ZtTwOHC0S_eNvCu-tltIydfxfMsH59LbgVX4e_1c,359
|
|
45
45
|
bizyengine/core/data_types.py,sha256=U1Ai149lvbVA-z59sfgniES9KSsyFIbDs_vcjpjlUK4,967
|
|
46
46
|
bizyengine/core/image_utils.py,sha256=--DmQb3R9Ev21MfZG9rfgOGsU2zRywJ-hpiNNN0N8p8,8586
|
|
47
|
-
bizyengine/core/nodes_base.py,sha256=
|
|
47
|
+
bizyengine/core/nodes_base.py,sha256=Kg6I1xTpyfTiB0fLy8GYb7GCK8NaHxgDSat9ywgXa00,8820
|
|
48
48
|
bizyengine/core/nodes_io.py,sha256=VhwRwYkGp0g3Mh0hx1OSwNZbV06NEV13w2aODSiAm5M,2832
|
|
49
49
|
bizyengine/core/commands/__init__.py,sha256=82yRdMT23RTiZPkFW_G3fVa-fj3-TUAXnj6cnGA3xRA,22
|
|
50
50
|
bizyengine/core/commands/base.py,sha256=TYH9lhr033B2roBLPkWkxcvoz_fW3cdzx_bvP_FI7dg,635
|
|
@@ -54,19 +54,19 @@ bizyengine/core/commands/processors/prompt_processor.py,sha256=RpNFzlFwpf_PsgmKp
|
|
|
54
54
|
bizyengine/core/commands/servers/model_server.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
55
|
bizyengine/core/commands/servers/prompt_server.py,sha256=giJXPMW-Mph2ccGbs9dQXs6ESiufYDhmGF1GgBsj-gw,8528
|
|
56
56
|
bizyengine/core/common/__init__.py,sha256=GicZw6YeAZk1PsKmFDt9dm1F75zPUlpia9Q_ki5vW1Y,179
|
|
57
|
-
bizyengine/core/common/caching.py,sha256=
|
|
57
|
+
bizyengine/core/common/caching.py,sha256=hRNsSrfNxgc1zzvBzLVjMY0iMkKqA0TBCr-iYhEpzik,6946
|
|
58
58
|
bizyengine/core/common/client.py,sha256=1Ka8DIjbmD9Gme9c_Q1zwXXueSCP3_OSdEDyGYEol50,10396
|
|
59
59
|
bizyengine/core/common/env_var.py,sha256=TM0832HWjwT1VTKicClugIHVfdXxvBxzz7pCbTnefXE,3342
|
|
60
60
|
bizyengine/core/common/utils.py,sha256=bm-XmSPy83AyjD0v5EfWp6jiO6_5p7rkZ_HQAuVmgmo,3086
|
|
61
61
|
bizyengine/core/configs/conf.py,sha256=D_UWG9SSJnK5EhbrfNFryJQ8hUwwdvhOGlq1TielwpI,3830
|
|
62
62
|
bizyengine/core/configs/models.json,sha256=jCrqQgjVeHugLb191Xay5rg0m3duTVISPp_GxVGQ3HA,2656
|
|
63
63
|
bizyengine/core/configs/models.yaml,sha256=Gbr5k-Yak_ybbPK50eK5wb6gKfDIWjdQ9QCVc7BvZ0Y,8399
|
|
64
|
-
bizyengine/core/path_utils/__init__.py,sha256=
|
|
64
|
+
bizyengine/core/path_utils/__init__.py,sha256=JVpqNHgaKiEtTI8_r47af8GtWHxrtOockQ6Qpzp9_MQ,260
|
|
65
65
|
bizyengine/core/path_utils/path_manager.py,sha256=tRVAcpsYvfWD-tK7khLvNCZayB0wpU9L0tRTH4ZESzM,10549
|
|
66
|
-
bizyengine/core/path_utils/utils.py,sha256=
|
|
66
|
+
bizyengine/core/path_utils/utils.py,sha256=SY5TDoOV5Sr_n3Ez2xbcMRsll1A1J7hPZ8Zn4tpjF3c,2393
|
|
67
67
|
bizyengine/misc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
68
68
|
bizyengine/misc/auth.py,sha256=V7VoHZ9-ljT_gUUOOh7AeNnAyVuyiK8fiqSM8T8k948,2671
|
|
69
|
-
bizyengine/misc/llm.py,sha256=
|
|
69
|
+
bizyengine/misc/llm.py,sha256=4fCMj5rxrjQ12Hyb5-JNHQHnugNdHoYZB2_9x8um8Lw,13526
|
|
70
70
|
bizyengine/misc/mzkolors.py,sha256=mWQh2XDdRza1iNacGZ3YApqbs5RHrW0nDIPGN1ZfC8g,2826
|
|
71
71
|
bizyengine/misc/nodes.py,sha256=HhLfYc_8Z7akcmtrvOviYdZ_GG5KhF5eoSjCzMK4pq4,43654
|
|
72
72
|
bizyengine/misc/nodes_controlnet_aux.py,sha256=Tza7XgStfmTm29bVl7qupE--ELTDfk8JaGFb93DxL_Q,16398
|
|
@@ -75,7 +75,7 @@ bizyengine/misc/route_sam.py,sha256=-bMIR2QalfnszipGxSxvDAHGJa5gPSrjkYPb5baaRg4,
|
|
|
75
75
|
bizyengine/misc/segment_anything.py,sha256=m-G0PsuP6IgpdUzhEqiqzPg1_svMVH5MTivOsoVR1-Y,8940
|
|
76
76
|
bizyengine/misc/supernode.py,sha256=ox1_ufOFbm4zlpPQD8TGd0JKv94vsscu1cCJOdbaZPY,4531
|
|
77
77
|
bizyengine/misc/utils.py,sha256=SkU_qHU3n3dnzq68mdg_E8380ivRDVZwIb4UgnakhMM,6828
|
|
78
|
-
bizyengine-1.2.
|
|
79
|
-
bizyengine-1.2.
|
|
80
|
-
bizyengine-1.2.
|
|
81
|
-
bizyengine-1.2.
|
|
78
|
+
bizyengine-1.2.11.dist-info/METADATA,sha256=JBQQgsJaoiTpf6L_zWoxjubKBm1APGJ3uSibg-rkkRI,4210
|
|
79
|
+
bizyengine-1.2.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
80
|
+
bizyengine-1.2.11.dist-info/top_level.txt,sha256=2zapzqxX-we5cRyJkGf9bd5JinRtXp3-_uDI-xCAnc0,11
|
|
81
|
+
bizyengine-1.2.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|