diff --git a/app/service/design_fast/utils/synthesis_item.py b/app/service/design_fast/utils/synthesis_item.py index a8ce1b4..606b1b5 100644 --- a/app/service/design_fast/utils/synthesis_item.py +++ b/app/service/design_fast/utils/synthesis_item.py @@ -60,6 +60,18 @@ def positioning(all_mask_shape, mask_shape, offset): # @RunTime def synthesis(data, size, basic_info): + """ + + Args: + data: + size: + basic_info: + + Returns: + + """ + # out_of_bounds_control: 是否允许服装越界 True 允许 False 不允许 默认情况允许 + out_of_bounds_control = basic_info.get('out_of_bounds_control', True) # 创建底图 base_image = Image.new('RGBA', size, (0, 0, 0, 0)) try: @@ -88,7 +100,10 @@ def synthesis(data, size, basic_info): while i: i -= 1 if top and data[i]['name'] in ["blouse_front", "outwear_front", "dress_front", "tops_front"]: - top = False + if out_of_bounds_control: + top = True + else: + top = False mask_shape = data[i]['mask'].shape y_offset, x_offset = data[i]['adaptive_position'] # 初始化叠加区域的起始和结束位置