realpath to abspath, update readme

pull/8/head
AlUlkesh 2023-01-26 08:51:03 +01:00
parent 35bef97243
commit 402c1addba
2 changed files with 17 additions and 14 deletions

View File

@ -1,14 +1,17 @@
# stable-diffusion-webui-images-browser
## stable-diffusion-webui-images-browser
This an extension for [stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui)
A custom extension for [AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui).
This an images browser for browsing past generated pictures, view their generated infomations, send the prompt to txt2img or img2img, collect images to your "favorites" folder, delete the images you no longer need, and you can also browse images in any folders on your computer.
![image](https://s6.jpg.cm/2022/10/24/PJjuZt.png)
This is an image browser for browsing past generated pictures, view their generated informations, send that information to txt2img, img2img and others, collect images to your "favorites" folder and delete the images you no longer need.
go to the directory \<stable-diffusion-webui project path\>/extensions and run command to install:
## Installation
`git clone https://github.com/yfszzx/stable-diffusion-webui-images-browser `
The extension can be installed directly from within the **Extensions** tab within the Webui.
and restart your stable-diffusion-webui, then you can see the new tab "Images Browser"
You can also install it manually by running the following command from within the webui directory:
[See here for more install details](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Extensions)
git clone https://github.com/AlUlkesh/stable-diffusion-webui-images-browser/ extensions/stable-diffusion-webui-images-browser
## Credit
Credit goes above all to the original maintainer of this extension: https://github.com/yfszzx/stable-diffusion-webui-images-browser

View File

@ -130,9 +130,9 @@ def get_image_aesthetic_score(img_path):
def get_image_page(img_path, page_index, filenames, keyword, sort_by):
if not cmd_opts.administrator:
head = os.path.realpath(".")
real_path = os.path.realpath(img_path)
if len(real_path) < len(head) or real_path[:len(head)] != head:
head = os.path.abspath(".")
abs_path = os.path.abspath(img_path)
if len(abs_path) < len(head) or abs_path[:len(head)] != head:
warning = f"You have not permission to visit {img_path}. If you want visit all directories, add command line argument option '--administrator', <a style='color:#990' href='https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings'>More detail here</a>"
return None, 0, None, "", "", "", None, None, warning
if page_index == 1 or page_index == 0 or len(filenames) == 0:
@ -163,9 +163,9 @@ def change_dir(img_dir, path_recorder, load_switch, img_path_history):
warning = None
try:
if not cmd_opts.administrator:
head = os.path.realpath(".")
real_path = os.path.realpath(img_dir)
if len(real_path) < len(head) or real_path[:len(head)] != head:
head = os.path.abspath(".")
abs_path = os.path.abspath(img_dir)
if len(abs_path) < len(head) or abs_path[:len(head)] != head:
warning = f"You have not permission to visit {img_dir}. If you want visit all directories, add command line argument option '--administrator', <a style='color:#990' href='https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings'>More detail here</a>"
except:
pass