From 0c8bfb465046d0591752e61ec32a6b195df9b9e1 Mon Sep 17 00:00:00 2001 From: bymyself Date: Sun, 16 Feb 2025 06:42:50 -0700 Subject: [PATCH] Add stable zero model url to whitelist (#2577) --- .../dialog/content/MissingModelsWarning.vue | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/components/dialog/content/MissingModelsWarning.vue b/src/components/dialog/content/MissingModelsWarning.vue index 7ca1f2b20a..1430a54f4b 100644 --- a/src/components/dialog/content/MissingModelsWarning.vue +++ b/src/components/dialog/content/MissingModelsWarning.vue @@ -49,6 +49,10 @@ const allowedSources = [ 'http://localhost:' // Included for testing usage only ] const allowedSuffixes = ['.safetensors', '.sft'] +// Models that fail above conditions but are still allowed +const whiteListedUrls = new Set([ + 'https://huggingface.co/stabilityai/stable-zero123/resolve/main/stable_zero123.ckpt' +]) interface ModelInfo { name: string @@ -93,18 +97,20 @@ const missingModels = computed(() => { folder_path: paths[0] } modelDownloads.value[model.name] = downloadInfo - if (!allowedSources.some((source) => model.url.startsWith(source))) { - return { - label: `${model.directory} / ${model.name}`, - url: model.url, - error: `Download not allowed from source '${model.url}', only allowed from '${allowedSources.join("', '")}'` + if (!whiteListedUrls.has(model.url)) { + if (!allowedSources.some((source) => model.url.startsWith(source))) { + return { + label: `${model.directory} / ${model.name}`, + url: model.url, + error: `Download not allowed from source '${model.url}', only allowed from '${allowedSources.join("', '")}'` + } } - } - if (!allowedSuffixes.some((suffix) => model.name.endsWith(suffix))) { - return { - label: `${model.directory} / ${model.name}`, - url: model.url, - error: `Only allowed suffixes are: '${allowedSuffixes.join("', '")}'` + if (!allowedSuffixes.some((suffix) => model.name.endsWith(suffix))) { + return { + label: `${model.directory} / ${model.name}`, + url: model.url, + error: `Only allowed suffixes are: '${allowedSuffixes.join("', '")}'` + } } } return {