Coder Social home page Coder Social logo

sirlorrence / openvino-ai-plugins-gimp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from intel/openvino-ai-plugins-gimp

0.0 0.0 0.0 169.72 MB

GIMP AI plugins with OpenVINO Backend

License: Apache License 2.0

Shell 0.18% C++ 1.18% Python 98.28% CMake 0.10% Batchfile 0.26%

openvino-ai-plugins-gimp's Introduction

OpenVINO™ AI Plugins for GIMP


Dedicated for GIMP 3, Python 3 and OpenVINO™.
⭐ ⭐ ⭐ ⭐ are welcome.

Current list of plugins:

[1] Super-Resolution
[2] Style-Transfer
[3] Inpainting
[4] Semantic-Segmentation
[5] Stable-Diffusion (Supports - 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)

Objectives

[1] Provides a set of OpenVINO™ based plugins that add AI features to GIMP.
[2] Serve as a reference 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.

Contribution

Welcome people interested in contribution! Please raise a PR for any new features, modifications, or bug fixes.

Use with GIMP

gimp-screenshot

Installation Steps

Install OpenVINO™

  • Download and install OpenVINO™ for your operating system. Please follow the instructions to download and install OpenVINO™ from the archive. Do not use pypi for installation.
  • Note that these plugins have been tested with 2023.1.0 and 2023.2.0

Windows

For detailed steps and tips please refer User guide for Windows.

Linux

This plugin is tested on Ubuntu 22.04. Building GIMP from source is recommended.
For detailed steps and tips please refer to Linux Installation Guide.

OpenVINO™ Image Generator Plugin with Stable Diffusion

Power Mode is enabled for int8 SD models and systems that has a "NPU" only

A. Prompt to Image

  1. Create or choose a layer
  2. Select Stable Diffusion from the drop down list in layers -> OpenVINO-AI-Plugins
  3. Choose the desired model and device from the drop down list.
  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"
  5. Enter prompt and other parameters
  6. Click on “Generate”. Wait for the total inference steps to get completed.

B. Image to Image

  1. Create or choose a layer or open an image
  2. Follow steps 2,3,4,5 from section A.
  3. Select "Use Initial Image"
  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.
  5. Click on “Generate”. 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.

  1. Choose a layer or Open an image of size 512x512. (Currently works best with this resolution)
  2. Use "Free select tool" to select the area in your image that you wish to change.
  3. Right click on your image and click on "Add layer mask". Then choose "Selection" in "Initialize layer Mask to". This should create a mask with your selection.
  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.
  5. Click on “Generate”. 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.

  1. Open an image with some pose that you want to see in new image.
  2. Select Stable Diffusion from the drop down list in layers -> OpenVINO-AI-Plugins
  3. Choose the controlnet_openpose model and device from the drop down list.
  4. Make sure to select -- "Use Initial Image" option from the GUI. If not selected then it will fail.
  5. Follow steps 4,5 from section A.
  6. Click on “Generate”. Wait for the total inference steps to get completed.

E. Stable-Diffusion-1.5 Controlnet-CannyEdge - Make sure to download and convert the model during install process.

  1. Open an image that you want to use for generating the new image.
  2. Select Stable Diffusion from the drop down list in layers -> OpenVINO-AI-Plugins
  3. Choose the controlnet_canny model and device from the drop down list.
  4. Make sure to select -- "Use Initial Image" option from the GUI. If not selected then it will fail.
  5. Follow steps 4,5 from section A.
  6. Click on “Generate”. Wait for the total inference steps to get completed.

F. Stable-Diffusion-1.5 Controlnet-Scribble - Make sure to download and convert the model during install process.

  1. Open an image that you want to use for generating the new image.
  2. Select Stable Diffusion from the drop down list in layers -> OpenVINO-AI-Plugins
  3. Choose the controlnet_scribble model and device from the drop down list.
  4. Make sure to select -- "Use Initial Image" option from the GUI. If not selected then it will fail.
  5. Follow steps 4,5 from section A.
  6. Click on “Generate”. Wait for the total inference steps to get completed.

With Advanced Setting

With Power Mode in Advanced Setting for SD int8 based models

Note that the screenshots below are based on the previous UI

OpenVINO™ Semantic Segmentation Plugin

OpenVINO™ Super Resolution Plugin

OpenVINO™ Style Transfer Plugin

OpenVINO™ Inpainting Plugin

  1. Open an image in GIMP.
  2. Make sure there is alpha channel added to the image by right clicking on the image from layer section and selecting “Add alpha channel”
  3. Add a new transparent layer of the same size as original image.
  4. Select paint brush with white foreground color and black background color. Choose the thickness of the brush
  5. Now paint the object that you want to remove from the image.
  6. Select the new layer and image at the same. You should see “two items selected in layer section”

Acknowledgements

License

Apache 2.0

Disclaimer

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.

openvino-ai-plugins-gimp's People

Contributors

arisha07 avatar gblong1 avatar ryanmetcalfeint8 avatar johnlefeng avatar sirlorrence avatar ggrzybow avatar dependabot[bot] avatar kingrei avatar joelwurtz avatar rdower avatar tschrist avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.