mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-10 21:42:37 +08:00
支持Concurrent-8 by米强滔
This commit is contained in:
parent
1199411747
commit
f1d1fb78cf
@ -205,6 +205,8 @@ parser.add_argument("--user-directory", type=is_valid_directory, default=None, h
|
||||
|
||||
parser.add_argument("--enable-compress-response-body", action="store_true", help="Enable compressing response body.")
|
||||
|
||||
parser.add_argument("--num-workers", type=int, default=1, help="Set the number of worker threads to process the queue (default: 1). Increase this for better concurrency but be aware of GPU memory limitations.")
|
||||
|
||||
parser.add_argument(
|
||||
"--comfy-api-base",
|
||||
type=str,
|
||||
|
||||
5
main.py
5
main.py
@ -336,7 +336,10 @@ def start_comfyui(asyncio_loop=None):
|
||||
prompt_server.add_routes()
|
||||
hijack_progress(prompt_server)
|
||||
|
||||
threading.Thread(target=prompt_worker, daemon=True, args=(prompt_server.prompt_queue, prompt_server,)).start()
|
||||
num_workers = max(1, args.num_workers)
|
||||
logging.info(f"Starting {num_workers} worker thread(s) for queue processing")
|
||||
for i in range(num_workers):
|
||||
threading.Thread(target=prompt_worker, daemon=True, args=(prompt_server.prompt_queue, prompt_server,), name=f"PromptWorker-{i+1}").start()
|
||||
|
||||
if args.quick_test_for_ci:
|
||||
exit(0)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user