Skip to content

Some code in these nodes is globally overwriting pytorch functions. #151

@kijai

Description

@kijai

Hey,

I've received some reports these nodes breaking torchscript model functionality, and quickly looking as to why, I came upon this:

torch.jit.script = patched_jit_script

This is a very bad practice as it disables Jit globally for everything in Comfy if the user simply have these nodes installed.

Also forcing torch.load to always be unsafe here:

torch.load = patched_torch_load

Is potentially even dangerous.

Please look into ways to do this without globally changing things, such as using context managers, as otherwise I will currently just have to tell people to uninstall these nodes.

Edit:

Also seems it's setting the torch._C._jit_set_profiling_executor(False) that is breaking things for me, this isn't the only node that does this too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions