Skip to content

Commit 0ce6ec6

Browse files
committed
Do not assign the result of SpandrelImageToImageModel.load_from_file(...) during probe to ensure that the model is immediately gc'd.
1 parent d099997 commit 0ce6ec6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

invokeai/backend/model_manager/probe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def get_model_type_from_checkpoint(cls, model_path: Path, checkpoint: Optional[C
253253
# 2. Spandrel has internal logic to determine a model's type from its state_dict before loading the model.
254254
# This logic is not exposed in spandrel's public API. We could copy the logic here, but then we have to
255255
# maintain it, and the risk of false positive detections is higher.
256-
_ = SpandrelImageToImageModel.load_from_file(model_path)
256+
SpandrelImageToImageModel.load_from_file(model_path)
257257
return ModelType.SpandrelImageToImage
258258
except spandrel.UnsupportedModelError:
259259
pass

0 commit comments

Comments
 (0)