mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-10 06:10:50 +08:00
- enable user db - fix main_pre order everywhere - fix absolute to relative imports everywhere - async better supported
34 lines
1.0 KiB
Python
34 lines
1.0 KiB
Python
import asyncio
|
|
|
|
from ..cmd.main_pre import args
|
|
from ..component_model.entrypoints_common import configure_application_paths, executor_from_args
|
|
|
|
|
|
async def main():
|
|
# assume we are a worker
|
|
from ..distributed.distributed_prompt_worker import DistributedPromptWorker
|
|
|
|
args.distributed_queue_worker = True
|
|
args.distributed_queue_frontend = False
|
|
assert args.distributed_queue_connection_uri is not None, "Set the --distributed-queue-connection-uri argument to your RabbitMQ server"
|
|
|
|
configure_application_paths(args)
|
|
executor = await executor_from_args(args)
|
|
|
|
async with DistributedPromptWorker(connection_uri=args.distributed_queue_connection_uri,
|
|
queue_name=args.distributed_queue_name,
|
|
executor=executor):
|
|
stop = asyncio.Event()
|
|
try:
|
|
await stop.wait()
|
|
except asyncio.CancelledError:
|
|
pass
|
|
|
|
|
|
def entrypoint():
|
|
asyncio.run(main())
|
|
|
|
|
|
if __name__ == "__main__":
|
|
entrypoint()
|