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!)
  • HD quality with V2 API

๐Ÿ“ Text Generation

  • Multiple AI models support
  • Real-time streaming
  • Function calling & tools

๐ŸŽ™๏ธ Audio Generation

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

๐Ÿ–ฅ๏ธ CLI Interface ๐Ÿ†•

  • Interactive terminal menu
  • Quick command-line access
  • No code required

๐Ÿš€ Unified API

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

โšก Fast & Reliable

  • Optimized performance
  • Smart caching
  • Production-ready

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

๐Ÿ–ฅ๏ธ CLI Interface (NEW!)

Quick Terminal Access:

  • ๐ŸŒธ Beautiful interactive menu
  • โšก Quick commands for automation
  • ๐ŸŽฏ Perfect for testing and learning
  • ๐Ÿ”ง Shell script integration
# Interactive mode
python -m blossom_ai.utils.cli

# Quick generation
python -m blossom_ai.utils.cli --image "sunset" --output sunset.png
python -m blossom_ai.utils.cli --text "Write a poem"

View CLI Documentation โ†’

๐Ÿ”ง Production Improvements (v0.4.5-v0.4.6)

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

๐Ÿ–ฅ๏ธ CLI Interface (NEW!)

Perfect for quick testing and learning:

# Launch interactive menu
python -m blossom_ai.utils.cli

# Quick commands
python -m blossom_ai.utils.cli --image "a beautiful sunset" --output sunset.png
python -m blossom_ai.utils.cli --text "Explain quantum computing"

# Set API token
export POLLINATIONS_API_KEY="your_token"
python -m blossom_ai.utils.cli

Interactive Menu:

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘        ๐ŸŒธ BLOSSOM AI CLI ๐ŸŒธ             โ•‘
โ•‘  Simple interface for AI generation      โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

1. ๐Ÿ–ผ๏ธ  Generate Image
2. ๐Ÿ’ฌ Generate Text
3. ๐Ÿ—ฃ๏ธ  Generate Audio (TTS)
4. โ„น๏ธ  Show Available Models
5. ๐Ÿšช Exit

๐Ÿ“š Full CLI Documentation โ†’

โšก Python Library

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)

๐ŸŽฏ V2 API with Advanced Features

import os
from blossom_ai import Blossom

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

# โœ… V2 API with advanced features
with Blossom(api_version="v2", api_token=api_token) as ai:
    # HD image with advanced controls
    image = ai.image.generate(
        "majestic dragon",
        quality="hd",
        guidance_scale=7.5,
        negative_prompt="blurry, low quality"
    )
    
    # Text with advanced parameters
    response = ai.text.generate(
        "Explain AI",
        max_tokens=200,
        frequency_penalty=0.5,
        temperature=0.8
    )
# Automatic cleanup - no resource leaks!

๐Ÿ“Š Why Blossom AI?

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  โœ“ CLI Interface for quick terminal access ๐Ÿ†•              โ”‚
โ”‚  โœ“ Unified API for image, text, and audio generation       โ”‚
โ”‚  โœ“ Both sync and async support out of the box              โ”‚
โ”‚  โœ“ V2 API with HD quality and advanced features            โ”‚
โ”‚  โœ“ Clean, modern Python with type hints                    โ”‚
โ”‚  โœ“ Production-ready with comprehensive testing             โ”‚
โ”‚  โœ“ Smart caching and optimization utilities                โ”‚
โ”‚  โœ“ Active development and community support                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽฏ Choose Your Style

๐Ÿ–ฅ๏ธ CLI (Terminal)

Perfect for:

  • โœ… Quick testing
  • โœ… Learning the API
  • โœ… Shell automation
  • โœ… No code required
python -m blossom_ai.utils.cli \
  --image "sunset" \
  --output sunset.png

๐Ÿ Library (Python)

Perfect for:

  • โœ… Production apps
  • โœ… Complex workflows
  • โœ… Integration
  • โœ… Advanced features
from blossom_ai import Blossom

with Blossom() as ai:
    ai.image.save("sunset", "sunset.png")

๐Ÿ“š Documentation

Resource Description
๐Ÿ“– Getting Started Complete guide to using Blossom AI
๐Ÿ–ฅ๏ธ CLI Interface ๐Ÿ†• Terminal interface documentation
โš™๏ธ 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

CLI:

# Quick generation
python -m blossom_ai.utils.cli --image "cyberpunk city" --output city.png

# Interactive mode with custom settings
python -m blossom_ai.utils.cli
# Then select: 1. Generate Image

Python:

# V1 API - Simple and fast
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",
        width=1920,
        height=1080
    )
๐Ÿ’ฌ Text Generation Examples

CLI:

# Quick text generation
python -m blossom_ai.utils.cli --text "Write a haiku about AI"

# Streaming mode
python -m blossom_ai.utils.cli
# Select: 2. Generate Text
# Then enable streaming for real-time output

Python:

# 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 quantum computing",
        max_tokens=200,
        frequency_penalty=0.5,
        temperature=0.8,
        stream=True
    )
๐ŸŽ™๏ธ Audio Generation Examples

CLI:

# Text-to-speech (requires API token)
export POLLINATIONS_API_KEY="your_token"
python -m blossom_ai.utils.cli --version v1 --audio "Hello world" --output hello.mp3

Python:

# Text-to-speech (requires API token)
with Blossom(api_version="v1", api_token="your_token") as ai:
    ai.audio.save("Hello, world!", "greeting.mp3", voice="nova")
    ai.audio.save("Welcome to Blossom AI", "welcome.mp3", voice="alloy")
๐Ÿ”ง Shell Automation Examples
#!/bin/bash

# Generate multiple images
for i in {1..5}; do
    python -m blossom_ai.utils.cli \
        --image "abstract art $i" \
        --output "art_$i.png"
done

# Batch text processing
questions=(
    "What is AI?"
    "Explain machine learning"
    "What is deep learning?"
)

for q in "${questions[@]}"; do
    echo "Q: $q"
    python -m blossom_ai.utils.cli --text "$q"
    echo "---"
done

๐Ÿ›ก๏ธ Production Ready

Blossom AI v0.4.7 is battle-tested with:

โœ… CLI Interface: Quick terminal access for testing and automation
โœ… 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()

๐ŸŽจ Advanced Features

๐Ÿง  Reasoning Module

Enhance prompts with structured thinking:

from blossom_ai.utils import ReasoningEnhancer

enhancer = ReasoningEnhancer()
enhanced = enhancer.enhance(
    "Design a microservices architecture",
    level="high"
)

โšก Caching Module

Cache responses for better performance:

from blossom_ai.utils import cached

@cached(ttl=3600)
def generate_text(prompt):
    with Blossom() as ai:
        return ai.text.generate(prompt)

๐Ÿ“š View Full Documentation โ†’

๐Ÿค 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 CLI Available

โฌ†๏ธ 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.7.tar.gz (139.6 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.7-py3-none-any.whl (143.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eclips_blossom_ai-0.4.7.tar.gz
  • Upload date:
  • Size: 139.6 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.7.tar.gz
Algorithm Hash digest
SHA256 4b1ebaf2609de67149412469177b074911e87a4a7240327f752648faf0b75aba
MD5 636c69deb94f03d54a49f4e82f5a6e9f
BLAKE2b-256 5e4b4ddad00d86f63206ab0744cec8e4d8d57c253c600e58f4cd0bcce24b6eac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for eclips_blossom_ai-0.4.7-py3-none-any.whl
Algorithm Hash digest
SHA256 0d96a81adf28620860b57e118701102a3efdb56b5eb737a9677c26ba01ba51af
MD5 c59983ff313607220512785b1ff42c61
BLAKE2b-256 6e45d2b91853209383f06d434501c75275b017ed128b55947f894093c93725cb

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