The knowledge on which inference is based can itself come from perception, comparison or testimony. Inference moves from the known to the unknown. It is immediately noticeable that the Nyaya understanding of inference focuses on causal relations not on what a modern Western philosopher would understand as logical relations. Comparison - a form of knowledge based on existing knowledge. The knowledge on which comparison is based can itself come from perception, inference, comparison or testimony.
Comparison moves from the known to the unknown.
So far comparison is similar to inference, and critics of Nyaya often argue it is actually a form of inference. Nyaya makes a distinction saying the process is distinct and the way we express it in language is distinct. Unfortunately, modern English use does not support the Nyaya claim. We often express reasoning from comparison by using 'thus' and 'therefore' and 'and so,' the typical marks in ordinary language of inference. From the point of view of modern logic, the Nyaya account of inference and comparison is inadequate.