ComfyScript icon indicating copy to clipboard operation
ComfyScript copied to clipboard

Support for `webp`

Open Praecordi opened this issue 9 months ago • 2 comments

I've recently switched to using webp for all my tasks. I've noticed that ComfyScript is not able to embed the workflow in webp files. Is that something that is possible? Or do I have to keep working with pngs for now?

Praecordi avatar Jul 17 '25 20:07 Praecordi

See https://github.com/Chaoses-Ib/ComfyScript/issues/19. ComfyScript will send workflows (both the source code and the prompt) to the backend. Whether they will be embed totally depends on the node you are using.

Chaoses-Ib avatar Jul 17 '25 21:07 Chaoses-Ib

I see what you are saying. My workflow contains the Preview node. I just tried a workflow in ComfyUI and despite me changing the preview file format setting to webp in ComfyUI, the Preview node still saves the temp files in png format. So the webp conversion somehow happened in my code, which I will have to investigate.

Also, is this error related to this:

Traceback (most recent call last):
  File "/home/ss/SD/ComfyUI/custom_nodes/ComfyScript/src/comfy_script/nodes/__init__.py", line 129, in chunks
    super().add_text('ComfyScriptSource', source, zip)
  File "/home/ss/.pyenv/versions/3.11.9/envs/sd/lib/python3.11/site-packages/PIL/PngImagePlugin.py", line 359, in add_text
    value = value.encode("latin-1", "strict")
            ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'encode'

If not then I can open a separate issue for it.

Praecordi avatar Jul 17 '25 23:07 Praecordi