Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,9 +2,9 @@ import gradio as gr
|
|
| 2 |
import requests
|
| 3 |
import io
|
| 4 |
from PIL import Image
|
| 5 |
-
import spaces
|
| 6 |
|
| 7 |
-
@spaces.GPU
|
| 8 |
def generate_brand_asset(prompt):
|
| 9 |
API_URL = "https://api-inference.huggingface.co/models/black-forest-labs/FLUX.1-schnell"
|
| 10 |
if not prompt: return None
|
|
@@ -12,23 +12,31 @@ def generate_brand_asset(prompt):
|
|
| 12 |
if response.status_code == 200:
|
| 13 |
return Image.open(io.BytesIO(response.content))
|
| 14 |
else:
|
| 15 |
-
raise gr.Error("
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
gr.Markdown("<center><h1>⚡ BranDevOps: Autonomous Creative System</h1></center>")
|
| 20 |
-
gr.Markdown("<center><h3>
|
| 21 |
|
| 22 |
with gr.Row():
|
| 23 |
with gr.Column():
|
| 24 |
-
prompt_input = gr.Textbox(
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
with gr.Column():
|
| 27 |
-
image_output = gr.Image(label="
|
| 28 |
|
| 29 |
submit_btn.click(fn=generate_brand_asset, inputs=prompt_input, outputs=image_output)
|
| 30 |
|
| 31 |
gr.Markdown("---")
|
| 32 |
-
gr.Markdown("<center><b>
|
| 33 |
|
| 34 |
demo.launch()
|
|
|
|
| 2 |
import requests
|
| 3 |
import io
|
| 4 |
from PIL import Image
|
| 5 |
+
import spaces
|
| 6 |
|
| 7 |
+
@spaces.GPU
|
| 8 |
def generate_brand_asset(prompt):
|
| 9 |
API_URL = "https://api-inference.huggingface.co/models/black-forest-labs/FLUX.1-schnell"
|
| 10 |
if not prompt: return None
|
|
|
|
| 12 |
if response.status_code == 200:
|
| 13 |
return Image.open(io.BytesIO(response.content))
|
| 14 |
else:
|
| 15 |
+
raise gr.Error("Server is busy. Please try again in a few seconds.")
|
| 16 |
|
| 17 |
+
custom_css = """
|
| 18 |
+
footer {visibility: hidden}
|
| 19 |
+
.gradio-container {max-width: 900px !important; margin: 0 auto;}
|
| 20 |
+
"""
|
| 21 |
+
|
| 22 |
+
with gr.Blocks(css=custom_css) as demo:
|
| 23 |
gr.Markdown("<center><h1>⚡ BranDevOps: Autonomous Creative System</h1></center>")
|
| 24 |
+
gr.Markdown("<center><h3>Generate premium logos and visual brand assets instantly via Cloud AI</h3></center>")
|
| 25 |
|
| 26 |
with gr.Row():
|
| 27 |
with gr.Column():
|
| 28 |
+
prompt_input = gr.Textbox(
|
| 29 |
+
label="Design Prompt",
|
| 30 |
+
placeholder="e.g., A minimalist geometric logo design, sharp symmetrical emblem, premium luxury style, white background..."
|
| 31 |
+
)
|
| 32 |
+
submit_btn = gr.Button("Generate Asset 🚀", variant="primary")
|
| 33 |
+
gr.Markdown("💡 **Tip:** Use keywords like *Minimalist, Symmetrical, Vector, Clean background* for high-end geometric results.")
|
| 34 |
with gr.Column():
|
| 35 |
+
image_output = gr.Image(label="Generated Output")
|
| 36 |
|
| 37 |
submit_btn.click(fn=generate_brand_asset, inputs=prompt_input, outputs=image_output)
|
| 38 |
|
| 39 |
gr.Markdown("---")
|
| 40 |
+
gr.Markdown("<center><b>Looking for a complete, production-ready brand identity engineering?</b><br>Let automated systems scale your business. <a href='https://gainopia.online' target='_blank'><b>Elevate Your Brand with Gainopia</b></a></center>")
|
| 41 |
|
| 42 |
demo.launch()
|