How to Use Different Internal Reference V for ADC and Comparator?

I want to use a 5V reference for the ADC (to get 5V = 1023),
and a ~2.5V reference for the analog comparator (< 2.5V = 0, > 2.5V = 1).

Is it possible?

“Configures the reference voltage used for analog input (i.e. the value used as the top of the input range).
Arduino AVR Boards (Uno, Mega, Leonardo, etc.):
INTERNAL2V56: a built-in 2.56V reference”

https://www.arduino.cc/reference/en/language/functions/analog-io/analogreference/

Is this about an Uno?

AFAIK the comparator can only work with the internal 1.1 V reference. But you can connect AIN1 to an external 2.5 V source of two equal resistors, that divide VCC by two. A 10 nF capacitor between AIN1 and GND may help to lose some noise. Use AIN0 as input.

Use the 1.1v internal reference and scale your inputs with voltage dividers .