add install script

pull/16/head
dr413677671 2022-12-02 01:07:40 +08:00
parent f3fc2d2697
commit 6b3fd7e40a
2 changed files with 29 additions and 3 deletions

View File

@ -114,14 +114,31 @@ Keep your pace. Let's start from building your prompt library. <a href="#build-l
### Prerequisites & Installation
go to a directory somewhere empty.
First, go to an empty directory where you store the temp.
Run git clone to get the clone-gallery.
```sh
git clone https://github.com/dr413677671/PromptGallery-stable-diffusion-webui.git
```
copy ./PromptGallery-stable-diffusion-webui/prompt-gallery to stable-diffusion-webui-project-path/extensions
copy ./PromptGallery-stable-diffusion-webui/scripts/prompt_gallery.py to table-diffusion-webui-project-path/scripts
Make sure you cloned the [stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) before. If not check out [stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) to install it first.
You have two options now. :>
Option A:
> copy ./PromptGallery-stable-diffusion-webui/prompt-gallery to stable-diffusion-webui-project-path/extensions
> copy ./PromptGallery-stable-diffusion-webui/scripts/prompt_gallery.py to table-diffusion-webui-project-path/scripts
Option B:
> Alternatively, goto the promptgallery-stable-diffusion-webui folder and run
```sh
python setup.py <table-diffusion-webui-project-path>
```
<p align="right">(<a href="#readme-top">back to top</a>)</p>

9
setup.py Normal file
View File

@ -0,0 +1,9 @@
import os
import shutil
import sys
current_dir= os.path.abspath(os.path.dirname(__file__))
print(os.path.join(os.path.join(current_dir,"extensions"),"prompt-gallery"), os.path.join(sys.argv[1],"extensions"))
print(os.path.join(current_dir,"scripts"), os.path.join(sys.argv[1],"scripts"))
shutil.copytree(os.path.join(os.path.join(current_dir,"extensions"),"prompt-gallery"), os.path.join(os.path.join(sys.argv[1],"extensions"),"prompt-gallery"))
shutil.copy(os.path.join(os.path.join(current_dir,"scripts"),"prompt_gallery.py"), os.path.join(sys.argv[1],"scripts"))