Skip to content

Commit

Permalink
removed unload_before and unload_after option
Browse files Browse the repository at this point in the history
  • Loading branch information
yusing committed Jun 17, 2024
1 parent 505b204 commit e0b788f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "comfyui_tensorrt"
description = "TensorRT Node for ComfyUI\nThis node enables the best performance on NVIDIA RTX™ Graphics Cards (GPUs) for Stable Diffusion by leveraging NVIDIA TensorRT."
version = "0.1.1"
version = "0.1.2"
license = "LICENSE"
dependencies = [
"tensorrt>=10.0.1",
Expand Down
13 changes: 1 addition & 12 deletions tensorrt_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,11 @@ def _convert(
context_max,
num_video_frames,
is_static: bool,
unload_before: bool = True,
unload_after: bool = True,
):
output_onnx = os.path.normpath(
os.path.join(self.temp_dir, str(time.time()), "model.onnx")
)

if unload_before:
comfy.model_management.unload_all_models()
comfy.model_management.load_models_gpu([model], force_patch_weights=True)
unet = model.model.diffusion_model

Expand Down Expand Up @@ -286,8 +282,7 @@ def forward(self, x, timesteps, context, y=None):
dynamic_axes=dynamic_axes,
)

if unload_after:
comfy.model_management.unload_all_models()
comfy.model_management.unload_all_models()
comfy.model_management.soft_empty_cache()

# TRT conversion starts here
Expand Down Expand Up @@ -606,8 +601,6 @@ def INPUT_TYPES(s):
"step": 1,
},
),
"unload_before": ("BOOLEAN", {"default": True}),
"unload_after": ("BOOLEAN", {"default": True}),
},
}

Expand All @@ -620,8 +613,6 @@ def convert(
width_opt,
context_opt,
num_video_frames,
unload_before: bool = True,
unload_after: bool = True,
):
return super()._convert(
model,
Expand All @@ -640,8 +631,6 @@ def convert(
context_opt,
num_video_frames,
is_static=True,
unload_before=unload_before,
unload_after=unload_after,
)


Expand Down

0 comments on commit e0b788f

Please sign in to comment.