Comfy-Org / Comfy-Org/ComfyUI_frontend

[Feature Request]: Move models metadata to nodes

Open
#2,661 1 comment 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues and checked the recent builds/commits

### What would your feature do ?

The models metadata is currently in the outermost scope of the workflow schema. Problems with this:

- There is not a system to persist workflow metadata, so it is lost as soon as the workflow is re-saved.
- It not accessible for use by custom node developers outside of making static example workflows. Majority of developers would prefer to attach this data on the node itself.
- It's difficult to track which model applies to which node widget, which can be an issue for maintainability longterm

### Proposed workflow

1. Write a custom node
2. Write an input that is a combo for a model
3. Attach the model metadata (name, url, directory) inside the input options dict like:
```python
class CheckpointLoaderSimple:
@classmethod
def INPUT_TYPES(s):
return {
"required": {
"ckpt_name": (
folder_paths.get_filename_list("checkpoints"),
{
"default": "v1-5-pruned-emaonly-fp16.safetensors",
"model": {
"name": "v1-5-pruned-emaonly-fp16.safetensors", # the download prompt will not re-appear if this value is not selected
"url": "https://huggingface.co/Comfy-Org/stable-diffusion-v1-5-archive/resolve/main/v1-5-pruned-emaonly-fp16.safetensors?download=true",
"directory": "checkpoints",
}
},
),
}
}
```

### Additional information

_No response_

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-2661-Feature-Request-Move-models-metadata-to-nodes-1a16d73d36508129aeb5ec2b1ef50115) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.