From 3f6333ed975e5d478e27527d57d7f7f06d21c37a Mon Sep 17 00:00:00 2001 From: Naren Dasan Date: Thu, 15 Aug 2024 10:37:36 -0600 Subject: [PATCH] refactor: Use HF to download the LoRA Signed-off-by: Naren Dasan --- examples/dynamo/mutable_torchtrt_module_example.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/dynamo/mutable_torchtrt_module_example.py b/examples/dynamo/mutable_torchtrt_module_example.py index c0f5f2bcc2..84122e074b 100644 --- a/examples/dynamo/mutable_torchtrt_module_example.py +++ b/examples/dynamo/mutable_torchtrt_module_example.py @@ -87,7 +87,7 @@ device = "cuda:0" prompt = "house in forest, shuimobysim, wuchangshuo, best quality" - negative = "(worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, skin spots, acnes, skin blemishes, age spot, glans, (watermark:2)," + negative = "(worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, out of focus, cloudy, (watermark:2)," pipe = DiffusionPipeline.from_pretrained( model_id, revision="fp16", torch_dtype=torch.float16 @@ -101,7 +101,11 @@ image.save("./without_LoRA_mutable.jpg") # Standard Huggingface LoRA loading procedure - pipe.load_lora_weights("./moxin.safetensors", adapter_name="lora1") + pipe.load_lora_weights( + "stablediffusionapi/load_lora_embeddings", + weight_name="moxin.safetensors", + adapter_name="lora1", + ) pipe.set_adapters(["lora1"], adapter_weights=[1]) pipe.fuse_lora() pipe.unload_lora_weights()