A (very?) naïve question, but I didn't get an answer on math.se: so here goes ….

In his original [ETCS](https://doi.org/10.1073/pnas.52.6.1506) paper, Lawvere states a categorial version of choice for sets in this form: "If the domain of $f$ has elements, then there exists $g$ such that $fgf = f$". So let's say, generalizing

(1) A category has Choice-1 iff for any $f\colon X \to Y$ where $X \not\cong 0$ [with $0$ initial], there exists a $g \colon Y \to X$ such that  $f \circ g \circ f = f$. 

Another more familiar version of choice for sets is that any surjection has a right inverse (or left inverse, depending on your preferred handedness convention!). Generalizing, let's say

(2) A category has Choice-2 iff for any epic $f\colon X \to Y$ there exists a $g \colon Y \to X$ such that  $f \circ g = 1_Y$. 

But (forgive a senior moment!) I'm embarrassingly unclear about the conditions — the weakest/most natural/nicest conditions? —  under which a category which has Choice-2 has Lawvere's Choice-1. Is there a standard story about this which I've missed?