Update app.py
Browse files
app.py
CHANGED
@@ -18,56 +18,55 @@ pipe = DiffusionPipeline.from_pretrained(
|
|
18 |
MAX_SEED = np.iinfo(np.int32).max
|
19 |
MAX_IMAGE_SIZE = 2048
|
20 |
|
21 |
-
#
|
22 |
EXAMPLES = [
|
23 |
{
|
24 |
-
"title": "
|
25 |
-
"prompt": """A
|
26 |
-
- Title
|
27 |
-
-
|
28 |
-
-
|
29 |
-
-
|
30 |
-
- Clean layout with pastel color scheme""",
|
31 |
"width": 1024,
|
32 |
"height": 1024
|
33 |
},
|
34 |
{
|
35 |
-
"title": "
|
36 |
-
"prompt": """A
|
37 |
-
-
|
38 |
-
-
|
39 |
-
-
|
40 |
-
-
|
41 |
"width": 1024,
|
42 |
"height": 1024
|
43 |
},
|
44 |
{
|
45 |
-
"title": "
|
46 |
-
"prompt": """A
|
47 |
-
-
|
48 |
-
-
|
49 |
-
-
|
50 |
-
-
|
51 |
"width": 1024,
|
52 |
"height": 1024
|
53 |
},
|
54 |
{
|
55 |
-
"title": "
|
56 |
-
"prompt": """A
|
57 |
-
-
|
58 |
-
-
|
59 |
-
-
|
60 |
-
-
|
61 |
"width": 1024,
|
62 |
"height": 1024
|
63 |
},
|
64 |
{
|
65 |
-
"title": "
|
66 |
-
"prompt": """A
|
67 |
-
-
|
68 |
-
-
|
69 |
-
-
|
70 |
-
-
|
71 |
"width": 1024,
|
72 |
"height": 1024
|
73 |
}
|
@@ -90,7 +89,7 @@ def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, num_in
|
|
90 |
height=height,
|
91 |
num_inference_steps=num_inference_steps,
|
92 |
generator=generator,
|
93 |
-
guidance_scale=0.0
|
94 |
).images[0]
|
95 |
return image, seed
|
96 |
|
@@ -170,8 +169,8 @@ css = """
|
|
170 |
with gr.Blocks(css=css) as demo:
|
171 |
gr.Markdown(
|
172 |
"""
|
173 |
-
<div class="title">GINI
|
174 |
-
<div class="subtitle">
|
175 |
""")
|
176 |
|
177 |
with gr.Row(equal_height=True):
|
@@ -179,13 +178,13 @@ with gr.Blocks(css=css) as demo:
|
|
179 |
with gr.Column(elem_id="input-column", scale=2):
|
180 |
with gr.Group(elem_classes="input-box"):
|
181 |
prompt = gr.Text(
|
182 |
-
label="
|
183 |
-
placeholder="Enter your
|
184 |
lines=10,
|
185 |
elem_classes="prompt-input"
|
186 |
)
|
187 |
-
run_button = gr.Button("Generate
|
188 |
-
result = gr.Image(label="Generated
|
189 |
|
190 |
with gr.Accordion("Advanced Settings", open=False):
|
191 |
seed = gr.Slider(
|
@@ -223,7 +222,7 @@ with gr.Blocks(css=css) as demo:
|
|
223 |
|
224 |
# 오른쪽 예제 컬럼
|
225 |
with gr.Column(elem_id="examples-column", scale=1):
|
226 |
-
gr.Markdown("### Example
|
227 |
for example in EXAMPLES:
|
228 |
with gr.Group(elem_classes="example-card"):
|
229 |
gr.Markdown(f"#### {example['title']}")
|
|
|
18 |
MAX_SEED = np.iinfo(np.int32).max
|
19 |
MAX_IMAGE_SIZE = 2048
|
20 |
|
21 |
+
# UI/UX 목업 예시들
|
22 |
EXAMPLES = [
|
23 |
{
|
24 |
+
"title": "Mobile App Wireframe",
|
25 |
+
"prompt": """A clean hand-drawn style wireframe for a mobile banking app:
|
26 |
+
- Title screen with logo
|
27 |
+
- Login screen (username, password, login button)
|
28 |
+
- Dashboard with 3 main sections (balance, transactions, quick actions)
|
29 |
+
- Bottom navigation bar (home, transfers, profile)""",
|
|
|
30 |
"width": 1024,
|
31 |
"height": 1024
|
32 |
},
|
33 |
{
|
34 |
+
"title": "E-commerce Website Mockup",
|
35 |
+
"prompt": """A sketch-style mockup for an online store homepage:
|
36 |
+
- Header with logo, search bar, cart icon
|
37 |
+
- Featured banner at the top
|
38 |
+
- Product grid with 4 columns, product images, and prices
|
39 |
+
- Minimal color palette, wireframe lines""",
|
40 |
"width": 1024,
|
41 |
"height": 1024
|
42 |
},
|
43 |
{
|
44 |
+
"title": "Blog Layout Wireframe",
|
45 |
+
"prompt": """A hand-drawn wireframe for a personal blog site:
|
46 |
+
- Top nav with logo, About, Contact
|
47 |
+
- Main section with blog post previews (title, short excerpt, read more)
|
48 |
+
- Right sidebar with categories and recent posts
|
49 |
+
- Footer with social media icons""",
|
50 |
"width": 1024,
|
51 |
"height": 1024
|
52 |
},
|
53 |
{
|
54 |
+
"title": "Dashboard Interface Mockup",
|
55 |
+
"prompt": """A pencil-drawn style mockup of an analytics dashboard:
|
56 |
+
- Top bar with logo and user avatar
|
57 |
+
- Left sidebar menu (Overview, Reports, Settings)
|
58 |
+
- Main area with charts: bar chart, line chart, pie chart
|
59 |
+
- Soft grayscale color scheme""",
|
60 |
"width": 1024,
|
61 |
"height": 1024
|
62 |
},
|
63 |
{
|
64 |
+
"title": "Social Media App Wireframe",
|
65 |
+
"prompt": """A simple wireframe for a social media mobile app:
|
66 |
+
- Feed of posts (user avatar, text, image thumbnail, like/share buttons)
|
67 |
+
- Top bar with camera icon, app logo
|
68 |
+
- Bottom bar with Home, Search, Notifications, Profile
|
69 |
+
- Light doodle style""",
|
70 |
"width": 1024,
|
71 |
"height": 1024
|
72 |
}
|
|
|
89 |
height=height,
|
90 |
num_inference_steps=num_inference_steps,
|
91 |
generator=generator,
|
92 |
+
guidance_scale=0.0
|
93 |
).images[0]
|
94 |
return image, seed
|
95 |
|
|
|
169 |
with gr.Blocks(css=css) as demo:
|
170 |
gr.Markdown(
|
171 |
"""
|
172 |
+
<div class="title">GINI Mockup</div>
|
173 |
+
<div class="subtitle">Generate elegant UI/UX wireframes or mockups with FLUX AI</div>
|
174 |
""")
|
175 |
|
176 |
with gr.Row(equal_height=True):
|
|
|
178 |
with gr.Column(elem_id="input-column", scale=2):
|
179 |
with gr.Group(elem_classes="input-box"):
|
180 |
prompt = gr.Text(
|
181 |
+
label="Mockup Prompt",
|
182 |
+
placeholder="Enter your UI/UX wireframe or mockup details...",
|
183 |
lines=10,
|
184 |
elem_classes="prompt-input"
|
185 |
)
|
186 |
+
run_button = gr.Button("Generate Mockup", variant="primary")
|
187 |
+
result = gr.Image(label="Generated Mockup")
|
188 |
|
189 |
with gr.Accordion("Advanced Settings", open=False):
|
190 |
seed = gr.Slider(
|
|
|
222 |
|
223 |
# 오른쪽 예제 컬럼
|
224 |
with gr.Column(elem_id="examples-column", scale=1):
|
225 |
+
gr.Markdown("### Example Mockups")
|
226 |
for example in EXAMPLES:
|
227 |
with gr.Group(elem_classes="example-card"):
|
228 |
gr.Markdown(f"#### {example['title']}")
|