-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathvideoModelSearch.py
More file actions
601 lines (542 loc) · 23.1 KB
/
Copy pathvideoModelSearch.py
File metadata and controls
601 lines (542 loc) · 23.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
class videoModelSearch:
"""Video Model Search node for searching and selecting video models"""
# Define the video models by architecture with their default dimensions
VIDEO_MODELS = {
"KlingAI": [
"klingai:1@2 (KlingAI V1.0 Pro)",
"klingai:1@1 (KlingAI V1 Standard)",
"klingai:2@2 (KlingAI V1.5 Pro)",
"klingai:2@1 (KlingAI V1.5 Standard)",
"klingai:3@1 (KlingAI V1.6 Standard)",
"klingai:3@2 (KlingAI V1.6 Pro)",
"klingai:4@3 (KlingAI V2.1 Master)",
"klingai:5@1 (KlingAI V2.1 Standard (I2V))",
"klingai:5@2 (KlingAI V2.1 Pro (I2V))",
"klingai:5@3 (KlingAI V2.0 Master)",
"klingai:6@1 (KlingAI 2.5 Turbo Pro)",
"klingai:7@1 (KlingAI Lip-Sync)",
"klingai:kling@o1 (Kling VIDEO O1)",
"klingai:kling-video@2.6-pro (Kling VIDEO 2.6 Pro)",
"klingai:kling-video@3-pro (Kling VIDEO 3.0 Pro)",
"klingai:kling-video@3-standard (Kling VIDEO 3.0 Standard)",
"klingai:kling-video@3.0-turbo (Kling VIDEO 3.0 Turbo)",
"klingai:kling-video@3-4k (Kling VIDEO 3.0 4K)",
"klingai:kling-video@o3-pro (Kling VIDEO O3 Pro)",
"klingai:kling-video@o3-standard (Kling VIDEO O3 Standard)",
"klingai:kling-video@o3-4k (Kling VIDEO O3 4K)",
"klingai:avatar@2.0-standard (KlingAI Avatar 2.0 Standard)",
"klingai:avatar@2.0-pro (KlingAI Avatar 2.0 Pro)",
],
"Veo": [
"google:2@0 (Veo 2.0)",
"google:3@0 (Veo 3.0)",
"google:3@1 (Veo 3.0 Fast)",
"google:3@2 (Veo 3.1)",
"google:3@3 (Veo 3.1 Fast)",
"google:veo@3.1-lite (Veo 3.1 Lite)",
],
"Bytedance": [
"bytedance:2@1 (Seedance 1.0 Pro)",
"bytedance:1@1 (Seedance 1.0 Lite)",
"bytedance:5@1 (OmniHuman 1)",
"bytedance:5@2 (OmniHuman 1.5)",
"bytedance:seedance@1.5-pro (Seedance 1.5 Pro)",
"bytedance:seedance@2.0-fast (Seedance 2.0 Fast)",
"bytedance:seedance@2.0 (Seedance 2.0)",
],
"MiniMax": [
"minimax:1@1 (MiniMax 01 Base)",
"minimax:2@1 (MiniMax 01 Director)",
"minimax:2@3 (MiniMax I2V 01 Live)",
"minimax:3@1 (MiniMax 02 Hailuo)",
"minimax:4@1 (MiniMax Hailuo 2.3)",
"minimax:4@2 (MiniMax Hailuo 2.3 Fast)",
],
"PixVerse": [
"pixverse:1@1 (PixVerse v3.5)",
"pixverse:1@2 (PixVerse v4)",
"pixverse:1@3 (PixVerse v4.5)",
"pixverse:1@5-fast (PixVerse v5 Fast)",
"pixverse:1@6 (PixVerse v5.5)",
"pixverse:1@7 (PixVerse v5.6)",
"pixverse:1@8 (PixVerse v6)",
"pixverse:lipsync@1 (PixVerse LipSync)",
"pixverse:modify@0 (PixVerse Modify)",
],
"Vidu": [
"vidu:1@0 (Vidu Q1 Classic)",
"vidu:1@1 (Vidu Q1)",
"vidu:1@5 (Vidu 1.5)",
"vidu:2@0 (Vidu 2.0)",
"vidu:4@1 (Vidu Q3)",
"vidu:4@2 (Vidu Q3 Turbo)",
],
"Alibaba": [
"runware:200@1 (Wan 2.1 1.3B)",
"runware:200@2 (Wan 2.1 14B)",
"runware:200@6 (Wan 2.2)",
"runware:200@8 (Wan 2.2 A14B Animate)",
"alibaba:wan@2.6 (Wan 2.6)",
"alibaba:wan@2.6-flash (Wan 2.6 Flash)",
"alibaba:wan@2.7 (Wan 2.7)",
"alibaba:happyhorse@1.0 (Alibaba Happy Horse 1.0)",
],
"OpenAI": [
"openai:3@1 (OpenAI Sora 3.1)",
"openai:3@0 (OpenAI Sora 3.0)",
],
"Lightricks": [
"lightricks:2@0 (LTX Fast)",
"lightricks:2@1 (LTX Pro)",
"lightricks:3@1 (LTX-2 Retake)",
"lightricks:ltx@2 (LTX-2)",
"lightricks:ltx@2.3 (LTX 2.3)",
"lightricks:ltx@2.3-fast (LTX 2.3 Fast)",
"lightricks:ltx@2.3-open (LTX-2.3 Open)",
],
"Ovi": [
"runware:190@1 (Ovi)",
],
"Runway": [
"runway:aleph@2.0 (Runway Aleph 2.0)",
"runway:2@1 (Runway Aleph)",
"runway:1@1 (Runway Gen-4 Turbo)",
"runway:1@2 (Runway Gen-4.5)",
],
"Luma": [
"lumaai:1@1 (Luma Ray 1.6)",
"lumaai:2@1 (Luma Ray 2)",
"lumaai:2@2 (Luma Ray 2 Flash)",
],
"Sync": [
"sync:lipsync-2@1 (Sync LipSync 2)",
"sync:lipsync-2-pro@1 (Sync LipSync 2 Pro)",
"sync:react-1@1 (Sync React-1)",
"sync:3@0 (sync-3)",
],
"Bria": [
"bria:60@1 (Bria Video Eraser)",
],
"Creatify": [
"creatify:aurora@fast (Creatify Aurora Avatar Model API (720p))",
"creatify:aurora@0 (Creatify Aurora Avatar Model API (720p))",
],
"HeyGen": [
"heygen:avatar@4 (HeyGen Avatar IV)",
"heygen:video-agent@0 (HeyGen Video Agent)",
"heygen:avatar@5 (HeyGen Avatar V)",
],
"Hunyuan": [
"runware:hunyuanvideo@1.5 (HunyuanVideo-1.5)",
],
"Kandinsky": [
"runware:210@1 (Kandinsky 5.0 Lite)",
],
"xAI": [
"xai:grok-imagine@video-1.5-preview (Grok Imagine Video 1.5 Preview)",
"xai:grok-imagine@video (Grok Imagine Video)",
],
"VEED": [
"veed:fabric@1.0 (VEED Fabric 1.0)",
],
"Pruna": [
"prunaai:p-video@0 (P-Video)",
"prunaai:p-video@avatar (P-Video Avatar)",
"prunaai:p-video@animate (P-Video Animate)",
"prunaai:p-video@replace (P-Video Replace)",
],
"SkyReels": [
"skywork:skyreels@v4 (SkyReels V4)",
],
}
# Model dimensions mapping
MODEL_DIMENSIONS = {
# KlingAI Models
"klingai:1@2": {"width": 1280, "height": 720},
"klingai:1@1": {"width": 1280, "height": 720},
"klingai:2@2": {"width": 1920, "height": 1080},
"klingai:2@1": {"width": 1280, "height": 720},
"klingai:3@1": {"width": 1280, "height": 720},
"klingai:3@2": {"width": 1920, "height": 1080},
"klingai:4@3": {"width": 1280, "height": 720},
"klingai:5@1": {"width": 1280, "height": 720},
"klingai:5@2": {"width": 1920, "height": 1080},
"klingai:5@3": {"width": 1920, "height": 1080},
"klingai:6@1": {"width": 1920, "height": 1080},
"klingai:7@1": {"width": 0, "height": 0},
"klingai:kling@o1": {"width": 1440, "height": 1440},
"klingai:kling-video@2.6-pro": {"width": 1920, "height": 1080},
"klingai:kling-video@3-pro": {"width": 1920, "height": 1080},
"klingai:kling-video@3-standard": {"width": 1920, "height": 1080},
"klingai:kling-video@3.0-turbo": {"width": 1920, "height": 1080},
"klingai:kling-video@3-4k": {"width": 3840, "height": 2160},
"klingai:kling-video@o3-pro": {"width": 1920, "height": 1080},
"klingai:kling-video@o3-standard": {"width": 1920, "height": 1080},
"klingai:kling-video@o3-4k": {"width": 3840, "height": 2160},
"klingai:avatar@2.0-standard": {"width": 0, "height": 0},
"klingai:avatar@2.0-pro": {"width": 0, "height": 0},
# Veo Models
"google:2@0": {"width": 1280, "height": 720},
"google:3@0": {"width": 1280, "height": 720},
"google:3@1": {"width": 1280, "height": 720},
"google:3@2": {"width": 1280, "height": 720},
"google:3@3": {"width": 1280, "height": 720},
"google:veo@3.1-lite": {"width": 1280, "height": 720},
# Bytedance Models
"bytedance:2@1": {"width": 864, "height": 480},
"bytedance:1@1": {"width": 864, "height": 480},
"bytedance:5@1": {"width": 1024, "height": 1024},
"bytedance:5@2": {"width": 1024, "height": 1024},
"bytedance:seedance@1.5-pro": {"width": 864, "height": 496},
"bytedance:seedance@2.0-fast": {"width": 864, "height": 496},
"bytedance:seedance@2.0": {"width": 864, "height": 496},
# MiniMax Models
"minimax:1@1": {"width": 1366, "height": 768},
"minimax:2@1": {"width": 1366, "height": 768},
"minimax:2@3": {"width": 1366, "height": 768},
"minimax:3@1": {"width": 1366, "height": 768},
"minimax:4@1": {"width": 1366, "height": 768},
"minimax:4@2": {"width": 1366, "height": 768},
# PixVerse Models
"pixverse:1@1": {"width": 640, "height": 360},
"pixverse:1@2": {"width": 640, "height": 360},
"pixverse:1@3": {"width": 640, "height": 360},
"pixverse:1@5-fast": {"width": 640, "height": 360},
"pixverse:1@6": {"width": 640, "height": 360},
"pixverse:1@7": {"width": 640, "height": 360},
"pixverse:1@8": {"width": 640, "height": 360},
"pixverse:lipsync@1": {"width": 640, "height": 360},
"pixverse:modify@0": {"width": 640, "height": 360},
# Vidu Models
"vidu:1@0": {"width": 1920, "height": 1080},
"vidu:1@1": {"width": 1920, "height": 1080},
"vidu:1@5": {"width": 1920, "height": 1080},
"vidu:2@0": {"width": 1920, "height": 1080},
"vidu:4@1": {"width": 1920, "height": 1080},
"vidu:4@2": {"width": 1920, "height": 1080},
# Wan Models
"runware:200@1": {"width": 853, "height": 480},
"runware:200@2": {"width": 853, "height": 480},
"runware:200@6": {"width": 1280, "height": 720},
"runware:200@8": {"width": 1104, "height": 832},
"alibaba:wan@2.6": {"width": 1280, "height": 720},
"alibaba:wan@2.6-flash": {"width": 1280, "height": 720},
"alibaba:wan@2.7": {"width": 1280, "height": 720},
"alibaba:happyhorse@1.0": {"width": 1280, "height": 720},
# OpenAI Models
"openai:3@1": {"width": 1280, "height": 720},
"openai:3@0": {"width": 1280, "height": 720},
# Lightricks Models
"lightricks:2@0": {"width": 1920, "height": 1080},
"lightricks:2@1": {"width": 1920, "height": 1080},
"lightricks:3@1": {"width": 0, "height": 0},
"lightricks:ltx@2": {"width": 1024, "height": 1024},
"lightricks:ltx@2.3": {"width": 1920, "height": 1080},
"lightricks:ltx@2.3-fast": {"width": 1920, "height": 1080},
"lightricks:ltx@2.3-open": {"width": 1024, "height": 1024},
# Ovi Models
"runware:190@1": {"width": 0, "height": 0},
# Runway Models
"runway:aleph@2.0": {"width": 0, "height": 0},
"runway:2@1": {"width": 1280, "height": 720},
"runway:1@1": {"width": 1280, "height": 720},
"runway:1@2": {"width": 1280, "height": 720},
# Luma Models
"lumaai:1@1": {"width": 1080, "height": 720},
"lumaai:2@1": {"width": 1080, "height": 720},
"lumaai:2@2": {"width": 1080, "height": 720},
# Sync Models
"sync:lipsync-2@1": {"width": 0, "height": 0},
"sync:lipsync-2-pro@1": {"width": 0, "height": 0},
"sync:react-1@1": {"width": 0, "height": 0},
"sync:3@0": {"width": 1280, "height": 720},
# Bria Models
"bria:60@1": {"width": 0, "height": 0},
# Creatify Models
"creatify:aurora@fast": {"width": 1280, "height": 720},
"creatify:aurora@0": {"width": 1280, "height": 720},
# Hunyuan Models
"runware:hunyuanvideo@1.5": {"width": 848, "height": 480},
# Kandinsky Models
"runware:210@1": {"width": 512, "height": 512},
# xAI Models
"xai:grok-imagine@video-1.5-preview": {"width": 480, "height": 480},
"xai:grok-imagine@video": {"width": 480, "height": 480},
# VEED Models (preserves input aspect ratio; resolution = shorter side)
"veed:fabric@1.0": {"width": 1280, "height": 720},
# Pruna Models (720p)
"prunaai:p-video@0": {"width": 1280, "height": 720},
"prunaai:p-video@avatar": {"width": 1280, "height": 720},
"prunaai:p-video@animate": {"width": 1280, "height": 720},
"prunaai:p-video@replace": {"width": 1280, "height": 720},
# HeyGen Models (Model ID: heygen-avatar-iv, heygen-avatar-v)
"heygen:avatar@4": {"width": 1280, "height": 720},
"heygen:video-agent@0": {"width": 1280, "height": 720},
"heygen:avatar@5": {"width": 1280, "height": 720},
# SkyReels Models
"skywork:skyreels@v4": {"width": 1280, "height": 720},
}
# Model resolutions mapping
MODEL_RESOLUTIONS = {
# KlingAI Models
"klingai:1@2": "720p",
"klingai:1@1": "720p",
"klingai:2@2": "1080p",
"klingai:2@1": "720p",
"klingai:3@1": "720p",
"klingai:3@2": "1080p",
"klingai:4@3": "720p",
"klingai:5@1": "720p",
"klingai:5@2": "1080p",
"klingai:5@3": "1080p",
"klingai:6@1": "1080p",
"klingai:7@1": None, # No resolution support
"klingai:kling@o1": None, # No standard resolution (1440x1440)
"klingai:kling-video@2.6-pro": "1080p",
"klingai:kling-video@3-pro": "1080p",
"klingai:kling-video@3-standard": "1080p",
"klingai:kling-video@3.0-turbo": "1080p",
"klingai:kling-video@3-4k": None, # No 4K option in current resolution dropdown
"klingai:kling-video@o3-pro": "1080p",
"klingai:kling-video@o3-standard": "1080p",
"klingai:kling-video@o3-4k": None, # No 4K option in current resolution dropdown
"klingai:avatar@2.0-standard": None, # No resolution support
"klingai:avatar@2.0-pro": None, # No resolution support
# Veo Models
"google:2@0": "720p",
"google:3@0": "720p",
"google:3@1": "720p",
"google:3@2": "720p",
"google:3@3": "720p",
"google:veo@3.1-lite": "720p",
# Bytedance Models
"bytedance:2@1": "480p",
"bytedance:1@1": "480p",
"bytedance:5@1": None, # No resolution support (fixed 1024x1024)
"bytedance:5@2": None, # No resolution support (fixed 1024x1024)
"bytedance:seedance@1.5-pro": "480p",
"bytedance:seedance@2.0-fast": "480p",
"bytedance:seedance@2.0": "480p",
# MiniMax Models (support both 768p and 720p, using 768p as primary)
"minimax:1@1": "768p",
"minimax:2@1": "768p",
"minimax:2@3": "768p",
"minimax:3@1": "768p",
"minimax:4@1": "768p",
"minimax:4@2": "768p",
# PixVerse Models
"pixverse:1@1": "360p",
"pixverse:1@2": "360p",
"pixverse:1@3": "360p",
"pixverse:1@5-fast": "360p",
"pixverse:1@6": "360p",
"pixverse:1@7": "360p",
"pixverse:1@8": "360p",
"pixverse:lipsync@1": "360p",
"pixverse:modify@0": "360p",
# Vidu Models
"vidu:1@0": "1080p",
"vidu:1@1": "1080p",
"vidu:1@5": "1080p",
"vidu:2@0": "1080p",
"vidu:4@1": "1080p",
"vidu:4@2": "1080p",
# Wan Models
"runware:200@1": "480p",
"runware:200@2": "480p",
"runware:200@6": "720p",
"runware:200@8": "720p",
"alibaba:wan@2.6": "720p",
"alibaba:wan@2.6-flash": "720p",
"alibaba:wan@2.7": "720p",
"alibaba:happyhorse@1.0": "720p",
# OpenAI Models
"openai:3@1": "720p",
"openai:3@0": "720p",
# Lightricks Models
"lightricks:2@0": "1080p",
"lightricks:2@1": "1080p",
"lightricks:3@1": None, # No resolution support
"lightricks:ltx@2": None, # No resolution support (fixed 1024x1024)
"lightricks:ltx@2.3": "1080p",
"lightricks:ltx@2.3-fast": "1080p",
"lightricks:ltx@2.3-open": None, # No resolution support (fixed 1024x1024)
# Ovi Models
"runware:190@1": None, # No resolution support
# Runway Models
"runway:aleph@2.0": None, # Output ratio matches input video
"runway:2@1": "720p",
"runway:1@1": "720p",
"runway:1@2": "720p",
# Luma Models
"lumaai:1@1": "720p",
"lumaai:2@1": "720p",
"lumaai:2@2": "720p",
# Sync Models
"sync:lipsync-2@1": "720p",
"sync:lipsync-2-pro@1": "720p",
"sync:react-1@1": "720p",
"sync:3@0": "720p",
# Bria Models
"bria:60@1": "720p",
# Creatify Models
"creatify:aurora@fast": "720p",
"creatify:aurora@0": "720p",
# Hunyuan Models
"runware:hunyuanvideo@1.5": "480p",
# Kandinsky Models
"runware:210@1": None, # No resolution support (fixed 512x512)
# xAI Models
"xai:grok-imagine@video-1.5-preview": "480p",
"xai:grok-imagine@video": "480p",
# VEED Models
"veed:fabric@1.0": "720p",
# Pruna Models
"prunaai:p-video@0": "720p",
"prunaai:p-video@avatar": "720p",
"prunaai:p-video@animate": "720p",
"prunaai:p-video@replace": "720p",
# HeyGen Models
"heygen:avatar@4": "720p",
"heygen:video-agent@0": "720p",
"heygen:avatar@5": "720p",
# SkyReels Models
"skywork:skyreels@v4": "720p",
}
MODEL_ARCHITECTURES = [
"All",
"KlingAI",
"Veo",
"Bytedance",
"MiniMax",
"PixVerse",
"Vidu",
"Wan", # Backward-compatible alias for existing workflows
"Alibaba",
"OpenAI",
"Lightricks",
"Ovi",
"Runway",
"Luma",
"Sync",
"Bria",
"Creatify",
"HeyGen",
"Hunyuan",
"Kandinsky",
"xAI",
"VEED",
"Pruna",
"SkyReels",
]
DEFAULT_DIMENSIONS = {"width": 1024, "height": 576}
@classmethod
def INPUT_TYPES(cls):
allModels = cls._getAllModels()
defaultModel = "klingai:5@3 (KlingAI V2.0 Master)"
defaultModelCode = defaultModel.split(" (")[0]
defaultDims = cls.MODEL_DIMENSIONS.get(defaultModelCode, cls.DEFAULT_DIMENSIONS)
defaultResolution = cls.MODEL_RESOLUTIONS.get(defaultModelCode, None)
return {
"required": {
"Model Search": ("STRING", {
"tooltip": "Search For Specific Video Model By Name Or Civit AIR Code (eg: KlingAI, Veo).",
}),
"Model Architecture": (cls.MODEL_ARCHITECTURES, {
"tooltip": "Choose Video Model Architecture To Filter Results.",
"default": "KlingAI",
}),
"VideoList": (allModels, {
"tooltip": "Video Model Results Will Show UP Here So You Could Choose From.",
"default": defaultModel,
}),
"Use Search Value": ("BOOLEAN", {
"tooltip": "When Enabled, the value you've set in the search input will be used instead.\n\nThis is useful in case the model search API is down or you prefer to set the model manually.",
"default": False,
"label_on": "Enabled",
"label_off": "Disabled",
}),
"useCustomDimensions": (["Model Default", "Custom", "Disabled"], {
"tooltip": "Model Default: Use model's recommended resolution. Custom: Use custom Width/Height values. Disabled: Don't pass width/height to API.",
"default": "Model Default",
}),
"Width": ("INT", {
"default": defaultDims["width"],
"min": 0,
"max": 4096,
"step": 1,
"tooltip": "Custom Width For The Selected Model. Defaults To Model's Recommended Width.",
}),
"Height": ("INT", {
"default": defaultDims["height"],
"min": 0,
"max": 4096,
"step": 1,
"tooltip": "Custom Height For The Selected Model. Defaults To Model's Recommended Height.",
}),
"useResolution": ("BOOLEAN", {
"tooltip": "Enable to include resolution parameter in API request. Disable if your model doesn't support resolution.",
"default": False,
}),
"resolution": (["360p", "480p", "720p", "768p", "1080p"], {
"tooltip": "Select a standard resolution for Video Inference. Only used when 'Use Resolution' is enabled.",
"default": defaultResolution if defaultResolution else "720p",
}),
},
}
@classmethod
def _getAllModels(cls):
"""Get all models from all architectures"""
allModels = []
for models in cls.VIDEO_MODELS.values():
allModels.extend(models)
return allModels
DESCRIPTION = "Directly Search and Connect Video Models to Runware Video Inference Nodes In ComfyUI."
FUNCTION = "videoModelSearch"
RETURN_TYPES = ("RUNWAREVIDEOMODEL",)
RETURN_NAMES = ("Runware Video Model",)
CATEGORY = "Runware"
@classmethod
def VALIDATE_INPUTS(cls, VideoList):
return True
def videoModelSearch(self, **kwargs):
"""Search and return video model with dimensions"""
enableSearchValue = kwargs.get("Use Search Value", False)
searchInput = kwargs.get("Model Search")
customWidth = kwargs.get("Width", 0)
customHeight = kwargs.get("Height", 0)
useCustomDimensions = kwargs.get("useCustomDimensions", "Model Default")
useResolution = kwargs.get("useResolution", False)
resolution = kwargs.get("resolution", "720p")
if enableSearchValue:
modelAirCode = searchInput
else:
currentModel = kwargs.get("VideoList")
modelAirCode = currentModel.split(" (")[0]
dimensions = self.MODEL_DIMENSIONS.get(modelAirCode, self.DEFAULT_DIMENSIONS)
modelResolution = self.MODEL_RESOLUTIONS.get(modelAirCode, None)
if useCustomDimensions == "Custom":
# Use custom dimensions from Width/Height widgets
width = customWidth
height = customHeight
elif useCustomDimensions == "Disabled":
# Don't pass width/height (use None in dict)
width = None
height = None
else: # "Model Default"
# Use model default dimensions
width = dimensions["width"]
height = dimensions["height"]
resultDict = {
"model": modelAirCode,
"useCustomDimensions": useCustomDimensions,
"width": width,
"height": height,
}
# Add resolution if enabled and model supports it
if useResolution and modelResolution is not None:
resultDict["resolution"] = resolution
resultDict["useResolution"] = True
else:
resultDict["useResolution"] = False
return (resultDict,)