import gradio as gr from models import generate_image, MODEL_ID from config import APPLE_TENCENT_THEME def generate_image_with_auth(prompt: str, profile: gr.OAuthProfile | None): if profile is None: raise gr.Error("⚠️ Please Sign in with Hugging Face to use this generator.") return generate_image(prompt) def create_ui(): with gr.Blocks( title="Boss Img Generator v2", theme=APPLE_TENCENT_THEME, css=""" body { background: linear-gradient(120deg, #1e1e2f, #2d2d44); color: #fff; font-family: 'Inter', sans-serif; } h1, h2, h3, p { color: white !important; } .gr-button { font-weight: 700; background: linear-gradient(90deg, #ff4d4d, #ff884d); border: none; transition: all 0.3s ease; } .gr-button:hover { transform: scale(1.05); box-shadow: 0 0 15px rgba(255, 100, 50, 0.5); } .gr-textbox textarea { background-color: rgba(255,255,255,0.1) !important; color: white !important; border-radius: 10px !important; } .gr-image { border-radius: 12px; box-shadow: 0 0 20px rgba(255,255,255,0.1); overflow: hidden; } .title-card { background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(10px); border-radius: 20px; padding: 20px; box-shadow: 0 0 25px rgba(255,255,255,0.05); text-align: center; } footer { text-align: center; margin-top: 30px; color: #aaa; } """ ) as demo: gr.HTML("""
Generate stunning AI visuals using Tencent’s advanced FAL AI model.
⚠️ Sign in with Hugging Face to unlock free access.