Spaces:
Running
on
Zero
Running
on
Zero
update app
Browse files
app.py
CHANGED
|
@@ -179,7 +179,13 @@ def infer(
|
|
| 179 |
return result, seed, gr.Button(visible=True)
|
| 180 |
|
| 181 |
# Wrapper for examples to handle file paths
|
| 182 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 183 |
|
| 184 |
# --- UI Layout ---
|
| 185 |
css="""
|
|
@@ -222,8 +228,8 @@ with gr.Blocks(css=css, theme=qwen_theme) as demo:
|
|
| 222 |
with gr.Accordion("⚙️ Advanced Settings", open=False):
|
| 223 |
seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0)
|
| 224 |
randomize_seed = gr.Checkbox(label="Randomize Seed", value=True)
|
| 225 |
-
guidance_scale = gr.Slider(label="Guidance Scale", minimum=1.0, maximum=10.0, step=0.1, value=
|
| 226 |
-
steps = gr.Slider(label="Inference Steps", minimum=1, maximum=50, step=1, value=
|
| 227 |
# Hidden sliders to hold image dimensions
|
| 228 |
height = gr.Slider(label="Height", minimum=256, maximum=1024, step=8, value=1024, visible=False)
|
| 229 |
width = gr.Slider(label="Width", minimum=256, maximum=1024, step=8, value=1024, visible=False)
|
|
|
|
| 179 |
return result, seed, gr.Button(visible=True)
|
| 180 |
|
| 181 |
# Wrapper for examples to handle file paths
|
| 182 |
+
@spaces.GPU
|
| 183 |
+
def infer_example(input_image_path, prompt, lora_adapter):
|
| 184 |
+
input_pil = Image.open(input_image_path).convert("RGB")
|
| 185 |
+
width, height = update_dimensions_on_upload(input_pil)
|
| 186 |
+
# Set default values for example inference
|
| 187 |
+
result, seed, _ = infer(input_pil, prompt, lora_adapter, 0, True, 1.0, 4, width, height)
|
| 188 |
+
return result, seed
|
| 189 |
|
| 190 |
# --- UI Layout ---
|
| 191 |
css="""
|
|
|
|
| 228 |
with gr.Accordion("⚙️ Advanced Settings", open=False):
|
| 229 |
seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0)
|
| 230 |
randomize_seed = gr.Checkbox(label="Randomize Seed", value=True)
|
| 231 |
+
guidance_scale = gr.Slider(label="Guidance Scale", minimum=1.0, maximum=10.0, step=0.1, value=1.0)
|
| 232 |
+
steps = gr.Slider(label="Inference Steps", minimum=1, maximum=50, step=1, value=4)
|
| 233 |
# Hidden sliders to hold image dimensions
|
| 234 |
height = gr.Slider(label="Height", minimum=256, maximum=1024, step=8, value=1024, visible=False)
|
| 235 |
width = gr.Slider(label="Width", minimum=256, maximum=1024, step=8, value=1024, visible=False)
|