Add Gemini API image editing functionality with AI-powered analysis and editing instructions - #1
Draft
khalatevarun with Copilot wants to merge 2 commits into
Draft
Add Gemini API image editing functionality with AI-powered analysis and editing instructions#1khalatevarun with Copilot wants to merge 2 commits into
khalatevarun with Copilot wants to merge 2 commits into
Conversation
Co-authored-by: khalatevarun <68511458+khalatevarun@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] what is the api endpoint to edit images with gemini api
Add Gemini API image editing functionality with AI-powered analysis and editing instructions
Sep 17, 2025
Copilot stopped work on behalf of
khalatevarun due to an error
September 17, 2025 23:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds comprehensive AI-powered image editing capabilities to the Base platform using Google's Gemini API. The implementation provides two main API endpoints for image analysis and editing instruction generation, along with a complete frontend interface.
New API Endpoints
/image/analyze- AI Image AnalysisAnalyzes uploaded images using Gemini AI to provide detailed insights about content, composition, and characteristics:
/image/edit- Professional Editing InstructionsGenerates detailed editing instructions based on user requirements and image analysis:
Frontend Integration
The platform now includes a dedicated AI Image Editor accessible from the main dashboard with:
Technical Implementation
Backend Changes:
src/utils/gemini.ts)Frontend Changes:
ImageEditor.tsxcomponentDependencies Added:
@google/generative-ai- Google Gemini AI SDKmulter- Secure file upload handling@types/multer- TypeScript definitionsConfiguration
Users need to add their Gemini API key to the environment:
Documentation
GEMINI_IMAGE_API.mdThis implementation provides a complete foundation for AI-powered image editing while maintaining all existing deployment functionality of the Base platform.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.