Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

Commit fd692e9

Browse files
committed
added onnx-models directory to the ignore list and worked on the readme file
1 parent b2bafe4 commit fd692e9

File tree

2 files changed

+55
-8
lines changed

2 files changed

+55
-8
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
# User-specific files (MonoDevelop/Xamarin Studio)
1313
*.userprefs
1414

15+
# Downloaded .onnx files
16+
onnx-models/
17+
1518
# Build results
1619
[Dd]ebug/
1720
[Dd]ebugPublic/

OnnxStack.Console/README.md

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
### 1.) Download the required `.onnx` models:
66

7+
**Method 1**
8+
9+
Download the required models from the following repositories:
710

811
* https://huggingface.co/rocca/swin-ir-onnx
912
* This is the upscaler model.
@@ -12,21 +15,62 @@
1215
* https://huggingface.co/SimianLuo/LCM_Dreamshaper_v7
1316
* https://huggingface.co/softwareweaver/stable-diffusion-xl-base-1.0-Olive-Onnx
1417

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+
1656

1757

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:
1959

2060

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.
2262
* 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`
2464
* Example with empty path:
2565
```json
26-
{
27-
"Type": "Tokenizer",
28-
"OnnxModelPath": ""
29-
}
66+
{
67+
"Type": "Tokenizer",
68+
"OnnxModelPath": ""
69+
},
70+
{
71+
"Type": "Tokenizer2",
72+
"OnnxModelPath": ""
73+
}
3074
```
3175

3276

0 commit comments

Comments
 (0)