Spaces:
Runtime error
Runtime error
tcd
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ from diffusers import AutoPipelineForImage2Image
|
|
9 |
from diffusers.utils import load_image
|
10 |
import math
|
11 |
from DeepCache import DeepCacheSDHelper
|
12 |
-
|
13 |
|
14 |
adapter_id = "latent-consistency/lcm-lora-sdv1-5"
|
15 |
|
@@ -31,10 +31,10 @@ def resize(value,img):
|
|
31 |
def infer(model_id,source_img, prompt, steps, seed, Strength):
|
32 |
pipe = OVStableDiffusionImg2ImgPipeline.from_pretrained(model_id, torch_dtype=torch.float16, export=True) if torch.cuda.is_available() else AutoPipelineForImage2Image.from_pretrained("stabilityai/sdxl-turbo")
|
33 |
pipe = pipe.to(device)
|
34 |
-
pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
|
35 |
-
tcd_lora_id = "h1t/TCD-SDXL-LoRA"
|
36 |
-
pipe.load_lora_weights(tcd_lora_id)
|
37 |
-
pipe.fuse_lora()
|
38 |
start_time = time.time()
|
39 |
generator = torch.Generator(device).manual_seed(seed)
|
40 |
if int(steps * Strength) < 1:
|
|
|
9 |
from diffusers.utils import load_image
|
10 |
import math
|
11 |
from DeepCache import DeepCacheSDHelper
|
12 |
+
|
13 |
|
14 |
adapter_id = "latent-consistency/lcm-lora-sdv1-5"
|
15 |
|
|
|
31 |
def infer(model_id,source_img, prompt, steps, seed, Strength):
|
32 |
pipe = OVStableDiffusionImg2ImgPipeline.from_pretrained(model_id, torch_dtype=torch.float16, export=True) if torch.cuda.is_available() else AutoPipelineForImage2Image.from_pretrained("stabilityai/sdxl-turbo")
|
33 |
pipe = pipe.to(device)
|
34 |
+
# pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config)
|
35 |
+
# tcd_lora_id = "h1t/TCD-SDXL-LoRA"
|
36 |
+
# pipe.load_lora_weights(tcd_lora_id)
|
37 |
+
# pipe.fuse_lora()
|
38 |
start_time = time.time()
|
39 |
generator = torch.Generator(device).manual_seed(seed)
|
40 |
if int(steps * Strength) < 1:
|