Skip to content
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

Converted checkpoint models redownload after clearing files from cache #398

Closed
bzlibby opened this issue Jul 10, 2023 · 2 comments · Fixed by #430
Closed

Converted checkpoint models redownload after clearing files from cache #398

bzlibby opened this issue Jul 10, 2023 · 2 comments · Fixed by #430
Labels
scope/api scope/convert status/fixed issues that have been fixed and released type/bug broken features
Milestone

Comments

@bzlibby
Copy link
Contributor

bzlibby commented Jul 10, 2023

After removing the safetensors files for my already converted checkpoint models from my cache folder, they were all re-downloaded the next time I started my local server. Once the safetensor file was re-downloaded to cache, logs indicate that the already existing converted model was recognized and conversion was skipped:

[2023-07-10 16:50:51,349] INFO: MainProcess MainThread __main__: downloading model from Civitai: https://civitai.com/api/download/models/97123 -> D:\onnx-web\models\.cache\diffusion-occidentalmix.safetensors
100%|████████████████████████████████████████████████████████████████████████████████████████| 1.99G/1.99G [08:45<00:00, 4.06MB/s]
[2023-07-10 16:59:47,852] INFO: MainProcess MainThread onnx_web.convert.diffusion.diffusers: converting Stable Diffusion model diffusion-occidentalmix: D:\onnx-web\models\.cache\diffusion-occidentalmix.safetensors -> D:\onnx-web\models\diffusion-occidentalmix/
[2023-07-10 16:59:47,853] INFO: MainProcess MainThread onnx_web.convert.diffusion.diffusers: ONNX model already exists, skipping

The models work as expected once the server is running, but it does mean that my cache folder is taking up a significant amount of space on my drive, which was my reason for deleting the files in the first place. Removing the already-converted models from the extras JSON file gets around this.

I haven't tested this with LoRas or inversions yet, but I'll update once I get the chance to with what I find.

@ssube ssube added this to the v0.10 milestone Jul 13, 2023
@ssube ssube added status/new issues that have not been confirmed yet type/bug broken features scope/convert scope/api labels Jul 13, 2023
@ssube
Copy link
Owner

ssube commented Jul 13, 2023

Once diffusion models have been converted, you should not need the original safetensors file or the temporary -torch folder, so that seems like a bug between the download code and conversion code.

You do need the safetensors for LoRAs and TIs, because they are never converted, but those are much smaller.

@ssube ssube modified the milestones: v0.10, v0.11 Dec 3, 2023
@ssube ssube mentioned this issue Dec 10, 2023
3 tasks
@ssube ssube reopened this Dec 10, 2023
@ssube ssube added status/progress issues that are in progress and have a branch and removed status/new issues that have not been confirmed yet labels Dec 10, 2023
@ssube
Copy link
Owner

ssube commented Dec 10, 2023

This should be fixed and will be in the v0.11 release. If the ONNX model directory already exists, the conversion code will not fetch the source tensor.

There is one case where that can still break: if you run out of disk while converting a model but after the ONNX model's folder has been created, you can end up with a partial model. In that case, delete the failed conversion's folder and run it again after ensuring you have enough space for the torch intermediates and ONNX output.

@ssube ssube added status/fixed issues that have been fixed and released and removed status/progress issues that are in progress and have a branch labels Dec 10, 2023
@ssube ssube closed this as completed Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope/api scope/convert status/fixed issues that have been fixed and released type/bug broken features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants