@click.command()
@click.pass_context
@click.option('--lower_res_pkl', help='Network pickle filename for lower resolutions', required=True)
@click.option('--higher_res_pkl', help='Network pickle filename for higher resolutions', required=True)
@click.option('--output_path', 'out', help='Network pickle filepath for output', default='./blended.pt')
@click.option('--model_res', type=int, help='Output resolution of model (likely 1024, 512, or 256)', default=64, show_default=True)
@click.option('--split_lvl', type=int, help='Resolution to split model weights', default=4, show_default=True)
def create_blended_model(ctx: click.Context, lower_res_pkl: str, higher_res_pkl: str, model_res: Optional[int], split_lvl: Optional[int], out: Optional[str]):
    lo_G_ema = torch.load(lower_res_pkl, map_location=torch.device('cpu'))['g_ema']
    hi = torch.load(higher_res_pkl, map_location=torch.device('cpu'))['g_ema']
    model_out = blend_models(lo_G_ema, hi, model_res, split_lvl)
    torch.save(model_out, out)
@click.command()
@click.pass_context
@click.option('--lower_res_pkl', help='Network pickle filename for lower resolutions', required=True)
@click.option('--higher_res_pkl', help='Network pickle filename for higher resolutions', required=True)
@click.option('--output_path', 'out', help='Network pickle filepath for output', default='./blended.pt')
@click.option('--model_res', type=int, help='Output resolution of model (likely 1024, 512, or 256)', default=64, show_default=True)
@click.option('--split_lvl', type=int, help='Resolution to split model weights', default=4, show_default=True)
def create_blended_model(ctx: click.Context, lower_res_pkl: str, higher_res_pkl: str, model_res: Optional[int], split_lvl: Optional[int], out: Optional[str]):
    lo_G_ema = torch.load(lower_res_pkl, map_location=torch.device('cpu'))['g_ema']
    hi = torch.load(higher_res_pkl, map_location=torch.device('cpu'))['g_ema']
    model_out = blend_models(lo_G_ema, hi, model_res, split_lvl)
    torch.save(model_out, out)