diff --git a/charts/incubator/lama-cleaner/.helmignore b/charts/incubator/lama-cleaner/.helmignore new file mode 100644 index 00000000000..77ca5567b26 --- /dev/null +++ b/charts/incubator/lama-cleaner/.helmignore @@ -0,0 +1,30 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ +# OWNERS file for Kubernetes +OWNERS +# helm-docs templates +*.gotmpl +# docs folder +/docs +# icon +icon.png diff --git a/charts/incubator/lama-cleaner/CHANGELOG.md b/charts/incubator/lama-cleaner/CHANGELOG.md new file mode 100644 index 00000000000..825c32f0d03 --- /dev/null +++ b/charts/incubator/lama-cleaner/CHANGELOG.md @@ -0,0 +1 @@ +# Changelog diff --git a/charts/incubator/lama-cleaner/Chart.yaml b/charts/incubator/lama-cleaner/Chart.yaml new file mode 100644 index 00000000000..5ebd320d457 --- /dev/null +++ b/charts/incubator/lama-cleaner/Chart.yaml @@ -0,0 +1,31 @@ +apiVersion: v2 +appVersion: "0.26.1" +dependencies: + - name: common + repository: https://library-charts.truecharts.org + version: 11.0.7 +deprecated: false +description: Open-source inpainting tool powered by SOTA AI model. +home: https://truecharts.org/docs/charts/lama-cleaner +icon: https://truecharts.org/img/hotlink-ok/chart-icons/lama-cleaner.png +keywords: + - lama-cleaner + - media + - AI +kubeVersion: ">=1.16.0-0" +maintainers: + - email: info@truecharts.org + name: TrueCharts + url: https://truecharts.org +name: lama-cleaner +sources: + - https://github.com/truecharts/charts/tree/master/charts/lama-cleaner + - https://github.com/Sanster/lama-cleaner +type: application +version: 0.0.1 +annotations: + truecharts.org/catagories: | + - media + - AI + truecharts.org/SCALE-support: "true" + truecharts.org/grade: U diff --git a/charts/incubator/lama-cleaner/README.md b/charts/incubator/lama-cleaner/README.md new file mode 100644 index 00000000000..b233e971b12 --- /dev/null +++ b/charts/incubator/lama-cleaner/README.md @@ -0,0 +1 @@ +# lama-cleaner diff --git a/charts/incubator/lama-cleaner/icon.png b/charts/incubator/lama-cleaner/icon.png new file mode 100644 index 00000000000..3ff91edd252 Binary files /dev/null and b/charts/incubator/lama-cleaner/icon.png differ diff --git a/charts/incubator/lama-cleaner/questions.yaml b/charts/incubator/lama-cleaner/questions.yaml new file mode 100644 index 00000000000..f9d784b3289 --- /dev/null +++ b/charts/incubator/lama-cleaner/questions.yaml @@ -0,0 +1,199 @@ +# Include{groups} +portals: + open: +# Include{portalLink} +questions: +# Include{global} + - variable: imageSelector + group: Container Image + label: Select Image + schema: + type: string + default: image + enum: + - value: image + description: CPU Image + - value: imageGPU + description: GPU Image +# Include{controller} +# Include{replicas} +# Include{replica1} +# Include{controllerExpertExtraArgs} + - variable: lamacleaner + group: App Configuration + label: Lama Cleaner Configuration + schema: + additional_attrs: true + type: dict + attrs: + - variable: model + label: Model + description: Inpainting Model https://github.com/Sanster/lama-cleaner#inpainting-model + schema: + type: string + required: true + default: lama + enum: + - value: lama + description: lama + - value: cv2 + description: cv2 + - value: ldm + description: ldm + - value: zits + description: zits + - value: fcf + description: fcf + - value: sd1.5 + description: sd1.5 + - value: mat + description: mat + - variable: input + label: Input + description: Path to image you want to load by default + schema: + type: string + default: "" + - variable: sd_run_local + label: Stable Diffusion Run Local + description: Once the model as downloaded, you can enable this. + schema: + type: boolean + default: false + - variable: hf_access_token + label: HuggingFace Access Token + description: Stable diffusion need HuggingFace access token to download model + schema: + type: string + show_if: [[ "sd_run_local", "=", "true"]] + private: true + default: "" + - variable: sd_disable_nsfw + label: Stable Diffusion Disable NSFW Checker. + description: Disable stable diffusion NSFW checker. + schema: + type: boolean + default: false + - variable: sd_cpu_text_encoder + label: Stable Diffusion Text Encoder + description: Always run stable-diffusion TextEncoder model on CPU. + schema: + type: boolean + default: false + - variable: sd_enable_xformers + label: Stable Diffusion Enable XFormers + description: Enable xFormers optimizations. + schema: + type: boolean + default: false + - variable: debug + label: Enable debug + description: Enable debug mode for flask web server + schema: + type: boolean + default: false +# Include{containerConfig} +# Include{serviceRoot} + - variable: main + label: Main Service + description: The Primary service on which the healthcheck runs, often the webUI + schema: + additional_attrs: true + type: dict + attrs: +# Include{serviceSelectorLoadBalancer} +# Include{serviceSelectorExtras} + - variable: main + label: Main Service Port Configuration + schema: + additional_attrs: true + type: dict + attrs: + - variable: port + label: Port + description: This port exposes the container port on the service + schema: + type: int + default: 10604 + required: true +# Include{serviceExpertRoot} + default: false +# Include{serviceExpert} +# Include{serviceList} +# Include{persistenceRoot} + - variable: torch + label: App Torch Storage + description: Stores the Application Torch. + schema: + additional_attrs: true + type: dict + attrs: +# Include{persistenceBasic} + - variable: huggingface + label: App HuggingFace Storage + description: Stores the Application HuggingFace. + schema: + additional_attrs: true + type: dict + attrs: +# Include{persistenceBasic} +# Include{persistenceList} +# Include{ingressRoot} + - variable: main + label: Main Ingress + schema: + additional_attrs: true + type: dict + attrs: +# Include{ingressDefault} +# Include{ingressTLS} +# Include{ingressTraefik} +# Include{ingressList} +# Include{security} +# Include{securityContextAdvancedRoot} + - variable: privileged + label: Privileged mode + schema: + type: boolean + default: false + - variable: readOnlyRootFilesystem + label: ReadOnly Root Filesystem + schema: + type: boolean + default: false + - variable: allowPrivilegeEscalation + label: Allow Privilege Escalation + schema: + type: boolean + default: false + - variable: runAsNonRoot + label: runAsNonRoot + schema: + type: boolean + default: false +# Include{podSecurityContextRoot} + - variable: runAsUser + label: runAsUser + description: The UserID of the user running the application + schema: + type: int + default: 0 + - variable: runAsGroup + label: runAsGroup + description: The groupID this App of the user running the application + schema: + type: int + default: 0 + - variable: fsGroup + label: fsGroup + description: The group that should own ALL storage. + schema: + type: int + default: 568 +# Include{podSecurityContextAdvanced} +# Include{resources} +# Include{advanced} +# Include{addons} +# Include{codeserver} +# Include{vpn} +# Include{documentation} diff --git a/charts/incubator/lama-cleaner/templates/_args.tpl b/charts/incubator/lama-cleaner/templates/_args.tpl new file mode 100644 index 00000000000..f0488465ea2 --- /dev/null +++ b/charts/incubator/lama-cleaner/templates/_args.tpl @@ -0,0 +1,33 @@ +{{- define "lama.args" -}} +args: + - --host=0.0.0.0 + - --port={{ .Values.service.main.ports.main.port }} + {{- if eq .Values.imageSelector "image" }} + - --device=cpu + {{- if .Values.lamacleaner.sd_cpu_text_encoder }} + - --sd-cpu-textencoder + {{- end }} + {{- else if eq .Values.imageSelector "gpuImage" }} + - --device=cuda + {{- end }} + {{- with .Values.lamacleaner.model }} + - --model={{ . }} + {{- end }} + {{- if .Values.lamacleaner.sd_run_local }} + - --sd-run-local + {{- else if .Values.lamacleaner.hf_access_token }} + - --hf_access_token={{ .Values.lamacleaner.hf_access_token }} + {{- end }} + {{- if .Values.lamacleaner.sd_enable_xformers }} + - --sd-enable-xformers + {{- end }} + {{- if .Values.lamacleaner.sd_disable_nsfw }} + - --sd-disable-nsfw + {{- end }} + {{- with .Values.lamacleaner.input }} + - --input={{ . }} + {{- end }} + {{- if .Values.lamacleaner.debug }} + - --debug + {{- end }} +{{- end -}} diff --git a/charts/incubator/lama-cleaner/templates/common.yaml b/charts/incubator/lama-cleaner/templates/common.yaml new file mode 100644 index 00000000000..32d10b87350 --- /dev/null +++ b/charts/incubator/lama-cleaner/templates/common.yaml @@ -0,0 +1,9 @@ +{{/* Make sure all variables are set properly */}} +{{- include "tc.common.loader.init" . }} + +{{- $newArgs := (include "lama.args" . | fromYaml) }} +{{- $args := concat .Values.args $newArgs.args }} +{{- $_ := set .Values "args" $args -}} + +{{/* Render the templates */}} +{{ include "tc.common.loader.apply" . }} diff --git a/charts/incubator/lama-cleaner/values.yaml b/charts/incubator/lama-cleaner/values.yaml new file mode 100644 index 00000000000..e283270246d --- /dev/null +++ b/charts/incubator/lama-cleaner/values.yaml @@ -0,0 +1,49 @@ +image: + repository: cwq1913/lama-cleaner + pullPolicy: IfNotPresent + tag: cpu-0.26.1@sha256:e57095636fe19e62280e78f10f98fff0fe1e0608e689515b2a0a56a7d2dad2e8 + +gpuImage: + repository: cwq1913/lama-cleaner + tag: gpu-0.26.1@sha256:65c54a6309f46bb643be31d704e4b361988b277f7b9492a9dd8e24c28220005c + pullPolicy: Always + +imageSelector: image + +command: lama-cleaner + +securityContext: + runAsNonRoot: false + readOnlyRootFilesystem: false + +podSecurityContext: + runAsUser: 0 + runAsGroup: 0 + +lamacleaner: + model: lama + input: "" + sd_run_local: false + hf_access_token: "" + sd_disable_nsfw: false + sd_cpu_text_encoder: false + sd_enable_xformers: false + debug: false + +service: + main: + ports: + main: + protocol: HTTP + port: 10604 + +persistence: + torch: + enabled: true + mountPath: /root/.cache/torch + huggingface: + enabled: true + mountPath: /root/.cache/huggingface + +portal: + enabled: true