Replicate Image Generator is a web application that allows users to generate images using the FlUX.1 image generation models (dev, pro, pro-ultra and schnell versions) hosted on Replicate. Additionally, images may be generated using both Recraft v3 models (image and SVG). This project is built with Next.js to provide a user-friendly interface for image generation.
- Generate images using Flux.1 AI models (dev and schnell versions) through the Replicate API
- Customize image generation parameters such as prompt, aspect ratio, and more
- Support for private LoRA models
- Secure handling of API keys (stored in browser's local storage)
- View and manage generated images
-
Clone the repository:
git clone https://github.com/ashakoen/next-js-flux1-replicate.git cd next-js-flux1-replicate
-
Install frontend dependencies:
npm install
-
Start the development server:
npm run dev
- Open your browser and navigate to
http://localhost:3000
- Enter your Replicate API key in the designated field
- Configure your image generation parameters
- Select either the "dev" or "schnell" version of the Flux.1 model
- Click "Generate Image" to create new images
- View and manage your generated images in the gallery section
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.
.
├── 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
- Built with Next.js and React
- Tailwind CSS for styling
- UI components from Radix UI
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.
- The Replicate API key is entered by the user in the frontend interface.
- The API key is stored in the user's browser local storage for convenience.
- When making requests, the frontend uses the API key to authenticate with the Replicate API.
You can customize various aspects of the frontend by modifying the following files:
next.config.mjs
: Next.js configurationtailwind.config.ts
: Tailwind CSS configurationtsconfig.json
: TypeScript configuration
Remember to never commit sensitive information like API keys to your version control system.
Contributions are welcome! Please submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or suggestions, please open an issue on the GitHub repository.