Counting without remembering
A Bloom filter answers whether an item is present. It cannot say how many distinct items it holds, because it never counted them.
Cardinality is a harder problem than membership in one specific way: the naive solution requires recognising repeats, and recognising a repeat means having kept the earlier occurrence. That is why a hash set works and why it costs space proportional to the answer.
The way out is to stop trying to recognise repeats at all, and instead to measure something about the hashes that is insensitive to duplicates.
Hash an item and you get a fixed pattern of bits. Hash the same item again and you get the identical pattern. So any property computed from the set of hash values seen is automatically unaffected by how many times each item arrived. Duplicates become free, without anything being stored.
The question is which property of a set of random-looking bit patterns reveals how many distinct patterns produced it.

