1
- # pylint: disable=missing-module-docstring, missing-class-docstring, missing-function-docstring, invalid-name
2
-
3
1
import os
4
2
5
3
# pylint: disable=import-error
@@ -48,8 +46,6 @@ def INPUT_TYPES(cls):
48
46
"multiline" : True ,
49
47
"default" : "" ,
50
48
"dynamicPrompts" : False ,
51
- "defaultInput" : True ,
52
- "forceInput" : False ,
53
49
},
54
50
),
55
51
"neg_prompt" : (
@@ -58,8 +54,6 @@ def INPUT_TYPES(cls):
58
54
"multiline" : True ,
59
55
"default" : "" ,
60
56
"dynamicPrompts" : False ,
61
- "defaultInput" : True ,
62
- "forceInput" : False ,
63
57
},
64
58
),
65
59
},
@@ -77,25 +71,20 @@ def INPUT_TYPES(cls):
77
71
{
78
72
"default" : "" ,
79
73
"placeholder" : "full path of the model" ,
80
- "defaultInput" : True ,
81
- "forceInput" : False ,
74
+ "dynamicPrompts" : False ,
82
75
},
83
76
),
84
77
"seed" : (
85
78
"INT" ,
86
79
{
87
80
"default" : - 1 ,
88
- "defaultInput" : True ,
89
- "forceInput" : False ,
90
81
},
91
82
),
92
83
"debug_level" : (
93
84
[e .value for e in DEBUG_LEVEL ],
94
85
{
95
86
"default" : DEBUG_LEVEL .minimal .value ,
96
87
"tooltip" : "Debug level" ,
97
- "defaultInput" : False ,
98
- "forceInput" : False ,
99
88
},
100
89
),
101
90
"variants_definitions" : (
@@ -105,8 +94,7 @@ def INPUT_TYPES(cls):
105
94
"multiline" : True ,
106
95
"placeholder" : "" ,
107
96
"tooltip" : "Definitions for variant models to be recognized based on strings found in the full filename. Format for each line is: 'name(kind)=comma separated list of substrings (case insensitive)' with kind being one of the base model types or not specified" ,
108
- "defaultInput" : False ,
109
- "forceInput" : False ,
97
+ "dynamicPrompts" : False ,
110
98
},
111
99
),
112
100
"wc_process_wildcards" : (
@@ -116,35 +104,39 @@ def INPUT_TYPES(cls):
116
104
"tooltip" : "Process wildcards in the prompt" ,
117
105
"label_on" : "Yes" ,
118
106
"label_off" : "No" ,
119
- "defaultInput" : False ,
120
- "forceInput" : False ,
121
107
},
122
108
),
123
109
"wc_wildcards_folders" : (
124
110
"STRING" ,
125
111
{
126
112
"default" : "" ,
127
113
"tooltip" : "Comma separated list of wildcards folders" ,
128
- "defaultInput" : False ,
129
- "forceInput" : False ,
114
+ "dynamicPrompts" : False ,
115
+ },
116
+ ),
117
+ "wc_wildcards_input" : (
118
+ "STRING" ,
119
+ {
120
+ "default" : "" ,
121
+ "multiline" : True ,
122
+ "placeholder" : "wildcards definitions" ,
123
+ "tooltip" : "Wildcards definitions in yaml/json format" ,
124
+ "dynamicPrompts" : False ,
130
125
},
131
126
),
132
127
"wc_if_wildcards" : (
133
128
[e .value for e in PromptPostProcessor .IFWILDCARDS_CHOICES ],
134
129
{
135
- "default" : PromptPostProcessor .IFWILDCARDS_CHOICES .ignore .value ,
130
+ "default" : PromptPostProcessor .IFWILDCARDS_CHOICES .stop .value ,
136
131
"tooltip" : "How to handle invalid wildcards in the prompt" ,
137
- "defaultInput" : False ,
138
- "forceInput" : False ,
139
132
},
140
133
),
141
134
"wc_choice_separator" : (
142
135
"STRING" ,
143
136
{
144
137
"default" : PromptPostProcessor .DEFAULT_CHOICE_SEPARATOR ,
145
138
"tooltip" : "Default separator for selected choices" ,
146
- "defaultInput" : False ,
147
- "forceInput" : False ,
139
+ "dynamicPrompts" : False ,
148
140
},
149
141
),
150
142
"wc_keep_choices_order" : (
@@ -154,17 +146,14 @@ def INPUT_TYPES(cls):
154
146
"tooltip" : "Keep the order of the choices in the prompt" ,
155
147
"label_on" : "Yes" ,
156
148
"label_off" : "No" ,
157
- "defaultInput" : False ,
158
- "forceInput" : False ,
159
149
},
160
150
),
161
151
"stn_separator" : (
162
152
"STRING" ,
163
153
{
164
154
"default" : PromptPostProcessor .DEFAULT_STN_SEPARATOR ,
165
155
"tooltip" : "Separator for the content added to the negative prompt" ,
166
- "defaultInput" : False ,
167
- "forceInput" : False ,
156
+ "dynamicPrompts" : False ,
168
157
},
169
158
),
170
159
"stn_ignore_repeats" : (
@@ -174,8 +163,6 @@ def INPUT_TYPES(cls):
174
163
"tooltip" : "Ignore repeated content added to the negative prompt" ,
175
164
"label_on" : "Yes" ,
176
165
"label_off" : "No" ,
177
- "defaultInput" : False ,
178
- "forceInput" : False ,
179
166
},
180
167
),
181
168
"cleanup_extra_spaces" : (
@@ -185,8 +172,6 @@ def INPUT_TYPES(cls):
185
172
"tooltip" : "Remove extra spaces" ,
186
173
"label_on" : "Yes" ,
187
174
"label_off" : "No" ,
188
- "defaultInput" : False ,
189
- "forceInput" : False ,
190
175
},
191
176
),
192
177
"cleanup_empty_constructs" : (
@@ -196,8 +181,6 @@ def INPUT_TYPES(cls):
196
181
"tooltip" : "Remove empty constructs" ,
197
182
"label_on" : "Yes" ,
198
183
"label_off" : "No" ,
199
- "defaultInput" : False ,
200
- "forceInput" : False ,
201
184
},
202
185
),
203
186
"cleanup_extra_separators" : (
@@ -207,8 +190,6 @@ def INPUT_TYPES(cls):
207
190
"tooltip" : "Remove extra separators" ,
208
191
"label_on" : "Yes" ,
209
192
"label_off" : "No" ,
210
- "defaultInput" : False ,
211
- "forceInput" : False ,
212
193
},
213
194
),
214
195
"cleanup_extra_separators2" : (
@@ -218,8 +199,6 @@ def INPUT_TYPES(cls):
218
199
"tooltip" : "Remove extra separators (additional cases)" ,
219
200
"label_on" : "Yes" ,
220
201
"label_off" : "No" ,
221
- "defaultInput" : False ,
222
- "forceInput" : False ,
223
202
},
224
203
),
225
204
"cleanup_breaks" : (
@@ -229,8 +208,6 @@ def INPUT_TYPES(cls):
229
208
"tooltip" : "Cleanup around BREAKs" ,
230
209
"label_on" : "Yes" ,
231
210
"label_off" : "No" ,
232
- "defaultInput" : False ,
233
- "forceInput" : False ,
234
211
},
235
212
),
236
213
"cleanup_breaks_eol" : (
@@ -240,8 +217,6 @@ def INPUT_TYPES(cls):
240
217
"tooltip" : "Set BREAKs in their own line" ,
241
218
"label_on" : "Yes" ,
242
219
"label_off" : "No" ,
243
- "defaultInput" : False ,
244
- "forceInput" : False ,
245
220
},
246
221
),
247
222
"cleanup_ands" : (
@@ -251,8 +226,6 @@ def INPUT_TYPES(cls):
251
226
"tooltip" : "Cleanup around ANDs" ,
252
227
"label_on" : "Yes" ,
253
228
"label_off" : "No" ,
254
- "defaultInput" : False ,
255
- "forceInput" : False ,
256
229
},
257
230
),
258
231
"cleanup_ands_eol" : (
@@ -262,8 +235,6 @@ def INPUT_TYPES(cls):
262
235
"tooltip" : "Set ANDs in their own line" ,
263
236
"label_on" : "Yes" ,
264
237
"label_off" : "No" ,
265
- "defaultInput" : False ,
266
- "forceInput" : False ,
267
238
},
268
239
),
269
240
"cleanup_extranetwork_tags" : (
@@ -273,8 +244,6 @@ def INPUT_TYPES(cls):
273
244
"tooltip" : "Clean up around extra network tags" ,
274
245
"label_on" : "Yes" ,
275
246
"label_off" : "No" ,
276
- "defaultInput" : False ,
277
- "forceInput" : False ,
278
247
},
279
248
),
280
249
"cleanup_merge_attention" : (
@@ -284,8 +253,6 @@ def INPUT_TYPES(cls):
284
253
"tooltip" : "Merge nested attention constructs" ,
285
254
"label_on" : "Yes" ,
286
255
"label_off" : "No" ,
287
- "defaultInput" : False ,
288
- "forceInput" : False ,
289
256
},
290
257
),
291
258
"remove_extranetwork_tags" : (
@@ -295,8 +262,6 @@ def INPUT_TYPES(cls):
295
262
"tooltip" : "Remove extra network tags" ,
296
263
"label_on" : "Yes" ,
297
264
"label_off" : "No" ,
298
- "defaultInput" : False ,
299
- "forceInput" : False ,
300
265
},
301
266
),
302
267
},
@@ -342,6 +307,7 @@ def IS_CHANGED(
342
307
variants_definitions ,
343
308
wc_process_wildcards ,
344
309
wc_wildcards_folders ,
310
+ wc_wildcards_input ,
345
311
wc_if_wildcards ,
346
312
wc_choice_separator ,
347
313
wc_keep_choices_order ,
@@ -372,6 +338,7 @@ def IS_CHANGED(
372
338
"variants_definitions" : variants_definitions ,
373
339
"process_wildcards" : wc_process_wildcards ,
374
340
"wildcards_folders" : wc_wildcards_folders ,
341
+ "wildcards_input" : wc_wildcards_input ,
375
342
"if_wildcards" : wc_if_wildcards ,
376
343
"choice_separator" : wc_choice_separator ,
377
344
"keep_choices_order" : wc_keep_choices_order ,
@@ -403,6 +370,7 @@ def process(
403
370
variants_definitions ,
404
371
wc_process_wildcards ,
405
372
wc_wildcards_folders ,
373
+ wc_wildcards_input ,
406
374
wc_if_wildcards ,
407
375
wc_choice_separator ,
408
376
wc_keep_choices_order ,
@@ -427,23 +395,33 @@ def process(
427
395
self .logger .warning ("Model class is not provided. System variables might not be properly set." )
428
396
if modelname == "" :
429
397
self .logger .warning ("Modelname is not provided. System variables will not be properly set." )
398
+ # model class values in ComfyUI\comfy\supported_models.py
430
399
env_info = {
431
400
"app" : "comfyui" ,
432
401
"models_path" : folder_paths .models_dir ,
433
402
"model_filename" : modelname or "" , # path is relative to checkpoints folder
434
403
"model_class" : modelclass ,
435
404
"is_sd1" : modelclass in ("SD15" , "SD15_instructpix2pix" ),
436
- "is_sd2" : modelclass in ("SD20" , "SD21UnclipL" , "SD21UnclipH" ),
405
+ "is_sd2" : modelclass in ("SD20" , "SD21UnclipL" , "SD21UnclipH" , "LotusD" ),
437
406
"is_sdxl" : (
438
407
modelclass in ("SDXL" , "SDXLRefiner" , "SDXL_instructpix2pix" , "Segmind_Vega" , "KOALA_700M" , "KOALA_1B" )
439
408
),
440
409
"is_ssd" : modelclass in ("SSD1B" ,),
441
410
"is_sd3" : modelclass in ("SD3" ,),
442
411
"is_flux" : modelclass in ("Flux" , "FluxInpaint" , "FluxSchnell" ),
443
412
"is_auraflow" : modelclass in ("AuraFlow" ,),
413
+ "is_pixart" : modelclass in ("PixArtAlpha" , "PixArtSigma" ),
414
+ "is_lumina2" : modelclass in ("Lumina2" ,),
415
+ "is_ltxv" : modelclass in ("LTXV" ,),
416
+ "is_cosmos" : modelclass in ("CosmosT2V" , "CosmosI2V" ),
417
+ "is_genmomochi" : modelclass in ("GenmoMochi" ,),
418
+ "is_hunyuan" : modelclass in ("HunyuanDiT" , "HunyuanDiT1" ),
419
+ "is_hunyuanvideo" : modelclass in ("HunyuanVideo" , "HunyuanVideoI2V" , "HunyuanVideoSkyreelsI2V" ),
420
+ "is_hunyuan3d" : modelclass in ("Hunyuan3Dv2" , "Hunyuan3Dv2mini" ),
421
+ "is_wanvideo" : modelclass in ("WAN21_T2V" , "WAN21_I2V" , "WAN21_FunControl2V" ),
422
+ "is_hidream" : modelclass in ("HiDream" ,),
444
423
}
445
- # Also supported: SVD_img2vid, SVD3D_u, SVD3_p, Stable_Zero123, SD_X4Upscaler,
446
- # Stable_Cascade_C, Stable_Cascade_B, StableAudio, HunyuanDiT, HunyuanDiT1, GenmoMochi, LTXV
424
+ # Also supported: SVD_img2vid, SVD3D_u, SVD3_p, Stable_Zero123, SD_X4Upscaler, Stable_Cascade_C, Stable_Cascade_B, StableAudio
447
425
448
426
if wc_wildcards_folders == "" :
449
427
wc_wildcards_folders = "," .join (folder_paths .get_folder_paths ("wildcards" ) or [])
@@ -477,7 +455,11 @@ def process(
477
455
"cleanup_merge_attention" : cleanup_merge_attention ,
478
456
"remove_extranetwork_tags" : remove_extranetwork_tags ,
479
457
}
480
- self .wildcards_obj .refresh_wildcards (debug_level , wildcards_folders if options ["process_wildcards" ] else None )
458
+ self .wildcards_obj .refresh_wildcards (
459
+ debug_level ,
460
+ wildcards_folders if options ["process_wildcards" ] else None ,
461
+ wc_wildcards_input ,
462
+ )
481
463
ppp = PromptPostProcessor (
482
464
self .logger , self .interrupt , env_info , options , self .grammar_content , self .wildcards_obj
483
465
)
@@ -519,8 +501,6 @@ def INPUT_TYPES(cls):
519
501
"multiline" : False ,
520
502
"default" : "" ,
521
503
"dynamicPrompts" : False ,
522
- "defaultInput" : False ,
523
- "forceInput" : False ,
524
504
},
525
505
),
526
506
},
0 commit comments