Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style: Add descriptions for the FLUX.1 Krea and Qwen Image (#8678)

ExDragine769fda060d08
diff --git a/src/config/aiModels/fal.ts b/src/config/aiModels/fal.ts
index 70579097866..d22dcb403b2 100644
--- a/src/config/aiModels/fal.ts
+++ b/src/config/aiModels/fal.ts
@@ -5,14 +5,34 @@ export const fluxSchnellParamsSchema: ModelParamsSchema = {
height: { default: 1024, max: 1536, min: 512, step: 1 },
prompt: { default: '' },
seed: { default: null },
- steps: { default: 4, max: 12, min: 1 },
+ steps: { default: 4, max: 12, min: 1, step: 1 },
width: { default: 1024, max: 1536, min: 512, step: 1 },
};
+export const fluxKreaParamsSchema: ModelParamsSchema = {
+ cfg: { default: 7.5, max: 20, min: 0, step: 0.1 },
+ height: { default: 1248, max: 2048, min: 512, step: 1 },
+ prompt: { default: '' },
+ seed: { default: null },
+ steps: { default: 28, max: 50, min: 1, step: 1 },
+ width: { default: 832, max: 2048, min: 512, step: 1 },
+};
+
+export const qwenImageParamsSchema: ModelParamsSchema = {
+ cfg: { default: 2.5, max: 20, min: 0, step: 0.1 },
+ height: { default: 1328, max: 1536, min: 512, step: 1 },
+ prompt: { default: '' },
+ seed: { default: null },
+ steps: { default: 30, max: 50, min: 2, step: 1 },
+ width: { default: 1328, max: 1536, min: 512, step: 1 },
+};
+
+
+
const falImageModels: AIImageModelCard[] = [
{
- description: 'Frontier image editing model.',
- displayName: 'FLUX.1 Kontext Dev',
+ description: '专注于图像编辑任务的FLUX.1模型,支持文本和图像输入。',
+ displayName: 'FLUX.1 Kontext [dev]',
enabled: true,
id: 'flux-kontext/dev',
parameters: {
@@ -43,8 +63,7 @@ const falImageModels: AIImageModelCard[] = [
type: 'image',
},
{
- description:
- 'FLUX.1 [schnell] 是一个拥有120亿参数的流式转换器模型,能够在1到4步内从文本生成高质量图像,适合个人和商业用途。',
+ description: 'FLUX.1 [schnell] 是一个具有120亿参数的图像生成模型,专注于快速生成高质量图像。',
displayName: 'FLUX.1 Schnell',
enabled: true,
id: 'flux/schnell',
@@ -53,7 +72,16 @@ const falImageModels: AIImageModelCard[] = [
type: 'image',
},
{
- description: 'Google 最高质量的图像生成模型',
+ description: 'Flux Krea [dev] 是一个有美学偏好的图像生成模型,目标是生成更加真实、自然的图像。',
+ displayName: 'FLUX.1 Krea [dev]',
+ enabled: true,
+ id: 'flux/krea',
+ parameters: fluxKreaParamsSchema,
+ releasedAt: '2025-07-31',
+ type: 'image',
+ },
+ {
+ description: 'Google 提供的高质量的图像生成模型',
displayName: 'Imagen 4',
enabled: true,
id: 'imagen4/preview',
@@ -69,6 +97,15 @@ const falImageModels: AIImageModelCard[] = [
releasedAt: '2025-05-21',
type: 'image',
},
+ {
+ description: 'Qwen团队带来的强大生图模型,具有令人印象深刻的中文文字生成能力和多样图片视觉风格。',
+ displayName: 'Qwen Image',
+ enabled: true,
+ id: 'qwen-image',
+ parameters: qwenImageParamsSchema,
+ releasedAt: '2025-08-04',
+ type: 'image',
+ },
];
export const allModels = [...falImageModels];
diff --git a/src/libs/model-runtime/fal/index.ts b/src/libs/model-runtime/fal/index.ts
index 73068a55f46..698985269cb 100644
--- a/src/libs/model-runtime/fal/index.ts
+++ b/src/libs/model-runtime/fal/index.ts
@@ -35,11 +35,11 @@ export class LobeFalAI implements LobeRuntimeAI {
['imageUrl', 'image_url'],
]);
- const defaultInput = {
+ const defaultInput: Record<string, unknown> = {
enable_safety_checker: false,
num_images: 1,
};
- const userInput = Object.fromEntries(
+ const userInput: Record<string, unknown> = Object.fromEntries(
(Object.entries(params) as [keyof typeof params, any][]).map(([key, value]) => [
paramsMap.get(key) ?? key,
value,
@@ -55,6 +55,12 @@ export class LobeFalAI implements LobeRuntimeAI {
delete userInput.height;
}
+ const modelsAcceleratedByDefault = new Set<string>(['flux/krea']);
+ if (modelsAcceleratedByDefault.has(model)) {
+ defaultInput['acceleration'] = 'high';
+ log('Applied default acceleration=high for model: %s', model);
+ }
+
const endpoint = `fal-ai/${model}`;
log('Calling fal.subscribe with endpoint: %s and input: %O', endpoint, {
...defaultInput,