Skip to main content

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

Project description

โœจ Features

๐Ÿ–ผ๏ธ Image Generation

  • Create stunning images from text
  • Direct URL generation (no downloads!)
  • Save to file or get raw bytes

๐Ÿ“ Text Generation

  • Multiple AI models support
  • Real-time streaming
  • Timeout protection

๐ŸŽ™๏ธ Audio Generation

  • Text-to-speech conversion
  • Multiple voice options
  • High-quality output

๐Ÿš€ Unified API

  • Sync & async support
  • Consistent interface
  • Easy to learn

๐Ÿงน Clean Code

  • Proper resource management
  • Automatic cleanup
  • Type hints included

โšก Fast & Reliable

  • Optimized performance
  • Error handling
  • Production-ready

๐Ÿ†• What's New in v0.4.5

๐Ÿ”ง Production Improvements

Performance:

  • โšก 100x faster import time (5s โ†’ 50ms)
  • ๐Ÿง  Smart model caching with 5-minute TTL
  • ๐Ÿ“‰ 19x less memory usage in long-running apps

Reliability:

  • โœ… Integration tests with VCR.py
  • ๐Ÿ”„ Intelligent retry with API-specified delays
  • ๐Ÿ›ก๏ธ Better error handling and recovery

Security:

  • ๐Ÿ” Tokens now only in headers (never in URLs)
  • โœ… SSL certificate verification enforced
  • ๐Ÿ”’ No token exposure in logs or browser history

See CHANGELOG for details

๐Ÿš€ Quick Start

๐Ÿ“ฆ Installation

pip install eclips-blossom-ai

โšก Basic Usage

from blossom_ai import Blossom

with Blossom() as ai:
    # Generate image URL (Fast & Free!)
    url = ai.image.generate_url("a beautiful sunset")
    print(url)
    
    # Save image directly to a file
    ai.image.save("a serene lake at dawn", "lake.jpg")

    # Get raw image bytes for custom processing
    image_bytes = ai.image.generate("a robot painting a portrait")
    # Now you can upload, display, or manipulate image_bytes as needed

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

    # Stream text
    for chunk in ai.text.generate("Tell me a story", stream=True):
        print(chunk, end='', flush=True)

๐Ÿ” Production-Ready Setup

import os
from blossom_ai import Blossom

# โœ… Best practice: Use environment variables
api_token = os.getenv('POLLINATIONS_API_KEY')

# โœ… Always use context managers
with Blossom(api_version="v2", api_token=api_token) as ai:
    # Your code here
    image = ai.image.generate(
        "a sunset",
        quality="hd",
        nologo=True
    )
# Automatic cleanup - no resource leaks!

๐Ÿ“Š Why Blossom AI?

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  โœ“ Unified API for image, text, and audio generation   โ”‚
โ”‚  โœ“ Both sync and async support out of the box          โ”‚
โ”‚  โœ“ Clean, modern Python with type hints                โ”‚
โ”‚  โœ“ Production-ready with comprehensive testing         โ”‚
โ”‚  โœ“ Active development and community support            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“š Documentation

Resource Description
๐Ÿ“– Getting Started Complete guide to using Blossom AI
โš™๏ธ Installation Setup and configuration instructions
๐Ÿ’ก Examples Practical code examples and use cases
๐Ÿ†• V2 API Guide Migrate to V2 API with new features
๐Ÿ“ Changelog Version history and updates
๐Ÿ”’ Security Security best practices

๐ŸŒŸ Showcase

๐ŸŽจ Image Generation Examples
# Generate artistic images
ai.image.save("a cyberpunk city at night", "cyberpunk.jpg")
ai.image.save("watercolor painting of mountains", "mountains.jpg")

# V2 API: HD quality with advanced controls
with Blossom(api_version="v2", api_token="token") as ai:
    image = ai.image.generate(
        "majestic dragon",
        quality="hd",
        guidance_scale=7.5,
        negative_prompt="blurry, low quality"
    )
๐Ÿ’ฌ Text Generation Examples
# Creative writing
story = ai.text.generate("Write a short sci-fi story")

# Code generation
code = ai.text.generate("Create a Python function to sort a list")

# V2 API: Advanced controls
with Blossom(api_version="v2", api_token="token") as ai:
    response = ai.text.generate(
        "Explain AI",
        max_tokens=200,
        frequency_penalty=0.5,
        temperature=0.8
    )
๐Ÿ“Š Audio Generation Examples
# Text-to-speech (requires API token)
with Blossom(api_token="your_token") as ai:
    ai.audio.save("Hello, world!", "greeting.mp3", voice="nova")

๐Ÿ›ก๏ธ super update

Blossom AI v0.4.5 best is with:

โœ… Comprehensive Testing: Integration tests with VCR.py
โœ… Memory Safe: No memory leaks in long-running applications
โœ… Secure: Tokens only in headers, SSL verification enforced
โœ… Fast: Optimized caching and connection pooling
โœ… Reliable: Smart retry logic with exponential backoff

Quick Health Check

from blossom_ai import Blossom

# Verify everything works
def health_check():
    try:
        with Blossom(api_version="v2", api_token="token") as client:
            # Test image
            img = client.image.generate("test", width=256, height=256)
            assert len(img) > 1000
            
            # Test text
            txt = client.text.generate("Say hello", max_tokens=10)
            assert len(txt) > 0
            
            print("โœ… Health check passed!")
            return True
    except Exception as e:
        print(f"โŒ Health check failed: {e}")
        return False

health_check()

๐Ÿค Contributing

Contributions are what make the open-source community amazing! Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

See CONTRIBUTING.md for detailed guidelines.

๐Ÿ“„ License

Distributed under the MIT License. See LICENSE for more information.

๐Ÿ’– Support

If you find this project helpful, please consider:

  • โญ Starring the repository
  • ๐Ÿ› Reporting bugs
  • ๐Ÿ’ก Suggesting new features
  • ๐Ÿ“ข Sharing with others

Made with ๐ŸŒธ and โค๏ธ by Eclips Team

Made with Python Powered by Pollinations.AI

โฌ†๏ธ Back to top

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.4.6.tar.gz (129.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.4.6-py3-none-any.whl (132.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eclips_blossom_ai-0.4.6.tar.gz
  • Upload date:
  • Size: 129.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.4.6.tar.gz
Algorithm Hash digest
SHA256 e2a37b5a9742551c0f36fbc6eedfcccdef840b580627c1c7b0fe1c92c23a99bb
MD5 beea0824be72200f7d26ac932b7cf482
BLAKE2b-256 04b51c82bc45e5262c03b18850908429c590a1bcde937f7dddc7312761d7b30d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for eclips_blossom_ai-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 abe6751b599dbe8f23f177cc78c861871dfbc22d7fa936d1096d8138711650b0
MD5 4fabc2476fe76d9ebc7313cb3ff89c07
BLAKE2b-256 8ef0f2a000f471265f11720c3c1a2098f4f1c68871c3345defd15141b03cd59f

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