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

Save previews as jpeg instead of as png? #97

Open
minogora opened this issue Apr 12, 2024 · 3 comments
Open

Save previews as jpeg instead of as png? #97

minogora opened this issue Apr 12, 2024 · 3 comments

Comments

@minogora
Copy link

I feel it would make more sense for the helper to store downloaded preview images with a jpeg extension instead of with a png extension. As the README states, automatic1111 will select to display a "model.preview.png" before a "model.jpeg" if both exist.

I have set automatic1111 to always save generated images as jpeg in order to keep file sizes down. This means when I generate my own preview for a model, it becomes "model.jpeg" and is never shown. It would make more sense for user generated preview images to be preferred over default downloaded ones and storing downloaded previews with a jpeg extension would solve that.

@zixaphir
Copy link
Owner

model.png should also display before model.preview.png. The file extension honestly doesn't matter, and I believe that Civitai serves jpeg files automatically now. It's just a filename and honestly the only reason they're named png instead of jpeg is because it's how the extension has always named them. Most software, including webui, don't care about the file extension and instead process the image based on the file header.

I might change this behavior because it's honestly very silly to intentionally use the wrong extension, but it should have no effect on what preview loads first.

@minogora
Copy link
Author

It does affect the display priority though. When automatic1111 is set to save generated images as jpeg, and I update the preview for a lora, if there is already a png preview downloaded from civitai, then the png preview will be shown.

Here is an example; I have these files for a model:

image

Porcelain_v1_R128.preview.png was downloaded by this extension, and is still displayed as the preview for the lora even after I generated an image and selected to replace the preview. This is because I have automatic1111 set to save images in jpeg format and then my replacement preview becomes Porcelain_v1_R128.jpeg. Automatic1111 does not prioritize model.jpeg over model.preview.png; it seems to pick the first match out of model.png, model.preview.png, model.jpeg, model.preview.jpeg.

This is not desired behaviour; if I select to replace the preview I obviously want to see my own generated image as the preview for the lora.

@zixaphir
Copy link
Owner

I double checked and you are correct. I'll see about changing the behavior on this side to deprioritize our previews, but I also consider this a bug in webui so I might try to fix it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants