HAL1993 commited on
Commit
3de2535
·
verified ·
1 Parent(s): d63fd6f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -78,19 +78,19 @@ def translate_albanian_to_english(text):
78
  # --- Dimension Calculation ---
79
  def _calculate_new_dimensions_wan(pil_image):
80
  if pil_image is None:
81
- return 384, 384 # Default to square if no image
82
 
83
  orig_w, orig_h = pil_image.size
84
  if orig_w <= 0 or orig_h <= 0:
85
- return 384, 384
86
 
87
  # Set the smaller dimension to 384
88
  aspect_ratio = orig_h / orig_w
89
  if orig_h <= orig_w:
90
- target_h = 384
91
  target_w = round(target_h / aspect_ratio)
92
  else:
93
- target_w = 384
94
  target_h = round(target_w * aspect_ratio)
95
 
96
  # Ensure dimensions are multiples of MOD_VALUE
 
78
  # --- Dimension Calculation ---
79
  def _calculate_new_dimensions_wan(pil_image):
80
  if pil_image is None:
81
+ return 416, 416 # Default to square if no image
82
 
83
  orig_w, orig_h = pil_image.size
84
  if orig_w <= 0 or orig_h <= 0:
85
+ return 416, 416
86
 
87
  # Set the smaller dimension to 384
88
  aspect_ratio = orig_h / orig_w
89
  if orig_h <= orig_w:
90
+ target_h = 416
91
  target_w = round(target_h / aspect_ratio)
92
  else:
93
+ target_w = 416
94
  target_h = round(target_w * aspect_ratio)
95
 
96
  # Ensure dimensions are multiples of MOD_VALUE