Spaces:
Running
on
Zero
Running
on
Zero
seawolf2357
commited on
Commit
•
a10076f
1
Parent(s):
7ed38a8
Update app.py
Browse files
app.py
CHANGED
@@ -84,4 +84,53 @@ footer {visibility: hidden;}
|
|
84 |
.generate-box .row {display: flex; align-items: center; margin-bottom: 10px;}
|
85 |
.generate-box .row > * {margin-right: 10px;}
|
86 |
.generate-box .row > *:last-child {margin-right: 0;}
|
87 |
-
.advanced-options {background-color: #e0e0e0; border-radius
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
.generate-box .row {display: flex; align-items: center; margin-bottom: 10px;}
|
85 |
.generate-box .row > * {margin-right: 10px;}
|
86 |
.generate-box .row > *:last-child {margin-right: 0;}
|
87 |
+
.advanced-options {background-color: #e0e0e0; border-radius: 10px; padding: 20px; margin-top: 20px;}
|
88 |
+
.examples-gallery {margin-top: 30px;}
|
89 |
+
"""
|
90 |
+
|
91 |
+
# --- Gradio UI ---
|
92 |
+
with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
|
93 |
+
with gr.Column(elem_id="container"):
|
94 |
+
gr.Markdown("# Open FLUX 1.1 Pro")
|
95 |
+
gr.Markdown("Flux Schnell-based with no commercial restrictions, 4-step fast image generation with quality enhancement, and improved memory efficiency (VAE).")
|
96 |
+
|
97 |
+
with gr.Row():
|
98 |
+
with gr.Column(scale=2):
|
99 |
+
result = gr.Image(label="Generated Image", show_label=False, interactive=False, elem_classes="image-box")
|
100 |
+
with gr.Column(scale=1):
|
101 |
+
with gr.Column(elem_classes="generate-box"):
|
102 |
+
prompt = gr.Text(
|
103 |
+
label="Prompt (한글 입력 가능)",
|
104 |
+
placeholder="섹시한 여자와 남자, 속옷, 전신, 일요일",
|
105 |
+
lines=3,
|
106 |
+
)
|
107 |
+
generateBtn = gr.Button("Generate Image", variant="primary")
|
108 |
+
|
109 |
+
with gr.Column(elem_classes="advanced-options"):
|
110 |
+
with gr.Row():
|
111 |
+
seed = gr.Number(label="Seed", value=42)
|
112 |
+
randomize_seed = gr.Checkbox(label="Randomize Seed", value=True)
|
113 |
+
with gr.Row():
|
114 |
+
width = gr.Slider(label="Width", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=DEFAULT_WIDTH)
|
115 |
+
height = gr.Slider(label="Height", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=DEFAULT_HEIGHT)
|
116 |
+
|
117 |
+
with gr.Column(elem_classes="examples-gallery"):
|
118 |
+
gr.Markdown("### Gallery")
|
119 |
+
gr.Examples(
|
120 |
+
examples=examples,
|
121 |
+
fn=generate_image,
|
122 |
+
inputs=[prompt],
|
123 |
+
outputs=[result, seed],
|
124 |
+
cache_examples="lazy"
|
125 |
+
)
|
126 |
+
|
127 |
+
generateBtn.click(
|
128 |
+
fn=generate_image,
|
129 |
+
inputs=[prompt, seed, width, height, randomize_seed],
|
130 |
+
outputs=[result, seed],
|
131 |
+
show_progress="full",
|
132 |
+
api_name="GenerateImage",
|
133 |
+
)
|
134 |
+
|
135 |
+
# Launch the app
|
136 |
+
demo.launch()
|