dr413677671 / PromptGallery-stable-diffusion-webui

A prompt cookbook worked as stable-diffusion-webui extenstions.
Apache License 2.0
153 stars 16 forks source link

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

Closed leohu1 closed 1 year ago

leohu1 commented 1 year ago

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

dr413677671 commented 1 year ago

No it points to the rootpath of webui

>scripts.basedir()
>'xxxxx\\stable-diffusion-webui'
leohu1 commented 1 year ago

No, you shoud not use it in function. But like this:

extension_dir = scripts.basedir()

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