(self, file)
| 287 | lora.multiplier = self.multiplier |
| 288 | |
| 289 | def load_weights(self, file): |
| 290 | if os.path.splitext(file)[1] == ".safetensors": |
| 291 | from safetensors.torch import load_file |
| 292 | |
| 293 | weights_sd = load_file(file) |
| 294 | else: |
| 295 | weights_sd = torch.load(file, map_location="cpu") |
| 296 | info = self.load_state_dict(weights_sd, False) |
| 297 | return info |
| 298 | |
| 299 | def prepare_optimizer_params(self, text_encoder_lr, unet_lr, default_lr): |
| 300 | self.requires_grad_(True) |
nothing calls this directly
no outgoing calls
no test coverage detected