Skip to content

Commit be3d655

Browse files
committed
Release 🌊🚒 FlowState Flux Engine (No Sage Attention)
🌊🚒 FlowState Flux Engine is complete. Need to wrap KJ Sage Attention. Testing adding KJ to toml requirements before integration.
1 parent dcc6f41 commit be3d655

14 files changed

Lines changed: 553 additions & 74 deletions

FS_Constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
# CONSTANTS
1414
##
1515
MAX_RESOLUTION=16384
16-
16+
TOOLTIP_UNDERLINE = 16
1717

FS_Mappings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
##
2222
NODE_CLASS_MAPPINGS = {
2323
'FlowState_LatentSource': FlowState_LatentSource,
24-
# 'FlowState_FluxEngine': FlowState_FluxEngine,
24+
'FlowState_FluxEngine': FlowState_FluxEngine,
2525
}
2626

2727
NODE_DISPLAY_NAME_MAPPINGS = {
28-
'FlowState_LatentSource': '🌊 FlowState Latent Source',
28+
'FlowState_LatentSource': '🌊🌱 FlowState Latent Source',
29+
'FlowState_FluxEngine': '🌊🚒 FlowState Flux Engine',
2930
# 'FlowState_QuickEdit': '🌊 FlowState Quick Edit',
30-
# 'FlowState_FluxEngine': '🌊 FlowState Flux Engine',
3131
# 'FlowState_AssetForge': '🌊 FlowState Asset Forge',
3232
}
3333

FS_Nodes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# NODES
1616
##
1717
from .FlowState_LatentSource import *
18+
from .FlowState_FluxEngine import *
1819

1920

2021
##

FS_Types.py

Lines changed: 146 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -40,49 +40,113 @@ def __ne__(self, __value: object) -> bool:
4040
##
4141

4242
# NUMERICAL
43-
TYPE_FLOAT = ('FLOAT', {'default': 1, 'min': -sys.float_info.max, 'max': sys.float_info.max, 'step': 0.01})
44-
TYPE_INT = ('INT', {'default': 1, 'min': -sys.maxsize, 'max': sys.maxsize, 'step': 1})
43+
TYPE_FLOAT = ('FLOAT', {'default': 1, 'min': -sys.float_info.max, 'max': sys.float_info.max, 'step': 0.01, 'tooltip': (
44+
f' Float\n {"-" * TOOLTIP_UNDERLINE}\n'
45+
f' - A floating point number.\n\n'
46+
)})
47+
TYPE_INT = ('INT', {'default': 1, 'min': -sys.maxsize, 'max': sys.maxsize, 'step': 1, 'tooltip': (
48+
f' Integer\n {"-" * TOOLTIP_UNDERLINE}\n'
49+
f' - An integer number.\n\n'
50+
)})
4551

4652
# LOGICAL
47-
TYPE_BOOLEAN = ('BOOLEAN', {'default': True})
48-
TYPE_BOOLEAN_FALSE = ('BOOLEAN', {'default': False})
49-
TYPE_BOOLEAN_TRUE = ('BOOLEAN', {'default': True})
50-
TYPE_BOOLEAN_PARAMS = ('BOOLEAN', {'default': False, 'tooltip': 'Add params to output images.'})
51-
TYPE_BOOLEAN_PROMPT = ('BOOLEAN', {'default': False, 'tooltip': 'Add prompt to output images.'})
52-
TYPE_BOOLEAN_PARAMS_TERM = ('BOOLEAN', {'default': False, 'tooltip': 'Print params to cmd/terminal.'})
53-
TYPE_BOOLEAN_PROMPT_TERM = ('BOOLEAN', {'default': False, 'tooltip': 'Print prompt to cmd/terminal.'})
53+
TYPE_BOOLEAN = ('BOOLEAN', {'default': True, 'tooltip': (
54+
f' Boolean\n {"-" * TOOLTIP_UNDERLINE}\n'
55+
f' - A logical operator (True/False).\n\n'
56+
)})
57+
TYPE_BOOLEAN_FALSE = ('BOOLEAN', {'default': False, 'tooltip': (
58+
f' Boolean (False)\n {"-" * TOOLTIP_UNDERLINE}\n'
59+
f' - A logical operator (True/False; default False).\n\n'
60+
)})
61+
TYPE_BOOLEAN_TRUE = ('BOOLEAN', {'default': True, 'tooltip': (
62+
f' Boolean (True)\n {"-" * TOOLTIP_UNDERLINE}\n'
63+
f' - A logical operator (True/False; default True).\n\n'
64+
)})
5465

5566
# STRING
56-
TYPE_STRING_IN = ('STRING', {'default': 'Enter a value.'})
57-
TYPE_STRING_ML = ('STRING', {'multiline': True, 'default': 'Enter a value.'})
67+
TYPE_STRING_IN = ('STRING', {'default': 'Enter a value.', 'tooltip': (
68+
f' String\n {"-" * TOOLTIP_UNDERLINE}\n'
69+
f' - String input (text).\n\n'
70+
)})
71+
TYPE_STRING_ML = ('STRING', {'multiline': True, 'default': 'Enter a value.', 'tooltip': (
72+
f' Multiline String\n {"-" * TOOLTIP_UNDERLINE}\n'
73+
f' - Multiline string input (text).\n\n'
74+
)})
5875

5976
# IMAGE
60-
TYPE_IMG_WIDTH = ('INT', {'default': 1024, 'min': 16, 'max': nodes.MAX_RESOLUTION, 'step': 8, 'tooltip': 'Defines width input image.'})
61-
TYPE_IMG_HEIGHT = ('INT', {'default': 1024, 'min': 16, 'max': nodes.MAX_RESOLUTION, 'step': 8, 'tooltip': 'Defines height of the input image.'})
77+
TYPE_IMG_WIDTH = ('INT', {'default': 1024, 'min': 16, 'max': nodes.MAX_RESOLUTION, 'step': 8, 'tooltip': (
78+
f' Width\n {"-" * TOOLTIP_UNDERLINE}\n'
79+
f' - Defines the width of the image.\n\n'
80+
)})
81+
TYPE_IMG_HEIGHT = ('INT', {'default': 1024, 'min': 16, 'max': nodes.MAX_RESOLUTION, 'step': 8, 'tooltip': (
82+
f' Height\n {"-" * TOOLTIP_UNDERLINE}\n'
83+
f' - Defines the height of the image.\n\n'
84+
)})
6285

6386
# LATENT
64-
TYPE_LATENT_IN = ('LATENT', {'tooltip': 'Input latent image for diffusion process.'})
87+
TYPE_LATENT_IN = ('LATENT', {'tooltip': (
88+
f' Latent Image\n {"-" * TOOLTIP_UNDERLINE}\n'
89+
f' - Input latent image for diffusion sampling.\n\n'
90+
)})
6591

6692
# SAMPLING
67-
TYPE_POSITIVE_CONDITIONING = ('CONDITIONING', {'tooltip': 'Positive conditioning from encoded text prompt.'})
68-
TYPE_NEGATIVE_CONDITIONING = ('CONDITIONING', {'tooltip': 'Negative conditioning from encoded text prompt. For SD models only. Will not be used for Flux.'})
69-
TYPE_SEED = ('INT', {'default': 4, 'min': -sys.maxsize, 'max': sys.maxsize, 'step': 1, 'tooltip': 'Random noise seed.'})
70-
TYPE_STEPS = ('INT', {'default': 32, 'min': 1, 'max': 10000, 'tooltip': 'Defines the number of steps to take in the sampling process.'})
71-
TYPE_GUIDANCE = ('FLOAT', {'default': 4.0, 'min': 0.0, 'max': 100.0, 'step':0.1, 'round': 0.01, 'tooltip': 'Controls the influence of external guidance (such as prompts or conditions) on the sampling process.'})
93+
TYPE_POSITIVE_CONDITIONING = ('CONDITIONING', {'tooltip': (
94+
f' Positive Conditioning\n {"-" * TOOLTIP_UNDERLINE}\n'
95+
f' - Positive conditioning from encoded text prompt.\n\n'
96+
)})
97+
TYPE_NEGATIVE_CONDITIONING = ('CONDITIONING', {'tooltip': (
98+
f' Negative Conditioning\n {"-" * TOOLTIP_UNDERLINE}\n'
99+
f' - Negative conditioning from encoded text prompt.\n\n'
100+
)})
101+
TYPE_SEED = ('INT', {'default': 32, 'min': -sys.maxsize, 'max': sys.maxsize, 'step': 1, 'tooltip': (
102+
f' Seed\n {"-" * TOOLTIP_UNDERLINE}\n'
103+
f' - Seed used to generate inital random noise.\n\n'
104+
)})
105+
TYPE_STEPS = ('INT', {'default': 32, 'min': 1, 'max': 10000, 'tooltip': (
106+
f' Steps\n {"-" * TOOLTIP_UNDERLINE}\n'
107+
f' - Defines the number of steps to take in the sampling process.\n\n'
108+
)})
109+
TYPE_GUIDANCE = ('FLOAT', {'default': 3.2, 'min': 0.0, 'max': 100.0, 'step':0.1, 'round': 0.01, 'tooltip': (
110+
f' Guidance\n {"-" * TOOLTIP_UNDERLINE}\n'
111+
f' - Defines the number of steps to take in the sampling process.\n\n'
112+
)})
72113
TYPE_DENOISE = ('FLOAT', {
73114
'default': 1.0, 'min': 0.0, 'max': 1.0, 'step': 0.01,
74115
'tooltip': (
75-
f'Sampler Denoise Amount\n\n'
116+
f' Sampler Denoise Amount\n {"-" * TOOLTIP_UNDERLINE}\n'
76117
f' - The amount of denoising applied, lower values will maintain the structure of the initial image allowing for image to image sampling.\n\n'
77118
)
78119
})
120+
TYPE_PROMPT_POSITIVE = ('STRING', {'multiline': True, 'default': 'Enter your positive prompt.', 'tooltip': (
121+
f' Positive Prompt\n {"-" * TOOLTIP_UNDERLINE}\n'
122+
f' - Positive text prompt describing your desired output.\n\n'
123+
)})
79124

80125
# MODEL
81-
TYPE_MODEL_IN = ('MODEL', {'tooltip': 'Input model.'})
82-
TYPE_CLIP_IN = ('CLIP', {'tooltip': 'The CLIP model used for encoding the text.'})
83-
TYPE_VAE_IN = ('VAE', {'tooltip': 'The VAE model used for encoding and decoding images.'})
84-
TYPE_CONTROL_NET_IN = ('CONTROL_NET', {'tooltip': 'The Control Net model used to patch your diffusion model.'})
85-
TYPE_LORA_IN = ('LORA', {'tooltip': 'The LoRA used to patch your diffusion model.'})
126+
TYPE_MODEL_IN = ('MODEL', {'tooltip': (
127+
f' Input Model\n {"-" * TOOLTIP_UNDERLINE}\n'
128+
f' - Diffusion model to be used in sampling.\n\n'
129+
)})
130+
TYPE_CLIP_IN = ('CLIP', {'tooltip': (
131+
f' CLIP / Text Encoder Model\n {"-" * TOOLTIP_UNDERLINE}\n'
132+
f' - The CLIP / Text Encoder model used for encoding the text.\n\n'
133+
)})
134+
TYPE_VAE_IN = ('VAE', {'tooltip': (
135+
f' Variational AutoEncoder (VAE)\n {"-" * TOOLTIP_UNDERLINE}\n'
136+
f' - The VAE model used for encoding and decoding images.\n\n'
137+
)})
138+
TYPE_CONTROL_NET_IN = ('CONTROL_NET', {'tooltip': (
139+
f' Control Net\n {"-" * TOOLTIP_UNDERLINE}\n'
140+
f' - The Control Net model used to patch your diffusion model.\n\n'
141+
)})
142+
TYPE_LORA_IN = ('LORA', {'tooltip': (
143+
f' Low Rank Adaptation Model (LoRA)\n {"-" * TOOLTIP_UNDERLINE}\n'
144+
f' - The LoRA used to patch your diffusion model.\n\n'
145+
)})
146+
TYPE_WEIGHT_DTYPE = (['default', 'fp8_e4m3fn', 'fp8_e4m3fn_fast', 'fp8_e5m2'], {'tooltip': (
147+
f' Weight Datatype (DType)\n {"-" * TOOLTIP_UNDERLINE}\n'
148+
f' - The data type to be used for your models weights.\n\n'
149+
)})
86150

87151
# MISC
88152
TYPE_JSON_WIDGET = ('JSON', {'forceInput': True})
@@ -95,21 +159,55 @@ def __ne__(self, __value: object) -> bool:
95159
##
96160

97161
# MODELS
98-
TYPE_DIFFUSION_MODELS_LIST = (DIFFUSION_MODELS_LIST(), {'tooltip': 'Diffusion model list.'})
99-
TYPE_CHECKPOINTS_LIST = (CHECKPOINTS_LIST(), {'tooltip': 'Checkpoint list.'})
100-
TYPE_CLIPS_LIST = (CLIPS_LIST(), {'tooltip': 'CLIP/text encoder list.'})
101-
TYPE_VAES_LIST = (VAES_LIST(), {'tooltip': 'VAE list.'})
102-
TYPE_CONTROL_NETS_LIST = (['none'] + CONTROL_NETS_LIST(), {'tooltip': 'Control Net list.'})
103-
TYPE_LORAS_LIST = (['none'] + LORAS_LIST(), {'tooltip': 'LoRA list.'})
104-
TYPE_ALL_MODEL_LISTS = (ALL_MODELS_LIST(), {'tooltip': 'Full diffusion model list.'})
162+
TYPE_DIFFUSION_MODELS_LIST = lambda: (DIFFUSION_MODELS_LIST(), {'tooltip': (
163+
f' Diffusion Model List\n {"-" * TOOLTIP_UNDERLINE}\n'
164+
f' - List of available diffusion models.\n\n'
165+
)})
166+
TYPE_CHECKPOINTS_LIST = lambda: (CHECKPOINTS_LIST(), {'tooltip': (
167+
f' Checkpoint List\n {"-" * TOOLTIP_UNDERLINE}\n'
168+
f' - List of available model checkpoints.\n\n'
169+
)})
170+
TYPE_CLIPS_LIST = lambda: (CLIPS_LIST(), {'tooltip': (
171+
f' CLIP / Text Encoder List\n {"-" * TOOLTIP_UNDERLINE}\n'
172+
f' - List of available Text Encoders and CLIP models.\n'
173+
f' - Used to convert your text prompts into semantic attention vectors (i.e., numbers) that the model can process.\n'
174+
f' - Contrastive Language-Image Pre-training (CLIP)\n\n'
175+
)})
176+
TYPE_VAES_LIST = lambda: (VAES_LIST(), {'tooltip': (
177+
f' VAE List\n {"-" * TOOLTIP_UNDERLINE}\n'
178+
f' - List of available Variational Autoencoders (VAE).\n'
179+
f' - Used to encode and decode images.\n\n'
180+
)})
181+
TYPE_CONTROL_NETS_LIST = lambda: (['none'] + CONTROL_NETS_LIST(), {'tooltip': (
182+
f' Control Net List\n {"-" * TOOLTIP_UNDERLINE}\n'
183+
f' - List of available Control Nets.\n'
184+
f' - Used to transfer structure of an input image to a generated output image.\n\n'
185+
)})
186+
TYPE_LORAS_LIST = lambda: (['none'] + LORAS_LIST(), {'tooltip': (
187+
f' LoRA List\n {"-" * TOOLTIP_UNDERLINE}\n'
188+
f' - List of available Low-Rank Adaptation models.\n'
189+
f' - Used to transfer a pre-trained style (cyberpunk, anime, photorealism, disney, etc.) to a generated output image.\n\n'
190+
)})
191+
TYPE_ALL_MODEL_LISTS = lambda: (ALL_MODELS_LIST(), {'tooltip': (
192+
f' Full Diffusion Model List\n {"-" * TOOLTIP_UNDERLINE}\n'
193+
f' - List of all available Diffusion Models (diffusion_models, checkpoints & unets folders).\n\n'
194+
)})
105195

106196
# SAMPLING
107-
TYPE_SAMPLERS = (SAMPLERS_LIST(), {'tool_tip': 'The sampling algorithm(s) used during the diffusion process.'}, )
108-
TYPE_SCHEDULERS = (SCHEDULERS_LIST(), {'tool_tip': 'The scheduling algorithm(s) used during the diffusion process.'}, )
197+
TYPE_SAMPLERS = lambda: (SAMPLERS_LIST(), {'tooltip': (
198+
f' Sampling Algorithm\n {"-" * TOOLTIP_UNDERLINE}\n'
199+
f' - List of available Sampling Algorithms.\n'
200+
f' - Used to control the noise removal during the sampling process.\n\n'
201+
)})
202+
TYPE_SCHEDULERS = lambda: (SCHEDULERS_LIST(), {'tooltip': (
203+
f' Scheduling Algorithm\n {"-" * TOOLTIP_UNDERLINE}\n'
204+
f' - List of available Scheduling Algorithms.\n'
205+
f' - Used to control the denoising steps during the sampling process.\n\n'
206+
)})
109207

110208
# FILES
111-
TYPE_INPUT_FILES = (sorted(INPUT_FILES()), {'image_upload': True})
112-
TYPE_OUTPUT_FILES = (sorted(OUTPUT_FILES()), {'image_upload': True})
209+
TYPE_INPUT_FILES = lambda: (sorted(INPUT_FILES()), {'image_upload': True})
210+
TYPE_OUTPUT_FILES = lambda: (sorted(OUTPUT_FILES()), {'image_upload': True})
113211

114212

115213

@@ -133,14 +231,12 @@ def __ne__(self, __value: object) -> bool:
133231

134232
# LATENT SOURCE
135233
TYPE_LATENT_BATCH_SIZE = ('INT', {'default': 1, 'min': 1, 'max': 4096, 'tooltip': (
136-
f'Custom Batch Size\n'
137-
f'-----------------\n'
234+
f' Custom Batch Size\n {"-" * TOOLTIP_UNDERLINE}\n'
138235
f' - The number of images you want to generate.\n\n'
139236
)})
140237
TYPE_LATENT_SOURCE_INPUT_TYPE = (['Empty Latent', 'Input Image', 'Uploaded Image'], {
141238
'tooltip': (
142-
f'Latent Type\n'
143-
f'-----------\n'
239+
f' Latent Type\n {"-" * TOOLTIP_UNDERLINE}\n'
144240
f' - Your choice of an empty latent (all zeros) or an image as a latent.\n\n'
145241
)
146242
})
@@ -167,20 +263,25 @@ def __ne__(self, __value: object) -> bool:
167263
'512x512 - 1:1'
168264
], {
169265
'tooltip': (
170-
f'Resolution Selector\n'
171-
f'-------------------\n'
266+
f' Resolution Selector\n {"-" * TOOLTIP_UNDERLINE}\n'
172267
f' - Select custom to use the entered width & height, or select a resolution.\n\n'
173268
)
174269
})
175270
TYPE_LATENT_SOURCE_ORIENTATION = (['Horizontal', 'Vertical'], {
176271
'tooltip': (
177-
f'Orientaion Selector\n'
178-
f'-------------------\n'
179-
f' - Resolutions given in horizontal orientation. Selects vertical to swap.\n\n'
272+
f' Orientaion Selector\n {"-" * TOOLTIP_UNDERLINE}\n'
273+
f' - Resolutions given in horizontal orientation. Select vertical to swap resolution aspect ratio.\n\n'
180274
)
181275
})
182276
TYPE_LATENT_SOURCE_OUT = ('LATENT', )
183277

278+
279+
# FLUX ENGINE
280+
TYPE_FLUX_ENGINE_OUT = ('MODEL', 'CLIP', 'VAE', 'IMAGE', 'LATENT', )
281+
282+
283+
284+
# --- TO DO ---
184285
# ADVANCED SAMPLING
185286
TYPE_ADDED_LINES = ('INT', {'default': 0, 'min': -20, 'max': 50, 'tooltip': 'Add lines to text in image if your prompt is cut off.'})
186287
TYPE_SEED_LIST = ('STRING', {'default': '4', 'tooltip': 'Random noise seed list. If not empty, seed list is used instead of seed.'})

FS_Utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_mins_and_secs(start_time):
1616
duration = time.time() - start_time
1717
mins = int(duration // 60)
1818
secs = int(duration - mins * 60)
19-
return duration, mins, secs
19+
return round(duration, 4), mins, secs
2020

2121

2222
# I/O

0 commit comments

Comments
 (0)