Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
@@ -136,20 +136,14 @@ def create_ui():
|
|
136 |
# Store image history in state
|
137 |
image_history = gr.State([])
|
138 |
|
139 |
-
# Settings visibility state
|
140 |
-
settings_visible = gr.State(False)
|
141 |
-
|
142 |
with gr.Row():
|
143 |
with gr.Column():
|
144 |
input_image = gr.Image(type="pil", label="Upload Image")
|
145 |
prompt = gr.Textbox(label="Edit Description", placeholder="Describe the edit you want...")
|
146 |
api_key = gr.Textbox(label="Gemini API Key", placeholder="Enter your Gemini API key", type="password")
|
147 |
|
148 |
-
#
|
149 |
-
|
150 |
-
|
151 |
-
with gr.Column(visible=False) as settings_panel:
|
152 |
-
gr.Markdown("### Advanced Settings")
|
153 |
temperature = gr.Slider(
|
154 |
minimum=0.0,
|
155 |
maximum=2.0,
|
@@ -167,16 +161,6 @@ def create_ui():
|
|
167 |
output_image = gr.Image(type="pil", label="Edited Image")
|
168 |
status = gr.Textbox(label="Status", interactive=False)
|
169 |
|
170 |
-
# Toggle settings visibility
|
171 |
-
def toggle_settings(visible):
|
172 |
-
return not visible, not visible
|
173 |
-
|
174 |
-
settings_btn.click(
|
175 |
-
fn=toggle_settings,
|
176 |
-
inputs=[settings_visible],
|
177 |
-
outputs=[settings_visible, settings_panel]
|
178 |
-
)
|
179 |
-
|
180 |
# Set up event handlers
|
181 |
edit_btn.click(
|
182 |
fn=process_image_edit,
|
|
|
136 |
# Store image history in state
|
137 |
image_history = gr.State([])
|
138 |
|
|
|
|
|
|
|
139 |
with gr.Row():
|
140 |
with gr.Column():
|
141 |
input_image = gr.Image(type="pil", label="Upload Image")
|
142 |
prompt = gr.Textbox(label="Edit Description", placeholder="Describe the edit you want...")
|
143 |
api_key = gr.Textbox(label="Gemini API Key", placeholder="Enter your Gemini API key", type="password")
|
144 |
|
145 |
+
# Replace hidden settings with accordion
|
146 |
+
with gr.Accordion("Advanced Settings", open=False):
|
|
|
|
|
|
|
147 |
temperature = gr.Slider(
|
148 |
minimum=0.0,
|
149 |
maximum=2.0,
|
|
|
161 |
output_image = gr.Image(type="pil", label="Edited Image")
|
162 |
status = gr.Textbox(label="Status", interactive=False)
|
163 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
# Set up event handlers
|
165 |
edit_btn.click(
|
166 |
fn=process_image_edit,
|