74 lines
1.9 KiB
TypeScript
74 lines
1.9 KiB
TypeScript
export interface RuxaImageModelPreset {
|
|
modelId: string;
|
|
displayName: string;
|
|
description: string;
|
|
supportsVision: boolean;
|
|
supportsImageGen: boolean;
|
|
capabilities?: Record<string, any>;
|
|
defaultParams?: Record<string, any>;
|
|
imageGenConfig?: Record<string, any>;
|
|
sortOrder: number;
|
|
}
|
|
|
|
export const RUXA_NANO_BANANA_2_MODEL_ID = "google/nano-banana-2";
|
|
export const RUXA_NANO_BANANA_PRO_MODEL_ID = "google/nano-banana-pro";
|
|
|
|
const RUXA_IMAGE_CONFIG = {
|
|
maxImages: 1,
|
|
supportsSize: true,
|
|
supports1K: true,
|
|
supports2K: true,
|
|
supports4K: true,
|
|
supportsPromptExtend: false,
|
|
supportsNegativePrompt: false,
|
|
supportsWatermark: false,
|
|
supportsSeed: false,
|
|
creditCostPerImage: 0,
|
|
enableLoadingPlaceholder: true,
|
|
loadingColor: "blue",
|
|
};
|
|
|
|
export const RUXA_IMAGE_MODEL_PRESETS: RuxaImageModelPreset[] = [
|
|
{
|
|
modelId: RUXA_NANO_BANANA_2_MODEL_ID,
|
|
displayName: "Nano Banana 2「专线」",
|
|
description:
|
|
"RUXA 专线 Nano Banana 2。支持文生图和图像编辑输入。",
|
|
supportsVision: true,
|
|
supportsImageGen: true,
|
|
defaultParams: {
|
|
provider: "ruxa",
|
|
endpoint: "nano-banana-2",
|
|
imageSize: "2K",
|
|
aspectRatio: "1:1",
|
|
},
|
|
imageGenConfig: {
|
|
...RUXA_IMAGE_CONFIG,
|
|
},
|
|
sortOrder: 10,
|
|
},
|
|
{
|
|
modelId: RUXA_NANO_BANANA_PRO_MODEL_ID,
|
|
displayName: "Nano Banana Pro「专线」",
|
|
description: "RUXA 专线 Nano Banana Pro。支持文生图和图像编辑输入。",
|
|
supportsVision: true,
|
|
supportsImageGen: true,
|
|
defaultParams: {
|
|
provider: "ruxa",
|
|
endpoint: "nano-banana-pro",
|
|
imageSize: "2K",
|
|
aspectRatio: "1:1",
|
|
},
|
|
imageGenConfig: {
|
|
...RUXA_IMAGE_CONFIG,
|
|
},
|
|
sortOrder: 20,
|
|
},
|
|
];
|
|
|
|
export function getRuxaImageModelPresetById(modelId: string) {
|
|
return RUXA_IMAGE_MODEL_PRESETS.find(
|
|
(preset) => preset.modelId === String(modelId || "").trim()
|
|
);
|
|
}
|