79 lines
2.2 KiB
TypeScript
79 lines
2.2 KiB
TypeScript
export const FAL_IMAGE_BASE_URL = "https://fal.run";
|
|
export const FAL_GPT_IMAGE_2_EDIT_MODEL_ID = "openai/gpt-image-2/edit";
|
|
|
|
export interface FalImageModelPreset {
|
|
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 FAL_IMAGE_MODEL_PRESETS: FalImageModelPreset[] = [
|
|
{
|
|
modelId: FAL_GPT_IMAGE_2_EDIT_MODEL_ID,
|
|
displayName: "FAL GPT Image 2 Edit",
|
|
description:
|
|
"FAL 托管的 OpenAI GPT Image 2 图片编辑模型,需至少一张参考图,支持多图参考、自然语言编辑与可选蒙版。",
|
|
supportsVision: true,
|
|
supportsImageGen: true,
|
|
capabilities: {
|
|
provider: "fal",
|
|
kind: "image-edit",
|
|
endpoint: FAL_GPT_IMAGE_2_EDIT_MODEL_ID,
|
|
apiFormat: "fal-gpt-image-2-edit",
|
|
officialUrl: "https://fal.ai/models/openai/gpt-image-2/edit",
|
|
requiredFields: ["prompt", "image_urls"],
|
|
optionalFields: [
|
|
"image_size",
|
|
"quality",
|
|
"num_images",
|
|
"output_format",
|
|
"mask_image_url",
|
|
"openai_api_key",
|
|
],
|
|
supportsMultiImageReference: true,
|
|
supportsMask: true,
|
|
supportsStreaming: true,
|
|
},
|
|
defaultParams: {
|
|
provider: "fal",
|
|
endpoint: FAL_GPT_IMAGE_2_EDIT_MODEL_ID,
|
|
apiFormat: "fal-gpt-image-2-edit",
|
|
imageSize: "auto",
|
|
quality: "high",
|
|
outputFormat: "png",
|
|
},
|
|
imageGenConfig: {
|
|
maxImages: 4,
|
|
supportsSize: true,
|
|
supports1K: true,
|
|
supports2K: true,
|
|
supports4K: true,
|
|
supportsPromptExtend: true,
|
|
supportsNegativePrompt: false,
|
|
supportsWatermark: false,
|
|
supportsSeed: false,
|
|
supportedImageSizes: [
|
|
"auto",
|
|
"square_hd",
|
|
"square",
|
|
"landscape_4_3",
|
|
"landscape_16_9",
|
|
"portrait_4_3",
|
|
"portrait_16_9",
|
|
],
|
|
supportedQualities: ["low", "medium", "high"],
|
|
enableLoadingPlaceholder: true,
|
|
loadingColor: "purple",
|
|
creditCostPerImage: 0,
|
|
creditCostPerVideo: 0,
|
|
},
|
|
sortOrder: 20,
|
|
},
|
|
];
|