-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moving models download settings to user settings. #3216
base: main
Are you sure you want to change the base?
Conversation
src/constants/coreSettings.ts
Outdated
id: 'Comfy.ModelLibrary.AllowedSources', | ||
category: ['Comfy', 'Model', 'Download'], | ||
name: 'Model Download Allowed Sources', | ||
type: 'hidden', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There does not seem to exists an array type so relying on hidden for now. I don't think allowing configuration in Interface brings a lot of value
src/constants/coreSettings.ts
Outdated
defaultValue: [ | ||
'https://civitai.com/', | ||
'https://huggingface.co/', | ||
'http://localhost:' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be added only if current domain is localhost ? It would be safer no ?
ff613ca
to
bf0df5c
Compare
const allowedSources = await settingsStore.get('Comfy.ModelLibrary.AllowedSources') | ||
const allowedSuffixes = await settingsStore.get('Comfy.ModelLibrary.AllowedSuffixes') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove the await
. Using await
in top level of the script makes it so the setup function returns a Promise.
Edit: Sorry, didn't see it was still a draft PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, I was still testing and doing changes.
Should be ok now, please tell me if you see any issue or suggestion
bf0df5c
to
a0888d9
Compare
I am not sure what kind of tests could be added. Do you see any or is it ok without additional tests ? |
d3d4e36
to
edfbcf5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for some context:
Originally I changed these hardcoded values to user settings, but they are reverted in https://github.com/Comfy-Org/ComfyUI_frontend/pull/890/files#r1772680306 with this TODO. The original idea for this TODO is to serve the allowed values from the backend server via server configuration rather than a value that the user can control.
@mcmonkey4eva for explaining what needs to be done here to resolve the TODO.
Ref: #890 (comment)
Thank you for the feedback. I tried to follow what I understood from the discussion intention. |
ea3e346
to
bead8a6
Compare
bead8a6
to
ec2731a
Compare
ec2731a
to
df1055c
Compare
The download restrictions (last I looked at things some months ago) are defined in ComfyUI (the python code repo), the frontend is merely just prerendering what the python is going to say about it -- so the values should be sourced from the python repo (eg a consistent internal API). Frontend settings make no sense for that data. Frontend hardcoding is a lazy but functional placeholder. |
BTW, the model downloading logic has been removed from the comfyui backend, the download for standalone is just using browser's download to download the model file. Download to directory directly feature is only available on desktop version. I think it is fine now to have the validation in the frontend only. |
Thank you for the info. I could not find a reference to this whitelist in the Comfy repo so I added a configuration and internal for it as you suggested. |
I see. |
My comments in the code there are outdated to the modern system per huchenlei's explanation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM on proceeding with orginal implementation of moving allow list to user settings.
I would like to be able to customize the download urls for comfy to whitelist new models servers.
I saw there was a todo in the front end part suggesting to do this change in particular so I decided to do it.
It should be completely transparent for user, just allow to customize the comfy.settings.json to have a custom option in case it needs to be changed.
I didn't find any relevant unit test to add, but please tell me if you think there should be one (both the modal and settings are already tested.)
┆Issue is synchronized with this Notion page by Unito