bizyengine 1.2.9__py3-none-any.whl → 1.2.10__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.
@@ -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
- "multiline": True,
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
- def apply_lora(self, lora_name, lora_weight=0.75, **kwargs):
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 BizyAirTaskCache(CacheManager):
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")
@@ -158,7 +158,7 @@ class BizyAirBaseNode:
158
158
  register_node(cls, PREFIX)
159
159
  cls.setup_input_types()
160
160
 
161
- # 验证FUNCTION接受**kwargs
161
+ # TODO refine 验证FUNCTION接受**kwargs
162
162
  if BIZYAIR_DEBUG:
163
163
  import inspect
164
164
 
@@ -6,4 +6,4 @@ from .path_manager import (
6
6
  guess_config,
7
7
  guess_url_from_node,
8
8
  )
9
- from .utils import filter_files_extensions
9
+ from .utils import compose_model_name, filter_files_extensions
@@ -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/version.txt CHANGED
@@ -1 +1 @@
1
- 1.2.9
1
+ 1.2.10
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bizyengine
3
- Version: 1.2.9
3
+ Version: 1.2.10
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=yNg8JnLF45fOFqLuJ1rEWRcAK5s2dl932Z8xvfge6Cg,6
2
+ bizyengine/version.txt,sha256=QwQnXzDgdsdqvcDygPD91VN_GscAlTuhkI4ppk1TGRk,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=OniFS3MK1a8FEZzXwkbrSDEmBO8l3ytq8CSqxx0wkwI,7355
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=uJ4qB5ZYKm64vmsA2Gp1-6n6CYrGvom1UIrStVVJE8k,8808
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,16 +54,16 @@ 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=isliSZsQyrNjXmupW-BaZ2EoVF5G8t7aHAhbcELAn5M,6253
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=5K9n4sexva0rfuYj3HcxdYeWnA1TuLTjpGGMFBTgnhM,240
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=ksgNPyQaqilOImscLkSYizbRfDQropfxpL8tqIXardM,881
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
69
  bizyengine/misc/llm.py,sha256=JOwzioAGtY1YjQZZfnm5xCB3frbbvNi3sHUltd_Qq2M,12856
@@ -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.9.dist-info/METADATA,sha256=Iw5QrJ5-GPfA2sLlvdauqEvvpXiEYuMVvPRyQCvtcxQ,4209
79
- bizyengine-1.2.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
80
- bizyengine-1.2.9.dist-info/top_level.txt,sha256=2zapzqxX-we5cRyJkGf9bd5JinRtXp3-_uDI-xCAnc0,11
81
- bizyengine-1.2.9.dist-info/RECORD,,
78
+ bizyengine-1.2.10.dist-info/METADATA,sha256=fkMBENG0KzaDDVH-pkmvcRIxxi23H9YSVMEsM6fPQBc,4210
79
+ bizyengine-1.2.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
80
+ bizyengine-1.2.10.dist-info/top_level.txt,sha256=2zapzqxX-we5cRyJkGf9bd5JinRtXp3-_uDI-xCAnc0,11
81
+ bizyengine-1.2.10.dist-info/RECORD,,