Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -229,12 +229,9 @@ def generate_image(prompt, style_name, seed, num_inference_steps, guidance_scale
|
|
| 229 |
return None, f"Error: {str(e)}"
|
| 230 |
|
| 231 |
def get_default_seed(style_name):
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
except Exception:
|
| 236 |
-
pass
|
| 237 |
-
return float(42)
|
| 238 |
|
| 239 |
|
| 240 |
# ... (omitted)
|
|
@@ -351,7 +348,8 @@ with gr.Blocks(title="Stable Diffusion Style Explorer", theme=gr.themes.Soft())
|
|
| 351 |
fn=get_default_seed,
|
| 352 |
inputs=[style_dropdown],
|
| 353 |
outputs=[seed_single],
|
| 354 |
-
api_name="update_seed"
|
|
|
|
| 355 |
)
|
| 356 |
|
| 357 |
generate_btn.click(
|
|
|
|
| 229 |
return None, f"Error: {str(e)}"
|
| 230 |
|
| 231 |
def get_default_seed(style_name):
|
| 232 |
+
if isinstance(style_name, str) and style_name in STYLES:
|
| 233 |
+
return gr.update(value=STYLES[style_name]["default_seed"])
|
| 234 |
+
return gr.update(value=42)
|
|
|
|
|
|
|
|
|
|
| 235 |
|
| 236 |
|
| 237 |
# ... (omitted)
|
|
|
|
| 348 |
fn=get_default_seed,
|
| 349 |
inputs=[style_dropdown],
|
| 350 |
outputs=[seed_single],
|
| 351 |
+
api_name="update_seed",
|
| 352 |
+
queue=False
|
| 353 |
)
|
| 354 |
|
| 355 |
generate_btn.click(
|