Upload dc.py
Browse files
dc.py
CHANGED
@@ -754,6 +754,7 @@ import numpy as np
|
|
754 |
import random
|
755 |
import json
|
756 |
import shutil
|
|
|
757 |
from tagger.tagger import insert_model_recom_prompt
|
758 |
from modutils import (safe_float, escape_lora_basename, to_lora_key, to_lora_path, valid_model_name, set_textual_inversion_prompt,
|
759 |
get_local_model_list, get_model_pipeline, get_private_lora_model_lists, get_valid_lora_name, get_state, set_state,
|
@@ -864,6 +865,8 @@ def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance
|
|
864 |
progress(1, desc="Inference completed.")
|
865 |
output_image = images[0][0] if images else None
|
866 |
|
|
|
|
|
867 |
return output_image
|
868 |
|
869 |
|
|
|
754 |
import random
|
755 |
import json
|
756 |
import shutil
|
757 |
+
import gc
|
758 |
from tagger.tagger import insert_model_recom_prompt
|
759 |
from modutils import (safe_float, escape_lora_basename, to_lora_key, to_lora_path, valid_model_name, set_textual_inversion_prompt,
|
760 |
get_local_model_list, get_model_pipeline, get_private_lora_model_lists, get_valid_lora_name, get_state, set_state,
|
|
|
865 |
progress(1, desc="Inference completed.")
|
866 |
output_image = images[0][0] if images else None
|
867 |
|
868 |
+
gc.collect()
|
869 |
+
|
870 |
return output_image
|
871 |
|
872 |
|