This branch is currently under development.
Dedicated for GIMP 3, Python 3 and OpenVino.
⭐ ⭐ ⭐ ⭐ are welcome.
[1] Super-Resolution
[2] Style-Transfer
[3] Inpainting
[4] Semantic-Segmentation
[5] Stable-Diffusion (Suppports - SD 1.4, SD 1.5 (landscape & portrait), SD 1.5 Inpainting, SD 1.5 Controlnet-Openpose)
[1] Provides a set of OpenVino based plugins that add AI features to GIMP.
[2] Serve as a refrence code for how to make use of OpenVino in GIMP application for inferencing on Intel's' CPU & GPU
[3] Add AI to routine image editing workflows.
Welcome people interested in contribution !! Please raise a PR for any new features, modifactions or bug fixes.
Skip steps 1 and 2 if you already have Python3 and Git on Windows
- 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
- 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.
- Download and install GIT
-
Install GIMP 2.99.10 (revision 2) or Install GIMP 2.99.14
-
Clone and run install script:
-
clone this repo:
git clone https://github.com/intel/openvino-ai-plugins-gimp.git
-
run install script - this will create the virtual environment "gimpenv3", install all required packages and will also walk you through models setup.
openvino-ai-plugins-gimp\install.bat
You can re-run "run install script" step later again to install & setup models that you may have missed.
-
-
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].
Example:Plug-ins in GIMP : <path\to>\gimpenv3\lib\site-packages\gimpopenvino\plugins
Add this path to [Edit-> Preferences-> Folders-> Plugins] in GIMP -
Restart GIMP, and you should see 'OpenVINO-AI-Plugins' show up in 'Layer' menu
-
Install flatpak distribution of GIMP development package -- instructions here: GIMP Development Downloads
-
Clone, run install script, copy weights:
# clone this repo: git clone https://github.com/intel/openvino-ai-plugins-gimp.git # run install script - this will create the virtual environment "gimpenv3", install all required packages and will also walk you through models setup. openvino-ai-plugins-gimp/install.sh
You can re-run "run install script" step later again to install & setup models that you may have missed.
-
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]. -
Restart GIMP, and you should see 'OpenVINO-AI-Plugins' show up in 'Layer' menu
- Create or choose a layer
- Select Stable Diffusion from the drop down list in layers -> OpenVINO-AI-Plugins
- Choose the desired model and device from the drop down list.
- 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"
- Enter prompt and other parameters
- Click on “Run Inference”. Wait for the total inference steps to get completed.
- Create or choose a layer or open an image
- Follow steps 2,3,4,5 from section A.
- Select "Use Initial Image"
- 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.
- Click on “Run Inference”. Wait for the total inference steps to get completed.
C. Stable-Diffusion-1.5 Inpainting - Make sure to download and convert the model during install process.
- Choose a layer or Open an image of size 512x512. (Currently works best with this resolution)
- Use "Free select tool" to select the area in your image that you wish to change.
- 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.
- 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.
- Click on “Run Inference”. Wait for the total inference steps to get completed.
D. Stable-Diffusion-1.5 Controlnet-Openpose - Make sure to download and convert the model during install process.
- Open an image with some pose that you want to see in new image.
- Select Stable Diffusion from the drop down list in layers -> OpenVINO-AI-Plugins
- Choose the controlnet_openpose model and device from the drop down list.
- Make sure to select -- "Use Initial Image" option from the GUI. If not selected then it will fail.
- Follow steps 4,5 from section A.
- Click on “Run Inference”. Wait for the total inference steps to get completed.
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
C:\Users\<user_name>\openvino-ai-plugins-gimp\gif\stable_diffusion.gif
- Open an image in GIMP.
- Make sure there is alpha channel added to the image by right clicking on the image from layer section and selecting “Add alpha channel”
- Add a new transparent layer of the same size as original image.
- Select paint brush with white foreground color and black background color. Choose the thickness of the brush
- Now paint the object that you want to remove from the image.
- Select the new layer and image at the same. You should see “two items selected in layer section”
- Plugin architecture inspired from GIMP-ML - https://github.com/kritiksoman/GIMP-ML/tree/GIMP3-ML
- Stable Diffusion Engine - https://github.com/bes-dev/stable_diffusion.openvino
Apache 2.0
Stable Diffusion’s data model is governed by the Creative ML Open Rail M license, which is not an open source license. https://github.com/CompVis/stable-diffusion. Users are responsible for their own assessment whether their proposed use of the project code and model would be governed by and permissible under this license.