gsbm commited on
Commit
0e124a3
·
verified ·
1 Parent(s): ebbe4cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -60,7 +60,7 @@ def generate_image(
60
  apply_refiner: bool = False,
61
  ):
62
  client = Client("hysts/SDXL")
63
- result = client.predict(
64
  prompt="((Seamless texture)), versatile pattern, high resolution, detailed design, subtle patterns, non-repetitive, smooth edges, square, "+prompt,
65
  negative_prompt=negative_prompt,
66
  prompt_2=prompt_2,
@@ -78,13 +78,7 @@ def generate_image(
78
  apply_refiner=apply_refiner,
79
  api_name="/run",
80
  )
81
- result = fix_base64_padding(result) # Fix the padding of the base64 string
82
- try:
83
- image_bytes = base64.b64decode(result)
84
- except binascii.Error:
85
- raise ValueError("Error decoding the Base64 string. Please check the input.")
86
- image = Image.open(BytesIO(image_bytes)) # Ensure the result is converted to a PIL Image
87
- normal_map = generate_normal_map(image)
88
  return image, normal_map
89
 
90
  examples = [
 
60
  apply_refiner: bool = False,
61
  ):
62
  client = Client("hysts/SDXL")
63
+ image = client.predict(
64
  prompt="((Seamless texture)), versatile pattern, high resolution, detailed design, subtle patterns, non-repetitive, smooth edges, square, "+prompt,
65
  negative_prompt=negative_prompt,
66
  prompt_2=prompt_2,
 
78
  apply_refiner=apply_refiner,
79
  api_name="/run",
80
  )
81
+ normal_map = generate_normal_map(Image.open(image))
 
 
 
 
 
 
82
  return image, normal_map
83
 
84
  examples = [