|
4 | 4 |
|
5 | 5 | ### 1.) Download the required `.onnx` models: |
6 | 6 |
|
| 7 | +**Method 1** |
| 8 | + |
| 9 | + Download the required models from the following repositories: |
7 | 10 |
|
8 | 11 | * https://huggingface.co/rocca/swin-ir-onnx |
9 | 12 | * This is the upscaler model. |
|
12 | 15 | * https://huggingface.co/SimianLuo/LCM_Dreamshaper_v7 |
13 | 16 | * https://huggingface.co/softwareweaver/stable-diffusion-xl-base-1.0-Olive-Onnx |
14 | 17 |
|
15 | | -Note: Ensure you run ```git lfs install``` before cloning the repository to ensure the models are downloaded correctly. |
| 18 | + |
| 19 | + Note: Ensure you run ```git lfs install``` before cloning the repository to ensure the models are downloaded correctly. |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | +**Method 2** |
| 28 | + |
| 29 | + Download Files |
| 30 | + |
| 31 | +Use the included 'download-models.bat' file to download the required models. |
| 32 | +* If your on mac or linux, you can open the `download-models.bat` file and run each command manually if you are unable to run the `.bat` file. |
| 33 | + * The `download-models.bat` will create a `onnx-models/` folder in current directory. Then it will download the required models into the `onnx-models/` folder. |
| 34 | + * If you are unable to run the `.bat` file or have issues, you can open the `download-models.bat` file and run each command manually. |
| 35 | + * The `.bat` file will not attempt to 're-download' or continue if the file already exists. If you need to re-download the models, delete the `onnx-models/` folder and run the `.bat` file again. |
| 36 | + |
| 37 | + |
| 38 | +### 2.) If necessary, switch to the correct Stable Diffusion 1.5 branch |
| 39 | + |
| 40 | +**Stable Diffusion 1.5 - Get the .onnx files after download.** |
| 41 | + |
| 42 | +* After you download the `Stable Diffusion 1.5` model at: https://huggingface.co/runwayml/stable-diffusion-v1-5, check to see if any of the folders contain `.onnx` files. |
| 43 | + * If none contain `.onnx` files, you will need to switch to the `.onnx` branch. |
| 44 | + * If you have already checked out the `onnx` branch and have the `.onnx` files from the `Stable Diffusion 1.5` repository, you can skip this step. |
| 45 | + |
| 46 | + |
| 47 | +We need to switch to the `onnx` branch to get the `.onnx` files. |
| 48 | +You can do this anyway you would like, or just run the following commands: |
| 49 | +* Open a new command prompt in `onnx-models/stable-diffusion-v1-5/` |
| 50 | +```bash |
| 51 | +git fetch origin |
| 52 | +git checkout origin/onnx |
| 53 | +``` |
| 54 | +_It might take some time to switch branches and download all of the `.onnx` files pending your internet speed._ |
| 55 | + |
16 | 56 |
|
17 | 57 |
|
18 | | -### 2.) Update the paths in the `appsettings.json` within the `/OnnxStack.Console/` project: |
| 58 | +### 3.) Update the paths in the `appsettings.json` within the `/OnnxStack.Console/` project: |
19 | 59 |
|
20 | 60 |
|
21 | | -* Update the paths in `appsettings.json` to point to the downloaded models |
| 61 | +* Update the paths in `appsettings.json` to point to the downloaded models. Update all the paths to point to the correct location of the downloaded models. |
22 | 62 | * If the downloaded model repository does not contain a `Tokenizer` or `Tokenizer2` `.onnx` file, leave the path empty. |
23 | | - * Note: When the path is empty, OnnxStack will use it's own 'built-in' tokenizer called `cliptokenizer.onnx` |
| 63 | + * Note: When the path is empty, OnnxStack will use it's own 'built-in' _default_ tokenizer called `cliptokenizer.onnx` |
24 | 64 | * Example with empty path: |
25 | 65 | ```json |
26 | | - { |
27 | | - "Type": "Tokenizer", |
28 | | - "OnnxModelPath": "" |
29 | | - } |
| 66 | + { |
| 67 | + "Type": "Tokenizer", |
| 68 | + "OnnxModelPath": "" |
| 69 | + }, |
| 70 | + { |
| 71 | + "Type": "Tokenizer2", |
| 72 | + "OnnxModelPath": "" |
| 73 | + } |
30 | 74 | ``` |
31 | 75 |
|
32 | 76 |
|
|
0 commit comments