Skip to content

aulakhs/Image-Generator

Repository files navigation

AI Image Generator with Voice Input

A modern Next.js application that generates AI images using FAL.AI's image generation API and supports voice input through Deepgram's speech-to-text API.

Features

  • 🎨 AI Image Generation using FAL.AI's flux/dev model
  • 🎤 Voice-to-Text input using Deepgram
  • ⚡ Real-time image generation with status updates
  • 🎯 High-definition square image output
  • 🎨 Modern UI with Tailwind CSS
  • 🔒 Secure API key handling through proxy routes

Demo

[Add screenshots or GIF here]

Tech Stack

  • Next.js 14 (App Router)
  • TypeScript
  • Tailwind CSS
  • FAL.AI Client
  • Deepgram SDK
  • React Hooks

Getting Started

Prerequisites

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/ai-image-generator.git
cd ai-image-generator
  1. Install dependencies:
npm install
# or
yarn install
  1. Create a .env.local file in the root directory:
FAL_KEY=your_fal_ai_key_here
DEEPGRAM_API_KEY=your_deepgram_key_here
  1. Start the development server:
npm run dev
# or
yarn dev
  1. Open http://localhost:3000 in your browser.

Usage

  1. Enter a text prompt describing the image you want to generate, or click the microphone button to use voice input.
  2. If using voice input, speak your prompt and click the button again to stop recording.
  3. Click "Generate" to create your image.
  4. Wait for the image to be generated (usually takes 10-15 seconds).
  5. The generated image will appear below the input field.

Project Structure

src/
├── app/
│   ├── api/
│   │   ├── fal/
│   │   │   └── proxy/
│   │   │       └── route.ts    # FAL.AI proxy route
│   │   │
│   │   └── components/
│   │       └── ImageGenerator.tsx  # Main component
│   │
│   ├── lib/
│   │   └── contexts/
│   │       └── DeepgramContext.tsx  # Deepgram context
│   │
│   ├── layout.tsx
│   └── page.tsx
│
├── .env.local.example
└── package.json

Environment Variables

Create a .env.local file with the following variables:

FAL_KEY=your_fal_ai_key_here
DEEPGRAM_API_KEY=your_deepgram_key_here

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

A modern Next.js application that generates AI images using FAL.AI's image generation API and supports voice input through Deepgram's speech-to-text API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors