Proposal: Storing Model Information in Workflow JSON #3717
robinjhuang
started this conversation in
Ideas
Replies: 2 comments 4 replies
-
This proposal came out of the node-standard discussions at the Comfy Leadership Summit last month. Let me know if there are better solutions for any of the approaches, or if this is a bad idea altogether. |
Beta Was this translation helpful? Give feedback.
4 replies
This comment was marked as spam.
This comment was marked as spam.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem
The workflow json is the primary way ComfyUI workflows are shared online. When dragging in a workflow, it is sometimes difficult to know exactly which model was used in the workflow.
Knowing the exact model that was used can be crucial for reproducing the result in the workflow output.
Proposed Enhancement
Capture the model information directly in the workflow json.
Saving the URL
Goal: Save download url for each model file.
Save a parallel model file under
model-name.json
. This idea is stolen from StableSwarm (thank you @mcmonkey4eva). The benefits of having a parallel file is that if a user moves/renames a model file, they will see the parallel file and move it as well.ComfyUI Manager / CLI
ComfyUI Manager and
comfy-cli
should create a parallel model file when they are used to download a model.Getting the Hash
We can calculate it locally. Took me 30s for a 4.5GB model file on a m1pro macbook. We can prompt users if they want to include it or add an optional in settings to opt-in/out.
Approach 1: Calculate hash at import time
As soon as the model is moved into the models folder, calculate the hash. Calculating the hash is CPU-only, so should not impact workflow generation speeds.
Approach 2: Calculate hash at export time
Ask the user if they want to include model hash when exporting the workflow and then calculate them.
Exporting Workflow JSON
When exporting the workflow json, Comfy can reference the parallel model file to check the model metadata.
Unresolved Problems
Beta Was this translation helpful? Give feedback.
All reactions