-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(docs): Modal example return PIL images (#73)
- Loading branch information
1 parent
89cb2fe
commit 13957e8
Showing
1 changed file
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13957e8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请问 Workflow() 不需要设置
wait=True
了吗?一直等到任务完成才退出context。13957e8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@binarytahr 下面
result.wait()
已经等待了13957e8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哈哈,原来是这个原因
13957e8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我为了方便随时修改 workflow 之后不用重新
modal deploy
,拆分成了 client.py 和 server.py 两个文件。comfyscript 写的 workflow 定义成 function 放在本地 client.py 里面,一开始我把这个 function 作为 argument 传给云端,但是云端会报错获取不到 source code。然后我就把 workflow function 转成 string 后作为 argument 传给云端 server.py。
deploy 好的 server.py 里面用
exec(workflow)
去执行。目前通过读取 output 文件夹里面生成的图片返回 bytes,可以成功运行。下午试了一下
result.wait().wait()
,会报错:NameError: name 'result' is not defined。感觉可能是exec()
限制比较多,和这个方法不兼容。外面的result.wait().wait()
获取不到exec()
里面执行的 result。