Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -62,12 +62,14 @@ def generate(
|
|
62 |
|
63 |
if not use_vae:
|
64 |
pipe = DiffusionPipeline.from_pretrained(model, torch_dtype=torch.float16)
|
65 |
-
|
|
|
66 |
|
67 |
if use_vae:
|
68 |
vae = AutoencoderKL.from_pretrained(vaecall, torch_dtype=torch.float16)
|
69 |
pipe = DiffusionPipeline.from_pretrained(model, vae=vae, torch_dtype=torch.float16)
|
70 |
-
|
|
|
71 |
|
72 |
if use_lora:
|
73 |
pipe.load_lora_weights(lora)
|
|
|
62 |
|
63 |
if not use_vae:
|
64 |
pipe = DiffusionPipeline.from_pretrained(model, torch_dtype=torch.float16)
|
65 |
+
sampler_class = getattr(spaces, sampler)
|
66 |
+
pipe.scheduler = sampler_class.from_config(pipe.scheduler.config)
|
67 |
|
68 |
if use_vae:
|
69 |
vae = AutoencoderKL.from_pretrained(vaecall, torch_dtype=torch.float16)
|
70 |
pipe = DiffusionPipeline.from_pretrained(model, vae=vae, torch_dtype=torch.float16)
|
71 |
+
sampler_class = getattr(spaces, sampler)
|
72 |
+
pipe.scheduler = sampler_class.from_config(pipe.scheduler.config)
|
73 |
|
74 |
if use_lora:
|
75 |
pipe.load_lora_weights(lora)
|