We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5b0d609 + ac1bad7 commit ca3a8c3Copy full SHA for ca3a8c3
fooocusapi/api.py
@@ -10,9 +10,19 @@
10
from fooocusapi.task_queue import TaskType
11
from fooocusapi.worker import process_generate, task_queue, process_top
12
from concurrent.futures import ThreadPoolExecutor
13
+from fastapi.middleware.cors import CORSMiddleware
14
+
15
16
app = FastAPI()
17
18
+app.add_middleware(
19
+ CORSMiddleware,
20
+ allow_origins=["*"], # 允许所有来源访问
21
+ allow_credentials=True,
22
+ allow_methods=["*"], # 允许所有HTTP方法
23
+ allow_headers=["*"], # 允许所有请求头
24
+)
25
26
work_executor = ThreadPoolExecutor(
27
max_workers=task_queue.queue_size*2, thread_name_prefix="worker_")
28
0 commit comments