Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ def is_valid_repo_id(repo_id):
|
|
18 |
model_repo_id = "CompVis/stable-diffusion-v1-4"
|
19 |
pipe = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype).to(device)
|
20 |
|
21 |
-
#
|
22 |
pipe.load_lora_weights("AnastasiaSh/sticker-cat-lora3")
|
23 |
|
24 |
MAX_SEED = np.iinfo(np.int32).max
|
@@ -43,8 +43,10 @@ def infer(
|
|
43 |
raise gr.Error(f"Некорректный идентификатор модели: '{model}'. Проверьте название.")
|
44 |
try:
|
45 |
new_pipe = DiffusionPipeline.from_pretrained(model, torch_dtype=torch_dtype).to(device)
|
46 |
-
|
|
|
47 |
new_pipe.load_lora_weights("AnastasiaSh/sticker-cat-lora3")
|
|
|
48 |
pipe = new_pipe
|
49 |
model_repo_id = model
|
50 |
except Exception as e:
|
|
|
18 |
model_repo_id = "CompVis/stable-diffusion-v1-4"
|
19 |
pipe = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype).to(device)
|
20 |
|
21 |
+
# --- Загрузка LoRA (1) ---
|
22 |
pipe.load_lora_weights("AnastasiaSh/sticker-cat-lora3")
|
23 |
|
24 |
MAX_SEED = np.iinfo(np.int32).max
|
|
|
43 |
raise gr.Error(f"Некорректный идентификатор модели: '{model}'. Проверьте название.")
|
44 |
try:
|
45 |
new_pipe = DiffusionPipeline.from_pretrained(model, torch_dtype=torch_dtype).to(device)
|
46 |
+
|
47 |
+
# --- Загрузка LoRA (2) ---
|
48 |
new_pipe.load_lora_weights("AnastasiaSh/sticker-cat-lora3")
|
49 |
+
|
50 |
pipe = new_pipe
|
51 |
model_repo_id = model
|
52 |
except Exception as e:
|