Spaces:
Runtime error
Runtime error
Update app.py
Browse files93 unmodified lines949596979899100200 unmodified lines30130230330430530630730830931031131231331431531631731831932032132232332432532693 unmodified lines# --- Helper function for dimension calculation ---MIN_DIM_SLIDER = 256 # As defined in the sliders minimum attributeTARGET_FIXED_SIDE = 512 # Desired fixed side length as per requirementdef calculate_new_dimensions(orig_w, orig_h):"""200 unmodified linesexcept Exception as e2:print(f"Fallback video saving error: {e2}")raise gr.Error(f"Failed to save video: {e2}")if isinstance(input_image_filepath, tempfile._TemporaryFileWrapper):if os.path.exists(input_image_filepath.name):try:input_image_filepath.close()os.remove(input_image_filepath.name)except: passelif input_image_filepath and os.path.exists(input_image_filepath) and input_image_filepath.startswith(tempfile.gettempdir()):try: os.remove(input_image_filepath)except: passif isinstance(input_video_filepath, tempfile._TemporaryFileWrapper):if os.path.exists(input_video_filepath.name):try:input_video_filepath.close()os.remove(input_video_filepath.name)except: passelif input_video_filepath and os.path.exists(input_video_filepath) and input_video_filepath.startswith(tempfile.gettempdir()):try: os.remove(input_video_filepath)except: passreturn output_video_path93 unmodified lines949596979899100200 unmodified lines30130230330430530693 unmodified lines# --- Helper function for dimension calculation ---MIN_DIM_SLIDER = 256 # As defined in the sliders minimum attributeTARGET_FIXED_SIDE = 768 # Desired fixed side length as per requirementdef calculate_new_dimensions(orig_w, orig_h):"""200 unmodified linesexcept Exception as e2:print(f"Fallback video saving error: {e2}")raise gr.Error(f"Failed to save video: {e2}")return output_video_path
app.py+1-21