3Stark123's picture
Create config.py
cfb3303 verified
"""
Configuration settings for the Text-to-Infographics Generator
"""
import os
from typing import Dict, List, Tuple
class Config:
"""Application configuration"""
# API Keys (set in Hugging Face Spaces secrets)
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY", "")
# Application settings
APP_TITLE = "AI Text-to-Infographics Generator"
APP_DESCRIPTION = "Transform your text into beautiful infographics with AI"
# Processing limits
MAX_TEXT_LENGTH = 15000
MIN_TEXT_LENGTH = 50
MAX_SECTIONS = 10
# Image settings
DEFAULT_WIDTH = 1080
DEFAULT_HEIGHT = 1920
DPI = 300
QUALITY = 95
# Supported formats
SUPPORTED_FORMATS = ["PNG", "PDF", "SVG"]
# Templates
TEMPLATES = [
"Modern",
"Corporate",
"Creative",
"Minimalist",
"Academic"
]
# Layout options
LAYOUTS = [
"Vertical",
"Horizontal",
"Grid",
"Flow"
]
# Color palettes
COLOR_PALETTES = {
"Blue": "#3498db",
"Green": "#2ecc71",
"Purple": "#9b59b6",
"Orange": "#e67e22",
"Red": "#e74c3c",
"Teal": "#1abc9c",
"Dark": "#2c3e50",
"Pink": "#fd79a8"
}
# Font settings
DEFAULT_FONTS = {
"title": ("Arial", 24, "bold"),
"heading": ("Arial", 18, "bold"),
"body": ("Arial", 14, "normal"),
"caption": ("Arial", 12, "normal")
}
# Gemini settings
GEMINI_MODEL = "gemini-1.5-flash"
GEMINI_TEMPERATURE = 0.3
GEMINI_MAX_TOKENS = 2048
# Color schemes for different templates
TEMPLATE_COLORS = {
"Modern": {
"primary": "#3498db",
"secondary": "#2ecc71",
"accent": "#f39c12",
"background": "#ecf0f1",
"text": "#2c3e50"
},
"Corporate": {
"primary": "#2c3e50",
"secondary": "#34495e",
"accent": "#3498db",
"background": "#ffffff",
"text": "#2c3e50"
},
"Creative": {
"primary": "#9b59b6",
"secondary": "#e91e63",
"accent": "#f39c12",
"background": "#fdf2e9",
"text": "#2c3e50"
},
"Minimalist": {
"primary": "#2c3e50",
"secondary": "#95a5a6",
"accent": "#3498db",
"background": "#ffffff",
"text": "#2c3e50"
},
"Academic": {
"primary": "#34495e",
"secondary": "#7f8c8d",
"accent": "#2980b9",
"background": "#f8f9fa",
"text": "#2c3e50"
}
}