Update app.py
Browse files
app.py
CHANGED
@@ -36,7 +36,7 @@ def select_model(model_name):
|
|
36 |
|
37 |
def generate_image(prompt, selected_model, is_negative=False, steps=1, cfg_scale=6, seed=None):
|
38 |
if not prompt.strip():
|
39 |
-
raise gr.Error("
|
40 |
|
41 |
model_url = select_model(selected_model)
|
42 |
API_URL = f"{model_url}"
|
@@ -58,7 +58,7 @@ def generate_image(prompt, selected_model, is_negative=False, steps=1, cfg_scale
|
|
58 |
return image
|
59 |
|
60 |
except requests.exceptions.RequestException as e:
|
61 |
-
raise gr.Error(
|
62 |
|
63 |
with gr.Blocks(theme="soft") as playground:
|
64 |
gr.HTML(
|
|
|
36 |
|
37 |
def generate_image(prompt, selected_model, is_negative=False, steps=1, cfg_scale=6, seed=None):
|
38 |
if not prompt.strip():
|
39 |
+
raise gr.Error("Error generating image: Input text is empty!")
|
40 |
|
41 |
model_url = select_model(selected_model)
|
42 |
API_URL = f"{model_url}"
|
|
|
58 |
return image
|
59 |
|
60 |
except requests.exceptions.RequestException as e:
|
61 |
+
raise gr.Error("Error generating image: The service/model is unavailable. Please try again later.")
|
62 |
|
63 |
with gr.Blocks(theme="soft") as playground:
|
64 |
gr.HTML(
|