The HTC One and Samsung Galaxy S4 enjoyed some alone time as the top flagships, but their position on top is now threatened with several new entrants including the Sony Xperia Z1. The Xperia Z1 comes with several advantages like its faster processor and improved camera but the Galaxy S4 is still a great device in its own right
If you already own a Galaxy S4 you should probably hang onto it for at least another year. While the Xperia Z1 is definitely the better device of the two, the differences aren't too big.
You can check out a detailed comparison between the Sony Xperia Z1 and the HTC One on PhoneArena.