Skip to content

lightXapi/AIStack-Integrator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI Stack Integrator

A comprehensive collection of AI-powered image processing and generation tools with implementations in multiple programming languages.

πŸ“ Project Structure

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

πŸš€ Available Implementations

Each folder contains implementations in 4 programming languages:

  • Node.js (.js files) - JavaScript/TypeScript implementation
  • Python (.py files) - Python implementation
  • Kotlin (.kt files) - Android/Kotlin implementation
  • Swift (.swift files) - iOS/Swift implementation

πŸ“‹ Prerequisites

For Node.js Implementation:

npm install axios
# or
yarn add axios

For Python Implementation:

pip install requests pillow

For Kotlin Implementation:

  • Android Studio
  • Add dependencies in build.gradle:
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
implementation 'com.google.code.gson:gson:2.8.9'

For Swift Implementation:

  • Xcode
  • Add dependencies in Package.swift or use CocoaPods:
pod 'Alamofire'
pod 'SwiftyJSON'

πŸ”‘ API Key Setup

  1. Get your API key from LightX API
  2. Replace YOUR_API_KEY in the code with your actual API key
  3. For production, use environment variables:

Node.js:

const API_KEY = process.env.LIGHTX_API_KEY || 'YOUR_API_KEY';

Python:

import os
API_KEY = os.getenv('LIGHTX_API_KEY', 'YOUR_API_KEY')

Kotlin:

val apiKey = BuildConfig.LIGHTX_API_KEY ?: "YOUR_API_KEY"

Swift:

let apiKey = Bundle.main.object(forInfoDictionaryKey: "LIGHTX_API_KEY") as? String ?? "YOUR_API_KEY"

🎯 How to Use

1. Choose Your Feature

Navigate to the folder of the AI feature you want to use (e.g., 01-remove-background/)

2. Select Your Language

Choose the implementation file for your preferred language:

  • lightx-[feature]-nodejs.js for Node.js
  • lightx-[feature]-python.py for Python
  • LightX[Feature].kt for Kotlin
  • LightX[Feature].swift for Swift

3. Configure the Code

  • Add your API key
  • Set the input image path
  • Configure any additional parameters
  • Set the output path

4. Run the Code

Node.js:

node lightx-[feature]-nodejs.js

Python:

python lightx-[feature]-python.py

Kotlin:

  • Open in Android Studio
  • Build and run on device/emulator

Swift:

  • Open in Xcode
  • Build and run on device/simulator

πŸ“ Example Usage

Background Removal (Node.js):

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'));

πŸ”§ Common Parameters

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 resolution
  • style: Processing style (varies by feature)

πŸ“Š API Response Format

{
    "success": true,
    "result": "base64_encoded_image",
    "processing_time": 2.5,
    "credits_used": 1
}

πŸ› οΈ Troubleshooting

Common Issues:

  1. API Key Error: Make sure your API key is valid and has sufficient credits
  2. Image Format: Supported formats are JPG, PNG, WEBP
  3. File Size: Maximum file size is usually 10MB
  4. Rate Limits: Check your API rate limits and usage

Error Codes:

  • 401: Invalid API key
  • 402: Insufficient credits
  • 413: File too large
  • 415: Unsupported file format
  • 429: Rate limit exceeded

πŸ“ž Support

πŸ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

πŸ“ˆ Roadmap

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors