The engines are generally the same (cam, compression other head differences). The thing you do want to pay attention to is the difference in where the front sprocket sits laterally. There's a discussion here that sort of touches on it:
http://forums.sohc4.net/index.php?topic=77449.msg872659#msg872659. The short story is that the K7 and K8's front sprocket (inside mounting surface) is 3/8ths of an inch more outboard relative to the mounts of the engine.
If you look at the link, it discusses the carrier... the K7 and K8 bike carriers were wider to accommodate the more outboard chain/front sprocket. There are differences between the K7/K8 frame and prior but the engine mounts relative to the swing arm pivot are the same. This kinda opens up possibilities for swing arm swaps... for example, if you have a K3 frame and K8 engine, it might make sense to get a K8 swing arm and carrier to alleviate the alignment issue. (K8 swing arms are slightly wider and longer than K6 and prior)