Skip to content

Commit b8bf89c

Browse files
Mary Hippmaryhipp
authored andcommitted
add fallback image and make sure description text is legible for model picker noncompact
1 parent a1ade2b commit b8bf89c

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelManagerPanel/ModelImage.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,17 @@ const ModelImage = ({ image_url }: Props) => {
3434
minHeight={MODEL_IMAGE_THUMBNAIL_SIZE}
3535
minWidth={MODEL_IMAGE_THUMBNAIL_SIZE}
3636
borderRadius="base"
37+
fallback={
38+
<Flex
39+
height={MODEL_IMAGE_THUMBNAIL_SIZE}
40+
minWidth={MODEL_IMAGE_THUMBNAIL_SIZE}
41+
borderRadius="base"
42+
alignItems="center"
43+
justifyContent="center"
44+
>
45+
<Icon color="base.500" as={PiImage} boxSize={FALLBACK_ICON_SIZE} />
46+
</Flex>
47+
}
3748
/>
3849
);
3950
};

invokeai/frontend/web/src/features/parameters/components/ModelPicker.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,12 @@ const optionNameSx: SystemStyleObject = {
413413
},
414414
};
415415

416+
const optionDescriptionSx: SystemStyleObject = {
417+
'&[data-is-compact="true"]': {
418+
color: 'base.800',
419+
},
420+
};
421+
416422
const PickerOptionComponent = typedMemo(
417423
<T extends AnyModelConfig>({ option, ...rest }: { option: WithStarred<T> } & BoxProps) => {
418424
const { $compactView } = usePickerContext<WithStarred<T>>();
@@ -453,7 +459,11 @@ const PickerOptionComponent = typedMemo(
453459
</Text>
454460
)}
455461
</Flex>
456-
{option.description && !compactView && <Text color="base.200">{option.description}</Text>}
462+
{option.description && !compactView && (
463+
<Text sx={optionDescriptionSx} data-is-compact={compactView}>
464+
{option.description}
465+
</Text>
466+
)}
457467
</Flex>
458468
</Flex>
459469
);

0 commit comments

Comments
 (0)