Kvikontent commited on
Commit
9c50765
1 Parent(s): 9aff37c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -49,9 +49,10 @@ def query(payload):
49
  def generate_image_from_prompt(prompt_text):
50
  gr.Info("Image generation started")
51
  image_bytes = query({"inputs": prompt_text})
52
- img = BytesIO(image_bytes) # Convert to BytesIO stream
53
- pil_img = Image.open(img) # Open the image using PIL library
54
- return pil_img # Return the converted PIL image
 
55
 
56
  title = "3D Icons SDXL Demo 🎨"
57
  description = "This app uses Hugging Face AI model to generate an image based on the provided text prompt 🖼."
 
49
  def generate_image_from_prompt(prompt_text):
50
  gr.Info("Image generation started")
51
  image_bytes = query({"inputs": prompt_text})
52
+ img = BytesIO(image_bytes)
53
+ pil_img = Image.open(img)
54
+ gr.Info("Image Generated Successfully!")
55
+ return pil_img
56
 
57
  title = "3D Icons SDXL Demo 🎨"
58
  description = "This app uses Hugging Face AI model to generate an image based on the provided text prompt 🖼."