The loan is based on the after-repair value
An appraiser values the property twice, in effect: as it stands, and as it will be once the approved scope of work is complete. You borrow against the second figure, which is what makes buying a house that needs thirty thousand dollars of work possible without thirty thousand dollars in the bank.