Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ base_model_id = "runwayml/stable-diffusion-v1-5"
|
|
| 14 |
lora_model_path = "./1211TeeniePing_Taesu-10.safetensors"
|
| 15 |
|
| 16 |
# Stable Diffusion ํ์ดํ๋ผ์ธ ์ด๊ธฐํ
|
| 17 |
-
pipe = StableDiffusionPipeline.from_pretrained(
|
| 18 |
pipe = pipe.to("cuda")
|
| 19 |
|
| 20 |
# LoRA ๊ฐ์ค์น ๋ก๋
|
|
@@ -23,7 +23,7 @@ def load_lora_weights(pipe, lora_path):
|
|
| 23 |
pipe.unet.load_attn_procs(lora_state_dict)
|
| 24 |
|
| 25 |
# LoRA ์ ์ฉ
|
| 26 |
-
load_lora_weights(pipe,
|
| 27 |
|
| 28 |
# API ํธ์ถ ํจ์ ์ ์
|
| 29 |
def generate_response(user_prompt):
|
|
|
|
| 14 |
lora_model_path = "./1211TeeniePing_Taesu-10.safetensors"
|
| 15 |
|
| 16 |
# Stable Diffusion ํ์ดํ๋ผ์ธ ์ด๊ธฐํ
|
| 17 |
+
pipe = StableDiffusionPipeline.from_pretrained(base_model_id, torch_dtype=torch.float16)
|
| 18 |
pipe = pipe.to("cuda")
|
| 19 |
|
| 20 |
# LoRA ๊ฐ์ค์น ๋ก๋
|
|
|
|
| 23 |
pipe.unet.load_attn_procs(lora_state_dict)
|
| 24 |
|
| 25 |
# LoRA ์ ์ฉ
|
| 26 |
+
load_lora_weights(pipe, lora_model_path)
|
| 27 |
|
| 28 |
# API ํธ์ถ ํจ์ ์ ์
|
| 29 |
def generate_response(user_prompt):
|