Ignore free_gpu_mem when using 🤗 diffuser model (#2326)

This commit is contained in:
Daya Adianto 2023-01-18 18:50:08 +07:00
parent e4ea98c277
commit a7b2074106
No known key found for this signature in database
GPG Key ID: 2C979F39966F058B

View File

@ -460,10 +460,13 @@ class Generate:
init_image = None
mask_image = None
if self.free_gpu_mem and self.model.cond_stage_model.device != self.model.device:
self.model.cond_stage_model.device = self.model.device
self.model.cond_stage_model.to(self.model.device)
try:
if self.free_gpu_mem and self.model.cond_stage_model.device != self.model.device:
self.model.cond_stage_model.device = self.model.device
self.model.cond_stage_model.to(self.model.device)
except AttributeError:
print(">> Warning: '--free_gpu_mem' is not yet supported when generating image using model based on HuggingFace Diffuser.")
pass
try:
uc, c, extra_conditioning_info = get_uc_and_c_and_ec(