@@ -88,7 +88,7 @@ class StableDiffusionAdapterPipelineOutput(BaseOutput):
88
88
"""
89
89
90
90
91
- def preprocess (image , height , width ):
91
+ def _preprocess_adapter_image (image , height , width ):
92
92
if isinstance (image , torch .Tensor ):
93
93
return image
94
94
elif isinstance (image , PIL .Image .Image ):
@@ -695,11 +695,11 @@ def __call__(
695
695
696
696
is_multi_adapter = isinstance (self .adapter , MultiAdapter )
697
697
if is_multi_adapter :
698
- adapter_input = [preprocess (img , height , width ).to (device ) for img in image ]
698
+ adapter_input = [_preprocess_adapter_image (img , height , width ).to (device ) for img in image ]
699
699
n , c , h , w = adapter_input [0 ].shape
700
700
adapter_input = torch .stack ([x .reshape ([n * c , h , w ]) for x in adapter_input ])
701
701
else :
702
- adapter_input = preprocess (image , height , width ).to (device )
702
+ adapter_input = _preprocess_adapter_image (image , height , width ).to (device )
703
703
adapter_input = adapter_input .to (self .adapter .dtype )
704
704
705
705
# 2. Define call parameters
0 commit comments