mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-11 23:00:51 +08:00
31 lines
804 B
Python
31 lines
804 B
Python
import asyncio
|
|
|
|
from .. import options
|
|
from ..distributed.distributed_prompt_worker import DistributedPromptWorker
|
|
|
|
options.enable_args_parsing()
|
|
|
|
from ..cli_args import args
|
|
|
|
|
|
async def main():
|
|
# assume we are a worker
|
|
args.distributed_queue_roles = ["worker"]
|
|
assert args.distributed_queue_connection_uri is not None, "Set the --distributed-queue-connection-uri argument to your RabbitMQ server"
|
|
|
|
async with DistributedPromptWorker(connection_uri=args.distributed_queue_connection_uri,
|
|
queue_name=args.distributed_queue_name):
|
|
stop = asyncio.Event()
|
|
try:
|
|
await stop.wait()
|
|
except asyncio.CancelledError:
|
|
pass
|
|
|
|
|
|
def entrypoint():
|
|
asyncio.run(main())
|
|
|
|
|
|
if __name__ == "__main__":
|
|
entrypoint()
|