2023-09-14 03:56:23 +00:00
|
|
|
import unittest
|
2023-09-15 00:35:48 +00:00
|
|
|
|
2023-09-14 03:56:23 +00:00
|
|
|
from PIL import Image
|
|
|
|
|
|
|
|
from onnx_web.chain.blend_mask import BlendMaskStage
|
2023-11-19 03:35:00 +00:00
|
|
|
from onnx_web.chain.result import StageResult
|
2023-09-14 03:56:23 +00:00
|
|
|
from onnx_web.params import HighresParams, UpscaleParams
|
|
|
|
|
|
|
|
|
|
|
|
class BlendMaskStageTests(unittest.TestCase):
|
|
|
|
def test_empty(self):
|
|
|
|
stage = BlendMaskStage()
|
2023-11-19 03:35:00 +00:00
|
|
|
sources = StageResult.empty()
|
2023-09-14 03:56:23 +00:00
|
|
|
result = stage.run(
|
|
|
|
None,
|
|
|
|
None,
|
|
|
|
None,
|
|
|
|
None,
|
|
|
|
sources,
|
|
|
|
highres=HighresParams(False, 1, 0, 0),
|
|
|
|
upscale=UpscaleParams(""),
|
|
|
|
stage_mask=Image.new("RGBA", (64, 64)),
|
|
|
|
)
|
|
|
|
|
|
|
|
self.assertEqual(len(result), 0)
|