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.

14.1 KB
Raw Blame
import type { ModelParamsSchema } from '../standard-parameters';
import type { AIImageModelCard, AIText2MusicModelCard, AIVideoModelCard } from '../types/aiModel';

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, 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 },
  // Tested: fal width/height max support up to 1536
  // Default values from https://chat.qwen.ai/ official website
  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 },
};

export const qwenEditParamsSchema: ModelParamsSchema = {
  cfg: { default: 4, max: 20, min: 0, step: 0.1 },
  height: { default: 1328, max: 1536, min: 512, step: 1 },
  imageUrl: { default: null },
  prompt: { default: '' },
  seed: { default: null },
  steps: { default: 30, max: 50, min: 2, step: 1 },
  width: { default: 1328, max: 1536, min: 512, step: 1 },
};

export const huanyuanImageParamsSchema: ModelParamsSchema = {
  cfg: { default: 7.5, max: 20, min: 1, step: 0.1 },
  prompt: { default: '' },
  seed: { default: null },
  size: {
    default: 'square_hd',
    enum: [
      'square_hd',
      'square',
      'portrait_4_3',
      'portrait_16_9',
      'landscape_4_3',
      'landscape_16_9',
    ],
  },
  steps: { default: 28, max: 50, min: 1, step: 1 },
};

const falImageModels: AIImageModelCard[] = [
  {
    description:
      'Nano Banana is Google’s newest, fastest, and most efficient native multimodal model, enabling image generation and editing through conversation.',
    displayName: 'Nano Banana',
    enabled: true,
    id: 'fal-ai/nano-banana',
    parameters: {
      imageUrls: { default: [], maxCount: 10 },
      prompt: {
        default: '',
      },
    },
    pricing: {
      units: [{ name: 'imageGeneration', rate: 0.039, strategy: 'fixed', unit: 'image' }],
    },
    releasedAt: '2025-08-26',
    type: 'image',
  },
  {
    description:
      'Seedream 4.0 is an image generation model from ByteDance Seed, supporting text and image inputs with highly controllable, high-quality image generation. It generates images from text prompts.',
    displayName: 'Seedream 4.0',
    enabled: true,
    id: 'fal-ai/bytedance/seedream/v4',
    parameters: {
      height: { default: 1024, max: 4096, min: 1024, step: 1 },
      imageUrls: { default: [], maxCount: 10, maxFileSize: 10 * 1024 * 1024 },
      prompt: {
        default: '',
      },
      seed: { default: null },
      width: { default: 1024, max: 4096, min: 1024, step: 1 },
    },
    pricing: {
      units: [{ name: 'imageGeneration', rate: 0.03, strategy: 'fixed', unit: 'image' }],
    },
    releasedAt: '2025-09-09',
    type: 'image',
  },
  {
    description: 'A powerful native multimodal image generation model.',
    displayName: 'HunyuanImage 3.0',
    enabled: true,
    id: 'fal-ai/hunyuan-image/v3',
    parameters: huanyuanImageParamsSchema,
    pricing: {
      units: [{ name: 'imageGeneration', rate: 0.1, strategy: 'fixed', unit: 'megapixel' }],
    },
    releasedAt: '2025-09-28',
    type: 'image',
  },
  {
    description: 'FLUX.1 model focused on image editing, supporting text and image inputs.',
    displayName: 'FLUX.1 Kontext [dev]',
    enabled: true,
    id: 'fal-ai/flux-kontext/dev',
    parameters: {
      imageUrl: { default: null },
      prompt: { default: '' },
      seed: { default: null },
      steps: { default: 28, max: 50, min: 10 },
    },
    pricing: {
      units: [{ name: 'imageGeneration', rate: 0.025, strategy: 'fixed', unit: 'megapixel' }],
    },
    releasedAt: '2025-06-28',
    type: 'image',
  },
  {
    description:
      'FLUX.1 Kontext [pro] accepts text and reference images as input, enabling targeted local edits and complex global scene transformations.',
    displayName: 'FLUX.1 Kontext [pro]',
    enabled: true,
    id: 'fal-ai/flux-pro/kontext',
    parameters: {
      aspectRatio: {
        default: '1:1',
        enum: ['21:9', '16:9', '4:3', '3:2', '1:1', '2:3', '3:4', '9:16', '9:21'],
      },
      imageUrl: { default: null },
      prompt: { default: '' },
      seed: { default: null },
    },
    pricing: {
      units: [{ name: 'imageGeneration', rate: 0.04, strategy: 'fixed', unit: 'image' }],
    },
    releasedAt: '2025-05-01',
    type: 'image',
  },
  {
    description:
      'FLUX.1 [schnell] is a 12B-parameter image generation model built for fast, high-quality output.',
    displayName: 'FLUX.1 Schnell',
    enabled: true,
    id: 'fal-ai/flux/schnell',
    parameters: fluxSchnellParamsSchema,
    pricing: {
      units: [{ name: 'imageGeneration', rate: 0.003, strategy: 'fixed', unit: 'megapixel' }],
    },
    releasedAt: '2024-08-01',
    type: 'image',
  },
  {
    description:
      'Flux Krea [dev] is an image generation model with an aesthetic bias toward more realistic, natural images.',
    displayName: 'FLUX.1 Krea [dev]',
    enabled: true,
    id: 'fal-ai/flux/krea',
    parameters: fluxKreaParamsSchema,
    pricing: {
      units: [{ name: 'imageGeneration', rate: 0.025, strategy: 'fixed', unit: 'megapixel' }],
    },
    releasedAt: '2025-07-31',
    type: 'image',
  },
  {
    description: 'High-quality image generation model from Google.',
    displayName: 'Imagen 4',
    enabled: true,
    id: 'fal-ai/imagen4/preview',
    organization: 'Deepmind',
    parameters: {
      aspectRatio: {
        default: '1:1',
        enum: ['1:1', '16:9', '9:16', '3:4', '4:3'],
      },
      prompt: { default: '' },
      seed: { default: null },
    },
    pricing: {
      units: [{ name: 'imageGeneration', rate: 0.05, strategy: 'fixed', unit: 'image' }],
    },
    releasedAt: '2025-05-21',
    type: 'image',
  },
  {
    description:
      'A professional image editing model from the Qwen team that supports semantic and appearance edits, precisely edits Chinese and English text, and enables high-quality edits such as style transfer and object rotation.',
    displayName: 'Qwen Edit',
    enabled: true,
    id: 'fal-ai/qwen-image-edit',
    parameters: qwenEditParamsSchema,
    pricing: {
      units: [{ name: 'imageGeneration', rate: 0.03, strategy: 'fixed', unit: 'megapixel' }],
    },
    releasedAt: '2025-08-19',
    type: 'image',
  },
  {
    description:
      'A powerful image generation model from the Qwen team with impressive Chinese text rendering and diverse visual styles.',
    displayName: 'Qwen Image',
    enabled: true,
    id: 'fal-ai/qwen-image',
    parameters: qwenImageParamsSchema,
    pricing: {
      units: [{ name: 'imageGeneration', rate: 0.02, strategy: 'fixed', unit: 'megapixel' }],
    },
    releasedAt: '2025-08-04',
    type: 'image',
  },
];

const falVideoModels: AIVideoModelCard[] = [
  {
    description:
      "ByteDance's Seedance 2.5 on fal, generating up to 30-second single-shot videos with native audio from text, first/last frames, or up to 30 reference images.",
    displayName: 'Seedance 2.5',
    enabled: true,
    // One card for the fal app; the runtime picks text-to-video, image-to-video or
    // reference-to-video from the supplied images.
    id: 'bytedance/seedance-2.5',
    organization: 'ByteDance',
    parameters: {
      aspectRatio: {
        default: '16:9',
        enum: ['21:9', '16:9', '4:3', '1:1', '3:4', '9:16'],
      },
      duration: { default: 5, max: 30, min: 4, step: 1 },
      endImageUrl: { default: null, maxFileSize: 30 * 1024 * 1024, requiresImageUrl: true },
      generateAudio: { default: true },
      imageUrl: { default: null, maxFileSize: 30 * 1024 * 1024 },
      imageUrls: { default: [], maxCount: 30, maxFileSize: 30 * 1024 * 1024 },
      prompt: { default: '' },
      resolution: { default: '720p', enum: ['480p', '720p', '1080p'] },
      seed: { default: null },
    },
    pricing: {
      // 5 seconds at the default 720p 16:9
      approximatePricePerVideo: 2.33,
      units: [
        {
          // Output tokens: width × height × (24 × seconds + 1) / 1024, with or without audio
          // (see meterVideoOutputTokens); input images are not billed. fal lists $0.0214 / 1K
          // tokens but bills 1080p at 1.094× the tokens (measured on every aspect ratio), so
          // its rate is 21.4 × 1.094
          lookup: {
            prices: { '1080p': 23.4116, '480p': 21.4, '720p': 21.4 },
            pricingParams: ['resolution'],
          },
          name: 'videoGeneration',
          strategy: 'lookup',
          unit: 'millionTokens',
        },
      ],
    },
    releasedAt: '2026-08-12',
    type: 'video',
  },
  {
    description:
      "fal's post-trained MiniMax H3 with stronger prompt adherence and aesthetics, supporting text-to-video, first/last-frame image-to-video, and reference-to-video with native audio.",
    displayName: 'H3 Max',
    enabled: true,
    // One card for the fal app; the runtime picks text-to-video, image-to-video or
    // reference-to-video from the supplied images.
    id: 'minimax/h3-max',
    parameters: {
      aspectRatio: {
        default: '16:9',
        enum: ['21:9', '16:9', '4:3', '1:1', '3:4', '9:16'],
      },
      duration: { default: 5, max: 15, min: 5, step: 1 },
      endImageUrl: { default: null },
      imageUrl: { default: null },
      imageUrls: {
        aspectRatio: { max: 2.5, min: 0.4 },
        default: [],
        maxCount: 9,
      },
      prompt: { default: '' },
      promptExtend: { default: 'balanced', enum: ['disabled', 'balanced', 'quality'] },
      resolution: { default: '768P', enum: ['480P', '768P', '1080P'] },
      seed: { default: null },
    },
    pricing: {
      // 5 seconds at the default 768P
      approximatePricePerVideo: 0.4,
      units: [
        {
          lookup: {
            prices: { '1080P': 0.16, '480P': 0.05, '768P': 0.08 },
            pricingParams: ['resolution'],
          },
          name: 'videoGeneration',
          strategy: 'lookup',
          unit: 'second',
        },
        {
          // Reference tokens above 4,096 per request at $0.02 / 1K; tokens per image follow the
          // aspect ratio (see countVideoReferenceImageTokens)
          mode: 'graduated',
          name: 'imageInput',
          strategy: 'tiered',
          tiers: [
            { rate: 0, upTo: 4096 },
            { rate: 20, upTo: 'infinity' },
          ],
          unit: 'millionTokens',
        },
      ],
    },
    releasedAt: '2026-09-01',
    type: 'video',
  },
];

/**
 * fal-hosted music models. Each card declares only the standard music params its fal endpoint
 * accepts; the runtime maps them to the endpoint's input fields (see `providers/fal/createMusic`).
 */
const falMusicModels: AIText2MusicModelCard[] = [
  {
    description:
      'MiniMax Music 2.6 on fal: full songs with vocals and arrangement from lyrics and a style description. Leave the lyrics empty to have them written from the description, or switch on instrumental.',
    displayName: 'MiniMax Music 2.6',
    enabled: true,
    id: 'fal-ai/minimax-music/v2.6',
    parameters: {
      autoLyrics: { default: false },
      bitrate: { default: 256_000, enum: [32_000, 64_000, 128_000, 256_000] },
      format: { default: 'mp3', enum: ['mp3', 'wav'] },
      instrumental: { default: false },
      lyrics: { default: null, maxLength: 3500 },
      prompt: { default: '', maxLength: 2000, minLength: 10, required: true },
      sampleRate: { default: 44_100, enum: [16_000, 24_000, 32_000, 44_100] },
    },
    pricing: {
      units: [{ name: 'musicGeneration', rate: 0.15, strategy: 'fixed', unit: 'song' }],
    },
    type: 'text2music',
  },
  {
    description:
      'MiniMax Music 3 on fal: complete songs up to five minutes from a structured style description and lyrics, billed by the generated length.',
    displayName: 'MiniMax Music 3',
    enabled: true,
    id: 'minimax/music-3',
    parameters: {
      duration: { default: 60, max: 300, min: 1, step: 1 },
      lyrics: { default: null, required: true },
      prompt: { default: '', required: true },
    },
    pricing: {
      units: [{ name: 'musicGeneration', rate: 0.002, strategy: 'fixed', unit: 'second' }],
    },
    type: 'text2music',
  },
  {
    description:
      'MiniMax Music 01 on fal: sings your lyrics (up to 600 characters) in the style of a reference song. The reference must be an MP3 or WAV with music and vocals, longer than 15 seconds.',
    displayName: 'MiniMax Music 01 (Reference Audio)',
    enabled: true,
    id: 'fal-ai/minimax-music',
    parameters: {
      lyrics: { default: null, maxLength: 600, required: true },
      prompt: { default: '' },
      referenceAudioUrl: { default: null, minDuration: 15, required: true },
    },
    pricing: {
      units: [{ name: 'musicGeneration', rate: 0.035, strategy: 'fixed', unit: 'song' }],
    },
    type: 'text2music',
  },
  {
    description:
      'ACE-Step 1.5 on fal: open-source song generation in 50+ languages with lyrics, style tags, instrumental mode and lengths up to 10 minutes, billed by the generated length.',
    displayName: 'ACE-Step 1.5',
    enabled: true,
    id: 'fal-ai/ace-step-1.5',
    parameters: {
      duration: { default: 30, max: 600, min: 10, step: 1 },
      instrumental: { default: false },
      lyrics: { default: null, maxLength: 4096 },
      prompt: { default: '', maxLength: 512 },
      style: { default: null, maxLength: 256 },
    },
    pricing: {
      // $0.0003 per output second, doubled because the runtime keeps fal's default `thinking: true`
      units: [{ name: 'musicGeneration', rate: 0.0006, strategy: 'fixed', unit: 'second' }],
    },
    type: 'text2music',
  },
];

export const allModels = [...falImageModels, ...falVideoModels, ...falMusicModels];

export default allModels;