diff --git a/app.py b/app.py index e9b6519..daeab2f 100644 --- a/app.py +++ b/app.py @@ -1,4 +1,3 @@ - import os import torch import random @@ -74,6 +73,27 @@ examples = [ ] ] +# clean unrelated ckpts +ckpts = [ + "realisticVisionV20_v20.safetensors", + "majicmixRealistic_v5Preview.safetensors", + "rcnzCartoon3d_v10.safetensors", + "lyriel_v16.safetensors", + "toonyou_beta3.safetensors" +] + +for path in glob(os.path.join("models", "DreamBooth_LoRA", "*.safetensors")): + for ckpt in ckpts: + if path.endswith(ckpt): break + else: + print(f"### Cleaning {path} ...") + os.system(f"rm -rf {path}") + +# clean Grdio cache +print(f"### Cleaning cached examples ...") +os.system(f"rm -rf gradio_cached_examples/") + + class AnimateController: def __init__(self):