-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Draft] Model library sidebar tab #837
Conversation
in-progress
(incomplete list atm)
src/App.vue
Outdated
@@ -100,6 +101,14 @@ const init = () => { | |||
component: markRaw(NodeLibrarySidebarTab), | |||
type: 'vue' | |||
}) | |||
app.extensionManager.registerSidebarTab({ | |||
id: 'model-library', | |||
icon: 'pi pi-folder-open', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably pick another icon. Maybe pi-box
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah wasn't sure what icon would work here. Swapped to box
const children = node.children?.map(fillNodeInfo) | ||
const model: ComfyModelDef | null = | ||
node.leaf && node.data ? node.data : null | ||
if (model && model.name.startsWith('\0')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a isLoading
getter on ComfyModel
should make logic here more explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ngl every version of this code will be a hack other than directly adding the loading entry to the tree instead of passing a fake def, but that adds significant code complexity for the sake of dodging the hack.
But yeah I'll add a bool on the modeldef to at least mark it a bit more properly than this nullchar indicator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary adding a new field, you just need to add a getter that returns the expression model.name.startsWith('\0')
@mcmonkey4eva Gentle ping on the investigation of why calling |
In the current case I saw the other day and showed in that gif, I believe it may actually just be (well it will be slow if you have a lot of models but when I'm not on a laptop in tokyo I'll do some loadtesting and PR some aggro caching to comfy core, and maybe some fancy fastloading of file data too if python will let me get away with it) |
based on node preview code
added a partial revert of 5a5a69d which was submitted directly to main without review and shockingly enough broke things |
Can you explain why the revert is necessary? |
Retargeted at dev1.3 per request in today's sync, seems to be working as intended locally |
* basic/empty model library sidebar tab in-progress * make it actually list out models * extremely primitive search impl * list out available folders (incomplete list atm) * load list dynamically * nice lil loading icon * that's not doing anything * run autoformatter * fix up some absolute vue shenanigans * swap to pi-box * is_fake_object * i think apply the tailwind thingo * trim '.safetensors' from end of display title * oop * after load, retain title if no new title is given * is_load_requested to prevent duplication * dirty initial model metadata load & preview based on node preview code * update model store tests * initial image icon for model lib * i hate this * better empty spacer * add api handler for '/models' * load model folders list instead of hardcoding * add a 'no content' placeholder for empty folders * autoformat * autoload model metadata * error handling on metadata loading * larger model icons * click a model to spawn a node for it * draggable model nodes * add a setting for whether to autoload or not * autoformat will be the death of me * cleanup promise code * make the model preview actually half-decent * revert bad unchecked change * put registration back
* basic/empty model library sidebar tab in-progress * make it actually list out models * extremely primitive search impl * list out available folders (incomplete list atm) * load list dynamically * nice lil loading icon * that's not doing anything * run autoformatter * fix up some absolute vue shenanigans * swap to pi-box * is_fake_object * i think apply the tailwind thingo * trim '.safetensors' from end of display title * oop * after load, retain title if no new title is given * is_load_requested to prevent duplication * dirty initial model metadata load & preview based on node preview code * update model store tests * initial image icon for model lib * i hate this * better empty spacer * add api handler for '/models' * load model folders list instead of hardcoding * add a 'no content' placeholder for empty folders * autoformat * autoload model metadata * error handling on metadata loading * larger model icons * click a model to spawn a node for it * draggable model nodes * add a setting for whether to autoload or not * autoformat will be the death of me * cleanup promise code * make the model preview actually half-decent * revert bad unchecked change * put registration back
* basic/empty model library sidebar tab in-progress * make it actually list out models * extremely primitive search impl * list out available folders (incomplete list atm) * load list dynamically * nice lil loading icon * that's not doing anything * run autoformatter * fix up some absolute vue shenanigans * swap to pi-box * is_fake_object * i think apply the tailwind thingo * trim '.safetensors' from end of display title * oop * after load, retain title if no new title is given * is_load_requested to prevent duplication * dirty initial model metadata load & preview based on node preview code * update model store tests * initial image icon for model lib * i hate this * better empty spacer * add api handler for '/models' * load model folders list instead of hardcoding * add a 'no content' placeholder for empty folders * autoformat * autoload model metadata * error handling on metadata loading * larger model icons * click a model to spawn a node for it * draggable model nodes * add a setting for whether to autoload or not * autoformat will be the death of me * cleanup promise code * make the model preview actually half-decent * revert bad unchecked change * put registration back
@807502278 no it's not through the internet, it's the metadata in the header of the model file - so whatever title pops up is what the author typed in as the title at some point, and has been sitting inside your model the entire time you've had it. Re showing the raw filename as an option instead of title, that's added in this pending PR: #1005 In the coming future we'll add tools to edit metadata freely, in the meantime you can use SwarmUI to edit the metadata (also the swarmui downloader can autoload better metadata from civit than what's baked into models by default if you give it a url) |
Thanks for telling me. It turns out to be the read model metadata. For each model I downloaded, the url and preview image are saved. I am very much looking forward to a tool that can freely edit metadata : ) |
Opening a draft PR for @huchenlei 's visibility and comments
This PR adds a sidebar tab to list and manage available models
Current State
TODO
Load model thumbnail if available and render it (rather than just a lil file icon)maybe hide the.safetensors
for cleanlinessAdd a preview view on hover, like the node preview, but showing the model's metadataMake it possible to drag the models out to nodespossibly a registry/store of x model type yields y node type? The core models are easy but needs an accessible storage API so custom nodes can register their own model types are handled in specific waysactually pull a proper list of folder types from upstream (currently hardcoded to the most common core types)(needs comfy API update either way)waiting on Add route to list model types comfyanonymous/ComfyUI#4846Maybe Todo Now Or Later
(Things that either can be in this PR or a followup)
Definitely Not Todo In This PR