Skip to content
项目

amrrs/fal-nanobanana-studio

在 GitHub 查看

关于

Nanobanana fal AI powered Photoshop-esque Studio

人工智能与机器学习

这些数字如何统计

可以做什么

  • 🎨 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

实测星标增长

24小时
0
7天
-1
15天
-1
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

NanoBanana Studio

A modern, AI-powered image editor alternative to Photoshop/Photopea, powered by Google's nanobanana API from fal.ai.

NanoBanana Studio Screenshot

Features

  • 🎨 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

Prerequisites

Installation

  1. Clone the repository and install dependencies:
npm run install:all
  1. Set up your environment variables:
cd backend
cp env.example .env

Edit 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.

Running the Application

Start both frontend and backend in development mode:

npm run dev

Usage

Edit Mode

  1. Click "Upload Image" to select an image file
  2. Enter a natural language prompt describing the edits you want (e.g., "make the sky more dramatic", "add a sunset", "remove the background")
  3. Optionally add a negative prompt to exclude unwanted elements
  4. Click "Edit Image" and wait for processing
  5. Download your edited image

API Configuration

Important: The application uses fal.ai's NanoBanana APIs:

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:

  1. Check the fal.ai documentation
  2. Look for the nanobanana model endpoint
  3. Update the fetch URL in backend/server.js if needed

API Endpoints

POST /api/edit-image

Edit an existing image using AI.

Request:

  • image (file): Image file to edit
  • prompt (string): Natural language editing instructions
  • negativePrompt (string, optional): Things to avoid in the edit

Response:

{
  "images": [{"url": "data:image/..."}]
}

POST /api/generate-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/..."}]
}

Tech Stack

  • Frontend: React + TypeScript + Vite
  • Backend: Node.js + Express
  • AI: Google nanobanana via fal.ai
  • UI: Custom CSS with modern design

Project Structure

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

Code Quality Features

  • 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

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

探索相关项目

加载中…