Spaces:
Running
Running
jhj0517
commited on
Commit
•
e0d1c62
1
Parent(s):
719689e
Add OUTPUT_FILTER_DIR
Browse files- app.py +3 -2
- modules/paths.py +2 -0
app.py
CHANGED
@@ -7,7 +7,7 @@ import yaml
|
|
7 |
|
8 |
from modules.sam_inference import SamInference
|
9 |
from modules.model_downloader import DEFAULT_MODEL_TYPE
|
10 |
-
from modules.paths import (OUTPUT_DIR, OUTPUT_PSD_DIR, SAM2_CONFIGS_DIR, TEMP_DIR)
|
11 |
from modules.utils import open_folder
|
12 |
from modules.constants import (AUTOMATIC_MODE, BOX_PROMPT_MODE, PIXELIZE_FILTER, COLOR_FILTER, DEFAULT_COLOR,
|
13 |
DEFAULT_PIXEL_SIZE)
|
@@ -127,7 +127,7 @@ class App:
|
|
127 |
|
128 |
btn_generate.click(fn=self.sam_inf.divide_layer,
|
129 |
inputs=input_params, outputs=[gallery_output, output_file])
|
130 |
-
btn_open_folder.click(fn=lambda: open_folder(
|
131 |
inputs=None, outputs=None)
|
132 |
dd_input_modes.change(fn=self.on_mode_change,
|
133 |
inputs=[dd_input_modes],
|
@@ -192,6 +192,7 @@ class App:
|
|
192 |
btn_generate.click(fn=self.sam_inf.create_filtered_video,
|
193 |
inputs=preview_params,
|
194 |
outputs=[vid_output, output_file])
|
|
|
195 |
|
196 |
self.demo.queue().launch(inbrowser=True)
|
197 |
|
|
|
7 |
|
8 |
from modules.sam_inference import SamInference
|
9 |
from modules.model_downloader import DEFAULT_MODEL_TYPE
|
10 |
+
from modules.paths import (OUTPUT_DIR, OUTPUT_PSD_DIR, SAM2_CONFIGS_DIR, TEMP_DIR, OUTPUT_FILTER_DIR)
|
11 |
from modules.utils import open_folder
|
12 |
from modules.constants import (AUTOMATIC_MODE, BOX_PROMPT_MODE, PIXELIZE_FILTER, COLOR_FILTER, DEFAULT_COLOR,
|
13 |
DEFAULT_PIXEL_SIZE)
|
|
|
127 |
|
128 |
btn_generate.click(fn=self.sam_inf.divide_layer,
|
129 |
inputs=input_params, outputs=[gallery_output, output_file])
|
130 |
+
btn_open_folder.click(fn=lambda: open_folder(OUTPUT_PSD_DIR),
|
131 |
inputs=None, outputs=None)
|
132 |
dd_input_modes.change(fn=self.on_mode_change,
|
133 |
inputs=[dd_input_modes],
|
|
|
192 |
btn_generate.click(fn=self.sam_inf.create_filtered_video,
|
193 |
inputs=preview_params,
|
194 |
outputs=[vid_output, output_file])
|
195 |
+
btn_open_folder.click(fn=lambda: open_folder(OUTPUT_FILTER_DIR), inputs=None, outputs=None)
|
196 |
|
197 |
self.demo.queue().launch(inbrowser=True)
|
198 |
|
modules/paths.py
CHANGED
@@ -5,6 +5,7 @@ MODELS_DIR = os.path.join(WEBUI_DIR, "models")
|
|
5 |
SAM2_CONFIGS_DIR = os.path.join(WEBUI_DIR, "configs")
|
6 |
OUTPUT_DIR = os.path.join(WEBUI_DIR, "outputs")
|
7 |
OUTPUT_PSD_DIR = os.path.join(OUTPUT_DIR, "psd")
|
|
|
8 |
TEMP_DIR = os.path.join(WEBUI_DIR, "temp")
|
9 |
TEMP_OUT_DIR = os.path.join(TEMP_DIR, "out")
|
10 |
|
@@ -12,6 +13,7 @@ for dir_path in [MODELS_DIR,
|
|
12 |
SAM2_CONFIGS_DIR,
|
13 |
OUTPUT_DIR,
|
14 |
OUTPUT_PSD_DIR,
|
|
|
15 |
TEMP_DIR,
|
16 |
TEMP_OUT_DIR]:
|
17 |
os.makedirs(dir_path, exist_ok=True)
|
|
|
5 |
SAM2_CONFIGS_DIR = os.path.join(WEBUI_DIR, "configs")
|
6 |
OUTPUT_DIR = os.path.join(WEBUI_DIR, "outputs")
|
7 |
OUTPUT_PSD_DIR = os.path.join(OUTPUT_DIR, "psd")
|
8 |
+
OUTPUT_FILTER_DIR = os.path.join(OUTPUT_DIR, "filter")
|
9 |
TEMP_DIR = os.path.join(WEBUI_DIR, "temp")
|
10 |
TEMP_OUT_DIR = os.path.join(TEMP_DIR, "out")
|
11 |
|
|
|
13 |
SAM2_CONFIGS_DIR,
|
14 |
OUTPUT_DIR,
|
15 |
OUTPUT_PSD_DIR,
|
16 |
+
OUTPUT_FILTER_DIR,
|
17 |
TEMP_DIR,
|
18 |
TEMP_OUT_DIR]:
|
19 |
os.makedirs(dir_path, exist_ok=True)
|