Skip to main content

๐ŸŒธ Beautiful and simple AI generation library for images, text, and audio

Project description

๐ŸŒธ Blossom AI

Python 3.8+ License: MIT Version

A beautiful Python SDK for Pollinations.AI - Generate images, text, and audio with AI.

Blossom AI is a comprehensive, easy-to-use Python library that provides unified access to Pollinations.AI's powerful AI generation services. Create stunning images, generate text with various models, and convert text to speech with multiple voices - all through a beautifully designed, intuitive API.

โœจ What's New in v0.2.5

๐Ÿ”— URL Generation Support

  • ๐ŸŒ generate_url() Method: Get direct image URLs without downloading bytes
  • โšก Lightning Fast: No network overhead - instant URL generation
  • ๐Ÿค– Bot-Friendly: Perfect for Discord, Telegram, and web integrations
  • ๐Ÿ’พ Traffic Efficient: Save bandwidth by sharing URLs instead of bytes
  • ๐Ÿ”’ Secure: Tokens are never included in URLs - always safe to share

Why Use generate_url()?

from blossom_ai import Blossom

client = Blossom()

# OLD WAY: Download image bytes (slow, uses bandwidth)
image_bytes = client.image.generate("sunset")  # ~2-5 seconds
# Then you need to upload to your server or send bytes...

# NEW WAY: Get URL instantly (fast, no bandwidth)
url = client.image.generate_url("sunset")  # <0.1 seconds
# Share the URL directly - Pollinations hosts the image!
print(url)  # https://image.pollinations.ai/prompt/sunset?model=flux&...

Perfect for:

  • ๐Ÿค– Discord/Telegram bots (embed URLs in messages)
  • ๐ŸŒ Web applications (use URLs in <img> tags)
  • ๐Ÿ“ฑ Mobile apps (reduce data transfer)
  • ๐Ÿ”„ Parallel generation (create many URLs quickly)
  • ๐Ÿ“Š Image galleries (no storage needed)

โš ๏ธ Important Notes

  • Audio Generation: Requires authentication (API token)
  • Hybrid API: Automatically detects sync/async context - no need for separate imports
  • Streaming: Works in both sync and async contexts with iterators
  • Stream Timeout: Default 30 seconds between chunks - automatically raises error if no data
  • Robust Error Handling: Graceful fallbacks when API endpoints are unavailable
  • Resource Management: Use context managers for proper cleanup

โœจ Features

  • ๐Ÿ–ผ๏ธ Image Generation - Create stunning images from text descriptions
  • ๐Ÿ”— Image URL Generation - Get direct links without downloading (NEW!)
  • ๐Ÿ“ Text Generation - Generate text with various AI models
  • ๐ŸŒŠ Streaming - Real-time text generation with timeout protection
  • ๐ŸŽ™๏ธ Audio Generation - Text-to-speech with multiple voices
  • ๐Ÿš€ Unified API - Same code works in sync and async contexts
  • ๐ŸŽจ Beautiful Errors - Helpful error messages with actionable suggestions
  • ๐Ÿ”„ Reproducible - Use seeds for consistent results
  • โšก Smart Async - Automatically switches between sync/async modes
  • ๐Ÿ›ก๏ธ Robust - Graceful error handling with fallbacks and timeout protection
  • ๐Ÿงน Clean - Proper resource management and cleanup
  • ๐Ÿ” Traceable - Request IDs for debugging

๐Ÿ“ฆ Installation

pip install eclips-blossom-ai

๐Ÿš€ Quick Start

from blossom_ai import Blossom

# Initialize
ai = Blossom()

# Generate an image URL (NEW in v0.2.5!)
url = ai.image.generate_url("a beautiful sunset over mountains")
print(url)  # https://image.pollinations.ai/prompt/...

# Generate and save an image
ai.image.save("a beautiful sunset over mountains", "sunset.jpg")

# Generate text
response = ai.text.generate("Explain quantum computing in simple terms")
print(response)

# Stream text in real-time (with automatic timeout protection)
for chunk in ai.text.generate("Tell me a story", stream=True):
    print(chunk, end='', flush=True)

# Generate audio (requires API token)
ai = Blossom(api_token="YOUR_TOKEN")
ai.audio.save("Hello, welcome to Blossom AI!", "welcome.mp3", voice="nova")

๐Ÿ”— Image URL Generation (NEW!)

The new generate_url() method provides instant access to image URLs without downloading:

Basic Usage

from blossom_ai import Blossom

client = Blossom()

# Get image URL instantly
url = client.image.generate_url("a beautiful sunset")
print(url)
# Output: https://image.pollinations.ai/prompt/a%20beautiful%20sunset?model=flux&width=1024&height=1024

With Custom Parameters

# Full control over generation
url = client.image.generate_url(
    prompt="cyberpunk city at night",
    model="flux",
    width=1920,
    height=1080,
    seed=42,           # Reproducible results
    nologo=True,       # Remove watermark
    private=True,      # Private generation
    enhance=True,      # AI prompt enhancement
    safe=True          # NSFW filter
)

# URLs are always safe to share - no tokens included!
print(url)  # https://image.pollinations.ai/prompt/...

Discord Bot Example

import discord
from blossom_ai import Blossom

client = Blossom()
bot = discord.Client()

@bot.event
async def on_message(message):
    if message.content.startswith('!imagine'):
        prompt = message.content[8:].strip()
        
        # Generate URL instantly - no download needed!
        url = await client.image.generate_url(
            prompt,
            nologo=True,
            private=True
        )
        
        # Discord will automatically show image preview
        await message.channel.send(url)

bot.run('YOUR_DISCORD_TOKEN')

Telegram Bot Example

from telegram import Update
from telegram.ext import Application, CommandHandler
from blossom_ai import Blossom

client = Blossom()

async def imagine(update: Update, context):
    prompt = ' '.join(context.args)
    
    # Generate URL - fast and efficient
    url = await client.image.generate_url(prompt, nologo=True)
    
    # Send image directly from URL
    await update.message.reply_photo(photo=url)

app = Application.builder().token("YOUR_TELEGRAM_TOKEN").build()
app.add_handler(CommandHandler("imagine", imagine))
app.run_polling()

Web Application Example

from flask import Flask, render_template, request
from blossom_ai import Blossom

app = Flask(__name__)
client = Blossom()

@app.route('/generate', methods=['POST'])
def generate():
    prompt = request.form['prompt']
    
    # Generate URL for web embedding
    url = client.image.generate_url(
        prompt,
        width=512,
        height=512,
        nologo=True
    )
    
    return render_template('result.html', image_url=url)

# In result.html:
# <img src="{{ image_url }}" alt="Generated Image">

Parallel URL Generation

import asyncio
from blossom_ai import Blossom

async def generate_gallery():
    client = Blossom()
    
    prompts = [
        "a red sunset",
        "a blue ocean",
        "a green forest",
        "a purple galaxy"
    ]
    
    # Generate all URLs in parallel - super fast!
    urls = await asyncio.gather(*[
        client.image.generate_url(prompt, seed=i)
        for i, prompt in enumerate(prompts)
    ])
    
    return urls

# Run it
urls = asyncio.run(generate_gallery())
for prompt, url in zip(prompts, urls):
    print(f"{prompt}: {url}")

HTML Gallery Generator

from blossom_ai import Blossom

client = Blossom()

def create_gallery(prompts):
    html = """
    <!DOCTYPE html>
    <html>
    <head>
        <title>AI Image Gallery</title>
        <style>
            .gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
            img { width: 100%; border-radius: 8px; }
        </style>
    </head>
    <body>
        <h1>AI Generated Gallery</h1>
        <div class="gallery">
    """
    
    for prompt in prompts:
        url = client.image.generate_url(prompt, nologo=True)
        html += f"""
            <div>
                <img src="{url}" alt="{prompt}">
                <p>{prompt}</p>
            </div>
        """
    
    html += """
        </div>
    </body>
    </html>
    """
    
    with open('gallery.html', 'w') as f:
        f.write(html)

# Create gallery
prompts = ["sunset", "mountains", "ocean", "forest", "city", "space"]
create_gallery(prompts)

Comparing URL vs Download

import time
from blossom_ai import Blossom

client = Blossom()

# Method 1: URL generation (instant)
start = time.time()
url = client.image.generate_url("a cat", seed=42)
url_time = time.time() - start
print(f"URL generation: {url_time:.3f}s")

# Method 2: Download bytes (slower)
start = time.time()
image_bytes = client.image.generate("a cat", seed=42)
download_time = time.time() - start
print(f"Download: {download_time:.3f}s ({len(image_bytes)} bytes)")

print(f"Speed improvement: {download_time / url_time:.1f}x faster!")
# Typical output: 20-50x faster!

When to Use URL vs Download

Use generate_url() when:

  • โœ… Sharing images in chat apps (Discord, Telegram, Slack)
  • โœ… Embedding in web pages
  • โœ… Creating image galleries
  • โœ… Mobile apps (reduce data usage)
  • โœ… You need instant results
  • โœ… Generating many images quickly

Use generate() when:

  • โœ… You need the actual image file
  • โœ… Processing/editing the image locally
  • โœ… Storing images in your own system
  • โœ… Working offline after generation
  • โœ… Need pixel-level access

๐ŸŒŠ Streaming Support

Get responses in real-time as they're generated, with built-in timeout protection:

Synchronous Streaming

from blossom_ai import Blossom

ai = Blossom()

# Simple streaming with automatic timeout protection
for chunk in ai.text.generate("Write a poem about AI", stream=True):
    print(chunk, end='', flush=True)

# Chat streaming
messages = [
    {"role": "system", "content": "You are a helpful assistant"},
    {"role": "user", "content": "Explain Python"}
]
for chunk in ai.text.chat(messages, stream=True):
    print(chunk, end='', flush=True)

# Collect full response from stream
chunks = []
for chunk in ai.text.generate("Hello", stream=True):
    chunks.append(chunk)
full_response = ''.join(chunks)

Asynchronous Streaming

import asyncio
from blossom_ai import Blossom

async def stream_example():
    ai = Blossom()
    
    # Async streaming with timeout protection
    async for chunk in await ai.text.generate("Tell me a story", stream=True):
        print(chunk, end='', flush=True)
    
    # Async chat streaming
    messages = [{"role": "user", "content": "Hello!"}]
    async for chunk in await ai.text.chat(messages, stream=True):
        print(chunk, end='', flush=True)

asyncio.run(stream_example())

๐Ÿ”„ Unified Sync/Async API

The same API works seamlessly in both synchronous and asynchronous contexts:

from blossom_ai import Blossom

ai = Blossom()

# Synchronous usage
url = ai.image.generate_url("a cute robot")
image_data = ai.image.generate("a cute robot")
text = ai.text.generate("Hello world")

# Asynchronous usage - same methods!
import asyncio

async def main():
    ai = Blossom()
    url = await ai.image.generate_url("a cute robot")  # NEW!
    image_data = await ai.image.generate("a cute robot")
    text = await ai.text.generate("Hello world")
    
asyncio.run(main())

No need for separate imports or different APIs - Blossom automatically detects your context and does the right thing!

๐Ÿ“– Examples

Image Generation

from blossom_ai import Blossom

ai = Blossom()

# NEW: Get URL without downloading
url = ai.image.generate_url(
    prompt="a majestic dragon in a mystical forest",
    width=1024,
    height=1024,
    model="flux",
    seed=42
)
print(f"Image URL: {url}")

# Generate and save an image
ai.image.save(
    prompt="a majestic dragon in a mystical forest",
    filename="dragon.jpg",
    width=1024,
    height=1024,
    model="flux"
)

# Get image data as bytes
image_data = ai.image.generate("a cute robot")

# Use different models
image_data = ai.image.generate("futuristic city", model="turbo")

# Reproducible results with seed
image_data = ai.image.generate("random art", seed=42)

# List available models (dynamically fetched from API)
models = ai.image.models()
print(models)  # ['flux', 'kontext', 'turbo', 'gptimage', ...]

Text Generation

from blossom_ai import Blossom

ai = Blossom()

# Simple text generation
response = ai.text.generate("What is Python?")

# With system message
response = ai.text.generate(
    prompt="Write a haiku about coding",
    system="You are a creative poet"
)

# Reproducible results with seed
response = ai.text.generate(
    prompt="Generate a random idea",
    seed=42  # Same seed = same result
)

# JSON mode
response = ai.text.generate(
    prompt="List 3 colors in JSON format",
    json_mode=True
)

# Streaming (with automatic timeout protection)
for chunk in ai.text.generate("Tell a story", stream=True):
    print(chunk, end='', flush=True)

# Chat with message history
response = ai.text.chat([
    {"role": "system", "content": "You are a helpful assistant"},
    {"role": "user", "content": "What's the weather like?"}
])

# Chat with streaming
messages = [{"role": "user", "content": "Explain AI"}]
for chunk in ai.text.chat(messages, stream=True):
    print(chunk, end='', flush=True)

# List available models (dynamically updated)
models = ai.text.models()
print(models)  # ['deepseek', 'gemini', 'mistral', 'openai', 'qwen-coder', ...]

Audio Generation

from blossom_ai import Blossom

# Audio generation requires an API token
ai = Blossom(api_token="YOUR_API_TOKEN")

# Generate and save audio
ai.audio.save(
    text="Welcome to the future of AI",
    filename="welcome.mp3",
    voice="nova"
)

# Try different voices
ai.audio.save("Hello", "hello_alloy.mp3", voice="alloy")
ai.audio.save("Hello", "hello_echo.mp3", voice="echo")

# Get audio data as bytes
audio_data = ai.audio.generate("Hello world", voice="shimmer")

# List available voices (dynamically updated)
voices = ai.audio.voices()
print(voices)  # ['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer', ...]

๐ŸŽฏ Supported Parameters

Image Generation

Parameter Type Default Description
prompt str - Image description (required)
model str "flux" Model to use
width int 1024 Image width in pixels
height int 1024 Image height in pixels
seed int None Seed for reproducibility
nologo bool False Remove watermark (requires token)
private bool False Keep image private
enhance bool False Enhance prompt with AI
safe bool False Enable NSFW filtering
referrer str None Optional referrer parameter

Image URL Generation (NEW!)

Same parameters as Image Generation, but returns URL string instead of bytes.

url = ai.image.generate_url(
    prompt="your prompt",
    model="flux",
    width=1024,
    height=1024,
    seed=42,
    nologo=True,
    private=True,
    enhance=False,
    safe=False,
    referrer="my-app"  # Optional
)

Text Generation

Parameter Type Default Description
prompt str - Text prompt (required)
model str "openai" Model to use
system str None System message
seed int None Seed for reproducibility
temperature float None โš ๏ธ Not supported in current API
json_mode bool False Force JSON output
private bool False Keep response private
stream bool False Stream response in real-time

Text Chat

Parameter Type Default Description
messages list - Chat message history (required)
model str "openai" Model to use
temperature float 1.0 Fixed at 1.0 (API limitation)
stream bool False Stream response in real-time
json_mode bool False Force JSON output
private bool False Keep response private

Audio Generation

Parameter Type Default Description
text str - Text to speak (required)
voice str "alloy" Voice to use
model str "openai-audio" TTS model

๐Ÿ› ๏ธ API Reference

Blossom Class

ai = Blossom(
    timeout=30,           # Request timeout in seconds
    debug=False,          # Enable debug mode
    api_token=None        # Optional API token for auth
)

# Generators (work in sync and async)
ai.image   # Image generation
ai.text    # Text generation (with streaming!)
ai.audio   # Audio generation (requires token)

Context Manager Support

# Synchronous context manager
with Blossom() as ai:
    result = ai.text.generate("Hello")
    # Resources automatically cleaned up

# Asynchronous context manager
async with Blossom() as ai:
    result = await ai.text.generate("Hello")
    # Resources automatically cleaned up

Image Generator Methods

# NEW: Generate image URL (returns str)
url = ai.image.generate_url(prompt, **options)

# Generate image (returns bytes)
image_data = ai.image.generate(prompt, **options)

# Save image to file (returns filepath)
filepath = ai.image.save(prompt, filename, **options)

# List available models
models = ai.image.models()  # Returns list of model names

Text Generator Methods

# Generate text (returns str or Iterator[str] if stream=True)
text = ai.text.generate(prompt, **options)

# Generate with streaming (automatic timeout protection)
for chunk in ai.text.generate(prompt, stream=True):
    print(chunk, end='')

# Chat with message history (returns str or Iterator[str] if stream=True)
text = ai.text.chat(messages, **options)

# Chat with streaming
for chunk in ai.text.chat(messages, stream=True):
    print(chunk, end='')

# List available models
models = ai.text.models()  # Returns list of model names

Audio Generator Methods

# Generate audio (returns bytes)
audio_data = ai.audio.generate(text, voice="alloy")

# Save audio to file (returns filepath)
filepath = ai.audio.save(text, filename, voice="nova")

# List available voices
voices = ai.audio.voices()  # Returns list of voice names

๐ŸŽจ Error Handling

Blossom AI provides structured, informative errors with actionable suggestions:

from blossom_ai import (
    Blossom, 
    BlossomError,
    NetworkError,
    APIError,
    AuthenticationError,
    ValidationError,
    RateLimitError,
    StreamError
)

ai = Blossom()

try:
    response = ai.text.generate("Hello")
except AuthenticationError as e:
    print(f"Auth failed: {e.message}")
    print(f"Suggestion: {e.suggestion}")
    # Output: Visit https://auth.pollinations.ai to get an API token
    
except ValidationError as e:
    print(f"Invalid parameter: {e.message}")
    print(f"Context: {e.context}")
    
except NetworkError as e:
    print(f"Connection issue: {e.message}")
    print(f"Suggestion: {e.suggestion}")
    
except RateLimitError as e:
    print(f"Too many requests: {e.message}")
    if e.retry_after:
        print(f"Retry after: {e.retry_after} seconds")
    
except StreamError as e:
    print(f"Stream error: {e.message}")
    print(f"Suggestion: {e.suggestion}")
    # Example: "Stream timeout: no data for 30s"
    
except APIError as e:
    print(f"API error: {e.message}")
    if e.context:
        print(f"Status: {e.context.status_code}")
        print(f"Request ID: {e.context.request_id}")
    
except BlossomError as e:
    # Catch-all for any Blossom error
    print(f"Error type: {e.error_type}")
    print(f"Message: {e.message}")
    print(f"Suggestion: {e.suggestion}")
    if e.context and e.context.request_id:
        print(f"Request ID: {e.context.request_id}")
    if e.original_error:
        print(f"Original error: {e.original_error}")

Error Types

  • NetworkError - Connection issues, timeouts
  • APIError - HTTP errors from API (4xx, 5xx)
  • AuthenticationError - Invalid or missing API token (401)
  • ValidationError - Invalid parameters
  • RateLimitError - Too many requests (429) with retry_after info
  • StreamError - Streaming-specific errors (timeouts, interruptions)
  • BlossomError - Base error class for all errors

๐Ÿ” Authentication

For higher rate limits and advanced features, get an API token:

from blossom_ai import Blossom

# With authentication
ai = Blossom(api_token="YOUR_API_TOKEN")

# Use token for downloading images with premium features
image_bytes = ai.image.generate("sunset", nologo=True)  # Token used here
ai.image.save("sunset", "sunset.jpg", nologo=True)      # Token used here
ai.audio.save("Hello", "hello.mp3")                     # Token required

# Generate URLs (always safe - no token in URL)
url = ai.image.generate_url("sunset", nologo=True)
print(url)  # https://image.pollinations.ai/...&nologo=true
# โœ… Safe to share - no token exposed!

When to use token:

  • โœ… generate() - Download images with authentication
  • โœ… save() - Save images with authentication
  • โœ… audio.generate() - Audio requires token
  • โŒ generate_url() - URLs never include tokens (always safe)

Get your API token at auth.pollinations.ai

๐Ÿ”’ Security Considerations

URL Generation Security

generate_url() is designed to be always secure:

ai = Blossom(api_token="YOUR_SECRET_TOKEN")

# โœ… URLs NEVER contain your token
url = ai.image.generate_url("landscape")
# Safe to share publicly - token not exposed

# The URL works for everyone, no authentication needed
print(url)  # https://image.pollinations.ai/prompt/landscape?model=flux&...

When You Need Authentication

Use generate() or save() for authenticated features:

# โœ… Token used securely (not exposed in URLs)
image_bytes = ai.image.generate("cat", nologo=True)
# Token sent in request headers, never in public URLs

# Save to file with authentication
ai.image.save("cat", "cat.jpg", nologo=True)
# Token used internally, file saved locally

Best Practices

For Public Bots (Discord, Telegram):

# Option 1: Share URL (fast, no token exposure)
url = ai.image.generate_url(prompt)
await ctx.send(url)

# Option 2: Download and upload (with auth features)
image = await ai.image.generate(prompt, nologo=True)
await ctx.send(file=discord.File(io.BytesIO(image), 'image.png'))

For Web Applications:

# โœ… Safe: URL in HTML (no token)
url = ai.image.generate_url(prompt)
return f'<img src="{url}">'

# โœ… Safe: Download server-side (token not exposed)
image = ai.image.generate(prompt, nologo=True)
# Process/store image server-side

๐Ÿ”„ Async Usage

The same API works in async contexts automatically:

import asyncio
from blossom_ai import Blossom

async def generate_content():
    ai = Blossom()
    
    # All methods work with await
    url = await ai.image.generate_url("landscape")  # NEW!
    image = await ai.image.generate("landscape")
    text = await ai.text.generate("story")
    audio = await ai.audio.generate("speech")
    
    # Streaming with async (with timeout protection)
    async for chunk in await ai.text.generate("poem", stream=True):
        print(chunk, end='')
    
    # Context manager support
    async with Blossom() as ai:
        result = await ai.text.generate("Hello")
    
    return url, image, text, audio

# Run async function
asyncio.run(generate_content())

๐Ÿงช Testing

Run the comprehensive test suite:

# Run all tests
python test_examples.py

# Run only sync tests
python test_examples.py --sync

# Run only async tests
python test_examples.py --async

# Run only streaming tests
python test_examples.py --streaming

# With API token
python test_examples.py --token YOUR_TOKEN

๐Ÿ›ก๏ธ Robustness Features

Blossom AI includes several robustness features:

Retry Logic

  • Automatic retry with exponential backoff for failed requests
  • Configurable retry attempts (default: 3)
  • Smart retry only for retryable errors (502, timeouts)
  • Respects Retry-After header for rate limits

Streaming Protection

  • Automatic timeout detection: 30 seconds between chunks by default
  • Graceful error handling: Clear messages when streams timeout
  • Resource cleanup: Guaranteed cleanup even if stream is interrupted
  • Request tracing: Every stream has a unique request ID

Resource Management

  • Centralized session management with SessionManager
  • Proper cleanup with context managers
  • Weakref-based cleanup to prevent memory leaks
  • Thread-safe async session handling across event loops
  • Optimized connection pool settings

Error Recovery

  • Graceful fallbacks when API endpoints are unavailable
  • Dynamic model discovery with fallback to defaults
  • Continues operation even when some endpoints fail
  • Enhanced error messages with request IDs and retry information

Dynamic Models

  • Models automatically update from API responses
  • Fallback to sensible defaults if API unavailable
  • Type-safe model validation with helpful error messages

๐Ÿ“š Advanced Usage

Custom Timeout

# Set custom timeout for slow connections
ai = Blossom(timeout=60)  # 60 seconds

Debug Mode

# Enable debug mode for detailed logging (includes request IDs)
ai = Blossom(debug=True)

Handling Rate Limits

from blossom_ai import Blossom, RateLimitError
import time

ai = Blossom()

try:
    response = ai.text.generate("Hello")
except RateLimitError as e:
    print(f"Rate limited: {e.message}")
    if e.retry_after:
        print(f"Waiting {e.retry_after} seconds...")
        time.sleep(e.retry_after)
        # Retry request
        response = ai.text.generate("Hello")

๐Ÿ—๏ธ Architecture

Key Components:

  • Base Generators - SyncGenerator and AsyncGenerator base classes with timeout protection
  • Session Managers - Centralized session lifecycle management with connection pooling
  • Dynamic Models - Models that update from API at runtime
  • Hybrid Generators - Automatic sync/async detection
  • URL Generation - Instant URL creation without network requests (NEW!)
  • Streaming Support - SSE parsing with Iterator/AsyncIterator and timeout protection
  • Structured Errors - Rich error context with suggestions and request IDs
  • Request Tracing - Unique IDs for debugging and error correlation

๐Ÿ“„ License

MIT License - see LICENSE file for details.

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ› Known Issues

  • Temperature parameter: The GET text endpoint doesn't support temperature parameter
  • Chat temperature: Fixed at 1.0 in OpenAI-compatible endpoint
  • API Variability: Some endpoints may occasionally return unexpected formats - handled gracefully with fallbacks

๐Ÿ“‹ Changelog

v0.2.5 (Current)

  • ๐Ÿ”— URL Generation: New generate_url() method for instant image URLs without downloading
  • โšก Performance: URL generation is 20-50x faster than downloading bytes
  • ๐Ÿค– Bot-Friendly: Perfect for Discord, Telegram, and web integrations
  • ๐Ÿ’พ Bandwidth Efficient: Share URLs instead of transferring bytes
  • ๐Ÿ”’ Always Secure: Tokens never included in URLs - completely safe to share publicly
  • ๐Ÿ“ Documentation: Comprehensive examples for bots and web apps

v0.2.4

  • ๐Ÿ›ก๏ธ Stream Timeout Protection: Automatic detection and handling (30s default)
  • โฑ๏ธ Smart Rate Limiting: Retry-After header parsing
  • ๐Ÿ” Request Tracing: Unique request IDs for debugging
  • ๐Ÿงน Enhanced Cleanup: Guaranteed resource cleanup
  • โšก Better Error Messages: Request IDs and retry information
  • ๐Ÿ”ง Connection Optimization: Improved session management
  • ๐Ÿ“ฆ New StreamError: Dedicated error type for streaming
  • ๐ŸŽฏ Enhanced Error Context: All errors include request_id

๐Ÿ”— Links

โค๏ธ Credits

Built with love using the Pollinations.AI platform.

Made with ๐ŸŒธ by the eclips team


This README reflects v0.2.5 with URL generation support and enhanced bot integrations.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eclips_blossom_ai-0.2.5.tar.gz (45.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eclips_blossom_ai-0.2.5-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

Details for the file eclips_blossom_ai-0.2.5.tar.gz.

File metadata

  • Download URL: eclips_blossom_ai-0.2.5.tar.gz
  • Upload date:
  • Size: 45.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for eclips_blossom_ai-0.2.5.tar.gz
Algorithm Hash digest
SHA256 619eeb44e08042c3a0c199b1d251581833552e788f1e155c80b4c0e08bd2fb13
MD5 048c86dd651d4546665e81c0588043f4
BLAKE2b-256 c6d2c81cc5b81bd01a9285fd1657a36e059c17b2dc6aea0e5b19911e53fe4fa0

See more details on using hashes here.

File details

Details for the file eclips_blossom_ai-0.2.5-py3-none-any.whl.

File metadata

File hashes

Hashes for eclips_blossom_ai-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f9b322bf609a01470be900fd602221a57d1b521c04cf14966359beb91ba85a5a
MD5 3111d398ac2ac7d86a5b915ac5cae6b8
BLAKE2b-256 c1d4103af1ad1473627664343dc5f840aa3d262c6eaa719df081c6e12a6e06df

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page