stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: Extra Networks does not show preview.png

Open acncagua opened this issue 2 years ago • 6 comments
trafficstars

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

Preview image is not displayed 2023-01-22

Steps to reproduce the problem

1.Place LoRA-test1.safetensors, LoRA-test2.safetensors, LoRA-test1.preview.png in the /mnt/r/data_model/LoRA folder. 2. Click the Extra Networks button. 3.Click the LoRA tab 4.LoRA-test1 becomes white

What should have happened?

LoRA-test1 should display the LoRA-test1.preview.png image

Commit where the problem happens

f2eae6127d16a80d1516d3f6245b648eeca26330

What platforms do you use to access UI ?

Linux

What browsers do you use to access the UI ?

Microsoft Edge

Command Line Arguments

--administrator --xformers --opt-channelslast --lora-dir /mnt/r/data_model/LoRA/

Additional information, context and logs

2023-01-22 (1)

acncagua avatar Jan 22 '23 04:01 acncagua

I've had this issue as well but on windows, I thought it was the default and would be added in later until I saw screenshots that showed the tab having working previews. Has anyone come up with a solution or discovered a cause? It would be useful to have images so I don't have to remember the names of each Lora, embedding, hypernet and there styles to plan what I want to generate

springheeledjack66 avatar Feb 04 '23 20:02 springheeledjack66

I just ran into the same issue, and thought that either my Loras had no previews, or the preview was not actually implemented yet.

ghostsquad avatar Feb 09 '23 10:02 ghostsquad

Experiencing the same issue on Windows 11, Chrome, here after an extended bit of time. Our team here hasn't found a fix for the PNG preview. However it doesn't seem to hinder the effect or viability of the LORA in the prompt. Still, if anyone ended up figuring out a fix, an update would be great.

SwissCakeRowl avatar Mar 04 '23 05:03 SwissCakeRowl

You can work around this by storing a PNG file with the same name as the network and refresh the view. Works for checkpoints and LORA, but I haven't tested with the others as I don't have any installed...

brainbent avatar Mar 10 '23 04:03 brainbent

It seems updating the function link_preview of ExtraNetworksPage in modules/ui_extra_network.py can work for my environment (windows 11, chrome).

The original function is like:

def link_preview(self, filename):
        return "./sd_extra_networks/thumb?filename=" + urllib.parse.quote(filename.replace('\\', '/')) + "&mtime=" + str(os.path.getmtime(filename))

The updated function is like:

def link_preview(self, filename):
        return "./file=" + urllib.parse.quote(filename.replace('\\', '/'))

This approach is not a good fix but it works for me.

jzzhang8 avatar Mar 14 '23 19:03 jzzhang8

It seems updating the function link_preview of ExtraNetworksPage in modules/ui_extra_network.py can work for my environment (windows 11, chrome).

The original function is like:

def link_preview(self, filename):
        return "./sd_extra_networks/thumb?filename=" + urllib.parse.quote(filename.replace('\\', '/')) + "&mtime=" + str(os.path.getmtime(filename))

The updated function is like:

def link_preview(self, filename):
        return "./file=" + urllib.parse.quote(filename.replace('\\', '/'))

This approach is not a good fix but it works for me.

It works, thanks!! As long PNG same LORA name in same folder. 👍😍

teelip avatar Apr 15 '23 06:04 teelip

I'm presently having this issue. If anyone else is, the above @jzzhang8 edit still works.

aleph23 avatar Mar 24 '24 16:03 aleph23