Skip to content

jtalborough/Replicate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎨 Replicate API Demo

A powerful demonstration of AI capabilities using the Replicate API, showcasing state-of-the-art AI models for image generation and analysis.

✨ Features

1. Image Generation (SDXL)

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"

2. Image Analysis (BLIP)

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

🚀 Getting Started

Prerequisites

  • Python 3.8 or higher
  • Replicate API token (Get one here)
  • Virtual environment (recommended)

Installation

  1. Clone the repository:
git clone <repository-url>
cd replicate-demo
  1. Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up your environment:
cp .env.example .env

Then edit .env and add your Replicate API token:

REPLICATE_API_TOKEN=your_token_here
  1. Run the application:
python app.py

Visit http://localhost:5000 in your browser to start using the app.

🛠️ Tech Stack

  • 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

📝 Usage Tips

Image Generation

  • Be specific about style, colors, and composition
  • Include details about lighting and atmosphere
  • Specify artistic style (e.g., watercolor, photorealistic, oil painting)

Image Analysis

  • Use direct image URLs (ending in .jpg, .png, etc.)
  • Images should be publicly accessible
  • Supported formats: JPG, PNG, WebP

🔒 Security Note

Never commit your .env file or expose your API token. The .env file is included in .gitignore to prevent accidental commits.

🤝 Contributing

Feel free to open issues or submit pull requests for improvements!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published