mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 07:00:23 +00:00
initial model store (#674)
* initial model store * refactor the 'modelstoreserviceimpl' to pinia * pepper in some reactive the inner ModelStore (per-folder) can't be pinia because its made of temporary instances, but it can be reactive * use refs in metadata class * remove 'reactive' * remove ref too * add simple unit tests for modelStore * make things worse via autoformatting * move mock impls to a function
This commit is contained in:
committed by
GitHub
parent
6c7fb5041d
commit
060e61f0db
@@ -343,6 +343,19 @@ class ComfyApi extends EventTarget {
|
||||
return await res.json()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the metadata for a model
|
||||
* @param {string} folder The folder containing the model
|
||||
* @param {string} model The model to get metadata for
|
||||
* @returns The metadata for the model
|
||||
*/
|
||||
async viewMetadata(folder: string, model: string) {
|
||||
const res = await this.fetchApi(
|
||||
`/view_metadata/${folder}?filename=${encodeURIComponent(model)}`
|
||||
)
|
||||
return await res.json()
|
||||
}
|
||||
|
||||
/**
|
||||
* Tells the server to download a model from the specified URL to the specified directory and filename
|
||||
* @param {string} url The URL to download the model from
|
||||
|
||||
Reference in New Issue
Block a user