-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add interface for generative ai worker - rename sd repository and move it to integrations - add genai backend in settings to choose between celery or ray
- Loading branch information
Showing
7 changed files
with
103 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
42 changes: 42 additions & 0 deletions
42
morpheus-server/app/integrations/genai_engine/genai_interface.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from abc import ABC, abstractmethod | ||
|
||
from PIL import Image | ||
|
||
from morpheus_data.models.schemas import MagicPrompt, Prompt, PromptControlNet | ||
|
||
|
||
class GenAIInterface(ABC): | ||
@staticmethod | ||
@abstractmethod | ||
def generate_text2img_images(prompt: Prompt) -> str: | ||
raise NotImplementedError("This method is not implemented") | ||
|
||
@staticmethod | ||
@abstractmethod | ||
def generate_img2img_images(prompt: Prompt, image: Image) -> str: | ||
raise NotImplementedError("This method is not implemented") | ||
|
||
@staticmethod | ||
@abstractmethod | ||
def generate_controlnet_images(prompt: PromptControlNet, image: Image) -> str: | ||
raise NotImplementedError("This method is not implemented") | ||
|
||
@staticmethod | ||
@abstractmethod | ||
def generate_pix2pix_images(prompt: Prompt, image: Image) -> str: | ||
raise NotImplementedError("This method is not implemented") | ||
|
||
@staticmethod | ||
@abstractmethod | ||
def generate_inpainting_images(prompt: Prompt, image: Image, mask: Image) -> str: | ||
raise NotImplementedError("This method is not implemented") | ||
|
||
@staticmethod | ||
@abstractmethod | ||
def generate_upscaling_images(prompt: Prompt, image: Image) -> str: | ||
raise NotImplementedError("This method is not implemented") | ||
|
||
@staticmethod | ||
@abstractmethod | ||
def generate_magicprompt(prompt: MagicPrompt) -> str: | ||
raise NotImplementedError("This method is not implemented") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters