V 1.0.0 - Kolors 1

This commit is contained in:
DESKTOP-CNFQ7PM\Primere
2024-11-09 18:29:02 +01:00
parent 092dcc34c5
commit f2acfd94a1
2 changed files with 5 additions and 33 deletions
+5 -19
View File
@@ -603,8 +603,8 @@ class PrimereCKPTLoader:
try:
comfy.model_management.soft_empty_cache()
comfy.model_management.unload_all_models()
comfy.model_management.cleanup_models()
comfy.model_management.unload_all_models()
except Exception:
print('No need to clear memory...')
@@ -819,16 +819,8 @@ class PrimereCKPTLoader:
if is_link == True:
model_name = Path(fullpathFile).stem
# device = model_management.get_torch_device()
# offload_device = model_management.unet_offload_device()
try:
comfy.model_management.soft_empty_cache()
comfy.model_management.unload_all_models()
comfy.model_management.cleanup_models()
except Exception:
print('No need to clear memory...')
device = model_management.get_torch_device()
offload_device = model_management.unet_offload_device()
dtype = {"bf16": torch.bfloat16, "fp16": torch.float16, "fp32": torch.float32}['fp16']
pbar = comfy.utils.ProgressBar(4)
model_path = os.path.join(folder_paths.models_dir, "diffusers", model_name)
@@ -850,11 +842,6 @@ class PrimereCKPTLoader:
pbar.update(1)
CHATGLM3_MODEL = {'text_encoder': text_encoder, 'tokenizer': tokenizer}
try:
comfy.model_management.soft_empty_cache()
except Exception:
print('No need to clear memory...')
if vae_name != "Baked":
OUTPUT_VAE = nodes.VAELoader.load_vae(self, vae_name)[0]
else:
@@ -1781,11 +1768,10 @@ class PrimereCLIP:
negative_text = utility.clear_hunyuan(negative_text, 512)
if model_concept == 'KwaiKolors':
model_management.unload_all_models()
model_management.soft_empty_cache()
device = model_management.get_torch_device()
offload_device = model_management.unet_offload_device()
model_management.unload_all_models()
model_management.soft_empty_cache()
tokenizer = clip['tokenizer']
text_encoder = clip['text_encoder']
text_encoder.to(device)
-14
View File
@@ -779,13 +779,6 @@ class PrimereKSampler:
diffvalue = str(int(model_samplingtime_list[1]) + timestamp_diff)
utility.add_value_to_cache('model_samplingtime', modelname_only, counter + '|' + diffvalue)
try:
comfy.model_management.soft_empty_cache()
# comfy.model_management.free_memory(memory_required=1.4 ** 64 - 1, device='cuda')
comfy.model_management.unload_all_models()
except Exception:
print('No need to clear cache...')
return (samples_out, workflow_tuple)
class PrimerePreviewImage():
@@ -901,13 +894,6 @@ class PrimereAestheticCKPTScorer():
final_prediction = '*** Aesthetic scorer off ***'
if (get_aesthetic_score == True):
try:
comfy.model_management.unload_all_models()
comfy.model_management.cleanup_models()
comfy.model_management.soft_empty_cache()
except Exception:
print('No need to clear memory...')
AESTHETIC_PATH = os.path.join(folder_paths.models_dir, 'aesthetic')
folder_paths.add_model_folder_path("aesthetic", AESTHETIC_PATH)
if os.path.exists(AESTHETIC_PATH) == False: