From c831cd40251262f6c59cdd9b9e685b73df82acf7 Mon Sep 17 00:00:00 2001 From: Will French Date: Thu, 19 Dec 2024 09:25:07 -0600 Subject: [PATCH 1/3] feature: switch to personal-files interface as a less intrusive location for models --- README.md | 16 +++------------- snap/snapcraft.yaml | 7 ++++++- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 1d3ddc5..8fc78d5 100644 --- a/README.md +++ b/README.md @@ -114,26 +114,16 @@ This snap contains support for AI plugins running on Intel hardware (CPU, GPU, a sudo snap connect gimp:npu-libs intel-npu-driver:npu-libs sudo snap connect gimp:openvino-libs openvino-toolkit-2404:openvino-libs sudo snap connect gimp:openvino-ai-plugins-gimp-libs openvino-ai-plugins-gimp:openvino-ai-plugins-gimp-libs + sudo snap connect gimp:dot-local-share-openvino-ai-plugins-gimp ``` -4. (Optional) Install stable diffusion models. Models for the other plugins are relatively small so are built into the snap, while the stable diffusion models are each on the order of GBs and therefore downloaded to a user's home directory via a `model-setup` command line tool. - - First connect the snap interfaces for the `model-setup` application: - - ```shell - sudo snap connect openvino-ai-plugins-gimp:home - sudo snap connect openvino-ai-plugins-gimp:openvino-libs openvino-toolkit-2404:openvino-libs - sudo snap connect openvino-ai-plugins-gimp:intel-npu intel-npu-driver:intel-npu - sudo snap connect openvino-ai-plugins-gimp:npu-libs intel-npu-driver:npu-libs - ``` - - Now run the application: +4. (Optional) Install stable diffusion models. Models for the other plugins are relatively small so are built into the snap, while the stable diffusion models are each on the order of GBs and therefore downloaded to a user's home directory at `~/.local/share/openvino-ai-plugins-gimp` via one of two methods: a `model-setup` command-line tool or from within the GIMP application. To run the interactive command-line tool: ```shell openvino-ai-plugins-gimp.model-setup ``` - Note this will install models in your home directory at `~/openvino-ai-plugins-gimp`. To adjust the path set the `GIMP_OPENVINO_MODELS_PATH` shell variable to a different non-hidden location in your home directory. + Alternatively, users may download models from within GIMP by clicking "Model" in the top-left of the stable diffusion dialog window (Layer -> OpenVINO-AI-Plugins -> Stable Diffusion). 5. Run `gimp` like normal. Instructions for using the OpenVINO AI plugins within GIMP can be found in the [upstream GitHub repo](https://github.com/intel/openvino-ai-plugins-gimp). diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 6e9aef2..3d92c59 100755 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -48,6 +48,10 @@ plugs: interface: content content: openvino-ai-plugins-gimp-2404 target: $SNAP/openvino-ai-plugins-gimp + dot-local-share-openvino-ai-plugins-gimp: + interface: personal-files + write: + - $HOME/.local/share/openvino-ai-plugins-gimp environment: GI_TYPELIB_PATH: $SNAP/gnome-platform/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gjs/girepository-1.0:$GI_TYPELIB_PATH @@ -75,6 +79,7 @@ apps: - npu-libs - openvino-libs - openvino-ai-plugins-gimp-libs + - dot-local-share-openvino-ai-plugins-gimp parts: babl: @@ -265,7 +270,7 @@ parts: plugin: dump source-type: git source: https://github.com/canonical/openvino-ai-plugins-gimp-snap.git - source-branch: frenchwr/create-snap # TODO: update to stable branch + source-branch: main stage: - command-chain/openvino-ai-plugins-gimp-launch From 563d68285d30429bf08cbdd9312af6c7d96deff7 Mon Sep 17 00:00:00 2001 From: Will French Date: Thu, 19 Dec 2024 11:43:25 -0600 Subject: [PATCH 2/3] fix: add plug-declaration to unblock build --- .github/plug-declaration.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .github/plug-declaration.json diff --git a/.github/plug-declaration.json b/.github/plug-declaration.json new file mode 100644 index 0000000..9dc967b --- /dev/null +++ b/.github/plug-declaration.json @@ -0,0 +1,3 @@ +{ + "personal-files": { "allow-installation": "true" } +} \ No newline at end of file From 9a01d3052cbcac8d6fe5c69ab35cbd06805362e0 Mon Sep 17 00:00:00 2001 From: Will French Date: Thu, 19 Dec 2024 13:04:38 -0600 Subject: [PATCH 3/3] fix: use fixed source for command-chain scripts --- snap/snapcraft.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 3d92c59..027bb29 100755 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -262,7 +262,7 @@ parts: plugin: dump source-type: git source: https://github.com/canonical/openvino-toolkit-snap.git - source-branch: openvino-toolkit-2404 + source-tag: 2024.5.0-0 stage: - command-chain/openvino-launch @@ -270,7 +270,7 @@ parts: plugin: dump source-type: git source: https://github.com/canonical/openvino-ai-plugins-gimp-snap.git - source-branch: main + source-commit: 7d20266d73ba25cd49aae55f0a2157911fb6bc75 # TODO: update to tagged release once upstream branch merged stage: - command-chain/openvino-ai-plugins-gimp-launch