Generate an image from a prompt using Fal.ai and Trigger.dev Realtime
This example project generates an image from a prompt using Fal.ai and shows the progress of the task on the frontend using Trigger.dev Realtime.
Walkthrough
This video walks through the process of creating this task in a Next.js project.
Tech stack
- Next.js using the App Router for the frontend
- Trigger tasks from the frontend using our React hooks
- Trigger.dev Realtime to stream updates to the frontend
- Trigger.dev for task processing
- Fal.ai for AI image generation
GitHub Repo
Check out and fork the full code in our nextjs-realtime-fal-demo repo .
To run the project and tasks locally, add your API keys to an .env
file, and update the project
ID in the trigger.config.ts
file to your project ID. To run the project in production, set the
TRIGGER_API_KEY
environment variable to your project API key, and update the environment
variables in the Trigger.dev dashboard.
Task code
This task converts an image to a cartoon using fal AI.
Testing your task
You can test your task by triggering it from the Trigger.dev dashboard. Here’s an example payload:
Was this page helpful?