@@ -41,20 +41,7 @@ import NoResultsPlaceholder from '@/components/common/NoResultsPlaceholder.vue'
41
41
import { useSettingStore } from ' @/stores/settingStore'
42
42
import { isElectron } from ' @/utils/envUtil'
43
43
44
- // TODO: Read this from server internal API rather than hardcoding here
45
- // as some installations may wish to use custom sources
46
- const allowedSources = [
47
- ' https://civitai.com/' ,
48
- ' https://huggingface.co/' ,
49
- ' http://localhost:' // Included for testing usage only
50
- ]
51
- const allowedSuffixes = [' .safetensors' , ' .sft' ]
52
- // Models that fail above conditions but are still allowed
53
- const whiteListedUrls = new Set ([
54
- ' https://huggingface.co/stabilityai/stable-zero123/resolve/main/stable_zero123.ckpt' ,
55
- ' https://huggingface.co/TencentARC/T2I-Adapter/resolve/main/models/t2iadapter_depth_sd14v1.pth?download=true' ,
56
- ' https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth'
57
- ])
44
+ const settingsStore = useSettingStore ()
58
45
59
46
interface ModelInfo {
60
47
name: string
@@ -79,6 +66,14 @@ const doNotAskAgain = ref(false)
79
66
80
67
const modelDownloads = ref <Record <string , ModelInfo >>({})
81
68
const missingModels = computed (() => {
69
+ // Custom models sources, extension and whitelist can be customized in user settings.
70
+ const allowedSources = settingsStore .get (' Comfy.ModelLibrary.AllowedSources' )
71
+ const allowedSuffixes = settingsStore .get (
72
+ ' Comfy.ModelLibrary.AllowedSuffixes'
73
+ )
74
+ const whiteListedUrls = new Set (
75
+ settingsStore .get (' Comfy.ModelLibrary.WhitelistedUrls' )
76
+ )
82
77
return props .missingModels .map ((model ) => {
83
78
const paths = props .paths [model .directory ]
84
79
if (model .directory_invalid || ! paths ) {
0 commit comments