A simple black and white web application for generating images using fal.ai workflow API with AI-powered object detection.
- Automatic Object Detection: Uses Google's Gemini 2.5 Flash to automatically identify the most prominent object in your uploaded image
- AI-Powered Segmentation: Automatically segments and styles the detected object using LoRA
- Real-time Progress: Shows step-by-step progress from image analysis to final generation
- Install dependencies:
npm install- Create a
.envfile in the project root with your API keys:
FAL_KEY=your_fal_api_key_here
REPLICATE_API_TOKEN=your_replicate_api_token_hereGet your API keys from:
- FAL API Key: https://fal.ai/dashboard/keys
- Replicate API Token: https://replicate.com/account/api-tokens
- Start the server:
npm start- Open your browser to
http://localhost:3000
- Upload an image using the file input on the left side
- Click "Generate" button
- Gemini AI will automatically detect the most prominent object in your image
- Wait for the image to be generated (progress bar will show on the right side)
- Generated images are saved in
/gen-imagesfolder
public/- Frontend files (HTML, CSS, JavaScript)server.js- Express backend server with fal.ai and Replicate/Gemini integrationconfig.js- Configuration for workflow parameterslora/- LoRA model files for stylinggen-images/- Generated images are saved hereuploads/- Temporary storage for uploaded images
- Upload: You upload an image through the web interface
- Analysis: The image is sent to Google's Gemini 2.5 Flash API which analyzes it and returns a one-word description of the most prominent object
- Segmentation: The detected object name is used as the text prompt for the segmentation workflow
- Styling: The segmented object is rendered in the SK3TCHING style (red marker on white background)
- Result: The final stylized image is displayed and saved locally