Fooocus icon indicating copy to clipboard operation
Fooocus copied to clipboard

added the download model from url feature

Open codezeros opened this issue 1 year ago • 9 comments

  • support all downloadable urls

Models can be downloaded simply by copying and pasting their URLs.

codezeros avatar Mar 03 '24 11:03 codezeros

preview

codezeros avatar Mar 03 '24 11:03 codezeros

General feedback: thank you for the implementation, this can be very useful if people don't know the file structure.

Code feedback:

* do not spam code comments for trivial things, as mentioned.

* do not autoformat whole files on existing projects, only your part of the implementation.

* add translations for every outpout, every message, etc. to en.json

* add argument for disabling the whole tab as not everyone wants/needs/allows users to download newc models, such as on hosted environments, as this may cause a huge increase in traffic (=> more costs) and may be abused, especially in a multi-user environment.

Looking forward to your adjustments.

@mashb1t thank you for your feedback i have now removed unnecessary comments and make the codebase simple and effective and we can set the path now directly in json config file instead of dynamically generate json on start of app each time run.

if there any other that need to improve feel free to tell me :)

codezeros avatar Mar 03 '24 18:03 codezeros

hi! if you can only download from civitAI you can get the filename and folder from the api. civitai provide array of files the first one is always the model file. the api also give you the model type you can select the folder based on the model type.

uptotec avatar Mar 04 '24 13:03 uptotec

hi! if you can only download from civitAI you can get the filename and folder from the api. civitai provide array of files the first one is always the model file. the api also give you the model type you can select the folder based on the model type.

@uptotec yes, for that we need to add store feature using civitai api but this is for downloading models directly into the application using url only also i have tested with huggingface and civitai urls and some other it works! without any issues but note that some model may have sign-in access restriction for those we can not download directly just with url alone

codezeros avatar Mar 04 '24 13:03 codezeros

@mashb1t i have modified according to your suggestion and also we can disable download tab using argument --disable-download-tab and also using checkbox in debug (still in progress any suggestions would help!) and added translation :)

codezeros avatar Mar 04 '24 15:03 codezeros

@codezeros thanks for the update, much appreciated. Will do the review during this week. I'm wondering, which benefit would it have to be able to toggle the tab in the developer debug settings?

mashb1t avatar Mar 04 '24 15:03 mashb1t

@codezeros thanks for the update, much appreciated. Will do the review during this week. I'm wondering, which benefit would it have to be able to toggle the tab in the developer debug settings?

image

@mashb1t i thought user can also disable the tab in fooocus itself to simply make the config easier for non-tech users which may help

codezeros avatar Mar 04 '24 15:03 codezeros

Some personal advice:

  1. You can list the fooocus's built-in model download links in downloadtab and add other backup download links. Select Download through the drop-down option to solve the problem of model download failure when fooocus is started.
  2. For Civitai, you can refresh the update of the model version

xhoxye avatar Mar 06 '24 00:03 xhoxye

That's enhancement is great! Thank you @codezeros

sd-jack avatar Jul 07 '24 13:07 sd-jack