Giter Site home page Giter Site logo

dr413677671 / promptgallery-stable-diffusion-webui Goto Github PK

View Code? Open in Web Editor NEW
146.0 7.0 15.0 1.24 MB

A prompt cookbook worked as stable-diffusion-webui extenstions.

License: Apache License 2.0

HTML 1.15% Python 98.85%
computer-vision deep-learning gan gradio image-generation stable-diffusion stable-diffusion-webui stable-diffusion-webui-plugin vuejs

promptgallery-stable-diffusion-webui's Introduction

Forks Stargazers Issues


Logo

Prompt Gallery

A prompt cookbook worked as stable-diffusion-webui extenstions.
Watch Demo »

Explore the docs · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. Contact
  6. Acknowledgments

About The Project

Please star the repo if you likes it :>

🐘 Good news: the extension now support webui dark theme.

Prompt Gallery works as a prompt-set library extension of stable-diffusion-webui. Stable-diffusion is an AI model which can generate illustration based on text-based prompts

The extension combined with four features:

  1. prompt-set library management
  2. preview pictures management
  3. select a combination of prompt-sets and generate illustration in webui
  4. avatar/character system

(back to top)

Getting Started

Prerequisites & Installation

  1. Install stable-diffusion-webui

  2. Edit webui-user.bat (Win) or webui-user.sh (Linux) with these arguments "--api --listen --cors-allow-origins http://localhost:5173"

install

  1. Start webui

  2. Install Prompt-gallery extension in Web-UI

4.1 Inout https://github.com/dr413677671/PromptGallery-stable-diffusion-webui.git in "URL for extension's git repository"

4.2 Input "Prompt Gallery" in Local directory name

install

Please refer to section Customized extension ip and port (optional) if you are using customized webui ip/port.

Usage

Restart webui. You should see a initial frontpage like this.

preset

There is no preview pictures. Prompt Gallery works like a framework. You need to create your own prompt-set library folloting by two steps:

  1. edit your prompt-set dictionary
  2. generate preview pictures for prompt-sets

Please follow the instructions below to build your own prompt-set library: Alternatively you could watch the video tutorial: View Demo

Build prompt-set library

Definition of avatars.yaml:

value negative param
Positive prompts Negative prompts Other params for webui image generation

Build Avatar library

Avatars is the charater displayed on the top of the extension. Defined your own character by editing /extensions/your-prompt-gallery-extension-name/assets/avatars.yaml

The field "value" is the prompt-set for each characters.

Teamplate:

 whiteHair: 
   value: "1 girl,  blush, White hair, Red eyes, animal ears,  looking at viewer, gothic lolita, dramatic angle, very beautiful, beautiful eyes, "
   negative: ""
 pinkGirl: 
   value: "petite, 1girl, solo, pink hair, very long hair, school uniform, happy,outdoors, flower field, excited"

Build prompt-set library

Prompt-sets are prompts displayed as cart boxes below.

Customized your own prompt-set by editing /extensions/your-prompt-gallery-extension-name/assets/tags.yaml

    category-tier-1:
      category-tier-1-1:
        "prompt-set-name-1":
          value: "prompt1, prompt2"
          negative: "neg-prompt1, neg-prompt2"
        "prompt-set-name-2"
          value: "prompt1"
          negative: "neg-prompt1"
      category-tier-1-2:
        "prompt-set-name-3":
          value: "prompts"

The prompt-set are managed hierarchyly (e.g. the config below defined a tier 1 category "Figure" containes two tier two categories "Hair" and "Face")

 Figure:
   Hair:
     "ponny-tail":
       value: "ponny-tail"
       negative: "lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, "
     "short_hair"
       value: "short_hair"
       negative: "long_hair,lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, "
   Face:
     "smile":
       value: "smile"

 Background:
   '':
     simple background:
       value: simple background
     sunburst background:
       value: sunburst background
   Nature:
     Space:
       value: "space background, space,"
     Startrails:
       value: colorful startrails
     Woods:
       value: "Woods background, fantacy background,"

Additionally you could edit field "param" to customized AI model parameters (or switch models using the webui model selection tab.):

 Style:
   General Effect:
     "General_ice_high_res":
       value: "flowing ice, portrait, focus on face, complex, extremely detailed , elegant, CG, (an extremely delicate and beautiful girl), incredibly absurdres, best quality,concept art"
       negative: "lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, "
       param: "Steps: 30, Sampler: Euler, CFG scale: 11.5, Seed: 1058629707, Size: 512x768, Variation seed: 1692844643, Variation seed strength: 0.27, Seed resize from: 1088x512"
 Background:
   '':
     simple background:
       value: simple background
     sunburst background:
       value: sunburst background
   Nature:
     Space:
       value: "space background, space,"
     Startrails:
       value: colorful startrails

Useful links for anime prompts:

sd-danbooru-tags or DeepDanbooru.

Using Prompt Gallery

  1. Slect tab "Prompt Gallery" on top navigation bar. You should see your dined prompt-sets in prompt-gallery.

  2. Select the avatar (model for demo)

  3. Select multiple prompt-sets

  4. Click "send WebUI"

2-1

  1. In a few minutes, Images geneated with teh selected prompt-sets will be downloaded in your browser

2-2

  1. The preview picture is missing. To add preview picture for each prompt-set, please refer to the next section.

Populate previews and QC

  1. For newly installed exteantion, there will be no preview pictures for each prompt-set.

3-1

  1. Goto tab "txt2img" in webui and Select "Prompt Gallery" in "scripts"

3-2

  1. Upload the avatar yaml library mentioned in section "Build Avatar library".

3-3

  1. Add default prompts or default negative (optional), default prompts are additional prompts that applied for each prompt-set preview picture generation

  2. Select "skip exists" if you wish to skip generating preview if preview picture exists for a prompt-set

3-4

  1. Wait for stable-diffusion-webui generate previews automatically.

3-5

  1. Pick the best image for preview picture of each prompt-set.

3-6

  1. Reflesh the browser. You should see the preview pictures in Prompt Gallery.

3-7

  1. The preview pictures are stored in prompt-gallery-directory/assets/preview/. You could always inspect the pictures manually.

(back to top)

Cutomize default image generation parameters

Sometimes you need to defined the default values for the AI model parameters.

  1. Change the params at the top of webui-directory/extension/prompt-gallery-extension-name/paste_this_to_webui_scripts_folder/prompt_gallery.py
BATCH_SIZE = 4
N_ITER = 2
STEPS = 30
CFG_SCALE = 11.5
WIDTH = 512
HEIGHT = 768
SAMPLER_INDEX = 1
RESTORE_FACE = 'true'
TILING = 'false'
DO_NOT_SAVE_GRID = 'false'

Customized extension ip and port (optional)

If you are using customized ip for webui and the extension fail to automatically detected your customized ip. Please try:

  1. Search %extension-path%\assets\index.*.js, change "127.0.0.1" to your customized webui ip

  2. Search %extension-path%\scripts\prompt_gallery.py change

pg_ip = "%your_webui_ip%" if shared.cmd_opts.listen else 'localhost'
pg_port = %your_webui_port%--
  1. Change the ip address in webui-user.bat (Win) or webui-user.sh (Linux)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

(back to top)

Built With

  • Vue
  • JavaScript
  • Gradio
  • Pytorch
  • React

Talk with me

(back to top)

Acknowledgments

(back to top)

promptgallery-stable-diffusion-webui's People

Contributors

dr413677671 avatar gizex avatar hppinata avatar smashinfries avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

promptgallery-stable-diffusion-webui's Issues

Feature Request: Option to show selected avatars image on all cards

Hi, first off all, I love the structure this extension provides for keeping track of different styles. However, one thing that I find annoying is having to click through each image of a card to display a specific avatar. The problem then amplifies when you want to compare different prompts with the same (non-default) avatar.

So one solution could be to have a option to switch all images on the cars to a specific avatar, either when clicking on the avatar button or a separate controller (drop-down box or similar) to select which avatar to view.

timeout for connectng to http://localhost:5173

some system are not fast enough for it's cpu, and that will cause the issue when connecting to http://localhost:5173 (timeout)
the code you written will try to connect to http://localhost:5173 immediately after the service up,
i recommand to change these line (just example)
tmp = requests.get("http://localhost:5173")
to this line

  wait_time = 0
  if_connect =False

  while if_connect == False and wait_time<=6:
      try:
          tmp = requests.get("http://localhost:5173")
          if_connect = True
      except:
          print(".")
          time.sleep(10)
          wait_time+=1

[Enhancement]Use scripts.basedir() than prompt_gallery_name.json

Use scripts.basedir() than prompt_gallery_name.json
I think it's simpler, don't you?
Like this:

extension_dir = scripts.basedir()
# don't use scripts.basedir() in function, or it will return the rootpath of webui.

def on_app_started(demo: Optional[gr.Blocks], app: FastAPI):
    app.mount('/prompt_gallery', StaticFiles(directory=extension_dir,html=True))	

modules.script_callbacks.on_app_started(on_app_started)

FileNotFoundError: [Errno 2] No such file or directory

Installation method: via webui

Trigger: generate the preview image

Trackback:

  File "C:\Users\dr413677671\Downloads\stable-diffusion-webui-master\modules\call_queue.py", line 45, in f
    res = list(func(*args, **kwargs))
  File "C:\Users\dr413677671\Downloads\stable-diffusion-webui-master\modules\call_queue.py", line 28, in f
    res = func(*args, **kwargs)
  File "C:\Users\dr413677671\Downloads\stable-diffusion-webui-master\modules\txt2img.py", line 46, in txt2img
    processed = modules.scripts.scripts_txt2img.run(p, *args)
  File "C:\Users\dr413677671\Downloads\stable-diffusion-webui-master\modules\scripts.py", line 317, in run
    processed = script.run(p, *script_args)
  File "C:\Users\dr413677671\Downloads\stable-diffusion-webui-master\scripts\prompt_gallery.py", line 590, in run
    proc = process_images(copy_p)
  File "C:\Users\dr413677671\Downloads\stable-diffusion-webui-master\modules\processing.py", line 430, in process_images
    res = process_images_inner(p)
  File "C:\Users\dr413677671\Downloads\stable-diffusion-webui-master\modules\processing.py", line 554, in process_images_inner
    images.save_image(Image.fromarray(x_sample), p.outpath_samples, "", seeds[i], prompts[i], opts.samples_format, info=infotext(n, i), p=p, suffix="-before-face-restoration")
  File "C:\Users\dr413677671\Downloads\stable-diffusion-webui-master\modules\images.py", line 519, in save_image
    image.save(fullfn, quality=opts.jpeg_quality, pnginfo=pnginfo_data)
  File "C:\Users\dr413677671\Downloads\stable-diffusion-webui-master\venv\lib\site-packages\PIL\Image.py", line 2317, in save
    fp = builtins.open(filename, "w+b")
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\dr413677671\\Downloads\\stable-diffusion-webui-master\\extensions\\PromptGallery-stable-diffusion-webui\\assets\\preview\\General_high_res\\./00000-228796099-portrait,fullbody,complex,extremelydetailed,elegant,CG,masterpiece,bestquality,conceptart,illustration,highres,original,-before-face-restoration.png'

Size param not working

parse_size doesn't return anything, which seems to be a bug.

def parse_size(i_width, i_height, str_size, cur_str):
i_width = str_size.split('x')[0]
i_height = str_size.split('x')[1]

def parse_size(str_size):
    i_width, i_height = str_size.split('x')
    return i_width, i_height

elif key == 'Size':
parse_size(m_width, m_height, value, cur_line)

        elif key == 'Size':
            m_width, m_height = parse_size(value)

IsADirectoryError when pressing 'Show pics' button

I was following the tutorial and trying to generate previews for the included presets. I selected the script and added the avatars.yaml and tags.yaml, generated the images, pressed on 'QC scan' and selected one of the prompts. When I tried to display the generated images by pressing 'Show pics' the field that is supposed to show the images only shows 'Error' in red.

The traceback in the terminal is:

Traceback (most recent call last):
  File "/data/apps/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 337, in run_predict
    output = await app.get_blocks().process_api(
  File "/data/apps/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1018, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "/data/apps/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 956, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "/data/apps/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/components.py", line 3742, in postprocess
    file_path = self.make_temp_copy_if_needed(img)
  File "/data/apps/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/processing_utils.py", line 379, in make_temp_copy_if_needed
    temp_file_path = self.get_temp_file_path(file_path)
  File "/data/apps/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/processing_utils.py", line 365, in get_temp_file_path
    file_hash = self.hash_file(file_path)
  File "/data/apps/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/processing_utils.py", line 334, in hash_file
    with open(file_path, "rb") as f:
IsADirectoryError: [Errno 21] Is a directory: 'extensions/PromptGallery-stable-diffusion-webui/assets/preview/General_fire_high_res/flowing fire portrait focus on face complex extremely'

In the folder assets\preview all the images are there but it fails to display them for some reason.

Could not get it to work, not showing generated images after "select".

It looks very interesting to me, but unfortunately I couldn't get it to work, even trying for hours and even looking at the code.

I'm sending a video showing the structure of the folders it generated (installing manually and following the installation guide step by step), I've already tried automatic installation through the "Available" tab, and I wasn't successful either.

Apparently when I'm pressing select, the files disappear from the preview folder and don't go anywhere, I imagine they should go to some folder right?

Video:
https://youtu.be/OQYz4d5cyKk

BUG: Does not correctly parse sampler index

when I enter a sampler in the param, it does not map correctly to sampler index. Always defaults to 1 (1 == Euler)

Looking at code for the parse param there is a elseif check that is incorrect

elif value == 'Sampler': m_sampler_index = map_sampler_to_idx[value]

You are checking if the value is Sampler, when it should be 'key'

Correction should be:

elif key == 'Sampler': m_sampler_index = map_sampler_to_idx[value]

buttons on Prompt Gallery don't work (AxiosError: Network Error)

Thanks for the great feature set. I'm dying to get this working.

I managed to get this working all the way up until the point where I click "send to webui" or "copy negatives" or any of those buttons. They all return this error in the console:

AxiosError: Network Error
    at u.onerror (http://localhost:5173/assets/index.bed48b02.js:42:4558)

I did use the command prompts as described (cors, api). Any thoughts appreciated

Use on remote machine

Having a quick look at the source code, it appears this can't be used when the webui is running on a remote machine, because it only listens on localhost. Am I missing something or can this not (currently?) be used when the webui is running remotely (e.g. accessed via --listen)?

Permission problem when launching webui.py

folder permission is set to 100 resulting in permission problem loading ./extensions/PromptGallery-stable-diffusion-webui/index.html when starting up webui.py. Permission always seem to reset on launching webui.py. This is the only extension that has this problem. Workaround is to suspend webui.py after message of permission problem starts flooding the screen, and do a chmod 755 on /extensions/PromptGallery-stable-diffusion-webui

Issue seen on WSL2-Ubuntu22.04

Google Colab Support

It fails to connect to localhost (of course). I'm using cloudflared tunnel to load sdwebui. I tried tunneling the gallery too (at localhost:5173) to open it separately, but it doesn't work. It seems that it shuts down because it failed to bind.

INFO:     Started server process [28361]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
ERROR:    [Errno 99] error while attempting to bind on address ('::1', 5173, 0, 0): cannot assign requested address
INFO:     Waiting for application shutdown.
INFO:     Application shutdown complete.

QC scan and show pics : Permission denied

First of all, thank you for making this great extension!
I tried to use the extension while following the video and it reproduced the previous part perfectly
But after generating the images, there are no images under QC scan, and when I select the select prompts dropdown on the right and click show pics, I only get a Permission denied in console

Traceback (most recent call last):
File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 284, in run_predict
output = await app.blocks.process_api(
File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 982, in process_api
result = await self.call_function(fn_index, inputs, iterator)
File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 824, in call_function
prediction = await anyio.to_thread.run_sync(
File "D:\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "D:\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "D:\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 867, in run
result = context.run(func, *args)
File "D:\stable-diffusion-webui\scripts\prompt_gallery.py", line 438, in update_gallery
return qc_dict[dropdown]
KeyError: ''
Traceback (most recent call last):
File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 284, in run_predict
output = await app.blocks.process_api(
File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 983, in process_api
data = self.postprocess_data(fn_index, result["prediction"], state)
File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 930, in postprocess_data
prediction_value = block.postprocess(prediction_value)
File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 3313, in postprocess
file = processing_utils.create_tmp_copy_of_file(
File "D:\stable-diffusion-webui\venv\lib\site-packages\gradio\processing_utils.py", line 341, in create_tmp_copy_of_file
shutil.copy2(file_path, file_obj.name)
File "D:\BaiduNetdiskDownload\stable-diffusion-webui\python\lib\shutil.py", line 434, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "D:\BaiduNetdiskDownload\stable-diffusion-webui\python\lib\shutil.py", line 254, in copyfile
with open(src, 'rb') as fsrc:
PermissionError: [Errno 13] Permission denied: 'D:\\stable-diffusion-webui\\extensions\\PromptGallery-stable-diffusion-webui\\assets\\preview\\3dCG\\3d 1 girl blush White hair Red eyes'

I think it may be that somehow the path is \\ instead of \ (like the path above)
because the image has been generated correctly and exists in that path with \ , but the path with \\ is not accessible

Use multiple models?

Is it possible to use multiple models when generating the gallery images? At the moment I'd like to put the models I have collected on display and show how they perform based on parameters.

I've tried slipping this into the tags.yaml but it didn't seem to change the model from what was already selected at the top left of the web ui. At least it didn't throw any errors.

The Example:
Anime:
Fox:
"AnythingV3":
value: "masterpiece, best quality, fox, anthro"
negative: "lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry"
param: "Model: anythingv3, Steps: 35, Sampler: Euler a, CFG scale: 7, Seed: 1058629707, Size: 512x768, Variation seed: 1692844643, Variation seed strength: 0.27, Seed resize from: 1088x512"

I have a lot of models I really don't want to generate them one by one and have to shuffle images and add parameters and stuff to the yaml to keep things organized.

Cannot customize avatars and tags

I modified avatars.yaml and tags.yaml but the extension doesn't update after refresh or reboot webui and remain as default template.

image

AssertionError: trying to open image file not in temporary directory

This happens after choosing an image and clicking select after running the script.

Traceback (most recent call last):
  File "D:\dev\stable-diffusion-webui-main\venv\lib\site-packages\gradio\routes.py", line 337, in run_predict
    output = await app.get_blocks().process_api(
  File "D:\dev\stable-diffusion-webui-main\venv\lib\site-packages\gradio\blocks.py", line 1015, in process_api
    result = await self.call_function(
  File "D:\dev\stable-diffusion-webui-main\venv\lib\site-packages\gradio\blocks.py", line 833, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "D:\dev\stable-diffusion-webui-main\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "D:\dev\stable-diffusion-webui-main\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "D:\dev\stable-diffusion-webui-main\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "D:\dev\stable-diffusion-webui-main\scripts\prompt_gallery.py", line 642, in <lambda>
    fn=lambda x: image_url(x),
  File "D:\dev\stable-diffusion-webui-main\scripts\prompt_gallery.py", line 565, in image_url
    assert normfn.startswith(tempdir), 'trying to open image file not in temporary directory'
AssertionError: trying to open image file not in temporary directory

Error while attempting to bind on address ('127.0.0.1', 5173)

At start up I get the error below and the info in the tab Prompt Gallery are not correctly displayed:

INFO: Started server process [8972]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: ::1:53807 - "GET / HTTP/1.1" 200 OK
ERROR: [Errno 10048] error while attempting to bind on address ('127.0.0.1', 5173): di norma è consentito un solo utilizzo di ogni indirizzo di socket (protocollo/indirizzo di rete/porta)
INFO: Waiting for application shutdown.
INFO: Application shutdown complete.

The following is a screenshot of the Prompt Gallery tab content:
immagine

I haven't loaded yet any avatar images, and I don't plan to do it at the moment being only interested to translate the UI in Italian language. Thank you.

script breaks model selector

So, I'm actually working on a pull request to add support for model ckpt selection in the params (I can see why this was not included). While debugging I found something interesting, using the script actually breaks the model selector. Once you generate images with this script on, the model selector no longer changes the model weights.

Can you see if you can reproduce?

  1. open automatic1111
  2. open Prompt Gallery script
  3. Load avatar and tag yamls with no errors
  4. click Generate
  5. Images generate with no errors
  6. change the model selector at the top of the UI
  7. Model changes instantly (no delay)
  8. CMD terminal does not do anything
  9. Click Generate
  10. Images generate with no errors BUT they are generated with the old model

I tried debugging a little but couldn't find anything. Perhaps the p_copy variable is overriding the default settings in the shared StableDiffusionProcessing variable?

Extension breaks when --data-dir is used.

I recently added --data-dir to my A1111 SD webui-user file. That flag changes the location of where the "extensions" folder is located.

This breaks your extension (that previously worked) with a "No such file or directory" error looking for "extensions/prompt_gallery_name.json". The file that throws the exception is extensions\PromptGallery-stable-diffusion-webui\scripts\prompt_gallery.py, line 34, in on_ui_settings: open("./extensions/prompt_gallery_name.json") as fd

Why do I need this?

It isn't immediately clear from the front page, why I need this, or why it would be helpful to my workflow. Could you elaborate on what this extension is, how it could be used, etc? It has a one sentence description, which is very vague, and then hits ya with a ton of setup and install info.

Please help. :P

Error when selecting generated images for prompt-sets

Following the tutorial video with default files i get this when pressing "Select" after the generation:

Traceback (most recent call last):
  File "D:\Repositories\Python\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 321, in run_predict
    output = await app.blocks.process_api(
  File "D:\Repositories\Python\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1015, in process_api
    result = await self.call_function(fn_index, inputs, iterator, request)
  File "D:\Repositories\Python\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 856, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "D:\Repositories\Python\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "D:\Repositories\Python\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "D:\Repositories\Python\stable-diffusion-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "D:\Repositories\Python\stable-diffusion-webui\scripts\prompt_gallery.py", line 634, in <lambda>
    fn=lambda x: image_url(x),
  File "D:\Repositories\Python\stable-diffusion-webui\scripts\prompt_gallery.py", line 571, in image_url
    if filedata.startswith("data:image/png;base64,"):
AttributeError: 'dict' object has no attribute 'startswith'

The window for selected preview displays error.

I found a comment on the tutorial video reporting the same problem.

A Number Of Issues

I've noticed a handful of issues while using this app. In order to not populate the issues I'll just list them all in here.

  1. When attempting to use the 'send webui' button it does not work, I get a a 'WARNING: Invalid HTTP request received.'.
  2. Prompt Gallery refuses to update/refresh. I've tried refreshing the page, reloading my ui, closing and re-opening Stable Diffusion but it refuses to update to reflect the changes I've made such as replacing images, adding 'avatars', renaming 'tags'.
  3. The tutorial segment at the top of the extension isn't going away, I'm not sure if there's a hidden way to remove it.
  4. Prompt Gallery does not show up on the mobile ui.

Going to the http://localhost:5173 directly shows it properly updated but still with the tutorial text, so I'm not sure if it's just refusing to update within stable diffusion for some reaosn.

With open(file_path, "rb") as f: PermissionErorr

When pressing "Show Pics" after generating I get "Error" in the UI and the console pops this:

Traceback (most recent call last):
  File "H:\Stable Diffusion\stable-diffusion-webui-master\venv\lib\site-packages\gradio\routes.py", line 337, in run_predict
    output = await app.get_blocks().process_api(
  File "H:\Stable Diffusion\stable-diffusion-webui-master\venv\lib\site-packages\gradio\blocks.py", line 1018, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "H:\Stable Diffusion\stable-diffusion-webui-master\venv\lib\site-packages\gradio\blocks.py", line 956, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "H:\Stable Diffusion\stable-diffusion-webui-master\venv\lib\site-packages\gradio\components.py", line 3742, in postprocess
    file_path = self.make_temp_copy_if_needed(img)
  File "H:\Stable Diffusion\stable-diffusion-webui-master\venv\lib\site-packages\gradio\processing_utils.py", line 379, in make_temp_copy_if_needed
    temp_file_path = self.get_temp_file_path(file_path)
  File "H:\Stable Diffusion\stable-diffusion-webui-master\venv\lib\site-packages\gradio\processing_utils.py", line 365, in get_temp_file_path
    file_hash = self.hash_file(file_path)
  File "H:\Stable Diffusion\stable-diffusion-webui-master\venv\lib\site-packages\gradio\processing_utils.py", line 334, in hash_file
    with open(file_path, "rb") as f:
PermissionError: [Errno 13] Permission denied: 'extensions\\PromptGallery-stable-diffusion-webui\\assets\\preview\\Test2\\ponytail 1girl'

I've tried changing the --cors-allow-origins https://localhost:5173 to 127.0.0.1:5173 as well as allowing full control over the extensions folder to all users in Windows. No effect.

Unable to use the extension

Hi there. I have some problem while trying to use this extension

Steps I used to install

  • copy git link
  • paste in automatic1111 and install
  • apply and reload then there are errors in console and the folder in which the extension was installed gets empties and the empty gets some permission overwritten making it unable to interact with unless use sudo.

In console, it gave 500 error. That it can't find <location_to_extension_folder>/prompt-gallery/index.html well of course since it was deleted

for the time being, I removed it completely.

Error when generating preview images for prompt-sets

When following the tutorial in the readme and using the default avatars.yaml and tags.yaml files I get the error bellow. It looks like extra \ got added into the output path at the end for some reason?

Traceback (most recent call last):
  File "D:\xxx\xxxxxxx\stable-diffusion-webui\modules\call_queue.py", line 45, in f
    res = list(func(*args, **kwargs))
  File "D:\xxx\xxxxxxx\stable-diffusion-webui\modules\call_queue.py", line 28, in f
    res = func(*args, **kwargs)
  File "D:\xxx\xxxxxxx\stable-diffusion-webui\modules\txt2img.py", line 46, in txt2img
    processed = modules.scripts.scripts_txt2img.run(p, *args)
  File "D:\xxx\xxxxxxx\stable-diffusion-webui\modules\scripts.py", line 328, in run
    processed = script.run(p, *script_args)
  File "D:\xxx\xxxxxxx\stable-diffusion-webui\scripts\prompt_gallery.py", line 692, in run
    proc = process_images(copy_p)
  File "D:\xxx\xxxxxxx\stable-diffusion-webui\modules\processing.py", line 464, in process_images
    res = process_images_inner(p)
  File "D:\xxx\xxxxxxx\stable-diffusion-webui\modules\processing.py", line 607, in process_images_inner
    images.save_image(image, p.outpath_samples, "", seeds[i], prompts[i], opts.samples_format, info=infotext(n, i), p=p)
  File "D:\xxx\xxxxxxx\stable-diffusion-webui\modules\images.py", line 536, in save_image
    _atomically_save_image(image, fullfn_without_extension, extension)
  File "D:\xxx\xxxxxxx\stable-diffusion-webui\modules\images.py", line 516, in _atomically_save_image
    image_to_save.save(temp_file_path, format=image_format, quality=opts.jpeg_quality, pnginfo=pnginfo_data)
  File "D:\xxx\xxxxxxx\stable-diffusion-webui\venv\lib\site-packages\PIL\Image.py", line 2317, in save
    fp = builtins.open(filename, "w+b")
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\xxx\\xxxxxxxx\\stable-diffusion-webui\\extensions\\PromptGallery-stable-diffusion-webui\\assets\\preview\\General_ice_high_res\\00000-0-flowing ice, portrait, focus on face, complex, extremely detailed , elegant, CG,  (an extremely delicate and beautiful girl), in.tmp'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.