Spaces:
Sleeping
Sleeping
Andre
commited on
Commit
·
737c5f6
1
Parent(s):
1ae7fed
“Update”
Browse files- src/img_gen.py +4 -4
src/img_gen.py
CHANGED
|
@@ -49,11 +49,11 @@ def generate_image(prompt_alias, team, model_alias, custom_prompt, height=360, w
|
|
| 49 |
# Initialize the InferenceClient
|
| 50 |
try:
|
| 51 |
client = InferenceClient(model_name, token=api_token)
|
| 52 |
-
|
| 53 |
-
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
image = client.text_to_image(
|
| 58 |
prompt,
|
| 59 |
guidance_scale=guidance_scale,
|
|
|
|
| 49 |
# Initialize the InferenceClient
|
| 50 |
try:
|
| 51 |
client = InferenceClient(model_name, token=api_token)
|
| 52 |
+
except Exception as e:
|
| 53 |
+
return None, f"ERROR: Failed to initialize InferenceClient. Details: {e}"
|
| 54 |
|
| 55 |
+
#Generate the image
|
| 56 |
+
try:
|
| 57 |
image = client.text_to_image(
|
| 58 |
prompt,
|
| 59 |
guidance_scale=guidance_scale,
|