Spaces:
Running
on
Zero
Running
on
Zero
Upload 3 files
Browse files- app.py +2 -3
- modutils.py +1 -1
- requirements.txt +2 -1
app.py
CHANGED
|
@@ -167,7 +167,7 @@ class GuiSD:
|
|
| 167 |
self.last_load = datetime.now()
|
| 168 |
self.inventory = []
|
| 169 |
|
| 170 |
-
def update_storage_models(self, storage_floor_gb=
|
| 171 |
while get_used_storage_gb() > storage_floor_gb:
|
| 172 |
if len(self.inventory) < required_inventory_for_purge:
|
| 173 |
break
|
|
@@ -780,7 +780,7 @@ with gr.Blocks(theme='NoCrypt/miku@>=1.2.2', elem_id="main", fill_width=True, cs
|
|
| 780 |
with gr.Column(scale=1):
|
| 781 |
|
| 782 |
def update_task_options(model_name, task_name):
|
| 783 |
-
new_choices = MODEL_TYPE_TASK[get_model_type(model_name)]
|
| 784 |
|
| 785 |
if task_name not in new_choices:
|
| 786 |
task_name = "txt2img"
|
|
@@ -863,7 +863,6 @@ with gr.Blocks(theme='NoCrypt/miku@>=1.2.2', elem_id="main", fill_width=True, cs
|
|
| 863 |
object_fit="contain",
|
| 864 |
# height="auto",
|
| 865 |
interactive=False,
|
| 866 |
-
#preview=False,
|
| 867 |
preview=False,
|
| 868 |
show_share_button=False,
|
| 869 |
show_download_button=True,
|
|
|
|
| 167 |
self.last_load = datetime.now()
|
| 168 |
self.inventory = []
|
| 169 |
|
| 170 |
+
def update_storage_models(self, storage_floor_gb=24, required_inventory_for_purge=3):
|
| 171 |
while get_used_storage_gb() > storage_floor_gb:
|
| 172 |
if len(self.inventory) < required_inventory_for_purge:
|
| 173 |
break
|
|
|
|
| 780 |
with gr.Column(scale=1):
|
| 781 |
|
| 782 |
def update_task_options(model_name, task_name):
|
| 783 |
+
new_choices = MODEL_TYPE_TASK[get_model_type(valid_model_name(model_name))]
|
| 784 |
|
| 785 |
if task_name not in new_choices:
|
| 786 |
task_name = "txt2img"
|
|
|
|
| 863 |
object_fit="contain",
|
| 864 |
# height="auto",
|
| 865 |
interactive=False,
|
|
|
|
| 866 |
preview=False,
|
| 867 |
show_share_button=False,
|
| 868 |
show_download_button=True,
|
modutils.py
CHANGED
|
@@ -172,7 +172,7 @@ class ModelInformation:
|
|
| 172 |
self.download_url = json_data.get("downloadUrl", "")
|
| 173 |
self.model_url = f"https://civitai.com/models/{self.model_id}?modelVersionId={self.model_version_id}"
|
| 174 |
self.filename_url = next(
|
| 175 |
-
(v.get("name", "") for v in json_data.get("files", []) if str(self.model_version_id) in v.get("downloadUrl", "")), ""
|
| 176 |
)
|
| 177 |
self.filename_url = self.filename_url if self.filename_url else ""
|
| 178 |
self.description = json_data.get("description", "")
|
|
|
|
| 172 |
self.download_url = json_data.get("downloadUrl", "")
|
| 173 |
self.model_url = f"https://civitai.com/models/{self.model_id}?modelVersionId={self.model_version_id}"
|
| 174 |
self.filename_url = next(
|
| 175 |
+
(v.get("name", "") for v in reversed(json_data.get("files", [])) if str(self.model_version_id) in v.get("downloadUrl", "")), ""
|
| 176 |
)
|
| 177 |
self.filename_url = self.filename_url if self.filename_url else ""
|
| 178 |
self.description = json_data.get("description", "")
|
requirements.txt
CHANGED
|
@@ -13,4 +13,5 @@ translatepy
|
|
| 13 |
timm
|
| 14 |
rapidfuzz
|
| 15 |
sentencepiece
|
| 16 |
-
unidecode
|
|
|
|
|
|
| 13 |
timm
|
| 14 |
rapidfuzz
|
| 15 |
sentencepiece
|
| 16 |
+
unidecode
|
| 17 |
+
ultralytics==8.3.47
|