Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

1.3 KB
Raw Blame
from abc import ABC, abstractmethod
from typing import Optional

from invokeai.app.services.image_records.image_records_common import ImageCategory


class BoardImagesServiceABC(ABC):
    """High-level service for board-image relationship management."""

    @abstractmethod
    def add_image_to_board(
        self,
        board_id: str,
        image_name: str,
    ) -> None:
        """Adds an image to a board."""
        pass

    @abstractmethod
    def remove_image_from_board(
        self,
        image_name: str,
        board_id: str,
    ) -> int:
        """Removes an image from the given board. Returns the number of rows removed."""
        pass

    @abstractmethod
    def get_all_board_image_names_for_board(
        self,
        board_id: str,
        categories: list[ImageCategory] | None,
        is_intermediate: bool | None,
        user_id: Optional[str] = None,
    ) -> list[str]:
        """Gets all board images for a board, as a list of the image names.

        When ``user_id`` is provided, results are restricted to images owned by that user;
        pass ``None`` for the admin path (no per-user restriction).
        """
        pass

    @abstractmethod
    def get_board_for_image(
        self,
        image_name: str,
    ) -> Optional[str]:
        """Gets an image's board id, if it has one."""
        pass