# yaml-language-server: $schema=https://schema.zeabur.app/template.json
apiVersion: zeabur.com/v1
kind: Template
metadata:
    name: InvokeAI
spec:
    description: InvokeAI is an implementation of Stable Diffusion, the open source text-to-image and image-to-image generator. It provides a streamlined process with various new features and options to aid the image generation process.
    coverImage: https://www.theaibuilders.dev/products/invokeai/invokeai-cover.png
    icon: https://www.theaibuilders.dev/products/invokeai/invokeai.png
    variables:
        - key: PUBLIC_DOMAIN
          type: DOMAIN
          name: InvokeAI Domain
          description: The domain for accessing your InvokeAI application.
    tags:
        - AI
        - Image
        - StableDiffusion
        - GUI
    readme: |-
        # InvokeAI Zeabur Template

        This template deploys the official InvokeAI docker image (`ghcr.io/invoke-ai/invokeai`) exposing the Web UI on port 9090.

        ## Features
        * Persistent volume for models & outputs (`/data`)
        * Optional Hugging Face token support
        * Domain binding via `PUBLIC_DOMAIN`
        * GPU toggle

        ## Environment Variables
        - `INVOKEAI_ROOT`: Directory inside the persistent volume used by InvokeAI (default `/data/invokeai`).
        - `HUGGING_FACE_HUB_TOKEN`: (Optional) enables downloading private HF models.
    services:
        - name: invokeai
          icon: https://www.theaibuilders.dev/products/invokeai/invokeai.png
          template: PREBUILT
          spec:
            id: invokeai
            source:
                image: ghcr.io/invoke-ai/invokeai:latest
            ports:
                - id: web
                  port: 9090
                  type: HTTP
            volumes:
                - id: data
                  dir: /data
            instructions:
                - title: Open InvokeAI Web UI
                  content: https://${PUBLIC_DOMAIN}
                - title: Internal HTTP Endpoint
                  content: http://invokeai:${WEB_PORT}
                - title: Data Persistence Path
                  content: /data
            env:
                CONTAINER_HOSTNAME:
                    default: ${CONTAINER_HOSTNAME}
                    expose: true
                HUGGING_FACE_HUB_TOKEN:
                    default: ""
                    expose: false
                INVOKEAI_ROOT:
                    default: /data/invokeai
                    expose: true
            gpu: {}
          domainKey: PUBLIC_DOMAIN
