Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -54,17 +54,18 @@ async def generate_image(
|
|
54 |
text = str(translator.translate(prompt, 'English')) + "," + lora_word
|
55 |
|
56 |
client = AsyncInferenceClient()
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
|
|
68 |
|
69 |
return image, seed
|
70 |
|
|
|
54 |
text = str(translator.translate(prompt, 'English')) + "," + lora_word
|
55 |
|
56 |
client = AsyncInferenceClient()
|
57 |
+
try:
|
58 |
+
image = await client.text_to_image(
|
59 |
+
prompt=text,
|
60 |
+
negative_prompt=negative_prompt,
|
61 |
+
height=height,
|
62 |
+
width=width,
|
63 |
+
guidance_scale=scales,
|
64 |
+
num_inference_steps=steps,
|
65 |
+
model=model,
|
66 |
+
)
|
67 |
+
except Exception as e:
|
68 |
+
raise gr.Error(f"Error in {e}")
|
69 |
|
70 |
return image, seed
|
71 |
|