Skip to content

Commit

Permalink
fix: specify the workspace for run (#38)
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming authored Jan 24, 2025
1 parent e181b07 commit 3f07d59
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/comfy_pack/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ def run(ctx, cpack: str, output_dir: str, help: bool, verbose: int):
workflow,
Path(output_dir).absolute(),
verbose=verbose,
workspace=server.workspace,
**validated_data.model_dump(),
)
console.print("\n[green]✓ Workflow is executed successfully![/green]")
Expand Down
3 changes: 3 additions & 0 deletions src/comfy_pack/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def run_workflow(
output_dir: Union[str, Path, None] = None,
timeout: int = 300,
verbose: int = 0,
workspace: str = ".",
**kwargs: Any,
) -> Any:
"""
Expand Down Expand Up @@ -258,6 +259,8 @@ def run_workflow(
command = [
"comfy",
"--skip-prompt",
"--workspace",
workspace,
"run",
"--workflow",
workflow_file_path.as_posix(),
Expand Down
3 changes: 2 additions & 1 deletion src/comfy_pack/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def _watch_server(server: comfy_pack.run.ComfyUIServer):
snapshot = {}


@bentoml.mount_asgi_app(app, path="/comfy")
@bentoml.asgi_app(app, path="/comfy")
@bentoml.service(traffic={"timeout": REQUEST_TIMEOUT * 2}, resources={"gpu": 1})
class ComfyService:
def __init__(self):
Expand Down Expand Up @@ -122,6 +122,7 @@ def generate(
output_dir=ctx.temp_dir,
timeout=REQUEST_TIMEOUT,
verbose=verbose,
workspace=self.server.workspace,
**kwargs,
)
if isinstance(ret, list):
Expand Down

0 comments on commit 3f07d59

Please sign in to comment.