Spaces:
Running
on
Zero
Running
on
Zero
rm faskAPI
Browse files
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
from fastapi import FastAPI
|
2 |
import gradio as gr
|
3 |
import os
|
4 |
import io
|
@@ -8,7 +7,6 @@ from scripts.process_utils import initialize, process_image_as_base64
|
|
8 |
from scripts.anime import init_model
|
9 |
from scripts.generate_prompt import load_wd14_tagger_model
|
10 |
|
11 |
-
app = FastAPI()
|
12 |
# 初期化
|
13 |
initialize(_use_local=False, use_gpu=True, use_dotenv=False)
|
14 |
init_model(use_local=False)
|
@@ -41,8 +39,5 @@ iface = gr.Interface(
|
|
41 |
description="Upload an image and select processing options to generate body and sketch images."
|
42 |
)
|
43 |
|
44 |
-
# APIとして公開
|
45 |
-
app = gr.mount_gradio_app(app, iface, path="/predict")
|
46 |
-
|
47 |
# Hugging Face Spacesでデプロイする場合
|
48 |
iface.queue().launch()
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import os
|
3 |
import io
|
|
|
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)
|
|
|
39 |
description="Upload an image and select processing options to generate body and sketch images."
|
40 |
)
|
41 |
|
|
|
|
|
|
|
42 |
# Hugging Face Spacesでデプロイする場合
|
43 |
iface.queue().launch()
|