Skip to content

Commit 532127c

Browse files
Merge pull request #66 from intel/2_99_R1
Merge the release branch for 2.99-R1 into main
2 parents feec859 + c5b3175 commit 532127c

30 files changed

+4803
-1502
lines changed

README.md

Lines changed: 66 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This branch is currently under development. <br>Dedicated for GIMP 3, Python 3 a
99
[2] Style-Transfer <br>
1010
[3] Inpainting <br>
1111
[4] Semantic-Segmentation <br>
12-
[5] Stable-Diffusion (Suppports - SD 1.4, SD 1.5 (landscape & portrait), SD 1.5 Inpainting, SD 1.5 Controlnet-OpenPose, SD 1.5 Controlnet-CannyEdge) <br>
12+
[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
1515
[1] Provides a set of OpenVino based plugins that add AI features to GIMP. <br>
@@ -35,8 +35,7 @@ Skip steps 1 and 2 if you already have Python3 and Git on Windows
3535
#### 2. Install Git
3636
- Download and install [GIT](https://git-scm.com/)
3737

38-
#### 3. Install the GIMP Plugin
39-
38+
#### 3. Install the GIMP Plugin
4039
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>
4140
2. Clone and run install script: <br>
4241

@@ -51,53 +50,92 @@ Skip steps 1 and 2 if you already have Python3 and Git on Windows
5150
Example: ```Plug-ins in GIMP : <path\to>\gimpenv3\lib\site-packages\gimpopenvino\plugins``` Add this path to [Edit-> Preferences-> Folders-> Plugins] in GIMP <br>
5251
4. Restart GIMP, and you should see 'OpenVINO-AI-Plugins' show up in 'Layer' menu <br>
5352

54-
### Linux (Tested on Ubuntu 20.04)
55-
1. Install flatpak distribution of GIMP development package -- instructions here: [GIMP Development Downloads](https://www.gimp.org/downloads/devel/) <br>
56-
2. Clone, run install script, copy weights: <br>
53+
### Linux
54+
This plugin is tested on Ubuntu 22.04.
55+
Building GIMP from source is recommended.
5756

57+
#### 1. Install Dependencies
5858
```
59-
# clone this repo:
60-
git clone https://github.com/intel/openvino-ai-plugins-gimp.git
59+
sudo apt update
60+
sudo apt install -y cmake libgflags-dev patchelf python3-pip gettext git git-lfs build-essential meson ninja-build autoconf libcairo2-dev libxt-dev libgdk-pixbuf-2.0-dev libgexiv2-dev libgtk-3-dev libmypaint-dev mypaint-brushes libbz2-dev libatk1.0-dev libgirepository1.0-dev libx11-xcb-dev libwmf-dev libxcb-glx0-dev libxcb-dri2-0-dev libxxf86vm-dev valgrind libappstream-glib-dev libpugixml-dev libxmu-dev libpoppler-glib-dev xsltproc librsvg2-dev libopencv-dev
61+
```
62+
63+
#### 2. Clone, build, and install babl
64+
```
65+
git clone https://gitlab.gnome.org/GNOME/babl
66+
cd babl
67+
git checkout tags/BABL_0_1_98
68+
meson _build
69+
ninja -C _build
70+
sudo ninja -C _build install
71+
```
72+
#### 3. Clone, build, and install gegl
73+
```
74+
git clone https://gitlab.gnome.org/GNOME/gegl
75+
cd gegl
76+
git checkout tags/GEGL_0_4_46
77+
meson _build
78+
ninja -C _build
79+
sudo ninja -C _build install
80+
```
81+
82+
#### 4. Clone, build, and install Gimp
83+
```
84+
git clone https://gitlab.gnome.org/GNOME/gimp
85+
cd gimp
86+
git checkout tags/GIMP_2_99_16
87+
meson _build
88+
ninja -C _build
89+
sudo ninja -C _build install
90+
```
91+
#### 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.
6193

62-
# run install script - this will create the virtual environment "gimpenv3", install all required packages and will also walk you through models setup.
63-
openvino-ai-plugins-gimp/install.sh
94+
```
95+
git clone https://github.com/intel/openvino-ai-plugins-gimp.git
96+
chmod +x openvino-ai-plugins-gimp/install.sh
97+
./openvino-ai-plugins-gimp/install.sh
6498
```
6599
*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
101+
```
102+
source /opt/intel/openvino/setupvars.sh
103+
export GI_TYPELIB_PATH=/usr/lib/x86_64-linux-gnu/girepository-1.0:/usr/local/lib/x86_64-linux-gnu/girepository-1.0
104+
```
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>
66107

67-
3. Start the GIMP application (```flatpak run org.gimp.GIMP```), and add the gimpenv3 path that was printed when running the above step to the list of plugin folders [Edit-> Preferences-> Folders-> Plugins]. <br>
68-
4. Restart GIMP, and you should see 'OpenVINO-AI-Plugins' show up in 'Layer' menu <br>
69-
70-
### OpenVINO™ Image Generator Plugin with Stable Diffusion - This GIF doesn't represent the current GUI
108+
# OpenVINO™ Image Generator Plugin with Stable Diffusion
71109
#### A. Prompt to Image
72110
1. Create or choose a layer <br>
73111
2. Select Stable Diffusion from the drop down list in layers -> OpenVINO-AI-Plugins <br>
74112
3. Choose the desired model and device from the drop down list.<br>
113+
- note that the [Latent Consistency Model](https://huggingface.co/SimianLuo/LCM_Dreamshaper_v7) is now supported. Choose `SD_1.5_square_lcm`
75114
4. Click on "Load Models" to compile & load the model on the selected device. Wait for it to complete. Please note that you need to perform this step only if you change the model or device or both. For any subsequent runs just click "Run Inference" <br>
76115
5. Enter prompt and other parameters <br>
77-
6. Click on “Run Inference”. Wait for the total inference steps to get completed. <br>
116+
6. Click on “Generate”. Wait for the total inference steps to get completed. <br>
78117

79118
#### B. Image to Image
80119
1. Create or choose a layer or open an image <br>
81120
2. Follow steps 2,3,4,5 from section A. <br>
82121
3. Select "Use Initial Image"
83122
4. By default the opened image in canvas will be used as initial image to the model. You can also select a different image by browsing from files.
84-
5. Click on “Run Inference”. Wait for the total inference steps to get completed. <br>
123+
5. Click on “Generate”. Wait for the total inference steps to get completed. <br>
85124

86125
#### C. Stable-Diffusion-1.5 Inpainting - Make sure to download and convert the model during install process.
87126
1. Choose a layer or Open an image of size 512x512. (Currently works best with this resolution) <br>
88127
2. Use "Free select tool" to select the area in your image that you wish to change. <br>
89128
3. Right click on your image and click on "Add layer mask". Then choose "Selection" in "Initalize layer Mask to". This should create a mask with your selection.
90129
4. Follow steps 2,3,4,5 from section A. Please note that you will only see "SD_1.5_Inpainting" in model options if you added a mask layer to your image. <br>
91-
5. Click on “Run Inference”. Wait for the total inference steps to get completed. <br>
92-
130+
5. Click on “Generate”. Wait for the total inference steps to get completed. <br>
93131

94132
#### D. Stable-Diffusion-1.5 Controlnet-Openpose - Make sure to download and convert the model during install process.
95133
1. Open an image with some pose that you want to see in new image. <br>
96134
2. Select Stable Diffusion from the drop down list in layers -> OpenVINO-AI-Plugins <br>
97135
3. Choose the controlnet_openpose model and device from the drop down list.<br>
98136
4. Make sure to select -- "Use Initial Image" option from the GUI. If not selected then it will fail.
99137
5. Follow steps 4,5 from section A. <br>
100-
5. Click on “Run Inference”. Wait for the total inference steps to get completed. <br>
138+
6. Click on “Generate”. Wait for the total inference steps to get completed. <br>
101139

102140
![](gifs/controlnet-openpose.png)
103141

@@ -108,12 +146,18 @@ Skip steps 1 and 2 if you already have Python3 and Git on Windows
108146
3. Choose the controlnet_canny model and device from the drop down list.<br>
109147
4. Make sure to select -- "Use Initial Image" option from the GUI. If not selected then it will fail.
110148
5. Follow steps 4,5 from section A. <br>
111-
5. Click on “Run Inference”. Wait for the total inference steps to get completed. <br>
149+
6. Click on “Generate”. Wait for the total inference steps to get completed. <br>
112150

113151

114-
*If create gif option is selected, please note that performance will reduce. The generated gif is located in below path. You can play it in GIMP by going to Filters -> Animations -> Playback* <br>
115-
```C:\Users\<user_name>\openvino-ai-plugins-gimp\gif\stable_diffusion.gif``` <br>
152+
#### F. Stable-Diffusion-1.5 Controlnet-Scribble - Make sure to download and convert the model during install process.
153+
1. Open an image that you want to use for generating the new image. <br>
154+
2. Select Stable Diffusion from the drop down list in layers -> OpenVINO-AI-Plugins <br>
155+
3. Choose the controlnet_scribble model and device from the drop down list.<br>
156+
4. Make sure to select -- "Use Initial Image" option from the GUI. If not selected then it will fail.
157+
5. Follow steps 4,5 from section A. <br>
158+
6. Click on “Generate”. Wait for the total inference steps to get completed. <br>
116159

160+
_Note that the screenshots below are based on the previous UI_
117161
![](gifs/stable-diffusion.png)
118162
![](gifs/stable-diffusion.webp)
119163

choose_sd_model.py

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)