Add stability node (Text2Img)

This commit is contained in:
Song
2023-09-07 12:50:13 +08:00
parent 1bbdf2e722
commit 3eac598c97
5 changed files with 209 additions and 61 deletions
+11 -14
View File
@@ -1,5 +1,5 @@
from abc import ABC, abstractmethod
from .compute_task import ComputeTask
from .compute_task import ComputeTask, ComputeTaskType
class ComputeNode(ABC):
@@ -8,15 +8,15 @@ class ComputeNode(ABC):
self.enable = True
@abstractmethod
async def push_task(self,task:ComputeTask,proiority:int = 0):
pass
@abstractmethod
async def remove_task(self,task_id:str):
async def push_task(self, task: ComputeTask, proiority: int = 0):
pass
@abstractmethod
def get_task_state(self,task_id:str):
async def remove_task(self, task_id: str):
pass
@abstractmethod
def get_task_state(self, task_id: str):
pass
@abstractmethod
@@ -28,7 +28,7 @@ class ComputeNode(ABC):
pass
@abstractmethod
def is_support(self,task_type:str) -> bool:
def is_support(self, task_type: ComputeTaskType) -> bool:
pass
@abstractmethod
@@ -37,17 +37,14 @@ class ComputeNode(ABC):
def is_trusted(self) -> bool:
return True
def get_fee_type(self) -> str:
return "free"
class LocalComputeNode(ComputeNode):
def display(self) -> str:
return super().display()
def is_local(self) -> bool:
return True