This is a Next.js app with fal and tldraw that demonstrates real-time AI image generation based on drawings in a canvas.
-
First, you need to add the fal credentials to your environment. The recommended way is to create a
.env.local
file and add the key you obtained fromhttps://fal.ai/dashboard/keys
:FAL_KEY="key_id:key_secret"
-
Make sure you install the dependencies:
npm install
-
Now you can run the Next.js project as usual:
npm run dev
Open http://localhost:3000 with your browser to see the result.
Note: although the commands above use npm
, feel free to use your preferred package manager,
Real-time image generation is just one of the many cool things you can do with fal. Make sure you:
- Check all the available Model APIs
- Check our Next.js integration guide
- Learn how to write your own model APIs on Introduction to serverless functions
- Read more about function endpoints on Serving functions
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Make sure you read our Code of Conduct
- Fork the project and clone your fork
- Setup the local environment with
npm install
- Create a feature branch (
git checkout -b feature/add-cool-thing
) or a bugfix branch (git checkout -b fix/smash-that-bug
) - Commit the changes (
git commit -m 'feat(client): added a cool thing'
) - use conventional commits - Push to the branch (
git push --set-upstream origin feature/add-cool-thing
) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.