def METHOD_NAME(
    img: np.ndarray,
    model: OnnxModel,
    tile_size: TileSize,
    separate_alpha: bool,
) -> np.ndarray:
    """Upscales an image with a pretrained model"""
    settings = get_settings()
    session = get_onnx_session(
        model,
        settings.gpu_index,
        settings.execution_provider,
        settings.tensorrt_fp16_mode,
        settings.tensorrt_cache_path,
    )
    input_shape, in_nc, req_width, req_height = get_input_shape(session)
    _, out_nc, _, _ = get_output_shape(session)
    change_shape = input_shape == "BHWC"
    exact_size = None
    if req_width is not None:
        exact_size = req_width, req_height or req_width
    elif req_height is not None:
        exact_size = req_width or req_height, req_height
    h, w, c = get_h_w_c(img)
    logger.debug(f"Image is {h}x{w}x{c}")
    return convenient_upscale(
        img,
        in_nc,
        out_nc,
        lambda i: upscale(i, session, tile_size, change_shape, exact_size),
        separate_alpha,
    )