IntelliJ IDEA can smartly tell the nodes that belong to the same package from the extraneous ones.
- Select a node element in diagram.
- Start navigating through the diagram.
So doing, the classes and packages that reside in different packages, are automatically grayed out.

