Spaces:
Configuration error
Configuration error
Update adapter_model.py
Browse files- adapter_model.py +6 -9
adapter_model.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
from dotenv import load_dotenv
|
2 |
import os
|
3 |
-
from diffusers import StableDiffusionInpaintPipelineLegacy,StableDiffusionControlNetPipeline,ControlNetModel, DDIMScheduler,
|
4 |
import torch
|
5 |
from ip_adapter import IPAdapter
|
6 |
|
@@ -9,9 +9,9 @@ load_dotenv()
|
|
9 |
BASE_MODEL_PATH = str(os.getenv(
|
10 |
"BASE_MODEL_PATH")
|
11 |
)
|
12 |
-
VAE_MODEL_PATH = str(os.getenv(
|
13 |
-
"VAE_MODEL_PATH")
|
14 |
-
)
|
15 |
IMAGE_ENCODER_PATH = str(os.getenv(
|
16 |
"IMAGE_ENCODER_PATH")
|
17 |
)
|
@@ -33,11 +33,8 @@ noise_scheduler = DDIMScheduler(
|
|
33 |
set_alpha_to_one=False,
|
34 |
steps_offset=1,
|
35 |
)
|
36 |
-
vae = AutoencoderKL.from_pretrained(VAE_MODEL_PATH).to(dtype=torch.float16)
|
37 |
-
|
38 |
-
#TODO
|
39 |
-
#from diffusers import ConsistencyDecoderVAE
|
40 |
-
#vae = ConsistencyDecoderVAE.from_pretrained("openai/consistency-decoder", torch_dtype=torch.float16)
|
41 |
|
42 |
|
43 |
class MODEL:
|
|
|
1 |
from dotenv import load_dotenv
|
2 |
import os
|
3 |
+
from diffusers import StableDiffusionInpaintPipelineLegacy,StableDiffusionControlNetPipeline,ControlNetModel, DDIMScheduler,ConsistencyDecoderVAE
|
4 |
import torch
|
5 |
from ip_adapter import IPAdapter
|
6 |
|
|
|
9 |
BASE_MODEL_PATH = str(os.getenv(
|
10 |
"BASE_MODEL_PATH")
|
11 |
)
|
12 |
+
#VAE_MODEL_PATH = str(os.getenv(
|
13 |
+
# "VAE_MODEL_PATH")
|
14 |
+
# )
|
15 |
IMAGE_ENCODER_PATH = str(os.getenv(
|
16 |
"IMAGE_ENCODER_PATH")
|
17 |
)
|
|
|
33 |
set_alpha_to_one=False,
|
34 |
steps_offset=1,
|
35 |
)
|
36 |
+
#vae = AutoencoderKL.from_pretrained(VAE_MODEL_PATH).to(dtype=torch.float16)
|
37 |
+
vae = ConsistencyDecoderVAE.from_pretrained("openai/consistency-decoder", torch_dtype=torch.float16)
|
|
|
|
|
|
|
38 |
|
39 |
|
40 |
class MODEL:
|