๐ธ Beautiful and simple AI generation library for images, text, and audio
Project description
๐ธ Blossom AI
๐ Quick Start โข ๐ Documentation โข ๐ฅ๏ธ CLI Interface โข ๐ก Examples โข ๐ Changelog
โจ Features
|
๐ผ๏ธ Image Generation
|
๐ Text Generation
|
๐๏ธ Audio Generation
|
|
๐ฅ๏ธ CLI Interface ๐
|
๐ Unified API
|
โก Fast & Reliable
|
๐ 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"
๐ง 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:
python -m blossom_ai.utils.cli \
--image "sunset" \
--output sunset.png
|
๐ Library (Python)Perfect for:
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 ModuleEnhance prompts with structured thinking: from blossom_ai.utils import ReasoningEnhancer
enhancer = ReasoningEnhancer()
enhanced = enhancer.enhance(
"Design a microservices architecture",
level="high"
)
|
โก Caching ModuleCache 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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b1ebaf2609de67149412469177b074911e87a4a7240327f752648faf0b75aba
|
|
| MD5 |
636c69deb94f03d54a49f4e82f5a6e9f
|
|
| BLAKE2b-256 |
5e4b4ddad00d86f63206ab0744cec8e4d8d57c253c600e58f4cd0bcce24b6eac
|
File details
Details for the file eclips_blossom_ai-0.4.7-py3-none-any.whl.
File metadata
- Download URL: eclips_blossom_ai-0.4.7-py3-none-any.whl
- Upload date:
- Size: 143.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d96a81adf28620860b57e118701102a3efdb56b5eb737a9677c26ba01ba51af
|
|
| MD5 |
c59983ff313607220512785b1ff42c61
|
|
| BLAKE2b-256 |
6e45d2b91853209383f06d434501c75275b017ed128b55947f894093c93725cb
|