I don't mean the question harshly or sarcastically. I'm suggesting you take a hard look at your motivations for staying even this long. I'm sure some of them are positive: you say the project interests you technically; maybe you have at least one or two co-workers you enjoy working with. But are there any negative motivations? Those could include martyrhood: a feeling that you somehow have to save this project, even though you almost certainly can't. Or, maybe you have some fear around interviewing, or are unsure you can find anything better. Or maybe just plain inertia.
If you thought that the project might somehow succeed and that you would ultimately get credit for that, that would be one thing. But in the extremely unlikely event that it does succeed, it's clear that K will get the credit; she's already moved to sideline you.
There's nothing here for you. Really. Find another job now.