-
Notifications
You must be signed in to change notification settings - Fork 22
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
Failed to download model! #18
Comments
Yes, I encountered this yesterday. I think I fixed it on my dev fork. I think it only affects content above the PG rating. |
Thanks. I think it's not only the model rating, but as far as I know, authors can close downloads without authorization. For example, I can't download this model. |
Yeah, I was testing, and there was another model that refused to locate the model. What I'm going to try to do next is to route the model info request through the server, since it has the API key. |
Speaking of me, I have no problem downloading the models themselves from the site, but I would find it more convenient to collect all the information about the model through this extension. |
The main reason I did not add it before, is that a full scan would be really slow. However, since you asked, I can add both a single and a full scan. |
On the original issue, I am able download the model you linked. (The separate problem I was running into was a gguf file was zipped.) In the model manager node folder, have you tried putting your api key in the |
Thank you! That would be great!
For some reason I didn't know anything about the API key before your question. I added my key in the server_settings.yaml and the problem with downloading models is gone. Thank you! I also found that some models are downloaded with metadata and some are not, is this the way it should be? |
It should download as long as you check the "Save Notes." checkbox at the top of the download tab. In the settings tab, you can set this to on by default with by checking "Save notes by default." |
Got it, thanks! And if possible, please add a button to open the model page on Civitai. |
Sure thing. |
After checking if “Save notes by default.” is enabled in the settings and "Save Notes" on the download page, I downloaded several models, but still not all models have the “Metadata” tab after downloading. For example, these models: |
The metadata tab is hidden if no embedded metadata was detected in the model. |
- See here for discussion: hayden-fr#18 - Added python requirement.
Okay, I've pushed some changes to my dev fork. There are two new buttons: (1) Try to open model url (I added an option in the settings to show the button also on the preview in model search grid) and (2) try to download model info from the web. Also, I added a python dependency, so you will need to make sure it is installed. I did not add a bulk scan functionality, as I am still debating if I should really add it, since a server could theoretically ban someone for automatically scraping a bunch of data all at once. |
Hmm, after updating dev Fork, “Model” button in ComfyUI is not showing up. As far as I understand, Civitai can temporarily block access to the site in case of excessive loading, but it will not ban. Through Civitai Helper I have scanned my entire library (about 900 Lora,150 checkpoints and 170 embeddings) and have not encountered with any bans or blocking. |
Again, did you install the new requirement? Otherwise, I need the command line error to debug it. |
Sorry, I install the requirements and the button appears. Unfortunately, the button to open the model page on Civitai doesn't work for me. When I press it, it turns to a gray color for a few seconds and then lights up red. There are no errors in the console after that. But in the console often (sometimes when trying to download models and sometimes for no clear reason) appears another warning:
I'm not sure what's causing this message. Button "download model info", downloads only the notes, but does not download the preview image. Is this how it should be? |
Strange. I'm not sure why the
The issue with automatically downloading preview images is that there are multiple, and the image list returned by the API may not be in the "correct" order, e.g. the first one may not be the author's preferred preview image (unless it has changed). Furthermore, I've had issues with using the Civitai API in the past failing to get the original full-resolution image. |
Okay, I pushed a fix for properly encoding the model path in url text (for example the character |
I'm sorry, I don't quite sure how I'm supposed to do this. What do you mean by “update the node” and “console in the web browser”? I have now completely reinstalled dev fork from scratch and so far everything is as it was, but I have figured out how to launch the page. If you just click on the Civitai open button, nothing happens, but if you click on that button and then immediately click several times (4 times for example) on the info button, then the page will open. In the console [py.exe] does not write any messages, but the error message that I wrote before is also gone. |
Very strange... They should be unrelated. Did you restart ComfyUI? |
Many times. Installed the latest version and I reinstalled requirements.txt once again. This button behaves very unpredictably. Now I tried after the restart to do the same thing I showed in the gif, and it doesn't react at all now. Another time it opened the Civitai page for me after a minute of waiting, but then it stopped doing that. And the python command line doesn't show any errors. |
I am assuming there is something wrong with my logic with handling the operating system file paths or the browser. Can you say what operating system ComfyUI is running on? Also, I pushed an update printing the bad url for the failed |
I am using Windows 10 Home x64 Reinstalled dev fork, now the first time click on the button it shows this message:
|
This is helpful. It should be I'll have a look over the code to see why this is happening.
I'm using Windows 11, so maybe that's not the issue. Is your browser up-to-date? I am using Chrome. |
I use two browsers, Vivaldi (Chromium based) and Firefox. Both the latest version. I have now checked both and the same message that I wrote earlier comes up. |
I'm sorry this is getting dragged out. I am still having trouble reproducing the issue on my end, which is making it difficult to locate the problem. I made a few small changes, but I don't know if they changed anything.
|
No problem. :) I recorded a short video (if you have two monitors, it can be stretched to one and a half that would better read the text).
Which folders and files are you interested in? Where are the models located, or the extension?
I'm not quite sure what caused it.
The video will be deleted automatically after 60 minutes. |
Okay, from your video, it appears it appears everything is working normally. It must be something really minor. The reason I asked if popups were blocked and if it was happening with every model, is I noticed popups were blocked by other browsers I tested. I assume when hashing a checkpoint file, which is large and therefore slow, it takes suspiciously too long for the browser. Just to confirm, does opening the external link not work with small LoRAs or text embedding files? Does it work if you allow popups or disable any ad-blocker? Also, in you're video didn't have the ComfyUI command line at the bottom and it didn't scroll with it, so I couldn't see if there were any ComfyUI server errors. Are there any abnormal errors there? |
I turned off the ad blocker and when I clicked on the button, browser asked me to allow Civitai popups. After that, small files size started to open the page on Civitai faster and large files took longer.
Sorry, I didn't quite understand. Is this command line inside the Comfyui window itself, or do you mean at the bottom of the py.exe console window? While I was dealing with the blocker, several errors appeared in the [py.exe] console:
|
Yes, the ComfyUI command line I was referring to was in the py.exe.
Do the
For this error, are there any preview images are missing? Are there any obvious patterns, such as, they all end with ".png"? |
I think I may have figured out what is causing this error. This is the result of the "Imagus" browser extension. It shows a large resolution image in a popup window. |
Nice. I was able to reproduce it with Imagus. I'll see if I can fix the problem and then I'll get working on your request on batch scan/download notes. For batch scanning images, we'll have to see, since I've had problems getting full-sized images using the Civiatai image API. Again, not to mention this is more likely than notes to get flagged by the server. BTW, I pushed a change to the dev fork where, if opening a link in a new url is blocked, it will instead open a ComfyUI dialog with a clickable link. Not as pretty, but I think that problem is solved. |
I like this solution even better than the automatic window opening. (at least for the moment). The only problem I see so far is that when clicking on checkpoints with a size of about 6.62 GiB, it takes about one minute to prepare the link. |
Yes, I know it's slow. I may end up caching the hashes and/or urls. I have to take a bit of time to implement it correctly because the model files can be moved around which adds an extra wrinkle. Alternatively, I recall someone suggested saving Civitai model info next to the model, which could short-circuit the problem, but this requires a bit more thought to implement it, because it needs to work with any website and it needs to be friendly with any other applications that may be accessing the models. |
I fixed the issue with Imagus. It should work now. |
I'm not an expert in this, but the only thing I can imagine is to save all the technical information about the model including the link to the site into an existing text document with notes. If of course this is even possible. |
I was wondering if it would be possible to make model-manager, when saving information about a model, create one zip file that would store all information, notes and all images of the model, not just previews. Model-manager would simply view this zip file and show all its contents in its interface. |
I don't think there's a need to zip the resources. That seems more like an individual's responsibility and again I want to be compatible with other software out there for model management. (Model weights are generally noisy and not really compressible, but if they were (e.g. empty weights, specialized lossless compression algorithm), that seems outside the scope of this extension. Images are similar, but there are ways to compress them in a lossy way, which is closer but generally outside the scope of this extension. And, the text we are dealing with is small, so that does not need to be compressed.) But yes, I'm still working on saving the model urls and info. |
I pushed an update to download the website metadata and save it beside the model file. All new downloads will save it the first time. It will use the website metadata to find a link before trying to hash the model, which should speed up opening links on subsequent url openings. Now I can move onto scanning. |
I've pushed another update to save |
It works pretty well, but some models create links not to the Civitai overview page, but a link to download the model. As I understand, it occurs with models downloaded after the last update. For models downloaded before, link works correctly |
You're right. In the downloader, I was saving the file download link.
Correct. I think I fixed it, but you'll have to delete any bad |
Thanks! Model links work great now! |
Okay, I've added a scan function to scan all model directories and download and save model info, notes and url. Obviously, it will take a longer if there are big files (e.g. checkpoints) to hash and it will not cache failed searches, so avoid running it multiple times. I tested it on my files and fixed any crashes. |
Here's my solution for setting model previews individually within the model manager. You can read more here: #25 (comment) Again, I don't know if you want to do a scan, as that will select whatever. Note that the images that are found in the model info may not be full resolution or compressed (for example, jpeg instead of png). |
Here is the instructions for doing a scan to download model previews. Note that you must download model info first for it to work properly. |
I agree this is very important and I've looked into this problem in the past. However, I'm not aware of an easy solution. Reading metadata from files in bulk is SLOW and may be wrong. For example, the metadata produced by Ostris's Flux Dev lora trainer says the base model is "sd_1.5". And, what should be done for files where there are no hints about base model, or for model files that are not image diffusion models (unet, clip, LLMs, etc.)? What I do, and what I recommend doing, is to manually sort your models into folders by base model and keep them strictly organized. Doing this has the benifit that you can then search just that model file, for example, search only flux dev models with
Maybe I'm not understanding what you're asking for, but I feel this functionality is a bit specialized and I'd prefer to avoid overriding default ComfyUI behaviors. Also, if you have specific feature suggestions/requests, feel free to open a new issue so it is easier for everyone to keep track of. 😉 |
I tried downloading a few models, but got this message:
"Failed to download model!
Unable to download from Civitai! Redirect url: /login?returnUrl=%2Fmodel-versions%2F297334&reason=download-auth"
The text was updated successfully, but these errors were encountered: