A modern, Adobe Firefly-inspired web application for generating images and videos from text descriptions using AI. Built with Next.js 15, TypeScript, Tailwind CSS, and fal.ai API.
🎨 Text-to-Image Generation - Create stunning images from text descriptions 🎬 Text-to-Video Generation - Generate dynamic videos from text prompts 🖼️ Image-to-Video - Animate your existing images ⚙️ Advanced Settings - Fine-tune generation parameters 🌙 Dark/Light Theme - Modern UI with theme switching 📱 Responsive Design - Works on desktop, tablet, and mobile ⚡ Real-time Generation - Fast AI-powered content creation 💾 Download & Share - Easy download and sharing capabilities
- Framework: Next.js 15 with App Router
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: Custom components with Framer Motion
- AI API: fal.ai (Flux, Stable Video, ESRGAN)
- Icons: Lucide React
- Theme: next-themes
- Node.js 18+ and npm/yarn
- A Replicate API token (get one at replicate.com)
-
Clone the repository
git clone <repository-url> cd text-image-app
-
Install dependencies
npm install
-
Set up environment variables Create a
.env.localfile in the root directory:# Replicate API Configuration REPLICATE_API_TOKEN=your_replicate_api_token_here
-
Start the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
Create a .env.local file with the following variables:
# Required: Your Replicate API token
REPLICATE_API_TOKEN=your_replicate_api_token_here- Visit replicate.com
- Sign up or log in to your account
- Go to your account settings
- Find the API tokens section
- Create a new API token
- Copy the token and add it to your
.env.localfile
- Select the "Text to Image" tab
- Enter a detailed description of the image you want to generate
- Optionally adjust settings like:
- Image size and aspect ratio
- Number of images to generate
- Guidance scale (how closely to follow the prompt)
- Inference steps (quality vs speed)
- Click "Generate" and wait for your images
- Select the "Text to Video" tab
- Optionally upload a source image to animate
- Enter a description of the video you want to create
- Adjust settings like:
- Video length (frames)
- Frames per second
- Guidance scale
- Inference steps
- Click "Generate Video" and wait for processing
- Be specific: Detailed prompts yield better results
- Use descriptive language: Include style, mood, lighting, etc.
- Experiment with settings: Different parameters can dramatically change outputs
- Try different aspect ratios: Choose the right format for your use case
src/
├── app/ # Next.js app directory
│ ├── globals.css # Global styles and CSS variables
│ ├── layout.tsx # Root layout with theme provider
│ └── page.tsx # Main page with tab navigation
├── components/ # React components
│ ├── Header.tsx # Navigation header with theme toggle
│ ├── ImageGenerator.tsx # Image generation interface
│ └── VideoGenerator.tsx # Video generation interface
├── lib/ # Utility functions
│ ├── fal.ts # fal.ai API integration
│ └── utils.ts # Helper functions
└── hooks/ # Custom React hooks (for future use)
The app uses the fal.ai API for AI generation:
- Image Generation:
fal-ai/flux/devmodel - Video Generation:
fal-ai/stable-videomodel - Image Upscaling:
fal-ai/esrganmodel
The app supports both dark and light themes. You can customize colors in:
tailwind.config.ts- Tailwind color palettesrc/app/globals.css- CSS custom properties
To use different AI models, update the model IDs in src/lib/fal.ts:
// Change these model IDs to use different models
const result = await fal.subscribe("fal-ai/flux/dev", { ... });
const result = await fal.subscribe("fal-ai/stable-video", { ... });- Push your code to GitHub
- Connect your repository to Vercel
- Add your environment variables in Vercel dashboard
- Deploy!
# Dockerfile example
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.
If you encounter any issues or have questions:
- Check the fal.ai documentation
- Review the Next.js documentation
- Open an issue in this repository
- fal.ai for the AI generation API
- Adobe Firefly for design inspiration
- Next.js for the amazing framework
- Tailwind CSS for the utility-first CSS framework
- Framer Motion for smooth animations
Happy Creating! 🎨✨