@@ -18,84 +18,117 @@ import {
18
18
isTIModelConfig ,
19
19
isUnknownModelConfig ,
20
20
isVAEModelConfig ,
21
+ isVideoModelConfig ,
21
22
} from 'services/api/types' ;
23
+ import { objectEntries } from 'tsafe' ;
22
24
23
- type ModelCategoryData = {
25
+ import type { FilterableModelType } from './store/modelManagerV2Slice' ;
26
+
27
+ export type ModelCategoryData = {
28
+ category : FilterableModelType ;
24
29
i18nKey : string ;
25
30
filter : ( config : AnyModelConfig ) => boolean ;
26
31
} ;
27
32
28
- export const MODEL_CATEGORIES : Record < string , ModelCategoryData > = {
33
+ export const MODEL_CATEGORIES : Record < FilterableModelType , ModelCategoryData > = {
34
+ unknown : {
35
+ category : 'unknown' ,
36
+ i18nKey : 'common.unknown' ,
37
+ filter : isUnknownModelConfig ,
38
+ } ,
29
39
main : {
30
- i18nKey : 'model_manager.category.main_models' ,
40
+ category : 'main' ,
41
+ i18nKey : 'modelManager.main' ,
31
42
filter : isNonRefinerMainModelConfig ,
32
43
} ,
33
44
refiner : {
34
- i18nKey : 'model_manager.category.refiner_models' ,
45
+ category : 'refiner' ,
46
+ i18nKey : 'sdxl.refiner' ,
35
47
filter : isRefinerMainModelModelConfig ,
36
48
} ,
37
49
lora : {
38
- i18nKey : 'model_manager.category.lora_models' ,
50
+ category : 'lora' ,
51
+ i18nKey : 'modelManager.loraModels' ,
39
52
filter : isLoRAModelConfig ,
40
53
} ,
41
54
embedding : {
42
- i18nKey : 'model_manager.category.embedding_models' ,
55
+ category : 'embedding' ,
56
+ i18nKey : 'modelManager.textualInversions' ,
43
57
filter : isTIModelConfig ,
44
58
} ,
45
59
controlnet : {
46
- i18nKey : 'model_manager.category.controlnet_models' ,
60
+ category : 'controlnet' ,
61
+ i18nKey : 'ControlNet' ,
47
62
filter : isControlNetModelConfig ,
48
63
} ,
49
64
t2i_adapter : {
50
- i18nKey : 'model_manager.category.t2i_adapter_models' ,
65
+ category : 't2i_adapter' ,
66
+ i18nKey : 'common.t2iAdapter' ,
51
67
filter : isT2IAdapterModelConfig ,
52
68
} ,
53
69
t5_encoder : {
54
- i18nKey : 'model_manager.category.t5_encoder_models' ,
70
+ category : 't5_encoder' ,
71
+ i18nKey : 'modelManager.t5Encoder' ,
55
72
filter : isT5EncoderModelConfig ,
56
73
} ,
57
74
control_lora : {
58
- i18nKey : 'model_manager.category.control_lora_models' ,
75
+ category : 'control_lora' ,
76
+ i18nKey : 'modelManager.controlLora' ,
59
77
filter : isControlLoRAModelConfig ,
60
78
} ,
61
79
clip_embed : {
62
- i18nKey : 'model_manager.category.clip_embed_models' ,
80
+ category : 'clip_embed' ,
81
+ i18nKey : 'modelManager.clipEmbed' ,
63
82
filter : isCLIPEmbedModelConfig ,
64
83
} ,
65
- spandrel : {
66
- i18nKey : 'model_manager.category.spandrel_image_to_image_models' ,
84
+ spandrel_image_to_image : {
85
+ category : 'spandrel_image_to_image' ,
86
+ i18nKey : 'modelManager.spandrelImageToImage' ,
67
87
filter : isSpandrelImageToImageModelConfig ,
68
88
} ,
69
89
ip_adapter : {
70
- i18nKey : 'model_manager.category.ip_adapter_models' ,
90
+ category : 'ip_adapter' ,
91
+ i18nKey : 'common.ipAdapter' ,
71
92
filter : isIPAdapterModelConfig ,
72
93
} ,
73
94
vae : {
74
- i18nKey : 'model_manager.category.vae_models' ,
95
+ category : 'vae' ,
96
+ i18nKey : 'VAE' ,
75
97
filter : isVAEModelConfig ,
76
98
} ,
77
99
clip_vision : {
78
- i18nKey : 'model_manager.category.clip_vision_models' ,
100
+ category : 'clip_vision' ,
101
+ i18nKey : 'CLIP Vision' ,
79
102
filter : isCLIPVisionModelConfig ,
80
103
} ,
81
104
siglip : {
82
- i18nKey : 'model_manager.category.siglip_models' ,
105
+ category : 'siglip' ,
106
+ i18nKey : 'modelManager.sigLip' ,
83
107
filter : isSigLipModelConfig ,
84
108
} ,
85
109
flux_redux : {
86
- i18nKey : 'model_manager.category.flux_redux_models' ,
110
+ category : 'flux_redux' ,
111
+ i18nKey : 'modelManager.fluxRedux' ,
87
112
filter : isFluxReduxModelConfig ,
88
113
} ,
89
- llava_one_vision : {
90
- i18nKey : 'model_manager.category.llava_one_vision_models' ,
114
+ llava_onevision : {
115
+ category : 'llava_onevision' ,
116
+ i18nKey : 'modelManager.llavaOnevision' ,
91
117
filter : isLLaVAModelConfig ,
92
118
} ,
93
- unknown : {
94
- i18nKey : 'model_manager.category.unknown_models' ,
95
- filter : isUnknownModelConfig ,
119
+ video : {
120
+ category : 'video' ,
121
+ i18nKey : 'Video' ,
122
+ filter : isVideoModelConfig ,
96
123
} ,
97
124
} ;
98
125
126
+ export const MODEL_CATEGORIES_AS_LIST = objectEntries ( MODEL_CATEGORIES ) . map ( ( [ category , { i18nKey, filter } ] ) => ( {
127
+ category,
128
+ i18nKey,
129
+ filter,
130
+ } ) ) ;
131
+
99
132
/**
100
133
* Mapping of model base to its color
101
134
*/
0 commit comments