For $X$ of cardinality at least continuum there exist such spaces, even metrizable ones. It follows immediately from a much more general result, proved by Trnková in [1]. She proves that the category of graphs admits a full embedding into the category of metrizable spaces with nonconstant maps. An inspection of the proof shows that a graph $G$ is sent to a space whose cardinality is $|G|\times\frak{c}$. Then we use the fact that there exist rigid graphs $G$ of every cardinality - this is proved in P. Vopěnka, A. Pultr and Z. Hedrlin, Commentationes Mathematicae Universitatis Carolinae 6(1965), 149-155.

[1] V. Trnková, Non-constant continuous mappings of metric or compact Hausdorff spaces, Comment. Math. Univ. Carolinae 13 (1972) 283–295.