Yao211 commited on
Commit
19799bc
·
verified ·
1 Parent(s): ee6069f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -42,6 +42,14 @@ def create_instructions_html():
42
  </div>
43
  """
44
 
 
 
 
 
 
 
 
 
45
  # Create the Gradio interface
46
  with gr.Blocks(css=get_custom_css(), title=f"{COMPANY_NAME} AI Image Generator") as demo:
47
  with gr.Row():
@@ -76,7 +84,7 @@ with gr.Blocks(css=get_custom_css(), title=f"{COMPANY_NAME} AI Image Generator")
76
 
77
  with gr.Row():
78
  model = gr.Dropdown(
79
- choices=get_available_models_secure(),
80
  value="flux",
81
  label="Model"
82
  )
 
42
  </div>
43
  """
44
 
45
+ # Get available models with error handling
46
+ try:
47
+ available_models = get_available_models_secure()
48
+ print(f"Available models: {available_models}")
49
+ except Exception as e:
50
+ print(f"Error getting models: {e}")
51
+ available_models = ["flux", "turbo", "kontext"] # Fallback
52
+
53
  # Create the Gradio interface
54
  with gr.Blocks(css=get_custom_css(), title=f"{COMPANY_NAME} AI Image Generator") as demo:
55
  with gr.Row():
 
84
 
85
  with gr.Row():
86
  model = gr.Dropdown(
87
+ choices=available_models,
88
  value="flux",
89
  label="Model"
90
  )