fix(ui): pass base/type when installing models, add flux formats to MM badges

This commit is contained in:
Mary Hipp 2024-08-21 13:26:52 -04:00 committed by Brandon
parent 400eb94d3b
commit b8486379ce
3 changed files with 17 additions and 3 deletions

View File

@ -12,10 +12,18 @@ type Props = {
export const StarterModelsResultItem = memo(({ result }: Props) => {
const { t } = useTranslation();
const allSources = useMemo(() => {
const _allSources = [{ source: result.source, config: { name: result.name, description: result.description } }];
const _allSources = [
{
source: result.source,
config: { name: result.name, description: result.description, type: result.type, base: result.base },
},
];
if (result.dependencies) {
for (const d of result.dependencies) {
_allSources.push({ source: d.source, config: { name: d.name, description: d.description } });
_allSources.push({
source: d.source,
config: { name: d.name, description: d.description, type: d.type, base: d.base },
});
}
}
return _allSources;

View File

@ -13,7 +13,7 @@ const BASE_COLOR_MAP: Record<BaseModelType, string> = {
'sd-2': 'teal',
sdxl: 'invokeBlue',
'sdxl-refiner': 'invokeBlue',
flux: 'invokeBlue',
flux: 'gold',
};
const ModelBaseBadge = ({ base }: Props) => {

View File

@ -13,6 +13,9 @@ const FORMAT_NAME_MAP: Record<AnyModelConfig['format'], string> = {
invokeai: 'internal',
embedding_file: 'embedding',
embedding_folder: 'embedding',
t5_encoder: 't5_encoder',
t5_encoder_8b: 't5_encoder_8b',
bnb_quantized_nf4b: 'quantized',
};
const FORMAT_COLOR_MAP: Record<AnyModelConfig['format'], string> = {
@ -22,6 +25,9 @@ const FORMAT_COLOR_MAP: Record<AnyModelConfig['format'], string> = {
invokeai: 'base',
embedding_file: 'base',
embedding_folder: 'base',
t5_encoder: 'base',
t5_encoder_8b: 'base',
bnb_quantized_nf4b: 'base',
};
const ModelFormatBadge = ({ format }: Props) => {