Skip to content

Commit

Permalink
fix(transpile): read workflow file in UTF-8 encoding (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaoses-Ib committed Jun 14, 2024
1 parent 086cd37 commit e9fba39
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/comfy_script/transpile/__main__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from typing import TextIO
import click

from . import *

@click.command(help='Transpile workflow to ComfyScript.')
@click.argument('workflow', type=click.File('r'))
@click.argument('workflow', type=click.File('r', encoding='utf-8'))
@click.option('--api', type=click.STRING, default='http://127.0.0.1:8188/', show_default=True)
@click.option('--runtime', is_flag=True, default=False, show_default=True, help='Wrap the script with runtime imports and workflow context.')
def cli(workflow, api: str, runtime: bool):
def cli(workflow: TextIO, api: str, runtime: bool):
workflow = workflow.read()
script = WorkflowToScriptTranspiler(workflow, api).to_script(runtime=runtime)
print(script)
Expand Down

0 comments on commit e9fba39

Please sign in to comment.