Spaces:
Paused
Paused
Commit
β’
71c1a49
1
Parent(s):
a7ae1ff
Update app.py
Browse files
app.py
CHANGED
@@ -110,21 +110,40 @@ face_adapter = f'/data/checkpoints/ip-adapter.bin'
|
|
110 |
controlnet_path = f'/data/checkpoints/ControlNetModel'
|
111 |
|
112 |
# load IdentityNet
|
|
|
113 |
identitynet = ControlNetModel.from_pretrained(controlnet_path, torch_dtype=torch.float16)
|
114 |
zoedepthnet = ControlNetModel.from_pretrained("diffusers/controlnet-zoe-depth-sdxl-1.0",torch_dtype=torch.float16)
|
|
|
|
|
|
|
|
|
115 |
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
|
|
|
|
|
|
|
|
|
116 |
pipe = StableDiffusionXLInstantIDImg2ImgPipeline.from_pretrained("rubbrband/albedobaseXL_v21",
|
117 |
vae=vae,
|
118 |
controlnet=[identitynet, zoedepthnet],
|
119 |
torch_dtype=torch.float16)
|
120 |
-
|
121 |
-
compel = Compel(tokenizer=[pipe.tokenizer, pipe.tokenizer_2] , text_encoder=[pipe.text_encoder, pipe.text_encoder_2], returned_embeddings_type=ReturnedEmbeddingsType.PENULTIMATE_HIDDEN_STATES_NON_NORMALIZED, requires_pooled=[False, True])
|
122 |
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config, use_karras_sigmas=True)
|
123 |
pipe.load_ip_adapter_instantid(face_adapter)
|
124 |
pipe.set_ip_adapter_scale(0.8)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
zoe = ZoeDetector.from_pretrained("lllyasviel/Annotators")
|
|
|
|
|
|
|
126 |
zoe.to(device)
|
127 |
-
|
128 |
pipe.to(device)
|
129 |
|
130 |
last_lora = ""
|
|
|
110 |
controlnet_path = f'/data/checkpoints/ControlNetModel'
|
111 |
|
112 |
# load IdentityNet
|
113 |
+
st = time.time()
|
114 |
identitynet = ControlNetModel.from_pretrained(controlnet_path, torch_dtype=torch.float16)
|
115 |
zoedepthnet = ControlNetModel.from_pretrained("diffusers/controlnet-zoe-depth-sdxl-1.0",torch_dtype=torch.float16)
|
116 |
+
et = time.time()
|
117 |
+
elapsed_time = et - st
|
118 |
+
print('Loading ControlNet took: ', elapsed_time, 'seconds')
|
119 |
+
st = time.time()
|
120 |
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
|
121 |
+
et = time.time()
|
122 |
+
elapsed_time = et - st
|
123 |
+
print('Loading VAE took: ', elapsed_time, 'seconds')
|
124 |
+
st = time.time()
|
125 |
pipe = StableDiffusionXLInstantIDImg2ImgPipeline.from_pretrained("rubbrband/albedobaseXL_v21",
|
126 |
vae=vae,
|
127 |
controlnet=[identitynet, zoedepthnet],
|
128 |
torch_dtype=torch.float16)
|
|
|
|
|
129 |
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config, use_karras_sigmas=True)
|
130 |
pipe.load_ip_adapter_instantid(face_adapter)
|
131 |
pipe.set_ip_adapter_scale(0.8)
|
132 |
+
et = time.time()
|
133 |
+
elapsed_time = et - st
|
134 |
+
print('Loading pipeline took: ', elapsed_time, 'seconds')
|
135 |
+
st = time.time()
|
136 |
+
compel = Compel(tokenizer=[pipe.tokenizer, pipe.tokenizer_2] , text_encoder=[pipe.text_encoder, pipe.text_encoder_2], returned_embeddings_type=ReturnedEmbeddingsType.PENULTIMATE_HIDDEN_STATES_NON_NORMALIZED, requires_pooled=[False, True])
|
137 |
+
et = time.time()
|
138 |
+
elapsed_time = et - st
|
139 |
+
print('Loading Compel took: ', elapsed_time, 'seconds')
|
140 |
+
|
141 |
+
st = time.time()
|
142 |
zoe = ZoeDetector.from_pretrained("lllyasviel/Annotators")
|
143 |
+
et = time.time()
|
144 |
+
elapsed_time = et - st
|
145 |
+
print('Loading Zoe took: ', elapsed_time, 'seconds')
|
146 |
zoe.to(device)
|
|
|
147 |
pipe.to(device)
|
148 |
|
149 |
last_lora = ""
|