for i, j in zip(reversed(seq), reversed(seq_next)):
    t = (torch.ones(n) * i).to(x.device)
    next_t = (torch.ones(n) * j).to(x.device)
    at = compute_alpha(b, t.long())
    at_next = compute_alpha(b, next_t.long())
    xt = xs[-1].to(x.device)
    et_output = torch.zeros(x_cond.size(0), 3, x_cond.size(2),
                            x_cond.size(3), device=x.device)

    xt_patch = torch.cat([crop(xt, hi, wi, p_size, p_size)
                          for (hi, wi) in corners], dim=0)
    x_cond_patch = torch.cat(
        [data_transform(crop(x_cond, hi, wi, p_size, p_size))
         for (hi, wi) in corners], dim=0)
    outputs = model(x_input, t, ii_input, jj_input, osize_input)
    et_output[0, :, hi:hi + p_size, wi:wi + p_size] += outputs[idx]

    et0 = torch.div(et_output, x_grid_mask)
    et1 = torch.div(et_output1, x_grid_mask1)
    et2 = torch.div(et_output2, x_grid_mask2)
    et = (et0 + et1 + et2) / 3.0

    x0_t = (xt - et * (1 - at).sqrt()) / at.sqrt()
    xt_next = at_next.sqrt() * x0_t + c1 * torch.randn_like(x) + c2 * et
