Skip to content

Commit e623893

Browse files
authored
Merge pull request #67 from intel/2_99_R1-hotfix
2 99 r1 hotfix
2 parents 532127c + 878030d commit e623893

File tree

4 files changed

+53
-38
lines changed

4 files changed

+53
-38
lines changed

README.md

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# OpenVINO™ AI Plugins for GIMP
44

5-
This branch is currently under development. <br>Dedicated for GIMP 3, Python 3 and OpenVino.<br> :star: :star: :star: :star: are welcome.<br>
5+
<br>Dedicated for GIMP 3, Python 3 and OpenVINO™.<br> :star: :star: :star: :star: are welcome.<br>
66

77
## Current list of plugins:
88
[1] Super-Resolution <br>
@@ -12,7 +12,7 @@ This branch is currently under development. <br>Dedicated for GIMP 3, Python 3 a
1212
[5] Stable-Diffusion (Suppports - SD 1.4, SD 1.5 (landscape, portrait, and Latent Consistency Model), SD 1.5 Inpainting, SD 1.5 Controlnet-OpenPose, SD 1.5 Controlnet-CannyEdge, SD 1.5 Controlnet-Scribble) <br>
1313

1414
# Objectives
15-
[1] Provides a set of OpenVino based plugins that add AI features to GIMP. <br>
15+
[1] Provides a set of OpenVINO™ based plugins that add AI features to GIMP. <br>
1616
[2] Serve as a refrence code for how to make use of OpenVino in GIMP application for inferencing on Intel's' CPU & GPU <br>
1717
[3] Add AI to routine image editing workflows. <br>
1818

@@ -25,30 +25,50 @@ Please raise a PR for any new features, modifactions or bug fixes.
2525

2626
## Installation Steps
2727

28+
### Install OpenVINO™
29+
- Download and install [OpenVINO™](https://github.com/openvinotoolkit/openvino/releases) for your operating system.
30+
- Note that these plugins have been tested with 2023.1.0 and 2023.2.0
31+
- For Intel&reg; Core™ Ultra support, you need to download and install OpenVINO™ from the archive. Do not use pypi for installation.
32+
33+
2834
### Windows
2935
Skip steps 1 and 2 if you already have Python3 and Git on Windows
3036

3137
#### 1. Install Python
32-
- Download a Python installer from python.org. Choose Python 3.7, 3.8, 3.9 and make sure to pick a 64 bit version. For example, this 3.9.13 installer: https://www.python.org/ftp/python/3.9.13/python-3.9.13-amd64.exe <br>
38+
- Download a Python installer from python.org. Choose Python 3.9 or 3.10 and make sure to pick a 64 bit version. For example, this 3.9.13 installer: https://www.python.org/ftp/python/3.9.13/python-3.9.13-amd64.exe <br>
3339
- Double click on the installer to run it, and follow the steps in the installer. Check the box to add Python to your PATH, and to install py. At the end of the installer, there is an option to disable the PATH length limit. It is recommended to click this. <br>
3440

3541
#### 2. Install Git
3642
- Download and install [GIT](https://git-scm.com/)
3743

3844
#### 3. Install the GIMP Plugin
39-
1. Install [GIMP 2.99.10 (revision 2)](https://download.gimp.org/gimp/v2.99/windows/gimp-2.99.10-setup-2.exe) or Install [GIMP 2.99.14](https://download.gimp.org/gimp/v2.99/windows/gimp-2.99.14-setup.exe) <br>
40-
2. Clone and run install script: <br>
41-
42-
- clone this repo: <br>
43-
```git clone https://github.com/intel/openvino-ai-plugins-gimp.git``` <br>
44-
45-
- run install script - this will create the virtual environment "gimpenv3", install all required packages and will also walk you through models setup. <br>
46-
```openvino-ai-plugins-gimp\install.bat``` <br>
45+
1. Install [GIMP 2.99.14](https://download.gimp.org/gimp/v2.99/windows/gimp-2.99.14-setup.exe) <br>
46+
2. Clone this repository: <br>
47+
```
48+
git clone https://github.com/intel/openvino-ai-plugins-gimp.git
49+
```
50+
3. Setup OpenVINO™ Environment
51+
<b>Note that you will need to do these steps everytime you start GIMP</b>
52+
```
53+
C:\Path\to\where\you\installed\OpenVINO\setupvars.bat
54+
```
55+
4. Run install script - this will create the virtual environment "gimpenv3", install all required packages and will also walk you through models setup. <br>
56+
```
57+
openvino-ai-plugins-gimp\install.bat
58+
```
59+
You will be prompted to setup the AI models used with OpenVINO™. Choose the models that you would like to setup, keeping in mind that choosing to download all of them may take time and considerable disk space.
4760
*You can re-run "run install script" step later again to install & setup models that you may have missed.* <br>
4861

4962
3. Start the GIMP application, and add the gimpenv3 path that was printed when running the above step to the list of plugin folders [Edit-> Preferences-> Folders-> Plugins]. <br>
50-
Example: ```Plug-ins in GIMP : <path\to>\gimpenv3\lib\site-packages\gimpopenvino\plugins``` Add this path to [Edit-> Preferences-> Folders-> Plugins] in GIMP <br>
51-
4. Restart GIMP, and you should see 'OpenVINO-AI-Plugins' show up in 'Layer' menu <br>
63+
Example: ```C:\User\<username>\GIMP\gimpenv3\lib\site-packages\gimpopenvino\plugins```
64+
65+
5. Restart GIMP, and you should see 'OpenVINO-AI-Plugins' show up in 'Layer' menu <br>
66+
```
67+
call "C:\Path\to\where\you\installed\OpenVINO\setupvars.bat"
68+
cd "C:\Program Files\GIMP 2.99\bin"
69+
.\gimp-2.99.exe
70+
```
71+
Note that you need to run setupvars.bat everytime you start GIMP. Creating a .bat file to do these steps may be helpful.
5272

5373
### Linux
5474
This plugin is tested on Ubuntu 22.04.
@@ -89,21 +109,31 @@ ninja -C _build
89109
sudo ninja -C _build install
90110
```
91111
#### 5. Install Plugins
92-
1. Clone, run install script, and download models. The following steps will create the virtual environment "gimpenv3", install all required packages and will also walk you through models setup.
93-
112+
1. Clone this repo
94113
```
95114
git clone https://github.com/intel/openvino-ai-plugins-gimp.git
115+
```
116+
2. Setup the environment Note that you will need to do these steps everytime you start GIMP
117+
```
118+
source /opt/intel/openvino/setupvars.sh
119+
export GI_TYPELIB_PATH=/usr/lib/x86_64-linux-gnu/girepository-1.0:/usr/local/lib/x86_64-linux-gnu/girepository-1.0
120+
```
121+
3. Run install script, and download models. The following steps will create the virtual environment "gimpenv3", install all required packages and will also walk you through models setup.
122+
```
96123
chmod +x openvino-ai-plugins-gimp/install.sh
124+
source /opt/intel/openvino/setupvars.sh
97125
./openvino-ai-plugins-gimp/install.sh
98126
```
127+
You will be prompted to setup the AI models used with OpenVINO™. Choose the models that you would like to setup, keeping in mind that choosing to download all of them may take time and considerable disk space.<br>
99128
*You can re-run "run install script" step later again to install & setup models that you may have missed.* <br>
100-
2. Setup the environment Note that you will need to do these steps everytime you start GIMP
129+
130+
5. Start the GIMP application (```gimp-2.99```), and add the gimpenv3 path that was printed when running the above step to the list of plugin folders [Edit-> Preferences-> Folders-> Plugins]. <br>
131+
6. Restart GIMP, and you should see 'OpenVINO-AI-Plugins' show up in 'Layer' menu <br>
101132
```
102133
source /opt/intel/openvino/setupvars.sh
103134
export GI_TYPELIB_PATH=/usr/lib/x86_64-linux-gnu/girepository-1.0:/usr/local/lib/x86_64-linux-gnu/girepository-1.0
135+
gimp-2.99
104136
```
105-
4. Start the GIMP application (```gimp-2.99```), and add the gimpenv3 path that was printed when running the above step to the list of plugin folders [Edit-> Preferences-> Folders-> Plugins]. <br>
106-
5. Restart GIMP, and you should see 'OpenVINO-AI-Plugins' show up in 'Layer' menu <br>
107137

108138
# OpenVINO™ Image Generator Plugin with Stable Diffusion
109139
#### A. Prompt to Image

gimpopenvino/tools/complete_install.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,7 @@ def setup_python_weights(install_location=None):
2929
os.mkdir(weight_path)
3030

3131
step = 1
32-
print("\n##########")
33-
print(
34-
"{}>> Reference Models present in weights folder. You can also download them from open model zoo.".format(
35-
step
36-
)
37-
)
38-
step += 1
39-
print(
40-
"{}>> Please move the weights folder from the cloned repository: \n"
41-
"openvino-ai-plugins-gimp".format(
42-
step
43-
)
44-
)
45-
print("and place in: " + weight_path)
46-
step += 1
47-
32+
print("\n##########\n")
4833
plugin_loc = os.path.dirname(gimpopenvino.__file__)
4934
ie = Core()
5035
supported_devices = ie.available_devices
@@ -66,10 +51,10 @@ def setup_python_weights(install_location=None):
6651

6752

6853
print(
69-
"{}>> Please add this path to Preferences --> Plug-ins in GIMP : ".format(step),
54+
"NOTE ! >> Please add this path to Preferences --> Plug-ins in GIMP : ",
7055
os.path.join(plugin_loc, "plugins"),
7156
)
72-
print("##########\n")
57+
print("\n##########\n")
7358

7459

7560
if __name__ == "__main__":

gimpopenvino/tools/openvino_common/models_ov/stable_diffusion_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def __init__(
140140
else:
141141
if "NPU" in device[2]:
142142
with open(os.path.join(model, blob_name), "rb") as f:
143-
self.unet_neg = self.core.import_model(f.read(), device[1])
143+
self.unet_neg = self.core.import_model(f.read(), device[2])
144144
else:
145145
self.unet_neg = self.core.compile_model(os.path.join(model, unet_int8_model), device[2])
146146
else:

model_setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def dl_all():
179179
print("5 - SD-1.5 Controlnet-Openpose")
180180
print("6 - SD-1.5 Controlnet-CannyEdge")
181181
print("7 - SD-1.5 Controlnet-Scribble")
182-
print("8 - LCM ")
182+
print("8 - SD-1.5 LCM ")
183183
print("12 - All the above models")
184184
print("0 - Exit SD-1.5 Model setup")
185185

0 commit comments

Comments
 (0)