RanM commited on
Commit
6450ed3
·
verified ·
1 Parent(s): 06a3d1b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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(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,4 +62,4 @@ gradio_interface = gr.Interface(
62
  )
63
 
64
  if __name__ == "__main__":
65
- gradio_interface.launch(share=True) # Optionally make it public with share=True
 
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