Fix bare exceptions, silent HTTP failures, and resolution display

- Replace bare except: with except Exception: in __del__ and reset() to avoid
  catching KeyboardInterrupt/SystemExit
- Add response.raise_for_status() to fail clearly on HTTP errors
- Fix resolution log output to show HxW instead of CHW shape

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
reaperhammer
2026-05-09 19:04:41 +12:00
co-authored by Claude Opus 4.7
parent 7cf8989cd3
commit eedc0938f9
3 changed files with 11 additions and 7 deletions
+6 -6
View File
@@ -143,12 +143,12 @@ class Engine:
if hasattr(self, 'cuda_graph_instance') and self.cuda_graph_instance is not None:
try:
cudart.cudaGraphDestroy(self.cuda_graph_instance)
except:
except Exception:
pass
if hasattr(self, 'graph') and self.graph is not None:
try:
cudart.cudaGraphDestroy(self.graph)
except:
except Exception:
pass
if hasattr(self, 'engine'):
@@ -171,13 +171,13 @@ class Engine:
if hasattr(self, 'cuda_graph_instance') and self.cuda_graph_instance is not None:
try:
cudart.cudaGraphDestroy(self.cuda_graph_instance)
except:
except Exception:
pass
self.cuda_graph_instance = None
if hasattr(self, 'graph') and self.graph is not None:
try:
cudart.cudaGraphDestroy(self.graph)
except:
except Exception:
pass
self.graph = None
@@ -283,13 +283,13 @@ class Engine:
if hasattr(self, 'cuda_graph_instance') and self.cuda_graph_instance is not None:
try:
cudart.cudaGraphDestroy(self.cuda_graph_instance)
except:
except Exception:
pass
self.cuda_graph_instance = None
if hasattr(self, 'graph') and self.graph is not None:
try:
cudart.cudaGraphDestroy(self.graph)
except:
except Exception:
pass
self.graph = None
+1
View File
@@ -85,6 +85,7 @@ def download_file(url, save_path):
GREEN = '\033[92m'
RESET = '\033[0m'
response = requests.get(url, stream=True)
response.raise_for_status()
total_size = int(response.headers.get('content-length', 0))
with open(save_path, 'wb') as file, tqdm(
+4 -1
View File
@@ -74,7 +74,10 @@ def generate_frames_rife(
# Append final frame
output_frames[out_len] = frames[-1:]
logger(f"done! - {out_len} total frames output at resolution: {output_frames[0].shape}")
# Get actual frame shape from first interpolated frame (CHW format)
actual_frame = output_frames[0]
h, w = actual_frame.shape[1], actual_frame.shape[2]
logger(f"done! - {out_len} total frames output at resolution: {h}x{w}")
out_len += 1
# clear cache for courtesy