mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-16 16:27:45 +01:00
stable diffusion allow postprocess kwargs
Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/12418063 * stable diffusion allow postprocess kwargs
This commit is contained in:
@@ -39,10 +39,10 @@ class DiffusersPipeline(Pipeline):
|
||||
self.models = [self.model]
|
||||
self.has_multiple_models = len(self.models) > 1
|
||||
|
||||
def preprocess(self, inputs: Dict[str, Any]) -> Dict[str, Any]:
|
||||
def preprocess(self, inputs: Dict[str, Any], **kwargs) -> Dict[str, Any]:
|
||||
return inputs
|
||||
|
||||
def postprocess(self, inputs: Dict[str, Any]) -> Dict[str, Any]:
|
||||
def postprocess(self, inputs: Dict[str, Any], **kwargs) -> Dict[str, Any]:
|
||||
return inputs
|
||||
|
||||
def __call__(self, input: Union[Input, List[Input]], *args,
|
||||
|
||||
@@ -75,7 +75,7 @@ class ChineseStableDiffusionPipeline(DiffusersPipeline):
|
||||
callback=inputs.get('callback'),
|
||||
callback_steps=inputs.get('callback_steps', 1))
|
||||
|
||||
def postprocess(self, inputs: Dict[str, Any]) -> Dict[str, Any]:
|
||||
def postprocess(self, inputs: Dict[str, Any], **kwargs) -> Dict[str, Any]:
|
||||
images = []
|
||||
for img in inputs.images:
|
||||
if isinstance(img, Image.Image):
|
||||
|
||||
@@ -65,7 +65,7 @@ class StableDiffusionWrapperPipeline(DiffusersPipeline):
|
||||
callback=inputs.get('callback'),
|
||||
callback_steps=inputs.get('callback_steps', 1))
|
||||
|
||||
def postprocess(self, inputs: Dict[str, Any]) -> Dict[str, Any]:
|
||||
def postprocess(self, inputs: Dict[str, Any], **kwargs) -> Dict[str, Any]:
|
||||
images = []
|
||||
for img in inputs.images:
|
||||
if isinstance(img, Image.Image):
|
||||
|
||||
Reference in New Issue
Block a user