ashakoen / next-js-flux1-replicate

Flux.1 Image Generator is a web application that allows users to generate images using the Flux.1 AI models (dev and schnell versions) hosted on Replicate. This project uses Next.js to provide a user-friendly interface for image generation.
https://next-js-flux1-replicate.vercel.app
MIT License
2 stars 1 forks source link

Flux.1 Image Generator

Flux.1 Image Generator is a web application that allows users to generate images using the Flux.1 AI models (dev and schnell versions) hosted on Replicate. This project is built with Next.js to provide a user-friendly interface for image generation.

flux-image-creator

Features

Installation

  1. Clone the repository:

    git clone https://github.com/ashakoen/next-js-flux1-replicate.git
    cd next-js-flux1-replicate
  2. Install frontend dependencies:

    npm install
  3. Start the development server:

    npm run dev

Usage

  1. Open your browser and navigate to http://localhost:3000
  2. Enter your Replicate API key in the designated field
  3. Configure your image generation parameters
  4. Select either the "dev" or "schnell" version of the Flux.1 model
  5. Click "Generate Image" to create new images
  6. View and manage your generated images in the gallery section

Security Note

The user's Replicate API key is stored securely in the browser's local storage and is not persisted in the backend. The frontend directly calls the Replicate API using the user's API key. Always ensure you're using the application over a secure connection (HTTPS) in production environments.

Project Structure

.
├── Dockerfile
├── LICENSE
├── README.md
├── components.json
├── docker-compose.yml
├── next-env.d.ts
├── next.config.mjs
├── package-lock.json
├── package.json
├── postcss.config.mjs
├── public
│   └── next.svg
├── src
│   ├── app
│   │   ├── api
│   │   │   └── replicate
│   │   │       └── route.ts
│   │   ├── components.tsx
│   │   ├── favicon.ico
│   │   ├── globals.css
│   │   ├── layout.tsx
│   │   └── page.tsx
│   ├── components
│   │   └── ui
│   │       ├── accordion.tsx
│   │       ├── alert.tsx
│   │       ├── button.tsx
│   │       ├── card.tsx
│   │       ├── dialog.tsx
│   │       ├── drawer.tsx
│   │       ├── input.tsx
│   │       ├── label.tsx
│   │       ├── select.tsx
│   │       ├── skeleton.tsx
│   │       ├── slider.tsx
│   │       ├── switch.tsx
│   │       ├── tabs.tsx
│   │       ├── textarea.tsx
│   │       └── tooltip.tsx
│   └── lib
│       └── utils.ts
├── tailwind.config.ts
└── tsconfig.json

Key Components

Frontend

Configuration

This project doesn't use environment files (.env) for configuration. Instead, sensitive information like API keys are handled directly in the frontend and not stored in the backend.

API Key Handling

Frontend Configuration

You can customize various aspects of the frontend by modifying the following files:

Remember to never commit sensitive information like API keys to your version control system.

Contributing

Contributions are welcome! Please submit a pull request.

License

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

Contact

For any questions or suggestions, please open an issue on the GitHub repository.