A web application that generates a set of 4 consistent icons from a single prompt using the Replicate API with Flux Schnell model.
- Generate 4 icons with consistent styling from a single prompt
- Multiple preset styles: Auto, Bold, Circular, Flat Colors, Monotone, Outline, Sticker, Pastels, Business, Cartoon, 3D Model, Gradient
- Optional brand color inputs (HEX values) to influence the color palette
- Download individual icons or all icons at once
- Modern, responsive UI built with React and Tailwind CSS
- Frontend: React + TypeScript + Create React App + Tailwind CSS
- Backend: Node.js + Express
- API: Replicate API (Flux Schnell model)
- Node.js (v18 or higher)
- npm or yarn
-
Clone the repository (if applicable) or navigate to the project directory
-
Install all dependencies (this will install both client and server dependencies in a shared
node_modules):npm install
-
Set up environment variables:
Create a
.envfile in theserverdirectory:cd server echo "REPLICATE_API_TOKEN=r8_N66Wxoi7DNfuLDi41QHPt7ZnD8Cn2Rh30pWRF" > .env echo "PORT=3001" >> .env cd ..
Or manually create
server/.envwith:REPLICATE_API_TOKEN=r8_N66Wxoi7DNfuLDi41QHPt7ZnD8Cn2Rh30pWRF PORT=3001
-
Start the backend server (in one terminal):
npm run server
Or alternatively:
cd server && npm start
The server will run on
http://localhost:3001 -
Start the frontend development server (in another terminal):
npm start
The frontend will run on
http://localhost:3000(Create React App will automatically open your browser) -
Open your browser and navigate to
http://localhost:3000
Note: Both client and server now share the same node_modules directory at the root level, reducing disk space and installation time.
- Enter a prompt describing the icon set you want to generate (e.g., "Hockey equipment")
- Select a preset style from the dropdown
- (Optional) Add brand colors using HEX values
- Click "Generate Icons"
- Wait for the 4 icons to be generated
- Download individual icons or all icons at once
.
├── server/ # Backend Express server
│ ├── index.js # Main server file with Replicate API integration
│ ├── package.json # Backend dependencies
│ └── .env # Environment variables (create this)
├── src/ # Frontend React application
│ ├── components/ # React components
│ │ ├── StyleSelector.tsx
│ │ ├── ColorInput.tsx
│ │ └── IconGrid.tsx
│ ├── services/ # API service functions
│ │ └── replicateApi.ts
│ ├── App.tsx # Main app component
│ ├── index.tsx # React entry point
│ ├── index.css # Global styles with Tailwind
│ └── types.ts # TypeScript type definitions
├── public/ # Public assets
│ ├── index.html # HTML template
│ └── manifest.json # Web app manifest
├── package.json # Frontend dependencies
├── tailwind.config.js # Tailwind CSS configuration
└── tsconfig.json # TypeScript configuration
Generates 4 icons based on the provided prompt, style, and optional colors.
Request Body:
{
"prompt": "Hockey equipment",
"style": "Pastels",
"colors": ["#FF5733", "#33FF57"]
}Response:
{
"success": true,
"icons": [
"https://replicate.delivery/.../output_0.png",
"https://replicate.delivery/.../output_1.png",
"https://replicate.delivery/.../output_2.png",
"https://replicate.delivery/.../output_3.png"
]
}Health check endpoint.
Response:
{
"status": "ok"
}Build the frontend:
npm run buildThe built files will be in the build directory.
The backend can be deployed to any Node.js hosting service (e.g., Vercel, Railway, Render).
Make sure to set the REPLICATE_API_TOKEN environment variable in your deployment platform.
- The application generates 4 icons in parallel for faster results
- Style consistency is achieved through prompt engineering with style modifiers
- Color inputs are incorporated into the prompt to influence the palette
- Icons are generated at 512x512 resolution with PNG format
✅ Product outputs: Coherent UX for prompt → consistent set of icons
✅ Code quality: Modular structure, error handling, TypeScript for type safety
✅ API integration: Reliable Replicate API integration with proper error handling
✅ Consistency controls: Style modifiers ensure visual consistency across all 4 icons