创建基于Stable Diffusion模型的分布式文本到图像AI系统
1. 工作器中的任务调度
我们可以尝试在工作器中调度任务。具体操作步骤如下:
1. 打开一个新的命令行,并确保已启用Python虚拟环境。
2. 启动Python交互式shell:
(venv) $ python
- 导入任务函数:
>>> from chapter14.basic.worker import text_to_image_task
- 发送任务:
>>> text_to_image_task.send("A Renaissance castle in the Loire Valley")
执行上述代码后,会输出类似如下的消息:
Message(queue_name='default', actor_name='text_to_image_task',
args=('A Renaissance castle in the Loire Valley',), kwargs={},
options={'redis_message_id': '663df44a-
超级会员免费看
订阅专栏 解锁全文
1001

被折叠的 条评论
为什么被折叠?



