Spaces:
Running
Running
add cpu
Browse files
app.py
CHANGED
@@ -60,7 +60,7 @@ def get_lora_sd_pipeline(
|
|
60 |
|
61 |
pipe = StableDiffusionPipeline.from_pretrained(
|
62 |
base_model_name_or_path, torch_dtype=dtype
|
63 |
-
).to(device)
|
64 |
pipe.unet = PeftModel.from_pretrained(
|
65 |
pipe.unet, unet_sub_dir, adapter_name=adapter_name
|
66 |
)
|
@@ -101,7 +101,7 @@ def infer(
|
|
101 |
# добавляем lora
|
102 |
pipe = get_lora_sd_pipeline(
|
103 |
os.path.join(CKPT_DIR, ""), adapter_name="sd-14-lora", dtype=torch_dtype
|
104 |
-
).to(device)
|
105 |
pipe.safety_checker = None
|
106 |
print(f"LoRA adapter loaded: {pipe.unet.active_adapters}")
|
107 |
|
@@ -112,7 +112,7 @@ def infer(
|
|
112 |
requires_safety_checker=False,
|
113 |
safety_checker=None,
|
114 |
)
|
115 |
-
pipe = pipe.to(device)
|
116 |
|
117 |
image = pipe(
|
118 |
prompt=prompt,
|
|
|
60 |
|
61 |
pipe = StableDiffusionPipeline.from_pretrained(
|
62 |
base_model_name_or_path, torch_dtype=dtype
|
63 |
+
) # .to(device)
|
64 |
pipe.unet = PeftModel.from_pretrained(
|
65 |
pipe.unet, unet_sub_dir, adapter_name=adapter_name
|
66 |
)
|
|
|
101 |
# добавляем lora
|
102 |
pipe = get_lora_sd_pipeline(
|
103 |
os.path.join(CKPT_DIR, ""), adapter_name="sd-14-lora", dtype=torch_dtype
|
104 |
+
) # .to(device)
|
105 |
pipe.safety_checker = None
|
106 |
print(f"LoRA adapter loaded: {pipe.unet.active_adapters}")
|
107 |
|
|
|
112 |
requires_safety_checker=False,
|
113 |
safety_checker=None,
|
114 |
)
|
115 |
+
pipe = pipe # .to(device)
|
116 |
|
117 |
image = pipe(
|
118 |
prompt=prompt,
|