Skip to content

Commit 85638d0

Browse files
committed
Loading & Improvement Updates
Updated System Initialization routine. Updated model loading & patching routines. Updated import pipelines.
1 parent 6755c1c commit 85638d0

16 files changed

Lines changed: 323 additions & 115 deletions

FS_Constants.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,34 @@
44
# Contact: flowstateeng@gmail.com | youtube.com/@flowstateeng
55

66

7+
78
##
89
# OUTSIDE IMPORTS
910
##
10-
import os, folder_paths
11+
import os, folder_paths, importlib
12+
import nodes
13+
1114

1215
##
1316
# CONSTANTS
1417
##
1518
MAX_RESOLUTION=16384
1619
TOOLTIP_UNDERLINE = 32
1720

21+
22+
# --- IMPORT KIJAI (THE GOAT) SAGE ATTENTION UNTIL COMFY CORE IMPLEMENTS A NODE
23+
SAGE_ATTENTION_INSTALLED = False
24+
25+
KJNODES_INSTALLED = "PathchSageAttentionKJ" in nodes.NODE_CLASS_MAPPINGS
26+
27+
SageAttention = None
28+
29+
30+
try:
31+
importlib.import_module("sageattention")
32+
SAGE_ATTENTION_INSTALLED = True
33+
except:
34+
SAGE_ATTENTION_INSTALLED = False
35+
36+
if SAGE_ATTENTION_INSTALLED and KJNODES_INSTALLED:
37+
SageAttention = nodes.NODE_CLASS_MAPPINGS['PathchSageAttentionKJ']()

FS_Mappings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@
3636
# SYSTEM STATUS
3737
##
3838
for fs_node in NODE_CLASS_MAPPINGS:
39-
print(f'\t - {fs_node}: {NODE_DISPLAY_NAME_MAPPINGS[fs_node]}')
39+
print(f'\t - 🟢 {fs_node}: {NODE_DISPLAY_NAME_MAPPINGS[fs_node]}')
4040

41-
print(f'\t - ✅ Mappings Loaded.')
41+
print(f'\t - ✅ Mappings Loaded.')

FS_Nodes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@
2121
##
2222
# SYSTEM STATUS
2323
##
24-
print(f'\t - ✅ All nodes Loaded.')
24+
print(f'\t - ✅ All nodes Loaded.')
2525

FS_Types.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
##
1111
from .FS_Assets import *
1212
from .FS_Constants import *
13-
from .FS_Types import *
14-
from .FS_Utils import *
1513

1614

1715
##
@@ -239,12 +237,22 @@ def __ne__(self, __value: object) -> bool:
239237
##
240238

241239
# SAGE ATTENTION
242-
TYPE_SAGE_ATTENTION_MODE = (['disabled'], {'tooltip': (
240+
enabled_sage_modes = [
241+
"disabled",
242+
"auto",
243+
"sageattn_qk_int8_pv_fp16_cuda",
244+
"sageattn_qk_int8_pv_fp16_triton",
245+
"sageattn_qk_int8_pv_fp8_cuda",
246+
"sageattn_qk_int8_pv_fp8_cuda++"
247+
] if SAGE_ATTENTION_INSTALLED else ['disabled']
248+
249+
TYPE_SAGE_ATTENTION_MODE = (enabled_sage_modes, {'tooltip': (
243250
f' Sage Attention Mode\n {"-" * TOOLTIP_UNDERLINE}\n'
244251
f' - The type of Sage Attention to use.\n'
245252
f' - This field will only show as "disabled" if you do not have the capability to run Sage Attention.\n\n'
246253
)})
247254

255+
248256
# MODEL
249257
TYPE_MODEL_FILE_TYPE = (['solo_model', 'checkpoint'], {'tooltip': (
250258
f' Model File Type\n {"-" * TOOLTIP_UNDERLINE}\n'

0 commit comments

Comments
 (0)