diff --git a/invokeai/app/invocations/onnx.py b/invokeai/app/invocations/onnx.py index d69eaeb02a..104474b430 100644 --- a/invokeai/app/invocations/onnx.py +++ b/invokeai/app/invocations/onnx.py @@ -264,8 +264,6 @@ class ONNXTextToLatentsInvocation(BaseInvocation): (input.type for input in unet.session.get_inputs() if input.name == "timestep"), "tensor(float16)" ) timestep_dtype = ORT_TO_NP_TYPE[timestep_dtype] - import time - times = [] for i in tqdm(range(len(scheduler.timesteps))): t = scheduler.timesteps[i] # expand the latents if we are doing classifier free guidance @@ -275,9 +273,7 @@ class ONNXTextToLatentsInvocation(BaseInvocation): # predict the noise residual timestep = np.array([t], dtype=timestep_dtype) - start_time = time.time() noise_pred = unet(sample=latent_model_input, timestep=timestep, encoder_hidden_states=prompt_embeds) - times.append(time.time() - start_time) noise_pred = noise_pred[0] # perform guidance @@ -307,7 +303,6 @@ class ONNXTextToLatentsInvocation(BaseInvocation): # call the callback, if provided #if callback is not None and i % callback_steps == 0: # callback(i, t, latents) - print(times) unet.release_session() torch.cuda.empty_cache() diff --git a/invokeai/backend/model_management/models/base.py b/invokeai/backend/model_management/models/base.py index 8c5a09e7f9..09e949baba 100644 --- a/invokeai/backend/model_management/models/base.py +++ b/invokeai/backend/model_management/models/base.py @@ -581,6 +581,8 @@ class IAIOnnxRuntimeModel: providers.append(self.provider) else: providers = get_available_providers() + if "TensorrtExecutionProvider" in providers: + providers.remove("TensorrtExecutionProvider") try: self.session = InferenceSession(self.proto.SerializeToString(), providers=providers, sess_options=sess) except Exception as e: