A modern, AI-powered image editor alternative to Photoshop/Photopea, powered by Google's nanobanana API from fal.ai.
- 🎨 AI-Powered Image Editing: Edit images using natural language prompts
- ✨ Image Generation: Generate new images from text descriptions
- 🖼️ Intuitive UI: Clean, modern interface inspired by professional image editors
- ⚡ Model Switcher: Toggle between NanoBanana and NanoBanana Pro on the fly
- 💾 Easy Export: Download your edited images with one click
- Node.js 18+ and npm
- A fal.ai API key (Get one here)
- Clone the repository and install dependencies:
npm run install:all- Set up your environment variables:
cd backend
cp env.example .envEdit backend/.env and add your fal.ai API key:
FAL_API_KEY=your_fal_ai_api_key_here
PORT=3001
Note: Get your fal.ai API key from fal.ai. You'll need to sign up and create an API key in your dashboard.
Start both frontend and backend in development mode:
npm run dev- Frontend will be available at: http://localhost:3000
- Backend API will be available at: http://localhost:3001
- Click "Upload Image" to select an image file
- Enter a natural language prompt describing the edits you want (e.g., "make the sky more dramatic", "add a sunset", "remove the background")
- Optionally add a negative prompt to exclude unwanted elements
- Click "Edit Image" and wait for processing
- Download your edited image
Important: The application uses fal.ai's NanoBanana APIs:
- Standard: NanoBanana Edit
- Pro tier: NanoBanana Pro Edit
Select your model in the UI, and the backend automatically routes to the appropriate endpoint. If fal.ai updates these URLs, adjust MODEL_ENDPOINTS in backend/server.js.
To verify the correct endpoint:
- Check the fal.ai documentation
- Look for the nanobanana model endpoint
- Update the fetch URL in
backend/server.jsif needed
Edit an existing image using AI.
Request:
image(file): Image file to editprompt(string): Natural language editing instructionsnegativePrompt(string, optional): Things to avoid in the edit
Response:
{
"images": [{"url": "data:image/..."}]
}Generate a new image from text.
Request:
{
"prompt": "a beautiful landscape...",
"negativePrompt": "blurry, low quality",
"width": 1024,
"height": 1024
}Response:
{
"images": [{"url": "data:image/..."}]
}- Frontend: React + TypeScript + Vite
- Backend: Node.js + Express
- AI: Google nanobanana via fal.ai
- UI: Custom CSS with modern design
nanobanana-studio/
├── frontend/ # React frontend application
│ ├── src/
│ │ ├── App.tsx # Main application component
│ │ ├── api.ts # API client functions
│ │ ├── types.ts # TypeScript type definitions
│ │ ├── utils.ts # Utility functions
│ │ ├── App.css # Styles
│ │ └── ...
│ └── package.json
├── backend/ # Express backend server
│ ├── server.js # API server with validation & error handling
│ ├── env.example # Environment variables template
│ └── package.json
├── package.json # Root package.json
├── README.md # Full documentation
└── SETUP.md # Quick setup guide
- TypeScript: Full type safety on frontend
- Error Handling: Comprehensive error handling on both frontend and backend
- Validation: Input validation for images, prompts, and parameters
- API Timeout: 120-second timeout for API requests
- File Validation: Type and size validation for uploaded images
- Logging: Structured logging for debugging
- Security: File type validation, size limits, and input sanitization
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
