Divyanshu04 commited on
Commit
7595acc
·
1 Parent(s): 073d257
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -54,8 +54,11 @@ def generate():
54
 
55
  image_bytes = query({"inputs": prompt,})
56
  # You can access the image with PIL.Image for example
 
57
 
58
- image = Image.open(io.BytesIO(image_bytes))
 
 
59
 
60
  # guidance_scale = 7.5
61
  # num_inference_steps = 24
@@ -79,7 +82,7 @@ def generate():
79
  # generator=g_cuda
80
  # ).images
81
 
82
- st.image(image)
83
 
84
  else:
85
  st.write('<Enter parameters to generate image>')
 
54
 
55
  image_bytes = query({"inputs": prompt,})
56
  # You can access the image with PIL.Image for example
57
+ img_io = io.BytesIO(image_bytes)
58
 
59
+ image = Image.open(img_io)
60
+ img_io.seek(0)
61
+ byteImg = img_io.read()
62
 
63
  # guidance_scale = 7.5
64
  # num_inference_steps = 24
 
82
  # generator=g_cuda
83
  # ).images
84
 
85
+ st.image(byteImg)
86
 
87
  else:
88
  st.write('<Enter parameters to generate image>')