INNER CODE UNIT · Python
center_col_from_left
Shilin-LU/TF-ICON · scripts/app.py:173
center_col_from_left = round(center_x / 512, 2)
aspect_ratio = new_h / new_w
if aspect_ratio > 1:
mask_scale = new_w * aspect_ratio / 256
mask_scale = new_h / 256
else:
mask_scale = new_w / 256
mask_scale = new_h / (aspect_ratio * 256)
# mask_scale = round(mask_scale, 2)
# =============================================================================================
data = [batch_size * [prompt]]
# read background image
init_image, target_width, target_height = load_img(init_img, mask_scale)