import asyncio
async def process_comfyui_t2I(text):
# 你的协程逻辑
print(text)
await asyncio.sleep(1) # 模拟异步操作
return "处理完成"
async def main():
# 确保使用 'await' 来调用协程
result = await process_comfyui_t2I('purple people fruit')
print(result)
# 使用 asyncio.run 来启动异步环境
if __name__ == '__main__':
asyncio.run(main())
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
最新推荐文章于 2024-06-14 12:24:14 发布