def merge_with_inner_canny(image: np.ndarray, mask1: np.ndarray, mask2: np.ndarray) -> (np.ndarray, np.ndarray):
    """
    Merge an image with inner Canny edges by applying Canny edge detection to the image and masks, and then removing
    the outline of mask1 to obtain inner edges.

    Args:
        image (np.ndarray): The input image as a NumPy array.
        mask1 (np.ndarray): The first binary mask.
        mask2 (np.ndarray): The second binary mask.

    Returns:
        tuple: A tuple containing two images - the first is the resized image, and the second is the Canny edges image with inner edges.
    """

    def remove_outline(img: np.ndarray, outline_mask: np.ndarray) -> np.ndarray:
        """
        Remove the outlined region from an image based on an outline mask.

        Args:
            img (np.ndarray): The input image as a NumPy array.
            outline_mask (np.ndarray): The binary mask that defines the outline region to be removed.

        Returns:
            np.ndarray: The resulting image with the outlined region removed.
        """
        # Convert outline mask to binary (0 or 1)
        binary_outline_mask = (outline_mask > 128).astype(np.uint8)

        # Invert the binary outline mask (0 for areas to exclude, 1 for areas to keep)
        inverted_mask = cv2.bitwise_not(binary_outline_mask)

        # Apply the inverted mask to the input image
        result_image = cv2.bitwise_and(img, img, mask=inverted_mask)

        return result_image

    def canny(img, res=512, thr_a=100, thr_b=200, **kwargs):
        def apply_canny(img, low_threshold, high_threshold):
            return cv2.Canny(img, low_threshold, high_threshold)

        l, h = thr_a, thr_b
        img, remove_pad = resize_image_with_pad(img, res)

        model_canny = apply_canny
        result = model_canny(img, l, h)
        return remove_pad(result), remove_pad(img)

    canny_image, resize_image = canny(image)

    _, resize_mask1 = canny(mask1)
    _, resize_mask2 = canny(mask2)

    mask1_outline = np.uint8(
        cv2.dilate(np.array(resize_mask1), np.ones((30, 30), np.uint8), iterations=1)
        - cv2.erode(np.array(resize_mask1), np.ones((30, 30), np.uint8), iterations=1)
    )

    mask1_outline = cv2.cvtColor(np.uint8(mask1_outline), cv2.COLOR_BGR2GRAY)

    # Remove the mask1 outline from the Canny image to obtain inner edges
    canny_image_inner = remove_outline(canny_image, mask1_outline)

    return resize_image, canny_image_inner, mask1_outline

    Merge an image with inner Canny edges by applying Canny edge detection to the image and masks, and then removing
    the outline of mask1 to obtain inner edges.

    Args:
        image (np.ndarray): The input image as a NumPy array.
        mask1 (np.ndarray): The first binary mask.
        mask2 (np.ndarray): The second binary mask.

    Returns:
        tuple: A tuple containing two images - the first is the resized image, and the second is the Canny edges image with inner edges.
    
scripts/easyphoto_utils/tryon_utils.py