π Live Demo: https://voltran-ai-image-editor.web.app/
π Backend API: https://voltran-ai-image-editor.onrender.com
A complete, production-ready AI image editing web application built with Flutter Web (frontend) and Python FastAPI (backend), powered by fal.ai's image editing models.
- Image Upload: Drag-and-drop or click-to-upload interface
- Prompt-Based Editing: Text input for describing desired edits
- Image Processing: Integration with fal.ai (Seedream V4, Nano Banana, FLUX Dev models)
- Result Display: View edited images in high quality
- Download: Save edited images locally
- Job Management: Track status of editing jobs
- RESTful API: Well-structured backend endpoints
- Database Persistence: SQLite for job history
- Dark/Light Theme: Toggle between dark and light modes
- Multi-language Support: Turkish and English localization
- AI Model Selection: Choose between Seedream V4, Nano Banana, or FLUX Dev
- Private History: Session-based job history (localStorage, device-specific)
- Version History: See all previous edits with metadata
- Before/After Slider: Interactive comparison tool
- Real-time Status: Live job status updates with polling
- Auto-scroll: Smooth navigation to results when selecting from history
- Responsive Design: Works on desktop, tablet, and mobile
- Error Handling: Comprehensive error messages and recovery
- CI/CD Pipeline: Automated deployment with GitHub Actions
Voltran/
βββ Core/ # Backend (Python/FastAPI)
β βββ main.py # FastAPI application
β βββ models.py # Database models & schemas
β βββ database.py # Database configuration
β βββ routes/
β β βββ jobs.py # API endpoints
β βββ services/
β β βββ fal_service.py # fal.ai integration
β βββ uploads/ # Uploaded images
β βββ requirements.txt # Python dependencies
β βββ .env # Environment variables
β
βββ Web/ # Frontend (Flutter Web)
βββ lib/
β βββ main.dart # App entry point
β βββ models/
β β βββ job.dart # Job data models
β βββ providers/
β β βββ theme_provider.dart # Theme management
β β βββ locale_provider.dart # Localization
β βββ services/
β β βββ api_service.dart # HTTP client
β β βββ storage_service.dart # localStorage for job history
β βββ screens/
β β βββ home_screen.dart # Main UI
β βββ widgets/
β βββ image_upload_widget.dart
β βββ job_history_widget.dart
β βββ before_after_slider.dart
βββ pubspec.yaml # Flutter dependencies
- Frontend (Flutter Web): https://voltran-ai-image-editor.web.app/
- Backend API: https://voltran-ai-image-editor.onrender.com
- API Documentation: https://voltran-ai-image-editor.onrender.com/docs
- Frontend: Firebase Hosting with GitHub Actions CI/CD
- Backend: Render.com free tier
- Database: SQLite (ephemeral on Render.com)
- AI Models: fal.ai (Seedream V4, Nano Banana, FLUX Dev)
- Navigate to Core directory
cd Core- Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies
pip install -r requirements.txt- Configure environment
cp .env.example .env
# Edit .env with your fal.ai API key- Run the server
python main.pyBackend will be available at: http://localhost:8000
API documentation: http://localhost:8000/docs
- Navigate to Web directory
cd Web- Install dependencies
flutter pub get- Run the app
flutter run -d chrome --web-port 3000Frontend will be available at: http://localhost:3000
Create a new image editing job
- Request: multipart/form-data
image: File (required)prompt: String (required)model: String (optional, default: "seedream") - Options: "seedream", "nano_banana", "flux_dev"
- Response: Job object with job_id
Get job status and result
- Response: Job details with status and result URL
List all jobs (with version history)
- Query params: skip, limit
- Response: Array of jobs with pagination
Delete a job and its associated files
Models Available:
- Seedream V4 (Default):
fal-ai/bytedance/seedream/v4/edit- Fast and efficient image editing - Nano Banana:
fal-ai/nano-banana/edit- Quick edits with smaller model - FLUX Dev:
fal-ai/flux/dev/image-to-image- Advanced image-to-image transformation
The implementation:
- Converts uploaded images to base64 for API transmission
- Submits async jobs to fal.ai with selected model
- Polls for completion status
- Stores result URLs in database
- Provides download functionality
Model Selection: Users can choose their preferred AI model from the frontend interface with localized descriptions in English and Turkish.
- FastAPI: Modern Python web framework
- SQLAlchemy: ORM for database operations
- SQLite: Lightweight database for job persistence
- fal-client: Official fal.ai Python SDK
- Uvicorn: ASGI server
- Pillow: Image processing utilities
- python-dotenv: Environment variable management
- Flutter Web: Cross-platform UI framework (v3.35.1, Dart 3.9.0)
- Provider: State management for theme and locale
- http: HTTP client for API calls
- file_picker: File upload functionality
- flutter_spinkit: Loading animations
- universal_html: Web-specific utilities and download handling
- url_launcher: Open external links (GitHub profile)
- GitHub Actions: CI/CD pipeline for automated deployment
- Firebase Hosting: Frontend hosting with global CDN
- Render.com: Backend hosting with automatic SSL
- Git: Version control
Live URL: https://voltran-ai-image-editor.onrender.com
The backend is automatically deployed from the main branch using render.yaml configuration.
Configuration:
- Root Directory:
Core/ - Build Command:
pip install -r requirements.txt - Start Command:
uvicorn main:app --host 0.0.0.0 --port $PORT - Environment Variables:
FAL_API_KEY: Your fal.ai API keyALLOWED_ORIGINS: Production domains (configured for Firebase Hosting)
Health Check: https://voltran-ai-image-editor.onrender.com/health
Live URL: https://voltran-ai-image-editor.web.app/
The frontend is automatically deployed via GitHub Actions on every push to main.
GitHub Actions Workflow:
# Automatically triggered on push to main
- Flutter 3.35.1 setup
- Dependencies installation (flutter pub get)
- Production build (flutter build web --release)
- Firebase Hosting deploymentManual Deployment (if needed):
cd Web
flutter build web --release
firebase deploy --only hosting- Select AI Model: Choose between Seedream V4 (fast), Nano Banana (quick), or FLUX Dev (advanced)
- Upload an image by clicking or dragging
- Enter a prompt:
- "Add a sunset background"
- "Make it look like an oil painting"
- "Change the color scheme to blue tones"
- "Add dramatic lighting"
- Click Generate Edit and wait for AI processing
- View results with before/after comparison (auto-scrolls to result)
- Download the edited image
- Check history to see your previous edits (private to your device)
# Health check
curl http://localhost:8000/health
# Create a job (replace with actual file)
curl -X POST http://localhost:8000/api/jobs \
-F "image=@test_image.jpg" \
-F "prompt=Add a sunset background"
# Get job status
curl http://localhost:8000/api/jobs/{job_id}
# List all jobs
curl http://localhost:8000/api/jobsThis project was developed with assistance from GitHub Copilot in the following ways:
- Boilerplate Creation: FastAPI routes, database models, Flutter widgets
- API Integration: HTTP client setup, async/await patterns
- Error Handling: Try-catch blocks, validation logic
- CORS Configuration: Proper middleware setup for web access
- File Upload: Multipart form handling in both backend and frontend
- State Management: Flutter state updates and async operations
- Image Processing: Base64 encoding for API transmission
- README Structure: Comprehensive documentation template
- Code Comments: Inline documentation for complex logic
- API Documentation: OpenAPI/Swagger integration
- Iterative Development: Quick prototyping and testing
- Bug Fixes: Identifying and resolving issues faster
- Best Practices: Following framework conventions
- File Storage: Images stored locally (would use S3/CDN in production)
- Job Polling: Client-side polling (would use WebSockets in production)
- Authentication: No user authentication (session-based via localStorage currently)
- Rate Limiting: No API rate limiting implemented
- Image Size: Large images may take longer to process
- History Persistence: Job history is device-specific (would add cloud sync with auth)
- Add caching layer (Redis) for frequent queries
- Implement queue system (Celery) for job processing
- Use object storage (S3) for images
- Add monitoring and logging (Sentry, DataDog)
- Implement user authentication and quotas
- Add CDN for faster image delivery
- API Key: Stored in
.envfile (never commit to version control) - CORS: Configured for production Firebase Hosting domain
- Private History: Job history stored locally in browser (localStorage)
- File Validation: Image type validation in backend
- SQL Injection: Protected by SQLAlchemy ORM
- XSS: Protected by Flutter's rendering engine
MIT License - Feel free to use this project for learning or commercial purposes.
- fal.ai: For providing the AI image editing API
- FastAPI: For the excellent Python web framework
- Flutter: For the powerful cross-platform UI framework
- GitHub Copilot: For AI-assisted development
For questions or issues, please open an issue on GitHub.
Built with β€οΈ using Flutter, FastAPI, and fal.ai