gokaygokay commited on
Commit
05c7809
1 Parent(s): 18fc70d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -208,15 +208,23 @@ def generate_image(additional_positive_prompt, additional_negative_prompt, heigh
208
  ).images
209
 
210
  if use_upscaler:
 
211
  upscaled_images = []
212
- for img in images:
 
 
 
 
213
  upscaled_img = upscale_image(img, upscale_factor)
214
  upscaled_images.append(upscaled_img)
215
  images = upscaled_images
216
 
 
217
  return images, seed, full_positive_prompt, full_negative_prompt
218
  except Exception as e:
219
  print(f"Error during image generation: {str(e)}")
 
 
220
  return None, seed, full_positive_prompt, full_negative_prompt
221
 
222
  # Gradio interface
 
208
  ).images
209
 
210
  if use_upscaler:
211
+ print("Upscaling images")
212
  upscaled_images = []
213
+ for i, img in enumerate(images):
214
+ print(f"Upscaling image {i+1}")
215
+ if not isinstance(img, Image.Image):
216
+ print(f"Converting image {i+1} to PIL Image")
217
+ img = Image.fromarray(np.uint8(img))
218
  upscaled_img = upscale_image(img, upscale_factor)
219
  upscaled_images.append(upscaled_img)
220
  images = upscaled_images
221
 
222
+ print("Returning results")
223
  return images, seed, full_positive_prompt, full_negative_prompt
224
  except Exception as e:
225
  print(f"Error during image generation: {str(e)}")
226
+ import traceback
227
+ traceback.print_exc()
228
  return None, seed, full_positive_prompt, full_negative_prompt
229
 
230
  # Gradio interface