Spaces:
Sleeping
Sleeping
File size: 3,327 Bytes
0128def 1c3fcb7 0128def 9fbf170 0128def 3ce50c4 9fbf170 1c3fcb7 9fbf170 0128def ae0dff8 1c3fcb7 ae0dff8 1c3fcb7 ae0dff8 9fbf170 ae0dff8 9fbf170 ae0dff8 1c3fcb7 9fbf170 ae0dff8 9fbf170 ae0dff8 1c3fcb7 9fbf170 1c3fcb7 9fbf170 1c3fcb7 9fbf170 1c3fcb7 ae0dff8 9fbf170 ae0dff8 1c3fcb7 9fbf170 1c3fcb7 9fbf170 ae0dff8 9fbf170 ae0dff8 9fbf170 ae0dff8 1c3fcb7 9fbf170 ae0dff8 9fbf170 1c3fcb7 ae0dff8 9fbf170 1c3fcb7 9fbf170 1c3fcb7 9fbf170 1c3fcb7 9fbf170 ae0dff8 1c3fcb7 ae0dff8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | ---
title: Wizard Spells AI Agent
colorFrom: pink
colorTo: yellow
sdk: streamlit
app_file: app.py
pinned: false
tags:
- streamlit
- wizard
- spells
- magic
- ai
- image-generation
---
# Wizard Spells AI Agent
An intelligent AI application that generates a single random wizard spell and creates a magical visualization using Streamlit and AI image generation.
## Features
- **Single Spell Generation**: Fetches one random wizard spell from the Wizard World API
- **AI-Powered Visualizations**: Generates magical images using FLUX.1-schnell model
- **Clean Interface**: Simple, focused Streamlit interface
- **Responsive Design**: Works great on desktop and mobile
- **Real-time Generation**: Live image generation with loading indicators
- **One-Click Experience**: Single button generates spell and visualization
## How It Works
1. **Click Generate**: Press the "Generate Random Spell!" button
2. **Spell Selection**: The app fetches one random spell from the database
3. **Image Creation**: AI generates a custom visualization for your spell
4. **Clean Display**: Spell name and effect shown with accompanying image
## Technology Stack
- **Frontend**: Streamlit (latest version)
- **Image Generation**: HuggingFace FLUX.1-schnell model
- **Spell Data**: Wizard World API
- **Image Processing**: Pillow (PIL)
- **Deployment**: HuggingFace Spaces
## Features in Detail
### 🎲 Single Spell Generation
- Fetches one spell from a comprehensive wizard spell database
- Each spell includes name and magical effect description
- Clean, focused display without clutter
### 🎨 AI Image Generation
- Uses state-of-the-art FLUX.1-schnell model
- Generates unique visualizations for each spell
- Handles API errors gracefully with fallback displays
### 📱 User Experience
- Simple one-button interface
- Loading indicators for better UX
- Sidebar with helpful information
- Responsive design for all devices
- Fast, streamlined workflow
## Usage Examples
Perfect for:
- D&D campaign inspiration
- Creative writing prompts
- Fantasy world building
- Educational content about magic systems
- Quick magical inspiration
- Entertainment and fun
## Interface Layout
- **Main Area**: Single spell display with name and effect
- **Image Panel**: AI-generated visualization of the spell
- **Sidebar**: App information and status indicators
- **Single Button**: One-click spell generation
## Setup for Local Development
1. Clone the repository
2. Install dependencies: `pip install -r requirements.txt`
3. Set HF_TOKEN environment variable (optional, for image generation)
4. Run: `streamlit run app.py`
## Technical Notes
- **No Version Pinning**: Uses latest stable versions of all libraries
- **Error Handling**: Graceful fallbacks when services are unavailable
- **Modular Design**: Clean separation of concerns
- **Performance**: Efficient API calls and image handling
- **Minimal Dependencies**: Only essential libraries included
## API Integration
- **Wizard World API**: Provides authentic wizard spell data
- **HuggingFace FLUX**: Powers the AI image generation
- **Streamlit**: Handles the web interface and user interactions
This project demonstrates modern Python web app development with AI integration, showcasing best practices for Streamlit applications with a focus on simplicity and user experience.
|