Here is a partial answer, which is maybe closer to a slightly different generalization from the poset case. In light of Chris Schommer-Pries' comment and answer, I've opted to work strictly, tweaking to require lifts only with respect to full subcategory inclusions. I believe non-strict statements follow easily. As noted in the proof of Lemma 2, the proof there is rather fiddly (and in particular does not immediately generalize to the $\infty$-categorical case) and it is possible I have made a mistake, so _caveat lector_!

---

**Claim:** Let $\mathcal K$ be an accessible category. Then $\mathcal K$ is (strictly) injective with respect to full subcategory inclusions (equivalently: injective-on-objects, fully faithful functors) between small categories if and only if $\mathcal K$ is locally presentable.

---

Recall than an accessible category is complete iff it is cocomplete iff it is locally presentable. Not only does this answer the question with a restriction on $\mathcal K$, but it _almost_ allows us to conclude that in the category $Acc$ of accessible categories and accessible functors, the objects which are injective with respect to full subcategory inclusions are precisely the locally presentable categories. Such a statement, if true, would provide a direct generalization of the case of posets, where instead of generalizing posets to categories, we generalize posets to accessible categories.

---

The proof of the claim will use the following lemmas. If $J$ is a category, let $J^\triangleright$ denote the cocone on $J$-- i.e. $J$ with a terminal object freely adjoined. Let $\infty \in J^\triangleright$ denote the cone point. Note that we have a canonical full subcategory inclusion $J \to J^\triangleright$. Similarly, $I^\triangleleft$ is $I$ with a free initial object $-\infty$ adjoined.

**Lemma 1:** Let $\mathcal K$ be an accessible category. Suppose that $\mathcal K$ is strictly injective with respect to the inclusion $J \to J^\triangleright$ for each small $J$. Then $\mathcal K$ has a terminal object.

**Proof:** Write $\mathcal K = Ind_\kappa(\mathcal K_\kappa)$, where $\mathcal K_\kappa$ is small. By hypothesis, the canonical inclusion $\mathcal K_\kappa \to \mathcal K$ has an extension along $\mathcal K_\kappa \to \mathcal (K_\kappa)^\triangleright$. Since the inclusion $\mathcal K_\kappa \to \mathcal K$ is cofinal, this implies that there is a cocone on the identity functor $\mathcal K \to \mathcal K$. Since $\mathcal K$ has split idempotents, it follows that $\mathcal K$ has a terminal object.

**Lemma 2:** Let $J$ be a category, and let $I$ be either a discrete category, or the walking cospan $I = \bullet \to \bullet \leftarrow \bullet$. Then the canonical functor $(I^\triangleleft \times J) \cup_{I \times J} (I \times J^\triangleright) \to I^\triangleleft \times J^\triangleright$ is fully faithful and injective on objects.

**Proof:** The thing to show is that if $i \in I$ and $j \in J$, then there is a unique map $(-\infty,j) \to (i,\infty)$ in the pushout category. I do not see a better way to do this than case-by-case analysis, and it is possible I have missed something. I don't believe this lemma holds for arbitrary $I$.


**Proof of Claim:** In one direction, if $\mathcal K$ is complete, then it is injective via Kan extensions as noted by Gregory Arone in the comments. Conversely, suppose that $\mathcal K$ is accessible and injective; we wish to show that $\mathcal K$ is complete, or equivalently that $\mathcal K$ has products and pullbacks.  That is, if $I$ is either discrete or the walking cospan $I = \bullet \to \bullet \leftarrow \bullet$ and $F: I \to \mathcal K$, we wish to show that $\mathcal K^{I^\triangleleft} \times_{\mathcal K^I} \{F\}$ has a terminal object. Since this category is accessible, it will suffice by Lemma 1 to show that it is injective with respect to $J \to J^{\triangleright}$ for all small $J$. It will suffice to show that $\mathcal K^{I^\triangleleft} \to \mathcal K^I$ has the right lifting property with respect to such functors. By the usual currying/uncurrying manipulations, this is equivalent to showing that $\mathcal K$ is injective with respect to the functor $(I^\triangleleft \times J) \cup_{I \times J} (I \times J^\triangleright) \to I^\triangleleft \times J^\triangleright$. This follows from Lemma 2 and the hypothesis that $\mathcal K$ is injective.