Skip to content

Commit d3d4e36

Browse files
committed
Ensuring localhost models dource is only added when hostname is localhost.
1 parent 5a3ee44 commit d3d4e36

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Diff for: src/components/dialog/content/MissingModelsWarning.vue

+4-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ const doNotAskAgain = ref(false)
6767
const modelDownloads = ref<Record<string, ModelInfo>>({})
6868
const missingModels = computed(() => {
6969
// Custom models sources, extension and whitelist can be customized in user settings.
70-
const allowedSources = settingsStore.get('Comfy.ModelLibrary.AllowedSources')
70+
let allowedSources = settingsStore.get('Comfy.ModelLibrary.AllowedSources')
71+
if (location.hostname === 'localhost' || location.hostname === '127.0.0.1') {
72+
allowedSources.push('http://localhost:')
73+
}
7174
const allowedSuffixes = settingsStore.get(
7275
'Comfy.ModelLibrary.AllowedSuffixes'
7376
)

Diff for: src/constants/coreSettings.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -750,11 +750,7 @@ export const CORE_SETTINGS: SettingParams[] = [
750750
category: ['Comfy', 'Model', 'Download'],
751751
name: 'Model Download Allowed Sources',
752752
type: 'hidden',
753-
defaultValue: [
754-
'https://civitai.com/',
755-
'https://huggingface.co/',
756-
'http://localhost:'
757-
],
753+
defaultValue: ['https://civitai.com/', 'https://huggingface.co/'],
758754
versionAdded: '1.16.0'
759755
},
760756
{

0 commit comments

Comments
 (0)