gsbm commited on
Commit
5d72442
·
verified ·
1 Parent(s): 25c519f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import os
2
  import random
 
3
  import gradio as gr
4
  from PIL import Image
5
  from gradio_client import Client
@@ -74,7 +75,8 @@ def generate_image(
74
  apply_refiner=apply_refiner,
75
  api_name="/run",
76
  )
77
- image = Image.open(BytesIO(result.content)) # Ensure the result is converted to a PIL Image
 
78
  normal_map = generate_normal_map(image)
79
  return image, normal_map
80
 
 
1
  import os
2
  import random
3
+ import base64
4
  import gradio as gr
5
  from PIL import Image
6
  from gradio_client import Client
 
75
  apply_refiner=apply_refiner,
76
  api_name="/run",
77
  )
78
+ image_bytes = base64.b64decode(result)
79
+ image = Image.open(BytesIO(image_bytes)) # Ensure the result is converted to a PIL Image
80
  normal_map = generate_normal_map(image)
81
  return image, normal_map
82