Skip to content

Instantly share code, notes, and snippets.

@svngoku
Created July 14, 2025 11:24
Show Gist options
  • Select an option

  • Save svngoku/6b004aaaffd37a2401530354bf7055b6 to your computer and use it in GitHub Desktop.

Select an option

Save svngoku/6b004aaaffd37a2401530354bf7055b6 to your computer and use it in GitHub Desktop.

Thank you for providing the detailed file. Here is a comprehensive list of the newest Fal AI endpoints for image and video generation, image upscaling, and guidance on image-to-prompt, along with full example code for each, as documented in your latest README_fal_ai.md file.


πŸ† Latest Fal AI Endpoints & Full Usage Code


πŸ–ΌοΈ Image Generation Endpoints

1. Google Imagen 4 (2025)

Endpoint: fal-ai/imagen4/preview

import { fal } from '@fal-ai/client';

const result = await fal.subscribe('fal-ai/imagen4/preview', {
  input: {
    prompt: 'A hyper-detailed photorealistic cityscape at sunset',
    image_size: '1024x1024'
  }
});

console.log('Generated image:', result.data.images[0].url);

2. FLUX.1 Pro Ultra

Endpoint: fal-ai/flux-pro/v1.1-ultra

import { fal } from '@fal-ai/client';

const result = await fal.subscribe('fal-ai/flux-pro/v1.1-ultra', {
  input: {
    prompt: 'Professional headshot, studio lighting',
    image_size: '1536x1536'
  }
});

console.log('Generated image:', result.data.images[0].url);

3. FLUX.1 [dev]

Endpoint: fal-ai/flux/dev

import { fal } from '@fal-ai/client';

const result = await fal.subscribe('fal-ai/flux/dev', {
  input: {
    prompt: 'A photorealistic portrait of a person',
    image_size: '1024x1024',
    num_inference_steps: 28
  }
});

4. FLUX.1 [schnell] (Fastest)

Endpoint: fal-ai/flux/schnell

import { fal } from '@fal-ai/client';

const result = await fal.subscribe('fal-ai/flux/schnell', {
  input: {
    prompt: 'A quick sketch of a cat',
    num_inference_steps: 4
  }
});

5. FLUX with LoRA

Endpoint: fal-ai/flux-lora

const result = await fal.subscribe('fal-ai/flux-lora', {
  input: {
    prompt: 'A portrait in anime style',
    loras: [{
      path: 'https://url-to-lora-weights.safetensors',
      scale: 1.0
    }]
  }
});

6. SANA 4K Generator

Endpoint: fal-ai/sana (Usage pattern similar to above endpoints.)


🎬 Video Generation Endpoints

1. Google Veo 3 (2025)

Endpoint: fal-ai/veo3

const result = await fal.subscribe('fal-ai/veo3', {
  input: {
    prompt: 'A person walking down a busy street with city sounds',
    duration: 5, // in seconds
    include_audio: true
  }
});
  • Note: Supports video with native audio generation.

2. Stable Video Diffusion

Endpoint: fal-ai/stable-video-diffusion

const result = await fal.subscribe('fal-ai/stable-video-diffusion', {
  input: {
    prompt: 'A sunrise timelapse in a mountain landscape',
    duration: 4
  }
});

πŸ–ŒοΈ Image Editing & Upscaling Endpoints

1. FLUX Kontext with LoRA

Endpoint: fal-ai/flux/kontext-lora (For advanced image editing.)


2. FLUX Differential Diffusion

Endpoint: fal-ai/flux-differential-diffusion (For special effects and differential edits.)


3. Background Removal

Endpoint: fal-ai/birefnet

const result = await fal.subscribe('fal-ai/birefnet', {
  input: {
    image_url: 'https://example.com/photo.png'
  }
});

4. Image Upscaling (ESRGAN)

Endpoint: fal-ai/esrgan

const result = await fal.subscribe('fal-ai/esrgan', {
  input: {
    image_url: 'https://example.com/photo.png'
  }
});

5. Face Swap

Endpoint: fal-ai/face-swap (For swapping faces between images.)


🧠 Image to Prompt (Image Captioning)

As of the information in your file, Fal AI does not offer a dedicated "image-to-prompt" endpoint yet. However, you can watch for updates on the official Fal AI models page as new captioning endpoints may be introduced in 2025.


βœ… Best Practices for Using Fal AI Endpoints

  • Use fal.subscribe(endpoint, { input: {...} }) for quick, interactive tasks.
  • For long-running or queued jobs (especially large images or training), use the queue pattern:
// Submit a task
const { request_id } = await fal.queue.submit('endpoint-name', { input: { ... } });

// Check job status
const status = await fal.queue.status('endpoint-name', { requestId: request_id });

// Get the result
const result = await fal.queue.result('endpoint-name', { requestId: request_id });

πŸ“¦ Installation & Setup

npm install @fal-ai/client
import { fal } from '@fal-ai/client';
fal.config({ credentials: 'your_api_key_here' });

🌐 Official Resources & Documentation


πŸ”” Recent Major Updates (2024–2025)

  • May 2025: Google Veo 3 video+audio, Imagen 4 improvements
  • December 2024: ElevenLabs TTS, Resemble AI, FLUX Kontext, open LoRA weights
  • November 2024: FLUX Pro Ultra (2K resolution)

⚑ Summary Table

Endpoint Type Released Use Case
fal-ai/imagen4/preview Image Generation 2025 Hyper-detailed images (Google)
fal-ai/flux-pro/v1.1-ultra Image Generation 2024 Pro 2K images
fal-ai/flux/dev Image Generation 2024 Dev, best quality
fal-ai/flux/schnell Image Generation 2024 Fastest
fal-ai/veo3 Video Generation 2025 Video (w/ audio)
fal-ai/stable-video-diffusion Video Generation 2024 High-quality video
fal-ai/esrgan Image Upscaling Ongoing 2x/4x upscaling

For the full endpoint JSON, see fal_ai_endpoints.json in your repository for schema and more examples. For detailed, always-updated reference, check Fal AI Models.


If you need sample code for a specific endpoint or use-case (e.g., inpainting, prompt-to-video, LoRA, etc.), let me know! All code here is from your latest Fal AI README and matches the current (2025) API.

@moniazmala
Copy link

is that free or requeird api code ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment