镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Silent custom node import failures in real mode #93

Open

Description

@JTriggerFish

It seems that custom nodes need to follow some strict relative imports to be parsed / stubbed properly into the nodes.piy files.
However auto imports generated by pycharm ( and presumably vscode ) don't always follow this convention and as a result sometimes nodes get silently not added to the stubs.
Is there a way to force any missed imports to throw an error - ideally with the full original error and its stack trade included - when importing comfy_script nodes in real mode ?

Activity

  1. Chaoses-Ib commented on Feb 2, 2025

    @Chaoses-Ib
    Owner

    Sorry, I don't understand what exactly you mean. If you want to throw import errors at the start, you can use from comfy_script.runtime.real.nodes import ExampleNode instead of the wildcard import. Imports don't affect the generation of type stubs.

  2. JTriggerFish commented on Feb 2, 2025

    @JTriggerFish
    Author

    So at the beginning of my script / notebook I have

    from comfy_script.runtime.real import *
    # from comfy_script.runtime import *
    
    load(comfyui=COMFY_FOLDER, args=ComfyUIArgs("--preview-method", "auto"))#, config=RealModeConfig(track_workflow=False))
    from comfy_script.runtime.real.nodes import *
    

    This updates the nodes.piy based on what gets collected from the custom_nodes subfolder and the output I get is:

    ComfyScript: Importing ComfyUI from ComfyUI
    Ib Custom Nodes: Loaded
    ComfyScript: Loaded
    Nodes: 308
    

    Now sometimes, one of the custom nodes I am working on fails to be loaded ( usually due to what I am 99% sure is an import error) but it doesn't show what the issue is, the only way I will notice is that the corresponding node will not be present in the nodes.piy filem, and the above will show (e.g. ):

    ComfyScript: Importing ComfyUI from ComfyUI
    Ib Custom Nodes: Loaded
    ComfyScript: Loaded
    Nodes: 307
    

    instead of 308

    I was wondering if there was a way to see what caused the node to fail to be loaded ?

  3. Chaoses-Ib commented on Feb 2, 2025

    @Chaoses-Ib
    Owner

    The nodes count is how many nodes ConfyUI loaded, not how many nodes loaded into the runtime (which hasn't happened when the count is printed), so the problem happens inside ComfyUI. Normally ConfyUI should print any exceptions during load. I'm not sure about your case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requestedruntime

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions