--- license: apache-2.0 title: AI-Powered Advertisement Generator sdk: streamlit emoji: 💻 colorFrom: blue colorTo: yellow --- # 🎨 AdForge AI - AI-Powered Advertisement Generator **Transform your product concepts into stunning professional advertisements using AI** [![Hugging Face](https://img.shields.io/badge/🤗%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces) [![FLUX.1](https://img.shields.io/badge/FLUX.1-schnell-purple)](https://huggingface.co/black-forest-labs/FLUX.1-schnell) [![License](https://img.shields.io/badge/license-Apache%202.0-green)](LICENSE) ## ✨ Features - 🚀 **Lightning Fast**: Generate professional ads in 5-10 seconds - 🎯 **JSON-Based Input**: Simply paste your product concept in JSON format - 🎨 **Multiple Variations**: Create up to 4 variations simultaneously - 📥 **One-Click Download**: Save high-resolution images instantly - 💎 **Professional Quality**: Powered by FLUX.1-schnell model (12B parameters) - 🆓 **Free to Use**: Leverages Hugging Face's free Inference API - 📊 **Template Library**: Pre-built templates for various industries - 🔒 **Secure**: Your API token stays on your device ## 🖼️ Sample Outputs AdForge AI can generate advertisements for: - 🏢 Tech Products (gadgets, software, electronics) - 🍔 Food & Beverage (restaurants, packaged goods) - 👗 Fashion (clothing, accessories, lifestyle) - 🚗 Automotive (cars, motorcycles, services) - 🏠 Real Estate (properties, home goods) - 💄 Beauty & Cosmetics - 🎮 Gaming & Entertainment - And much more! ## 🚀 Quick Start ### Prerequisites 1. **Hugging Face Account** (Free) - Sign up at [huggingface.co](https://huggingface.co) 2. **API Token** (Free) - Go to [Settings → Access Tokens](https://huggingface.co/settings/tokens) - Create new token with "Make calls to Inference API" permission - Copy the token (starts with `hf_...`) ### Deployment on Hugging Face Spaces 1. **Create a New Space** ``` - Go to https://huggingface.co/new-space - Name: adforge-ai (or your preferred name) - SDK: Streamlit - Visibility: Public (or Private) - Click "Create Space" ``` 2. **Upload Files** ``` - Click "Files" tab - Upload: app.py, requirements.txt, README.md - Commit changes ``` 3. **Wait for Build** - Space will automatically build (takes 2-3 minutes) - Once ready, your app will be live! 4. **Use the App** - Enter your HF API token in the sidebar - Paste your ad concept JSON - Click "Generate Advertisement" - Download your results! ### Local Development ```bash # Clone or create project directory mkdir adforge-ai && cd adforge-ai # Create virtual environment python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # Install dependencies pip install -r requirements.txt # Run the app streamlit run app.py ``` Visit `http://localhost:8501` in your browser. ## 📝 JSON Input Format ### Basic Example ```json { "product_name": "Premium Coffee Beans", "description": "Organic single-origin arabica coffee beans", "style": "rustic", "mood": "warm and inviting", "target_audience": "coffee enthusiasts", "colors": ["rich brown", "cream", "gold"], "setting": "wooden table with natural light", "composition": "centered", "lighting": "natural morning light" } ``` ### Advanced Example ```json { "product_name": "Smartwatch Ultra", "description": "Advanced fitness tracking smartwatch with AMOLED display", "style": "minimalist and modern", "mood": "sophisticated and premium", "target_audience": "tech-savvy fitness enthusiasts", "colors": ["midnight black", "titanium silver", "sport orange"], "setting": "modern gym environment", "composition": "dynamic angle with motion blur", "lighting": "dramatic spotlighting with rim light", "key_features": ["heart rate monitoring", "GPS tracking", "7-day battery"], "avoid": ["cartoon style", "cluttered background"] } ``` ## 🎯 Use Cases ### Marketing Teams - Rapid prototyping of ad concepts - A/B testing different visual approaches - Campaign ideation and brainstorming ### E-commerce - Product listing images - Social media content - Banner advertisements ### Startups - MVP marketing materials - Pitch deck visuals - Landing page images ### Agencies - Client presentations - Mood boards - Creative direction visualization ## ⚙️ Configuration Options ### Image Resolution - **1024x1024** (Square) - Instagram, Facebook posts - **1024x768** (Landscape) - Website banners, YouTube thumbnails - **768x1024** (Portrait) - Instagram Stories, Pinterest ### Number of Variations - Generate 1-4 variations per concept - Useful for A/B testing and options ### Style Options - **Minimalist**: Clean, modern, Apple-style - **Professional**: Corporate, business-focused - **Vibrant**: Colorful, energetic, eye-catching - **Editorial**: Magazine-quality, artistic - **Rustic**: Natural, organic, handcrafted ### Mood Options - **Energetic**: Dynamic, exciting, action-oriented - **Calm**: Peaceful, relaxing, serene - **Luxurious**: Premium, high-end, exclusive - **Playful**: Fun, creative, lighthearted - **Sophisticated**: Elegant, refined, classy ## 💡 Pro Tips 1. **Be Specific with Colors** - ✅ Good: "ocean blue", "sunset orange" - ❌ Avoid: "blue", "orange" 2. **Describe Lighting Clearly** - Examples: "golden hour backlight", "soft diffused studio light", "dramatic side lighting" 3. **Use the Avoid Field** - Specify what you DON'T want: ["text overlays", "people", "cluttered background"] 4. **Experiment with Composition** - Try: "rule of thirds", "centered", "dynamic diagonal", "low angle hero shot" 5. **Combine Style Elements** ```json "style": "minimalist with editorial fashion photography elements" ``` ## 🔧 Technical Details ### Model Information - **Model**: FLUX.1-schnell by Black Forest Labs - **Parameters**: 12 billion - **Architecture**: Flow-based transformer - **Speed**: 1-4 inference steps (ultra-fast) - **License**: Apache 2.0 (free for commercial use) ### API Information - **Provider**: Hugging Face Inference API - **Free Tier**: Rate limited (hundreds of requests per hour) - **PRO Tier**: 20x more requests ($9/month) - **Response Time**: 5-10 seconds average ### Image Quality - **Resolution**: Up to 1024x1024 pixels - **Format**: PNG - **Quality**: Professional-grade, photorealistic - **Use Cases**: Commercial, personal, research ## 🐛 Troubleshooting ### "Model is loading" Error - **Solution**: Wait 20-30 seconds and retry. Cold start requires model warm-up. ### "Invalid API token" Error - **Check**: Token starts with `hf_` - **Verify**: Token has "Inference API" permission - **Regenerate**: Create new token if needed ### "Rate limit exceeded" Error - **Free tier**: Wait for next hour or next month - **Solution**: Upgrade to PRO ($9/month) for 20x more requests - **Alternative**: Use different HF account temporarily ### Slow Generation - **Normal**: 5-10 seconds per image is expected - **If slower**: Model might be loading (first request) - **Tip**: Reduce number of variations for faster results ### Image Quality Issues - **Improve prompts**: Be more specific and detailed - **Adjust negative prompts**: Add more unwanted elements to avoid - **Try different styles**: Experiment with style combinations ## 📊 Comparison with Alternatives | Feature | AdForge AI | Midjourney | DALL-E 3 | Canva AI | |---------|-----------|------------|----------|----------| | **Price** | Free | $10-60/mo | $20/mo | $13-30/mo | | **Speed** | 5-10s | 30-60s | 15-30s | 10-20s | | **API Access** | ✅ Yes | ❌ No | ✅ Yes | ✅ Limited | | **JSON Input** | ✅ Yes | ❌ No | ❌ No | ❌ No | | **Batch Generation** | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes | | **Commercial License** | ✅ Free | ✅ Paid | ✅ Paid | ✅ Paid | | **Self-Hosted** | ✅ Yes | ❌ No | ❌ No | ❌ No | ## 🛣️ Roadmap - [ ] Video generation support - [ ] LoRA model support for brand consistency - [ ] Image-to-image editing - [ ] Batch processing via CSV upload - [ ] API endpoint for integration - [ ] Gallery of user-generated ads - [ ] Advanced prompt templates - [ ] Multi-language support ## 🤝 Contributing Contributions are welcome! Feel free to: - Report bugs - Suggest features - Submit pull requests - Share your generated advertisements ## 📄 License This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details. The FLUX.1-schnell model is also under Apache 2.0 license, allowing free commercial use. ## 🙏 Acknowledgments - **Black Forest Labs** - For the amazing FLUX.1 model - **Hugging Face** - For the free Inference API - **Streamlit** - For the awesome web framework - **Community** - For feedback and support ## 📞 Support - **Issues**: [GitHub Issues](your-github-repo) - **Documentation**: This README - **HF Spaces**: [Community Discussions](https://huggingface.co/spaces/your-space/discussions) ## 🌟 Show Your Support If you find AdForge AI useful: - ⭐ Star the repository - 🔄 Share with your network - 💬 Leave feedback - 🎨 Share your generated ads! --- **Built with ❤️ using FLUX.1-schnell and Hugging Face** *Generate professional advertisements in seconds, not hours!*