Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import requests
|
3 |
+
import numpy as np
|
4 |
+
|
5 |
+
|
6 |
+
def run(prompt, token):
|
7 |
+
result = requests.post(
|
8 |
+
"https://api.workranked.com/ai-web-design",
|
9 |
+
data={"prompt": prompt, "token": token},
|
10 |
+
).json()
|
11 |
+
|
12 |
+
image = np.array(result["images"][0]) if result.get("images") else None
|
13 |
+
|
14 |
+
return [image, result["balance"]]
|
15 |
+
|
16 |
+
|
17 |
+
gr.Interface(
|
18 |
+
fn=run,
|
19 |
+
inputs=[
|
20 |
+
gr.Textbox(
|
21 |
+
label="Text Prompt",
|
22 |
+
lines=3,
|
23 |
+
info="For the best results, try formatting your prompt similar to the examples below",
|
24 |
+
),
|
25 |
+
gr.Textbox(label="Secret Token"),
|
26 |
+
],
|
27 |
+
outputs=[
|
28 |
+
gr.Image(label="AI-generated Image"),
|
29 |
+
gr.Number(label="Generations Remaining"),
|
30 |
+
],
|
31 |
+
title="AI Web Design Demo",
|
32 |
+
description="""Try out a text-to-image AI model specifically trained to generate website designs and graphics.
|
33 |
+
|
34 |
+
[Subscribe here](https://upperhorizon.com/waitlist-wd?utm_campaign=gradio-demo) to get updates on the development and release of this tool.
|
35 |
+
|
36 |
+
Have an idea or suggestion? Provide feedback directly to me (the developer) at [hello@upperhorizon.com](mailto:hello@upperhorizon.com).""",
|
37 |
+
submit_btn="Generate",
|
38 |
+
examples=[
|
39 |
+
[
|
40 |
+
"header, homepage, 1920px, award-winning, Shopping & Retail\nminimalist, dark mode, flat vector graphic of film camera, tech-focused, monochrome elements, black, orange accents, modern design, futuristic vibe\ncinematic gear, motor upgrade, camera control, training app, testimonials, demos, creative filmmaking, film production technology, wireless control, virtual production tools, third axis control",
|
41 |
+
None,
|
42 |
+
],
|
43 |
+
[
|
44 |
+
"header, 1920px, award winning, Food & Drink\nmodern, eco friendly, clean design, subtle divider lines, sans serif fonts, minimalistic, nature themed, images of jars and leaves, earthy tones, colors: olive green, cream, soft brown\nsustainability, eco friendly, packaging, recycling, food waste, environmental protection, honey products, innovation, conservation, community, recipes, composting, green initiatives",
|
45 |
+
None,
|
46 |
+
],
|
47 |
+
[
|
48 |
+
"homepage, 1920px, tech startup, detailed\nindustrial space theme, scientific, modern, technical vibes, large serif text, colors: deep black, cosmic gray, bright red accents\nspace exploration, robotics, technology development, scientific research, missions, educational resources, planetary studies, climate change",
|
49 |
+
None,
|
50 |
+
],
|
51 |
+
[
|
52 |
+
"header, 1920px, award-winning, Community\nclean, simple, 2-column, minimal, playful, pastel vibes, vector illustration of graph, icons, rounded buttons, soft shadows, colors: yellow, white, black\nreporting analytics, data dashboards, employee engagement, trends, recognition, free trial, peer feedback, integrations, Slack, Microsoft Teams, custom rewards",
|
53 |
+
None,
|
54 |
+
],
|
55 |
+
[
|
56 |
+
"1920px, award-winning, Best Mobile User Experience\npurple background, bold sans-serif text, minimalist, two-column layout, app store buttons, centered elements, playful, modern, clean design, colors: pastel purple, white, black\ntemplates, marketplace, pricing, download, connect socials, monetize, audience building, analytics, creators, influencers, small businesses, e-commerce, mobile app, community",
|
57 |
+
None,
|
58 |
+
],
|
59 |
+
[
|
60 |
+
"header, 1920px, detailed, award-winning, e-commerce\nnatural textures, minimalist, neutral tones, modern, clean layout, Scandinavian design, earthy vibes, subtle elegance, images: cozy interiors, muted beige, warm brown, soft grey\nrug collections, classic styles, heirloom, new arrivals, sale, samples, custom, cart, wishlist, sustainable, B Corporation, home decor, interior design, online shopping",
|
61 |
+
None,
|
62 |
+
],
|
63 |
+
[
|
64 |
+
"header, homepage, 1920px, detailed, award-winning, Non-Profit\nclassical, grayscale, academic theme, clean design, serif fonts, overlapping images, geometric accents, neutral tones, colors: muted teal, brick red, classic tan\nresearch programs, antitrust, consumer protection, data security, privacy, financial regulation, innovation, intellectual property, telecommunications, publications, events, policy debates",
|
65 |
+
None,
|
66 |
+
],
|
67 |
+
[
|
68 |
+
"homepage, 1920px, highly detailed\ncolorful futuristic, vibrant neon green, deep purple, holographic elements, tech-themed, 3D graphics of phones and rings, single bold column, minimal text, playful, modern, floating objects, abstract shapes\nfinancial services, money management, peer-to-peer payments, stock investment, discounts, banking apps, prepaid debit cards, tax filing",
|
69 |
+
None,
|
70 |
+
],
|
71 |
+
[
|
72 |
+
"header, homepage, 1920px, detailed, award-winning, Best Visual Design, Aesthetic\nsleek, minimalist, dark mode, monochrome, modern, tech-themed, large hero image, 2-column layout, rounded buttons, seamless transitions, bold typography, dynamic, colors: black, white, violet accents\ncreative collaboration, media sharing, feedback tracking, cloud-based platform, video editing, production workflow, file transfer",
|
73 |
+
None,
|
74 |
+
],
|
75 |
+
],
|
76 |
+
).launch()
|