adding logging

This commit is contained in:
Threads_Of_Fate
2026-04-23 12:08:58 -04:00
parent e4150f8e93
commit 2464f44f74
3 changed files with 11 additions and 4 deletions
+4
View File
@@ -18,6 +18,10 @@ import torch
import comfy.model_management as mm
from pathlib import Path
# Use polygraphy TensorRTX backend
os.environ["POLYGRAPHY_USE_TENSORRT_RTX"] = "1"
from polygraphy import cuda
from .vfi_utilities import preprocess_frames, postprocess_frames, generate_frames_rife
from .trt_utilities import Engine
+2 -3
View File
@@ -297,11 +297,10 @@ class Engine:
if not enable_all_tactics:
config_kwargs["tactic_sources"] = []
# Load ONNX file then convert the model to fp16
# Probably might cause issues if onnx file given is quantized or whatever
# Load ONNX file
onnx_bytes = onnx.load(onnx_path)
onnx_precision = onnx_bytes.graph.input[0].type.tensor_type.elem_type
onnx_simp, check = simplify(float16.convert_float_to_float16(onnx_bytes) if onnx_precision == onnx.TensorProto.FLOAT else onnx_bytes)
onnx_simp, check = simplify(onnx_bytes)
if not check:
error(f"Simplified ONNX model: {onnx_path} could not be validated")
+5 -1
View File
@@ -11,6 +11,7 @@ import os
import torch
import typing
import logging
import numpy as np
from comfy.model_management import soft_empty_cache, get_torch_device
@@ -73,6 +74,8 @@ def generate_frames_rife(
cache_counter = 0
pbar = ProgressBar(len(frames))
logging.info(f"Interpolating frames")
for frame_itr in range(len(frames) - 1):
@@ -96,13 +99,14 @@ def generate_frames_rife(
cache_counter += 1
if cache_counter >= clear_cache_after_n_frames:
soft_empty_cache()
logging.info(f"Clearing cache...")
cache_counter = 0
pbar.update(1)
# Append final frame
output_frames[out_len] = frames[-1:]
logger(f"done! - {(len(frames) -1) * (multiplier-1)} new frames generated at resolution: {output_frames[0].shape}")
logging.info(f"done! - {(len(frames) -1) * (multiplier-1)} new frames generated at resolution: {output_frames[0].shape}")
out_len += 1
# clear cache for courtesy