comfy-ui-api-workflow 0.0.1__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.
- comfy_ui_api_workflow/__about__.py +1 -0
- comfy_ui_api_workflow/__init__.py +9 -0
- comfy_ui_api_workflow/_impl/__init__.py +0 -0
- comfy_ui_api_workflow/_impl/data_structure.py +182 -0
- comfy_ui_api_workflow/_impl/enums.py +13 -0
- comfy_ui_api_workflow/_impl/errors/__init__.py +3 -0
- comfy_ui_api_workflow/_impl/errors/data_structure.py +34 -0
- comfy_ui_api_workflow/_impl/errors/node.py +63 -0
- comfy_ui_api_workflow/_impl/errors/output.py +5 -0
- comfy_ui_api_workflow/_impl/errors/pipeline.py +14 -0
- comfy_ui_api_workflow/_impl/errors/workflow.py +13 -0
- comfy_ui_api_workflow/_impl/exceptions.py +22 -0
- comfy_ui_api_workflow/_impl/lazy.py +71 -0
- comfy_ui_api_workflow/_impl/nodes/__init__.py +3 -0
- comfy_ui_api_workflow/_impl/nodes/advanced/__init__.py +3 -0
- comfy_ui_api_workflow/_impl/nodes/advanced/debug.py +103 -0
- comfy_ui_api_workflow/_impl/nodes/advanced/guidance.py +281 -0
- comfy_ui_api_workflow/_impl/nodes/advanced/hooks/__init__.py +29 -0
- comfy_ui_api_workflow/_impl/nodes/advanced/hooks/clip.py +35 -0
- comfy_ui_api_workflow/_impl/nodes/advanced/hooks/combine.py +108 -0
- comfy_ui_api_workflow/_impl/nodes/advanced/hooks/cond_pair.py +203 -0
- comfy_ui_api_workflow/_impl/nodes/advanced/hooks/cond_single.py +143 -0
- comfy_ui_api_workflow/_impl/nodes/advanced/hooks/create.py +130 -0
- comfy_ui_api_workflow/_impl/nodes/advanced/hooks/scheduling.py +167 -0
- comfy_ui_api_workflow/_impl/nodes/advanced/multigpu.py +78 -0
- comfy_ui_api_workflow/_impl/nodes/audio.py +260 -0
- comfy_ui_api_workflow/_impl/nodes/base.py +214 -0
- comfy_ui_api_workflow/_impl/nodes/experimental/__init__.py +283 -0
- comfy_ui_api_workflow/_impl/nodes/experimental/attention_experiments.py +156 -0
- comfy_ui_api_workflow/_impl/nodes/experimental/stable_cascade.py +16 -0
- comfy_ui_api_workflow/_impl/nodes/image/__init__.py +601 -0
- comfy_ui_api_workflow/_impl/nodes/image/adjustments.py +46 -0
- comfy_ui_api_workflow/_impl/nodes/image/background_removal.py +16 -0
- comfy_ui_api_workflow/_impl/nodes/image/batch.py +236 -0
- comfy_ui_api_workflow/_impl/nodes/image/color.py +104 -0
- comfy_ui_api_workflow/_impl/nodes/image/compositing.py +128 -0
- comfy_ui_api_workflow/_impl/nodes/image/detection.py +689 -0
- comfy_ui_api_workflow/_impl/nodes/image/filters.py +215 -0
- comfy_ui_api_workflow/_impl/nodes/image/geometry_estimation.py +307 -0
- comfy_ui_api_workflow/_impl/nodes/image/mask.py +291 -0
- comfy_ui_api_workflow/_impl/nodes/image/post_processors.py +45 -0
- comfy_ui_api_workflow/_impl/nodes/image/pre_processors.py +13 -0
- comfy_ui_api_workflow/_impl/nodes/image/transform.py +385 -0
- comfy_ui_api_workflow/_impl/nodes/image/upscaling.py +188 -0
- comfy_ui_api_workflow/_impl/nodes/image/video.py +66 -0
- comfy_ui_api_workflow/_impl/nodes/model/__init__.py +3 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/__init__.py +395 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/ace.py +232 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/autoregressive.py +53 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/controlnet.py +153 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/cosmos.py +108 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/flux.py +121 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/gligen.py +57 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/hidream.py +31 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/hunyuan_3d.py +44 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/hunyuan_image.py +21 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/hunyuan_video.py +243 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/instructpix2pix.py +28 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/kandinsky.py +78 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/lotus.py +8 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/ltxv.py +504 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/lumina.py +39 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/minimax.py +110 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/minimax_music.py +53 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/photomaker.py +28 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/pixart.py +34 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/qwen_image.py +101 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/stable_audio.py +34 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/stable_cascade.py +16 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/stable_diffusion.py +141 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/stable_diffusion_upscaler.py +37 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/stable_video.py +63 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/stable_video_3d.py +53 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/stable_zero123.py +128 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/transform.py +341 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/trellis.py +168 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/triposplat.py +54 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/void.py +61 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/wan/__init__.py +184 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/wan/animate.py +255 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/wan/camera.py +150 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/wan/dancer.py +102 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/wan/fun_control.py +129 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/wan/fun_inpaint.py +68 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/wan/humo.py +63 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/wan/move.py +332 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/wan/phantom_subject.py +58 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/wan/scail.py +161 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/wan/sound.py +128 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/wan/vace.py +73 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/yue2.py +189 -0
- comfy_ui_api_workflow/_impl/nodes/model/conditioning/z_image.py +59 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/__init__.py +510 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/ace.py +49 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/advanced/__init__.py +210 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/advanced/operations.py +113 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/autoregressive.py +36 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/batch.py +93 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/chroma_radiance.py +28 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/cosmos.py +36 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/flux.py +28 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/hidream.py +28 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/hunyuan_3d.py +57 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/hunyuan_image.py +28 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/hunyuan_video.py +130 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/ltxv.py +162 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/minimax.py +28 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/minimax_music.py +25 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/mochi.py +36 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/qwen.py +36 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/seedvr.py +16 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/stable_cascade.py +60 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/stable_diffusion.py +28 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/transform.py +92 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/trellis.py +91 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/triposplat.py +86 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/void.py +54 -0
- comfy_ui_api_workflow/_impl/nodes/model/latent/yue2.py +25 -0
- comfy_ui_api_workflow/_impl/nodes/model/loaders.py +820 -0
- comfy_ui_api_workflow/_impl/nodes/model/merging/__init__.py +290 -0
- comfy_ui_api_workflow/_impl/nodes/model/merging/model_specific.py +4370 -0
- comfy_ui_api_workflow/_impl/nodes/model/patch/__init__.py +463 -0
- comfy_ui_api_workflow/_impl/nodes/model/patch/anima.py +53 -0
- comfy_ui_api_workflow/_impl/nodes/model/patch/chroma_radiance.py +50 -0
- comfy_ui_api_workflow/_impl/nodes/model/patch/flux.py +63 -0
- comfy_ui_api_workflow/_impl/nodes/model/patch/hidream.py +72 -0
- comfy_ui_api_workflow/_impl/nodes/model/patch/ltxv.py +125 -0
- comfy_ui_api_workflow/_impl/nodes/model/patch/minimax.py +92 -0
- comfy_ui_api_workflow/_impl/nodes/model/patch/qwen.py +57 -0
- comfy_ui_api_workflow/_impl/nodes/model/patch/sensenova.py +21 -0
- comfy_ui_api_workflow/_impl/nodes/model/patch/stable_cascade.py +21 -0
- comfy_ui_api_workflow/_impl/nodes/model/patch/stable_diffusion.py +21 -0
- comfy_ui_api_workflow/_impl/nodes/model/patch/supir.py +57 -0
- comfy_ui_api_workflow/_impl/nodes/model/patch/unet.py +281 -0
- comfy_ui_api_workflow/_impl/nodes/model/patch/wan.py +143 -0
- comfy_ui_api_workflow/_impl/nodes/model/sampling/__init__.py +228 -0
- comfy_ui_api_workflow/_impl/nodes/model/sampling/custom.py +123 -0
- comfy_ui_api_workflow/_impl/nodes/model/sampling/guiders.py +252 -0
- comfy_ui_api_workflow/_impl/nodes/model/sampling/noise.py +52 -0
- comfy_ui_api_workflow/_impl/nodes/model/sampling/samplers.py +531 -0
- comfy_ui_api_workflow/_impl/nodes/model/sampling/schedulers.py +462 -0
- comfy_ui_api_workflow/_impl/nodes/model/sampling/sigmas.py +163 -0
- comfy_ui_api_workflow/_impl/nodes/model/training.py +249 -0
- comfy_ui_api_workflow/_impl/nodes/partner/__init__.py +3 -0
- comfy_ui_api_workflow/_impl/nodes/partner/audio/__init__.py +3 -0
- comfy_ui_api_workflow/_impl/nodes/partner/audio/elevenlabs.py +47 -0
- comfy_ui_api_workflow/_impl/nodes/partner/image/__init__.py +3 -0
- comfy_ui_api_workflow/_impl/nodes/partner/image/bytedance.py +16 -0
- comfy_ui_api_workflow/_impl/nodes/partner/image/krea.py +31 -0
- comfy_ui_api_workflow/_impl/nodes/partner/image/luma.py +27 -0
- comfy_ui_api_workflow/_impl/nodes/partner/image/recraft.py +220 -0
- comfy_ui_api_workflow/_impl/nodes/partner/text/__init__.py +3 -0
- comfy_ui_api_workflow/_impl/nodes/partner/text/gemini.py +25 -0
- comfy_ui_api_workflow/_impl/nodes/partner/text/openai.py +77 -0
- comfy_ui_api_workflow/_impl/nodes/partner/video/__init__.py +3 -0
- comfy_ui_api_workflow/_impl/nodes/partner/video/bytedance.py +16 -0
- comfy_ui_api_workflow/_impl/nodes/partner/video/pixverse.py +27 -0
- comfy_ui_api_workflow/_impl/nodes/text.py +506 -0
- comfy_ui_api_workflow/_impl/nodes/three_d/__init__.py +563 -0
- comfy_ui_api_workflow/_impl/nodes/three_d/mesh.py +183 -0
- comfy_ui_api_workflow/_impl/nodes/three_d/splat.py +262 -0
- comfy_ui_api_workflow/_impl/nodes/three_d/texturing.py +254 -0
- comfy_ui_api_workflow/_impl/nodes/utilities/__init__.py +404 -0
- comfy_ui_api_workflow/_impl/nodes/utilities/logic.py +44 -0
- comfy_ui_api_workflow/_impl/nodes/utilities/primitive.py +107 -0
- comfy_ui_api_workflow/_impl/nodes/validation.py +126 -0
- comfy_ui_api_workflow/_impl/nodes/video/__init__.py +440 -0
- comfy_ui_api_workflow/_impl/nodes/video/batch.py +45 -0
- comfy_ui_api_workflow/_impl/nodes/video/preprocessors.py +24 -0
- comfy_ui_api_workflow/_impl/nodes/video/transform.py +52 -0
- comfy_ui_api_workflow/_impl/pipeline.py +67 -0
- comfy_ui_api_workflow/_impl/workflow.py +539 -0
- comfy_ui_api_workflow-0.0.1.dist-info/METADATA +123 -0
- comfy_ui_api_workflow-0.0.1.dist-info/RECORD +176 -0
- comfy_ui_api_workflow-0.0.1.dist-info/WHEEL +4 -0
- comfy_ui_api_workflow-0.0.1.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
from typing import Literal, get_args
|
|
2
|
+
|
|
3
|
+
from ...base import BaseNode
|
|
4
|
+
from ...validation import validate_choice, validate_range
|
|
5
|
+
|
|
6
|
+
ConditioningSetProperties_Set_Cond_Areas = Literal["default", "mask bounds"]
|
|
7
|
+
CONDITIONINGSETPROPERTIES_SET_COND_AREAS = frozenset(
|
|
8
|
+
get_args(ConditioningSetProperties_Set_Cond_Areas)
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ConditioningSetProperties(BaseNode):
|
|
13
|
+
__slots__ = ("cond_NEW", "set_cond_area", "strength", "mask", "hooks", "timesteps")
|
|
14
|
+
CATEGORY = "advanced/hooks/cond single"
|
|
15
|
+
OUTPUTS = {"CONDITIONING": 0}
|
|
16
|
+
RETURN_TYPES = ("CONDITIONING",)
|
|
17
|
+
INPUT_SOCKET_TYPES = {
|
|
18
|
+
"cond_NEW": "CONDITIONING",
|
|
19
|
+
"strength": "FLOAT",
|
|
20
|
+
"set_cond_area": "V1 COMBO",
|
|
21
|
+
"mask": "MASK",
|
|
22
|
+
"hooks": "HOOKS",
|
|
23
|
+
"timesteps": "TIMESTEPS_RANGE",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
def __init__(
|
|
27
|
+
self,
|
|
28
|
+
node_id: str,
|
|
29
|
+
cond_NEW: tuple[str, int],
|
|
30
|
+
set_cond_area: ConditioningSetProperties_Set_Cond_Areas | tuple[str, int],
|
|
31
|
+
strength: float | tuple[str, int] = 1.0,
|
|
32
|
+
mask: tuple[str, int] | None = None,
|
|
33
|
+
hooks: tuple[str, int] | None = None,
|
|
34
|
+
timesteps: tuple[str, int] | None = None,
|
|
35
|
+
) -> None:
|
|
36
|
+
super().__init__(node_id=node_id)
|
|
37
|
+
self.cond_NEW = cond_NEW
|
|
38
|
+
self.set_cond_area = set_cond_area
|
|
39
|
+
self.strength = strength
|
|
40
|
+
if mask is not None:
|
|
41
|
+
self.mask = mask
|
|
42
|
+
if hooks is not None:
|
|
43
|
+
self.hooks = hooks
|
|
44
|
+
if timesteps is not None:
|
|
45
|
+
self.timesteps = timesteps
|
|
46
|
+
self.__validate()
|
|
47
|
+
|
|
48
|
+
def __validate(self) -> None:
|
|
49
|
+
validate_choice(
|
|
50
|
+
"set_cond_area",
|
|
51
|
+
self.set_cond_area,
|
|
52
|
+
CONDITIONINGSETPROPERTIES_SET_COND_AREAS,
|
|
53
|
+
)
|
|
54
|
+
validate_range("strength", self.strength, 0.0, 10.0)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
ConditioningSetPropertiesAndCombine_Set_Cond_Areas = Literal["default", "mask bounds"]
|
|
58
|
+
CONDITIONINGSETPROPERTIESANDCOMBINE_SET_COND_AREAS = frozenset(
|
|
59
|
+
get_args(ConditioningSetPropertiesAndCombine_Set_Cond_Areas)
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class ConditioningSetPropertiesAndCombine(BaseNode):
|
|
64
|
+
__slots__ = (
|
|
65
|
+
"cond",
|
|
66
|
+
"cond_NEW",
|
|
67
|
+
"set_cond_area",
|
|
68
|
+
"strength",
|
|
69
|
+
"mask",
|
|
70
|
+
"hooks",
|
|
71
|
+
"timesteps",
|
|
72
|
+
)
|
|
73
|
+
CATEGORY = "advanced/hooks/cond single"
|
|
74
|
+
OUTPUTS = {"CONDITIONING": 0}
|
|
75
|
+
RETURN_TYPES = ("CONDITIONING",)
|
|
76
|
+
INPUT_SOCKET_TYPES = {
|
|
77
|
+
"cond": "CONDITIONING",
|
|
78
|
+
"cond_NEW": "CONDITIONING",
|
|
79
|
+
"strength": "FLOAT",
|
|
80
|
+
"set_cond_area": "V1 COMBO",
|
|
81
|
+
"mask": "MASK",
|
|
82
|
+
"hooks": "HOOKS",
|
|
83
|
+
"timesteps": "TIMESTEPS_RANGE",
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
def __init__(
|
|
87
|
+
self,
|
|
88
|
+
node_id: str,
|
|
89
|
+
cond: tuple[str, int],
|
|
90
|
+
cond_NEW: tuple[str, int],
|
|
91
|
+
set_cond_area: (
|
|
92
|
+
ConditioningSetPropertiesAndCombine_Set_Cond_Areas | tuple[str, int]
|
|
93
|
+
),
|
|
94
|
+
strength: float | tuple[str, int] = 1.0,
|
|
95
|
+
mask: tuple[str, int] | None = None,
|
|
96
|
+
hooks: tuple[str, int] | None = None,
|
|
97
|
+
timesteps: tuple[str, int] | None = None,
|
|
98
|
+
) -> None:
|
|
99
|
+
super().__init__(node_id=node_id)
|
|
100
|
+
self.cond = cond
|
|
101
|
+
self.cond_NEW = cond_NEW
|
|
102
|
+
self.set_cond_area = set_cond_area
|
|
103
|
+
self.strength = strength
|
|
104
|
+
if mask is not None:
|
|
105
|
+
self.mask = mask
|
|
106
|
+
if hooks is not None:
|
|
107
|
+
self.hooks = hooks
|
|
108
|
+
if timesteps is not None:
|
|
109
|
+
self.timesteps = timesteps
|
|
110
|
+
self.__validate()
|
|
111
|
+
|
|
112
|
+
def __validate(self) -> None:
|
|
113
|
+
validate_choice(
|
|
114
|
+
"set_cond_area",
|
|
115
|
+
self.set_cond_area,
|
|
116
|
+
CONDITIONINGSETPROPERTIESANDCOMBINE_SET_COND_AREAS,
|
|
117
|
+
)
|
|
118
|
+
validate_range("strength", self.strength, 0.0, 10.0)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
class ConditioningSetDefaultCombine(BaseNode):
|
|
122
|
+
__slots__ = ("cond", "cond_DEFAULT", "hooks")
|
|
123
|
+
CATEGORY = "advanced/hooks/cond single"
|
|
124
|
+
OUTPUTS = {"CONDITIONING": 0}
|
|
125
|
+
RETURN_TYPES = ("CONDITIONING",)
|
|
126
|
+
INPUT_SOCKET_TYPES = {
|
|
127
|
+
"cond": "CONDITIONING",
|
|
128
|
+
"cond_DEFAULT": "CONDITIONING",
|
|
129
|
+
"hooks": "HOOKS",
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
def __init__(
|
|
133
|
+
self,
|
|
134
|
+
node_id: str,
|
|
135
|
+
cond: tuple[str, int],
|
|
136
|
+
cond_DEFAULT: tuple[str, int],
|
|
137
|
+
hooks: tuple[str, int] | None = None,
|
|
138
|
+
) -> None:
|
|
139
|
+
super().__init__(node_id=node_id)
|
|
140
|
+
self.cond = cond
|
|
141
|
+
self.cond_DEFAULT = cond_DEFAULT
|
|
142
|
+
if hooks is not None:
|
|
143
|
+
self.hooks = hooks
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
from ...base import BaseNode
|
|
2
|
+
from ...validation import validate_not_empty, validate_range
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class CreateHookLora(BaseNode):
|
|
6
|
+
__slots__ = ("lora_name", "strength_model", "strength_clip", "prev_hooks")
|
|
7
|
+
CATEGORY = "advanced/hooks/create"
|
|
8
|
+
OUTPUTS = {"HOOKS": 0}
|
|
9
|
+
RETURN_TYPES = ("HOOKS",)
|
|
10
|
+
INPUT_SOCKET_TYPES = {
|
|
11
|
+
"lora_name": "V1 COMBO",
|
|
12
|
+
"strength_model": "FLOAT",
|
|
13
|
+
"strength_clip": "FLOAT",
|
|
14
|
+
"prev_hooks": "HOOKS",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
def __init__(
|
|
18
|
+
self,
|
|
19
|
+
node_id: str,
|
|
20
|
+
lora_name: str | tuple[str, int],
|
|
21
|
+
strength_model: float | tuple[str, int] = 1.0,
|
|
22
|
+
strength_clip: float | tuple[str, int] = 1.0,
|
|
23
|
+
prev_hooks: tuple[str, int] | None = None,
|
|
24
|
+
) -> None:
|
|
25
|
+
super().__init__(node_id=node_id)
|
|
26
|
+
self.lora_name = lora_name
|
|
27
|
+
self.strength_model = strength_model
|
|
28
|
+
self.strength_clip = strength_clip
|
|
29
|
+
if prev_hooks is not None:
|
|
30
|
+
self.prev_hooks = prev_hooks
|
|
31
|
+
self.__validate()
|
|
32
|
+
|
|
33
|
+
def __validate(self) -> None:
|
|
34
|
+
validate_not_empty("lora_name", self.lora_name)
|
|
35
|
+
validate_range("strength_model", self.strength_model, -20.0, 20.0)
|
|
36
|
+
validate_range("strength_clip", self.strength_clip, -20.0, 20.0)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class CreateHookLoraModelOnly(BaseNode):
|
|
40
|
+
__slots__ = ("lora_name", "strength_model", "prev_hooks")
|
|
41
|
+
CATEGORY = "advanced/hooks/create"
|
|
42
|
+
OUTPUTS = {"HOOKS": 0}
|
|
43
|
+
RETURN_TYPES = ("HOOKS",)
|
|
44
|
+
INPUT_SOCKET_TYPES = {
|
|
45
|
+
"lora_name": "V1 COMBO",
|
|
46
|
+
"strength_model": "FLOAT",
|
|
47
|
+
"prev_hooks": "HOOKS",
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
def __init__(
|
|
51
|
+
self,
|
|
52
|
+
node_id: str,
|
|
53
|
+
lora_name: str | tuple[str, int],
|
|
54
|
+
strength_model: float | tuple[str, int] = 1.0,
|
|
55
|
+
prev_hooks: tuple[str, int] | None = None,
|
|
56
|
+
) -> None:
|
|
57
|
+
super().__init__(node_id=node_id)
|
|
58
|
+
self.lora_name = lora_name
|
|
59
|
+
self.strength_model = strength_model
|
|
60
|
+
if prev_hooks is not None:
|
|
61
|
+
self.prev_hooks = prev_hooks
|
|
62
|
+
self.__validate()
|
|
63
|
+
|
|
64
|
+
def __validate(self) -> None:
|
|
65
|
+
validate_not_empty("lora_name", self.lora_name)
|
|
66
|
+
validate_range("strength_model", self.strength_model, -20.0, 20.0)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class CreateHookModelAsLora(BaseNode):
|
|
70
|
+
__slots__ = ("ckpt_name", "strength_model", "strength_clip", "prev_hooks")
|
|
71
|
+
CATEGORY = "advanced/hooks/create"
|
|
72
|
+
OUTPUTS = {"HOOKS": 0}
|
|
73
|
+
RETURN_TYPES = ("HOOKS",)
|
|
74
|
+
INPUT_SOCKET_TYPES = {
|
|
75
|
+
"ckpt_name": "V1 COMBO",
|
|
76
|
+
"strength_model": "FLOAT",
|
|
77
|
+
"strength_clip": "FLOAT",
|
|
78
|
+
"prev_hooks": "HOOKS",
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
def __init__(
|
|
82
|
+
self,
|
|
83
|
+
node_id: str,
|
|
84
|
+
ckpt_name: str | tuple[str, int],
|
|
85
|
+
strength_model: float | tuple[str, int] = 1.0,
|
|
86
|
+
strength_clip: float | tuple[str, int] = 1.0,
|
|
87
|
+
prev_hooks: tuple[str, int] | None = None,
|
|
88
|
+
) -> None:
|
|
89
|
+
super().__init__(node_id=node_id)
|
|
90
|
+
self.ckpt_name = ckpt_name
|
|
91
|
+
self.strength_model = strength_model
|
|
92
|
+
self.strength_clip = strength_clip
|
|
93
|
+
if prev_hooks is not None:
|
|
94
|
+
self.prev_hooks = prev_hooks
|
|
95
|
+
self.__validate()
|
|
96
|
+
|
|
97
|
+
def __validate(self) -> None:
|
|
98
|
+
validate_not_empty("ckpt_name", self.ckpt_name)
|
|
99
|
+
validate_range("strength_model", self.strength_model, -20.0, 20.0)
|
|
100
|
+
validate_range("strength_clip", self.strength_clip, -20.0, 20.0)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
class CreateHookModelAsLoraModelOnly(BaseNode):
|
|
104
|
+
__slots__ = ("ckpt_name", "strength_model", "prev_hooks")
|
|
105
|
+
CATEGORY = "advanced/hooks/create"
|
|
106
|
+
OUTPUTS = {"HOOKS": 0}
|
|
107
|
+
RETURN_TYPES = ("HOOKS",)
|
|
108
|
+
INPUT_SOCKET_TYPES = {
|
|
109
|
+
"ckpt_name": "V1 COMBO",
|
|
110
|
+
"strength_model": "FLOAT",
|
|
111
|
+
"prev_hooks": "HOOKS",
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
def __init__(
|
|
115
|
+
self,
|
|
116
|
+
node_id: str,
|
|
117
|
+
ckpt_name: str | tuple[str, int],
|
|
118
|
+
strength_model: float | tuple[str, int] = 1.0,
|
|
119
|
+
prev_hooks: tuple[str, int] | None = None,
|
|
120
|
+
) -> None:
|
|
121
|
+
super().__init__(node_id=node_id)
|
|
122
|
+
self.ckpt_name = ckpt_name
|
|
123
|
+
self.strength_model = strength_model
|
|
124
|
+
if prev_hooks is not None:
|
|
125
|
+
self.prev_hooks = prev_hooks
|
|
126
|
+
self.__validate()
|
|
127
|
+
|
|
128
|
+
def __validate(self) -> None:
|
|
129
|
+
validate_not_empty("ckpt_name", self.ckpt_name)
|
|
130
|
+
validate_range("strength_model", self.strength_model, -20.0, 20.0)
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
from typing import Literal, get_args
|
|
2
|
+
|
|
3
|
+
from ...base import BaseNode
|
|
4
|
+
from ...validation import validate_bool, validate_choice, validate_range
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class SetHookKeyframes(BaseNode):
|
|
8
|
+
__slots__ = ("hooks", "hook_kf")
|
|
9
|
+
CATEGORY = "advanced/hooks/scheduling"
|
|
10
|
+
OUTPUTS = {"HOOKS": 0}
|
|
11
|
+
RETURN_TYPES = ("HOOKS",)
|
|
12
|
+
INPUT_SOCKET_TYPES = {"hooks": "HOOKS", "hook_kf": "HOOK_KEYFRAMES"}
|
|
13
|
+
|
|
14
|
+
def __init__(
|
|
15
|
+
self,
|
|
16
|
+
node_id: str,
|
|
17
|
+
hooks: tuple[str, int],
|
|
18
|
+
hook_kf: tuple[str, int] | None = None,
|
|
19
|
+
) -> None:
|
|
20
|
+
super().__init__(node_id=node_id)
|
|
21
|
+
self.hooks = hooks
|
|
22
|
+
if hook_kf is not None:
|
|
23
|
+
self.hook_kf = hook_kf
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class CreateHookKeyframe(BaseNode):
|
|
27
|
+
__slots__ = ("strength_mult", "start_percent", "prev_hook_kf")
|
|
28
|
+
CATEGORY = "advanced/hooks/scheduling"
|
|
29
|
+
OUTPUTS = {"HOOK_KF": 0}
|
|
30
|
+
RETURN_TYPES = ("HOOK_KEYFRAMES",)
|
|
31
|
+
INPUT_SOCKET_TYPES = {
|
|
32
|
+
"strength_mult": "FLOAT",
|
|
33
|
+
"start_percent": "FLOAT",
|
|
34
|
+
"prev_hook_kf": "HOOK_KEYFRAMES",
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
def __init__(
|
|
38
|
+
self,
|
|
39
|
+
node_id: str,
|
|
40
|
+
strength_mult: float | tuple[str, int] = 1.0,
|
|
41
|
+
start_percent: float | tuple[str, int] = 0.0,
|
|
42
|
+
prev_hook_kf: tuple[str, int] | None = None,
|
|
43
|
+
) -> None:
|
|
44
|
+
super().__init__(node_id=node_id)
|
|
45
|
+
self.strength_mult = strength_mult
|
|
46
|
+
self.start_percent = start_percent
|
|
47
|
+
if prev_hook_kf is not None:
|
|
48
|
+
self.prev_hook_kf = prev_hook_kf
|
|
49
|
+
self.__validate()
|
|
50
|
+
|
|
51
|
+
def __validate(self) -> None:
|
|
52
|
+
validate_range("strength_mult", self.strength_mult, -20.0, 20.0)
|
|
53
|
+
validate_range("start_percent", self.start_percent, 0.0, 1.0)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
CreateHookKeyframesInterpolated_Interpolations = Literal[
|
|
57
|
+
"linear", "ease_in", "ease_out", "ease_in_out"
|
|
58
|
+
]
|
|
59
|
+
CREATEHOOKKEYFRAMESINTERPOLATED_INTERPOLATIONS = frozenset(
|
|
60
|
+
get_args(CreateHookKeyframesInterpolated_Interpolations)
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class CreateHookKeyframesInterpolated(BaseNode):
|
|
65
|
+
__slots__ = (
|
|
66
|
+
"interpolation",
|
|
67
|
+
"strength_start",
|
|
68
|
+
"strength_end",
|
|
69
|
+
"start_percent",
|
|
70
|
+
"end_percent",
|
|
71
|
+
"keyframes_count",
|
|
72
|
+
"print_keyframes",
|
|
73
|
+
"prev_hook_kf",
|
|
74
|
+
)
|
|
75
|
+
CATEGORY = "advanced/hooks/scheduling"
|
|
76
|
+
OUTPUTS = {"HOOK_KF": 0}
|
|
77
|
+
RETURN_TYPES = ("HOOK_KEYFRAMES",)
|
|
78
|
+
INPUT_SOCKET_TYPES = {
|
|
79
|
+
"strength_start": "FLOAT",
|
|
80
|
+
"strength_end": "FLOAT",
|
|
81
|
+
"interpolation": "V1 COMBO",
|
|
82
|
+
"start_percent": "FLOAT",
|
|
83
|
+
"end_percent": "FLOAT",
|
|
84
|
+
"keyframes_count": "INT",
|
|
85
|
+
"print_keyframes": "BOOLEAN",
|
|
86
|
+
"prev_hook_kf": "HOOK_KEYFRAMES",
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
def __init__(
|
|
90
|
+
self,
|
|
91
|
+
node_id: str,
|
|
92
|
+
interpolation: CreateHookKeyframesInterpolated_Interpolations | tuple[str, int],
|
|
93
|
+
strength_start: float | tuple[str, int] = 1.0,
|
|
94
|
+
strength_end: float | tuple[str, int] = 1.0,
|
|
95
|
+
start_percent: float | tuple[str, int] = 0.0,
|
|
96
|
+
end_percent: float | tuple[str, int] = 1.0,
|
|
97
|
+
keyframes_count: int | tuple[str, int] = 5,
|
|
98
|
+
print_keyframes: bool | tuple[str, int] = False,
|
|
99
|
+
prev_hook_kf: tuple[str, int] | None = None,
|
|
100
|
+
) -> None:
|
|
101
|
+
super().__init__(node_id=node_id)
|
|
102
|
+
self.interpolation = interpolation
|
|
103
|
+
self.strength_start = strength_start
|
|
104
|
+
self.strength_end = strength_end
|
|
105
|
+
self.start_percent = start_percent
|
|
106
|
+
self.end_percent = end_percent
|
|
107
|
+
self.keyframes_count = keyframes_count
|
|
108
|
+
self.print_keyframes = print_keyframes
|
|
109
|
+
if prev_hook_kf is not None:
|
|
110
|
+
self.prev_hook_kf = prev_hook_kf
|
|
111
|
+
self.__validate()
|
|
112
|
+
|
|
113
|
+
def __validate(self) -> None:
|
|
114
|
+
validate_choice(
|
|
115
|
+
"interpolation",
|
|
116
|
+
self.interpolation,
|
|
117
|
+
CREATEHOOKKEYFRAMESINTERPOLATED_INTERPOLATIONS,
|
|
118
|
+
)
|
|
119
|
+
validate_range("strength_start", self.strength_start, 0.0, 10.0)
|
|
120
|
+
validate_range("strength_end", self.strength_end, 0.0, 10.0)
|
|
121
|
+
validate_range("start_percent", self.start_percent, 0.0, 1.0)
|
|
122
|
+
validate_range("end_percent", self.end_percent, 0.0, 1.0)
|
|
123
|
+
validate_range("keyframes_count", self.keyframes_count, 2, 100)
|
|
124
|
+
validate_bool("print_keyframes", self.print_keyframes)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class CreateHookKeyframesFromFloats(BaseNode):
|
|
128
|
+
__slots__ = (
|
|
129
|
+
"floats_strength",
|
|
130
|
+
"start_percent",
|
|
131
|
+
"end_percent",
|
|
132
|
+
"print_keyframes",
|
|
133
|
+
"prev_hook_kf",
|
|
134
|
+
)
|
|
135
|
+
CATEGORY = "advanced/hooks/scheduling"
|
|
136
|
+
OUTPUTS = {"HOOK_KF": 0}
|
|
137
|
+
RETURN_TYPES = ("HOOK_KEYFRAMES",)
|
|
138
|
+
INPUT_SOCKET_TYPES = {
|
|
139
|
+
"floats_strength": "FLOATS",
|
|
140
|
+
"start_percent": "FLOAT",
|
|
141
|
+
"end_percent": "FLOAT",
|
|
142
|
+
"print_keyframes": "BOOLEAN",
|
|
143
|
+
"prev_hook_kf": "HOOK_KEYFRAMES",
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
def __init__(
|
|
147
|
+
self,
|
|
148
|
+
node_id: str,
|
|
149
|
+
floats_strength: tuple[str, int],
|
|
150
|
+
start_percent: float | tuple[str, int] = 0.0,
|
|
151
|
+
end_percent: float | tuple[str, int] = 1.0,
|
|
152
|
+
print_keyframes: bool | tuple[str, int] = False,
|
|
153
|
+
prev_hook_kf: tuple[str, int] | None = None,
|
|
154
|
+
) -> None:
|
|
155
|
+
super().__init__(node_id=node_id)
|
|
156
|
+
self.floats_strength = floats_strength
|
|
157
|
+
self.start_percent = start_percent
|
|
158
|
+
self.end_percent = end_percent
|
|
159
|
+
self.print_keyframes = print_keyframes
|
|
160
|
+
if prev_hook_kf is not None:
|
|
161
|
+
self.prev_hook_kf = prev_hook_kf
|
|
162
|
+
self.__validate()
|
|
163
|
+
|
|
164
|
+
def __validate(self) -> None:
|
|
165
|
+
validate_range("start_percent", self.start_percent, 0.0, 1.0)
|
|
166
|
+
validate_range("end_percent", self.end_percent, 0.0, 1.0)
|
|
167
|
+
validate_bool("print_keyframes", self.print_keyframes)
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
from ..base import BaseNode
|
|
2
|
+
from ..validation import validate_not_empty, validate_range
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class MultiGPU_WorkUnits(BaseNode):
|
|
6
|
+
__slots__ = ("model", "max_gpus")
|
|
7
|
+
CATEGORY = "advanced/multigpu"
|
|
8
|
+
OUTPUTS = {"MODEL": 0}
|
|
9
|
+
RETURN_TYPES = ("MODEL",)
|
|
10
|
+
INPUT_SOCKET_TYPES = {"model": "MODEL", "max_gpus": "INT"}
|
|
11
|
+
|
|
12
|
+
def __init__(
|
|
13
|
+
self, node_id: str, model: tuple[str, int], max_gpus: int | tuple[str, int] = 2
|
|
14
|
+
) -> None:
|
|
15
|
+
super().__init__(node_id=node_id)
|
|
16
|
+
self.model = model
|
|
17
|
+
self.max_gpus = max_gpus
|
|
18
|
+
self.__validate()
|
|
19
|
+
|
|
20
|
+
def __validate(self) -> None:
|
|
21
|
+
validate_range("max_gpus", self.max_gpus, 1)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class SelectModelDevice(BaseNode):
|
|
25
|
+
__slots__ = ("model", "device")
|
|
26
|
+
CATEGORY = "advanced/multigpu"
|
|
27
|
+
OUTPUTS = {"MODEL": 0}
|
|
28
|
+
RETURN_TYPES = ("MODEL",)
|
|
29
|
+
INPUT_SOCKET_TYPES = {"model": "MODEL", "device": "COMBO"}
|
|
30
|
+
|
|
31
|
+
def __init__(
|
|
32
|
+
self, node_id: str, model: tuple[str, int], device: str | tuple[str, int]
|
|
33
|
+
) -> None:
|
|
34
|
+
super().__init__(node_id=node_id)
|
|
35
|
+
self.model = model
|
|
36
|
+
self.device = device
|
|
37
|
+
self.__validate()
|
|
38
|
+
|
|
39
|
+
def __validate(self) -> None:
|
|
40
|
+
validate_not_empty("device", self.device)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class SelectCLIPDevice(BaseNode):
|
|
44
|
+
__slots__ = ("clip", "device")
|
|
45
|
+
CATEGORY = "advanced/multigpu"
|
|
46
|
+
OUTPUTS = {"CLIP": 0}
|
|
47
|
+
RETURN_TYPES = ("CLIP",)
|
|
48
|
+
INPUT_SOCKET_TYPES = {"clip": "CLIP", "device": "COMBO"}
|
|
49
|
+
|
|
50
|
+
def __init__(
|
|
51
|
+
self, node_id: str, clip: tuple[str, int], device: str | tuple[str, int]
|
|
52
|
+
) -> None:
|
|
53
|
+
super().__init__(node_id=node_id)
|
|
54
|
+
self.clip = clip
|
|
55
|
+
self.device = device
|
|
56
|
+
self.__validate()
|
|
57
|
+
|
|
58
|
+
def __validate(self) -> None:
|
|
59
|
+
validate_not_empty("device", self.device)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class SelectVAEDevice(BaseNode):
|
|
63
|
+
__slots__ = ("vae", "device")
|
|
64
|
+
CATEGORY = "advanced/multigpu"
|
|
65
|
+
OUTPUTS = {"VAE": 0}
|
|
66
|
+
RETURN_TYPES = ("VAE",)
|
|
67
|
+
INPUT_SOCKET_TYPES = {"vae": "VAE", "device": "COMBO"}
|
|
68
|
+
|
|
69
|
+
def __init__(
|
|
70
|
+
self, node_id: str, vae: tuple[str, int], device: str | tuple[str, int]
|
|
71
|
+
) -> None:
|
|
72
|
+
super().__init__(node_id=node_id)
|
|
73
|
+
self.vae = vae
|
|
74
|
+
self.device = device
|
|
75
|
+
self.__validate()
|
|
76
|
+
|
|
77
|
+
def __validate(self) -> None:
|
|
78
|
+
validate_not_empty("device", self.device)
|