sidharthg commited on
Commit
c044eef
·
verified ·
1 Parent(s): a97f45a

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -229,10 +229,13 @@ 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
- """Get the default seed for a specific style"""
233
- if style_name is None or style_name not in STYLES:
234
- return 42
235
- return STYLES[style_name]["default_seed"]
 
 
 
236
 
237
  # ... (omitted)
238
 
 
229
  return None, f"Error: {str(e)}"
230
 
231
  def get_default_seed(style_name):
232
+ try:
233
+ if isinstance(style_name, str) and style_name in STYLES:
234
+ return float(STYLES[style_name]["default_seed"])
235
+ except Exception:
236
+ pass
237
+ return float(42)
238
+
239
 
240
  # ... (omitted)
241