A powerful demonstration of AI capabilities using the Replicate API, showcasing state-of-the-art AI models for image generation and analysis.
Generate high-quality images from text descriptions using Stability AI's SDXL model.
Example prompts:
- "A serene Japanese garden with cherry blossoms, a small wooden bridge over a koi pond, in watercolor style"
- "A futuristic cityscape at night with neon lights and flying vehicles, cyberpunk style"
- "A cozy coffee shop interior with warm lighting, steam rising from coffee cups, photorealistic"
Analyze images using Salesforce's BLIP model to get natural language descriptions.
Capabilities:
- Generate detailed descriptions of image content
- Identify objects, scenes, and activities
- Understand context and relationships in images
- Python 3.8 or higher
- Replicate API token (Get one here)
- Virtual environment (recommended)
- Clone the repository:
git clone <repository-url>
cd replicate-demo- Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Set up your environment:
cp .env.example .envThen edit .env and add your Replicate API token:
REPLICATE_API_TOKEN=your_token_here
- Run the application:
python app.pyVisit http://localhost:5000 in your browser to start using the app.
- Backend: Flask (Python web framework)
- Frontend: HTML, JavaScript, TailwindCSS
- AI Models:
- Stability AI's SDXL for image generation
- Salesforce's BLIP for image analysis
- API: Replicate
- Be specific about style, colors, and composition
- Include details about lighting and atmosphere
- Specify artistic style (e.g., watercolor, photorealistic, oil painting)
- Use direct image URLs (ending in .jpg, .png, etc.)
- Images should be publicly accessible
- Supported formats: JPG, PNG, WebP
Never commit your .env file or expose your API token. The .env file is included in .gitignore to prevent accidental commits.
Feel free to open issues or submit pull requests for improvements!