Chaoses-Ib / ComfyScript

A Python frontend and library for ComfyUI
https://discord.gg/arqJbtEg7w
MIT License
432 stars 24 forks source link

Turn off transpiler option/transpile on command #38

Closed Praecordi closed 7 months ago

Praecordi commented 7 months ago

I have a habit of printing out seed numbers so I can go back to specific seeds that I liked. The transpiler really crowds up my command window, so that I have to scroll a lot. Is there an easy way to disable automatic transpiling, maybe by adding an option in settings? I think we can always use the cmdline version of the transpiler in case we need it.

Chaoses-Ib commented 7 months ago

Here is a temp workaround from https://github.com/Chaoses-Ib/ComfyScript/issues/27#issuecomment-1963031860:

Replace setup() here with pass:

https://github.com/Chaoses-Ib/ComfyScript/blob/327a5b76edca4afffd5d4108016b2b0ddc32dd4e/src/comfy_script/nodes/__init__.py#L167-L169

Chaoses-Ib commented 7 months ago

You can now turn off it by adding a settings.toml file at the repository root with the following content:

# These settings can also be overriden by:
# - Environment variables
#   e.g. `COMFY_SCRIPT_TRANSPILE_HOOK_ENABLED=false`
# - Python code
#   e.g.
#   ```python
#   from comfy_script.config import settings
#   settings.transpile.hook.enabled=False
#   ```

[transpile.hook]
# When ComfyScript is installed as custom nodes, `SaveImage` and similar nodes will be hooked to automatically save the script as the image's metadata. The script will also be printed to the terminal.
# To disable a feature, change its value to `false`.
save_script = true
print_script = false
Praecordi commented 7 months ago

Thank you for the quick response!