From c62d2dcb8bc7b13c1720ab23d25eaf32bc808616 Mon Sep 17 00:00:00 2001 From: Marco van Dijk Date: Tue, 16 Jul 2024 15:33:18 +0200 Subject: [PATCH] Sanity check: don't try to load LoRas if there are none to load --- runner/app/pipelines/util.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runner/app/pipelines/util.py b/runner/app/pipelines/util.py index c76bfdd3..d1521212 100644 --- a/runner/app/pipelines/util.py +++ b/runner/app/pipelines/util.py @@ -140,6 +140,9 @@ def load_loras(pipeline: any, requested_loras: str): pipeline: Diffusion pipeline, usually available under self.ldm. loras: JSON string with key-value pairs, where the key is the repository to load LoRas from and the value is the strength (float with a minimum value of 0.0) to assign to the LoRa. """ + # No LoRas to load + if requested_loras == "" or requested_loras == None: + return; # Parse LoRas param as JSON to extract key-value pairs loras = json.loads(requested_loras) # Build a list of adapter names and their requested strength