{"id":31241760,"url":"https://github.com/warpdotdev/nano-banana-editor","last_synced_at":"2025-09-23T00:59:43.903Z","repository":{"id":314971663,"uuid":"1051385480","full_name":"warpdotdev/nano-banana-editor","owner":"warpdotdev","description":"🍌 AI-Powered Iterative Image Editor using Google's Gemini 2.5 Flash Image API (Nano Banana). Upload images, edit with natural language, and navigate through your editing history with click-to-revert functionality.","archived":false,"fork":false,"pushed_at":"2025-09-05T22:38:00.000Z","size":116,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-16T00:50:02.820Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://nano-banana-editor.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/warpdotdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-05T22:37:44.000Z","updated_at":"2025-09-11T22:11:13.000Z","dependencies_parsed_at":"2025-09-16T00:50:04.392Z","dependency_job_id":"3e92db8a-a303-4e7e-b582-422adb107151","html_url":"https://github.com/warpdotdev/nano-banana-editor","commit_stats":null,"previous_names":["warpdotdev/nano-banana-editor"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/warpdotdev/nano-banana-editor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warpdotdev%2Fnano-banana-editor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warpdotdev%2Fnano-banana-editor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warpdotdev%2Fnano-banana-editor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warpdotdev%2Fnano-banana-editor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/warpdotdev","download_url":"https://codeload.github.com/warpdotdev/nano-banana-editor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warpdotdev%2Fnano-banana-editor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276497769,"owners_count":25652890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-22T02:00:08.972Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-23T00:59:42.725Z","updated_at":"2025-09-23T00:59:43.898Z","avatar_url":"https://github.com/warpdotdev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🍌 Nano Banana Editor\n\n**An AI-Powered Iterative Image Editor using Google's Gemini 2.5 Flash Image API**\n\n![Next.js](https://img.shields.io/badge/Next.js-15.5.2-000000?style=flat-square\u0026logo=next.js)\n![TypeScript](https://img.shields.io/badge/TypeScript-5.0-3178C6?style=flat-square\u0026logo=typescript)\n![Tailwind CSS](https://img.shields.io/badge/Tailwind-3.0-38B2AC?style=flat-square\u0026logo=tailwind-css)\n![Google AI](https://img.shields.io/badge/Google%20AI-Gemini%202.5-4285F4?style=flat-square\u0026logo=google)\n\n## ✨ Features\n\n- **🖼️ Smart Image Upload**: Drag \u0026 drop or click to upload thumbnails\n- **🤖 AI-Powered Editing**: Uses Google's Gemini 2.5 Flash Image (\"Nano Banana\") API for intelligent image modifications\n- **🔄 Iterative Workflow**: Each generated image becomes the new base for further editing\n- **📚 Visual History**: Bottom timeline showing all previous versions with click-to-revert\n- **⚡ Real-time Processing**: Async API calls with loading states and progress feedback\n- **🎨 Modern UI**: Clean, responsive interface built with Tailwind CSS\n- **🔒 Secure**: API keys managed through Google Cloud Secret Manager\n\n## 🚀 How It Works\n\n1. **Upload** a thumbnail image\n2. **Describe** your desired changes in natural language\n3. **Process** with AI - Nano Banana generates your edited image\n4. **Iterate** - the result becomes your new base image for further edits\n5. **Navigate** through your editing history and revert to any previous version\n\n### Example Editing Session:\n- Original: Photo of a person\n- Edit 1: \"make the hat black\" → generates image with black hat\n- Edit 2: \"add sunglasses\" → generates image with black hat + sunglasses  \n- Edit 3: \"change background to sunset\" → generates final image with all modifications\n- **Click any thumbnail** to revert to that version and continue editing from there\n\n## 🛠️ Tech Stack\n\n- **Framework**: Next.js 15.5.2 with App Router\n- **Language**: TypeScript\n- **Styling**: Tailwind CSS\n- **AI API**: Google Gemini 2.5 Flash Image ([@google/genai](https://www.npmjs.com/package/@google/genai))\n- **Image Processing**: HTML5 Canvas + FileReader API\n- **Deployment**: Vercel-ready\n\n## 🏃‍♂️ Quick Start\n\n### Prerequisites\n- Node.js 18+\n- Google Cloud account with Generative AI API access\n- Gemini API key\n\n### Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/warpdotdev/nano-banana-editor.git\ncd nano-banana-editor\n\n# Install dependencies\nnpm install\n\n# Set up environment variables\ncp .env.example .env.local\n# Add your Google Generative AI API key to .env.local\n```\n\n### Environment Setup\n\nCreate a `.env.local` file:\n\n```env\n# Get your API key from: https://ai.google.dev/gemini-api/docs/api-key\nGOOGLE_GENERATIVE_AI_API_KEY=your_api_key_here\n```\n\n### Development\n\n```bash\nnpm run dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000) to start editing images!\n\n## 🏗️ Architecture\n\n### Frontend (`/src/app/page.tsx`)\n- React hooks for state management (image history, current image, loading states)\n- File upload handling with drag \u0026 drop support\n- Real-time form validation and submission\n- Responsive image display with history timeline\n\n### Backend (`/src/app/api/process-image/route.ts`)\n- Next.js API route handling image processing requests\n- Integration with Google Gemini 2.5 Flash Image API\n- Base64 image encoding/decoding for API communication\n- Error handling and response formatting\n\n### Key Features Implementation\n\n**Iterative Editing Workflow**:\n```typescript\n// After successful API response:\nsetSelectedImage(result.generatedImage);  // Replace current image\nsetImageHistory(prev =\u003e [...prev, previousImage]);  // Save to history\nsetInstructions(\"\");  // Clear for next edit\n```\n\n**History Management**:\n```typescript\n// Click to revert truncates history (like git reset)\nconst revertToHistoryImage = (historyItem, index) =\u003e {\n  setImageHistory(prev =\u003e prev.slice(0, index));  // Truncate\n  setSelectedImage(historyItem.image);  // Revert\n};\n```\n\n## 🎯 API Integration\n\nThe app integrates with Google's Gemini 2.5 Flash Image API (\"Nano Banana\"):\n\n```typescript\nconst response = await genAI.models.generateContent({\n  model: 'gemini-2.5-flash-image-preview',\n  contents: [{\n    parts: [\n      { text: instructions },\n      { inlineData: { mimeType: file.type, data: base64Data } }\n    ]\n  }]\n});\n```\n\n## 🐛 Debugging Features\n\nThis project includes debugging capabilities using the Puppeteer MCP server:\n- Live page inspection for UI bugs\n- Real-time CSS debugging\n- Image rendering diagnostics\n- Console log monitoring\n\n## 🌟 Recent Fixes\n\n- **History Thumbnails**: Fixed black square rendering by correcting CSS overlay transparency\n- **Stack Behavior**: Fixed history to properly truncate instead of append when reverting\n- **Image Handling**: Improved data URL processing with regular `\u003cimg\u003e` tags\n\n## 🚀 Deployment\n\n### Vercel (Recommended)\n\n```bash\nnpm run build\nvercel --prod\n```\n\nDon't forget to add your `GOOGLE_GENERATIVE_AI_API_KEY` in the Vercel environment variables!\n\n### Other Platforms\n\nThe app is a standard Next.js application and can be deployed to any platform that supports Node.js.\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📝 License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- Google AI team for the amazing Gemini 2.5 Flash Image API\n- Next.js team for the excellent framework\n- Tailwind CSS for the utility-first styling approach\n\n---\n\n**Built with ❤️ by the Warp team**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarpdotdev%2Fnano-banana-editor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwarpdotdev%2Fnano-banana-editor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarpdotdev%2Fnano-banana-editor/lists"}