Skip to content

Conversation

bigcat88
Copy link
Member

This PR solves a long-standing flaw when we can specify which models to download when installing a node, but these models are not displayed on the flow installation screen.

Since we do have a direct relationship between the flow of ComfyUI, since it consists of class names, and not the repository name, and our models are tied to the repository name in the case of nodes.

BASIC_NODE_LIST = {
    "ComfyUI-BRIA_AI-RMBG": {
        "models": [
            AIResourceModel(
                name="RMGB-1.4",
                save_path="{root}custom_nodes/ComfyUI-BRIA_AI-RMBG/RMBG-1.4/model.pth",
                url="https://huggingface.co/andrey18106/vix_models/resolve/main/RMBG-1.4/model.pth",
                homepage="https://huggingface.co/briaai/RMBG-1.4",
                hash="893c16c340b1ddafc93e78457a4d94190da9b7179149f8574284c83caebf5e8c",
            ),
        ],
    },
}    

Therefore, this PR takes a list of nodes loaded into ComfyUI, searches for matches, and gets a list of AIResourceModel at the output and adds it to the flow models.

  1. This will allow a much more accurate representation of which models are used (for example, ComfyUI-BRIA_AI-RMBG has a Not-Commercial license)
  2. Also, now these models will only be downloaded when installing flow (previously they were downloaded after installing the node) - this will reduce the size of the Zip archive for Windows by ~500 megabytes (140 MB BRIA_AI-RMBG + 360 megabytes antelopev2.zip for InSightFace)
  3. This will allow us to add new background removal node, that needs model and we will not increase the overall size of the windows archive =)

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
@bigcat88 bigcat88 requested a review from andrey18106 August 25, 2024 14:15
Copy link
Contributor

@andrey18106 andrey18106 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bigcat88 bigcat88 merged commit 9106d5d into main Aug 25, 2024
11 checks passed
@bigcat88 bigcat88 deleted the feat/nodes-models-to-flow-models branch August 25, 2024 14:31
@bigcat88 bigcat88 mentioned this pull request Sep 1, 2024
bigcat88 added a commit that referenced this pull request Sep 1, 2024
The hardest part is behind us, we were able to update and fix all the
flows broken after PR 2666 from the ComfiUI repo.

Also, the basic work on supporting inpainteng was done, although there
is still a lot missing - it already works and can be used. Great!

* #151
* #148
* #149

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants