multimodalart HF Staff commited on
Commit
a930ff9
·
verified ·
1 Parent(s): 4d68dfd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -21
app.py CHANGED
@@ -94,7 +94,7 @@ if latent_upsampler_instance:
94
 
95
  # --- Helper function for dimension calculation ---
96
  MIN_DIM_SLIDER = 256 # As defined in the sliders minimum attribute
97
- TARGET_FIXED_SIDE = 512 # Desired fixed side length as per requirement
98
 
99
  def calculate_new_dimensions(orig_w, orig_h):
100
  """
@@ -301,26 +301,6 @@ def generate(prompt, negative_prompt, input_image_filepath, input_video_filepath
301
  except Exception as e2:
302
  print(f"Fallback video saving error: {e2}")
303
  raise gr.Error(f"Failed to save video: {e2}")
304
-
305
- if isinstance(input_image_filepath, tempfile._TemporaryFileWrapper):
306
- if os.path.exists(input_image_filepath.name):
307
- try:
308
- input_image_filepath.close()
309
- os.remove(input_image_filepath.name)
310
- except: pass
311
- elif input_image_filepath and os.path.exists(input_image_filepath) and input_image_filepath.startswith(tempfile.gettempdir()):
312
- try: os.remove(input_image_filepath)
313
- except: pass
314
-
315
- if isinstance(input_video_filepath, tempfile._TemporaryFileWrapper):
316
- if os.path.exists(input_video_filepath.name):
317
- try:
318
- input_video_filepath.close()
319
- os.remove(input_video_filepath.name)
320
- except: pass
321
- elif input_video_filepath and os.path.exists(input_video_filepath) and input_video_filepath.startswith(tempfile.gettempdir()):
322
- try: os.remove(input_video_filepath)
323
- except: pass
324
 
325
  return output_video_path
326
 
 
94
 
95
  # --- Helper function for dimension calculation ---
96
  MIN_DIM_SLIDER = 256 # As defined in the sliders minimum attribute
97
+ TARGET_FIXED_SIDE = 768 # Desired fixed side length as per requirement
98
 
99
  def calculate_new_dimensions(orig_w, orig_h):
100
  """
 
301
  except Exception as e2:
302
  print(f"Fallback video saving error: {e2}")
303
  raise gr.Error(f"Failed to save video: {e2}")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
 
305
  return output_video_path
306