mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-05 23:50:08 +00:00
initial download-folder-selector interface (#890)
* initial download-folder-selector interface * use primevue select * add a folder select visibility checkbox * slightly reduce indirection * fix up select box updating * revert bad upstream changes * cleanup * allow localhost sourced models in ui side (for testing purposes only basically, but does no harm in deployed envs) * add screenshot expectations to test * Update test expectations [skip ci] * add testing of folder select * fix test * don't exclude folder selector when there's only 1 since the checkbox covers that better anyway * oo - fix checkbox * Update test expectations [skip ci] * testing - don't expect screenshots :( * experimental new test code * toHaveClass is silly * add // comments documenting intent of allowedSources --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
committed by
Chenlei Hu
parent
30469a6d88
commit
35a7c81fd8
@@ -396,7 +396,8 @@ class ComfyApi extends EventTarget {
|
||||
url: string,
|
||||
model_directory: string,
|
||||
model_filename: string,
|
||||
progress_interval: number
|
||||
progress_interval: number,
|
||||
folder_path: string
|
||||
): Promise<DownloadModelStatus> {
|
||||
const res = await this.fetchApi('/internal/models/download', {
|
||||
method: 'POST',
|
||||
@@ -407,7 +408,8 @@ class ComfyApi extends EventTarget {
|
||||
url,
|
||||
model_directory,
|
||||
model_filename,
|
||||
progress_interval
|
||||
progress_interval,
|
||||
folder_path
|
||||
})
|
||||
})
|
||||
return await res.json()
|
||||
@@ -716,6 +718,10 @@ class ComfyApi extends EventTarget {
|
||||
async getLogs(): Promise<string> {
|
||||
return (await axios.get(this.internalURL('/logs'))).data
|
||||
}
|
||||
|
||||
async getFolderPaths(): Promise<Record<string, string[]>> {
|
||||
return (await axios.get(this.internalURL('/folder_paths'))).data
|
||||
}
|
||||
}
|
||||
|
||||
export const api = new ComfyApi()
|
||||
|
||||
@@ -2189,10 +2189,11 @@ export class ComfyApp {
|
||||
})
|
||||
}
|
||||
|
||||
showMissingModelsError(missingModels) {
|
||||
showMissingModelsError(missingModels, paths) {
|
||||
if (useSettingStore().get('Comfy.Workflow.ShowMissingModelsWarning')) {
|
||||
showMissingModelsWarning({
|
||||
missingModels,
|
||||
paths,
|
||||
maximizable: true
|
||||
})
|
||||
}
|
||||
@@ -2414,7 +2415,8 @@ export class ComfyApp {
|
||||
this.showMissingNodesError(missingNodeTypes)
|
||||
}
|
||||
if (missingModels.length && showMissingModelsDialog) {
|
||||
this.showMissingModelsError(missingModels)
|
||||
const paths = await api.getFolderPaths()
|
||||
this.showMissingModelsError(missingModels, paths)
|
||||
}
|
||||
await this.#invokeExtensionsAsync('afterConfigureGraph', missingNodeTypes)
|
||||
requestAnimationFrame(() => {
|
||||
|
||||
Reference in New Issue
Block a user