Skip to content

Commit

Permalink
robust reload logic
Browse files Browse the repository at this point in the history
  • Loading branch information
pkuliyi2015 committed May 23, 2023
1 parent 9ad38b3 commit 17b75e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/stablesr.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ def run(self, p: StableDiffusionProcessingImg2Img, model: str, scale_factor:floa
if self.last_path != self.model_list[model]:
# load the model
self.stablesr_model = None
# get the type and the device of the unet model's first parameter

if self.stablesr_model is None:
self.stablesr_model = StableSR(self.model_list[model], dtype=first_param.dtype, device=first_param.device)
self.last_path = self.model_list[model]

Expand Down

0 comments on commit 17b75e9

Please sign in to comment.