Skip to content

Commit cef8208

Browse files
authored
✨ feat: add image generation capabilities using Google AI Imagen API (#8503)
1 parent 7d85a77 commit cef8208

File tree

5 files changed

+434
-15
lines changed

5 files changed

+434
-15
lines changed

src/config/aiModels/google.ts

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { AIChatModelCard } from '@/types/aiModel';
1+
import { ModelParamsSchema } from '@/libs/standard-parameters';
2+
import { AIChatModelCard, AIImageModelCard } from '@/types/aiModel';
23

34
const googleChatModels: AIChatModelCard[] = [
45
{
@@ -496,6 +497,38 @@ const googleChatModels: AIChatModelCard[] = [
496497
},
497498
];
498499

499-
export const allModels = [...googleChatModels];
500+
// Common parameters for Imagen models
501+
const imagenBaseParameters: ModelParamsSchema = {
502+
aspectRatio: {
503+
default: '1:1',
504+
enum: ['1:1', '16:9', '9:16', '3:4', '4:3'],
505+
},
506+
prompt: { default: '' },
507+
};
508+
509+
const googleImageModels: AIImageModelCard[] = [
510+
{
511+
description: 'Imagen 4th generation text-to-image model series',
512+
displayName: 'Imagen4 Preview 06-06',
513+
enabled: true,
514+
id: 'imagen-4.0-generate-preview-06-06',
515+
organization: 'Deepmind',
516+
parameters: imagenBaseParameters,
517+
releasedAt: '2024-06-06',
518+
type: 'image',
519+
},
520+
{
521+
description: 'Imagen 4th generation text-to-image model series Ultra version',
522+
displayName: 'Imagen4 Ultra Preview 06-06',
523+
enabled: true,
524+
id: 'imagen-4.0-ultra-generate-preview-06-06',
525+
organization: 'Deepmind',
526+
parameters: imagenBaseParameters,
527+
releasedAt: '2024-06-06',
528+
type: 'image',
529+
},
530+
];
531+
532+
export const allModels = [...googleChatModels, ...googleImageModels];
500533

501534
export default allModels;

0 commit comments

Comments
 (0)