Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ model = AutoPipelineForText2Image.from_pretrained("stabilityai/sdxl-turbo")
|
|
11 |
async def generate_image(prompt):
|
12 |
try:
|
13 |
# Generate an image based on the prompt
|
14 |
-
output = model
|
15 |
print(f"Model output: {output}")
|
16 |
|
17 |
# Check if the model returned images
|
@@ -62,4 +62,4 @@ gradio_interface = gr.Interface(
|
|
62 |
)
|
63 |
|
64 |
if __name__ == "__main__":
|
65 |
-
gradio_interface.launch(
|
|
|
11 |
async def generate_image(prompt):
|
12 |
try:
|
13 |
# Generate an image based on the prompt
|
14 |
+
output = await asyncio.to_thread(model, prompt=prompt, num_inference_steps=1, guidance_scale=0.0)
|
15 |
print(f"Model output: {output}")
|
16 |
|
17 |
# Check if the model returned images
|
|
|
62 |
)
|
63 |
|
64 |
if __name__ == "__main__":
|
65 |
+
gradio_interface.launch() # No need for share=True for local testing
|