Spaces:
Running
on
Zero
Running
on
Zero
@spaces.GPU
Browse files
app.py
CHANGED
@@ -7,6 +7,8 @@ from scripts.process_utils import initialize, process_image_as_base64
|
|
7 |
from scripts.anime import init_model
|
8 |
from scripts.generate_prompt import load_wd14_tagger_model
|
9 |
|
|
|
|
|
10 |
# 初期化
|
11 |
initialize(_use_local=False, use_gpu=True, use_dotenv=False)
|
12 |
init_model(use_local=False)
|
@@ -22,13 +24,11 @@ def process_image(input_image, mode, weight1, weight2):
|
|
22 |
|
23 |
return sotai_pil, sketch_pil
|
24 |
|
|
|
25 |
def gradio_process_image(input_image, mode, weight1, weight2):
|
26 |
sotai_image, sketch_image = process_image(input_image, mode, weight1, weight2)
|
27 |
return sotai_image, sketch_image
|
28 |
|
29 |
-
# pwdを取得
|
30 |
-
print(os.getcwd())
|
31 |
-
|
32 |
# サンプル画像のパスリスト
|
33 |
sample_images = [
|
34 |
'images/sample1.png',
|
|
|
7 |
from scripts.anime import init_model
|
8 |
from scripts.generate_prompt import load_wd14_tagger_model
|
9 |
|
10 |
+
import spaces
|
11 |
+
|
12 |
# 初期化
|
13 |
initialize(_use_local=False, use_gpu=True, use_dotenv=False)
|
14 |
init_model(use_local=False)
|
|
|
24 |
|
25 |
return sotai_pil, sketch_pil
|
26 |
|
27 |
+
@spaces.GPU
|
28 |
def gradio_process_image(input_image, mode, weight1, weight2):
|
29 |
sotai_image, sketch_image = process_image(input_image, mode, weight1, weight2)
|
30 |
return sotai_image, sketch_image
|
31 |
|
|
|
|
|
|
|
32 |
# サンプル画像のパスリスト
|
33 |
sample_images = [
|
34 |
'images/sample1.png',
|