A simplified MVP version of Pollinations.AI focusing on core image generation functionality.
- β¨ Simple Image Generation - Generate images from text prompts via URL
- π¨ FLUX Model Support - Uses advanced AI models for high-quality images
- π§ Customizable Parameters - Control width, height, seed, and more
- β‘ Fast & Lightweight - Minimal dependencies, easy to deploy
- π Free to Use - No API keys required for basic usage
# Clone the repository
git clone https://github.com/gitmvp-com/pollinations-mvp.git
cd pollinations-mvp
# Install dependencies
npm install
# Copy environment configuration
cp .env.example .env
# Start the server
npm startnpm startThe server will start on http://localhost:16384
Open your browser or use curl:
# Simple generation
curl -o image.jpg "http://localhost:16384/prompt/a%20beautiful%20sunset%20over%20mountains"
# With custom parameters
curl -o image.jpg "http://localhost:16384/prompt/cyberpunk%20city?width=1920&height=1080&seed=42"Endpoint: GET /prompt/{prompt}
Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
| width | integer | 1024 | Image width in pixels |
| height | integer | 1024 | Image height in pixels |
| seed | integer | random | Seed for reproducible results |
| model | string | flux | Model to use (flux, turbo) |
| enhance | boolean | false | Auto-enhance prompt |
Example:
# Generate a landscape image
curl "http://localhost:16384/prompt/mountain%20landscape?width=1920&height=1080&seed=123" > landscape.jpg
# Generate with enhanced prompt
curl "http://localhost:16384/prompt/cute%20cat?enhance=true" > cat.jpgEndpoint: GET /models
curl http://localhost:16384/modelsResponse:
["flux", "turbo"]import requests
from urllib.parse import quote
prompt = "A serene mountain landscape at sunrise"
url = f"http://localhost:16384/prompt/{quote(prompt)}"
params = {"width": 1280, "height": 720, "seed": 42}
response = requests.get(url, params=params)
with open("image.jpg", "wb") as f:
f.write(response.content)
print("Image generated successfully!")import fetch from 'node-fetch';
import fs from 'fs';
const prompt = "A futuristic city with flying cars";
const url = `http://localhost:16384/prompt/${encodeURIComponent(prompt)}?width=1280&height=720`;
const response = await fetch(url);
const buffer = await response.buffer();
fs.writeFileSync('city.jpg', buffer);
console.log('Image generated successfully!');<img src="http://localhost:16384/prompt/beautiful%20sunset?width=800&height=600"
alt="AI Generated Sunset" />This MVP is intentionally simple:
βββββββββββββββββββ
β Client Request β
β /prompt/... β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β HTTP Server β
β (Node.js) β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β Rate Limiter β
β (IP-based) β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β Image Generator β
β (FLUX API) β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β Return Image β
β (JPEG/PNG) β
βββββββββββββββββββ
pollinations-mvp/
βββ src/
β βββ index.js # Main server
β βββ generator.js # Image generation logic
β βββ rateLimiter.js # Simple rate limiting
β βββ utils.js # Helper functions
βββ .env.example # Environment template
βββ package.json # Dependencies
βββ README.md # Documentation
Edit .env to customize:
# Server port
PORT=16384
# Image generation API (default: Pollinations public API)
IMAGE_API_URL=https://image.pollinations.ai/prompt
# Rate limiting (milliseconds between requests)
RATE_LIMIT_INTERVAL=30000# Build
docker build -t pollinations-mvp .
# Run
docker run -p 16384:16384 pollinations-mvp# Production mode
NODE_ENV=production npm startThis MVP focuses on simplicity and includes only:
β Included:
- Basic image generation
- Simple rate limiting
- Model selection (flux, turbo)
- Parameter customization
β Not Included (in full version):
- Advanced authentication system
- Multiple backend services
- Real-time feeds
- Audio generation
- Text generation
- Vision/multimodal features
- React hooks library
- Advanced caching strategies
- Content safety filters
- Analytics & telemetry
- Full Pollinations.AI: github.com/pollinations/pollinations
- API Documentation: Pollinations API Docs
- Website: pollinations.ai
MIT License - see LICENSE file for details.
This MVP is inspired by the amazing work of the Pollinations.AI team. This is a simplified educational version focusing on core image generation features.
Made with β€οΈ for learning and experimentation