A comprehensive collection of AI-powered image processing and generation tools with implementations in multiple programming languages.
Each AI feature is organized in its own folder with 4 language implementations:
AIStack-Integrator/
βββ 01-remove-background/ # Background removal
βββ 02-cleanup-picture/ # Image cleanup and enhancement
βββ 03-expand-photo/ # Photo expansion
βββ 04-replace-item/ # Object replacement
βββ 05-cartoon-character/ # Cartoon character generation
βββ 06-caricature-generator/ # Caricature creation
βββ 07-ai-avatar/ # AI avatar generation
βββ 08-product-photoshoot/ # Product photography
βββ 09-background-generator/ # Background generation
βββ 10-ai-portrait/ # Portrait generation
βββ 11-ai-faceswap/ # Face swapping
βββ 12-ai-outfit/ # Virtual outfit try-on
βββ 13-ai-image2image/ # Image-to-image transformation
βββ 14-ai-sketch2image/ # Sketch to image conversion
βββ 15-ai-hairstyle/ # Hairstyle generation
βββ 16-ai-upscaler/ # Image upscaling
βββ 17-ai-filter/ # AI filters
βββ 18-ai-haircolor/ # Hair color change
βββ 19-ai-virtual-tryon/ # Virtual try-on
βββ 20-ai-headshot/ # Professional headshots
βββ 21-haircolor-rgb/ # RGB hair color manipulation
Each folder contains implementations in 4 programming languages:
- Node.js (
.jsfiles) - JavaScript/TypeScript implementation - Python (
.pyfiles) - Python implementation - Kotlin (
.ktfiles) - Android/Kotlin implementation - Swift (
.swiftfiles) - iOS/Swift implementation
npm install axios
# or
yarn add axiospip install requests pillow- Android Studio
- Add dependencies in
build.gradle:
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
implementation 'com.google.code.gson:gson:2.8.9'- Xcode
- Add dependencies in
Package.swiftor use CocoaPods:
pod 'Alamofire'
pod 'SwiftyJSON'- Get your API key from LightX API
- Replace
YOUR_API_KEYin the code with your actual API key - For production, use environment variables:
const API_KEY = process.env.LIGHTX_API_KEY || 'YOUR_API_KEY';import os
API_KEY = os.getenv('LIGHTX_API_KEY', 'YOUR_API_KEY')val apiKey = BuildConfig.LIGHTX_API_KEY ?: "YOUR_API_KEY"let apiKey = Bundle.main.object(forInfoDictionaryKey: "LIGHTX_API_KEY") as? String ?? "YOUR_API_KEY"Navigate to the folder of the AI feature you want to use (e.g., 01-remove-background/)
Choose the implementation file for your preferred language:
lightx-[feature]-nodejs.jsfor Node.jslightx-[feature]-python.pyfor PythonLightX[Feature].ktfor KotlinLightX[Feature].swiftfor Swift
- Add your API key
- Set the input image path
- Configure any additional parameters
- Set the output path
node lightx-[feature]-nodejs.jspython lightx-[feature]-python.py- Open in Android Studio
- Build and run on device/emulator
- Open in Xcode
- Build and run on device/simulator
const fs = require('fs');
const axios = require('axios');
const API_KEY = 'YOUR_API_KEY';
const inputImage = 'path/to/input.jpg';
const outputPath = 'path/to/output.png';
// Read image file
const imageBuffer = fs.readFileSync(inputImage);
// Make API request
const response = await axios.post('https://api.lightx.ai/v1/remove-background', {
image: imageBuffer.toString('base64')
}, {
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
}
});
// Save result
fs.writeFileSync(outputPath, Buffer.from(response.data.result, 'base64'));Most implementations support these common parameters:
image: Input image (base64 encoded or file path)output_format: Output format (png, jpg, webp)quality: Image quality (1-100)resolution: Output resolutionstyle: Processing style (varies by feature)
{
"success": true,
"result": "base64_encoded_image",
"processing_time": 2.5,
"credits_used": 1
}- API Key Error: Make sure your API key is valid and has sufficient credits
- Image Format: Supported formats are JPG, PNG, WEBP
- File Size: Maximum file size is usually 10MB
- Rate Limits: Check your API rate limits and usage
401: Invalid API key402: Insufficient credits413: File too large415: Unsupported file format429: Rate limit exceeded
- Documentation: LightX API Docs
- Support: LightX Support
- Community: LightX Community
This project is licensed under the MIT License. See the LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- Add more AI features
- Implement batch processing
- Add web interface
- Create Docker containers
- Add unit tests
- Implement caching
Note: This is a collection of implementation examples. Make sure to follow LightX API terms of service and usage policies.