When consuming a caloric deficit to lose weight every additional calorie not eaten is essentially replaced by a calorie of endogenous fat. If one were to consume no fat, no protein, and 50 grams of carbs - the worst possible macro ratio, one would still be in ketosis if they weren’t exceeding their carb tolerance/budget.
I think some make the mistake of focusing on the consumed macro ratios and eat more fat to compensate for eating more protein and especially for eating more carbs. But it doesn’t work that way. Each additional gram of fat eaten is merely preventing an additional gram of endogenous fat from being burned.
Carbs are a problem when they raise insulin blocking fat burning. Even worse when this leads to the blood sugar roller coaster which increases appetite. Slow digesting carbs such as those in leafy greens are very unlikely to cause those effects unless one has a very deranged metabolism. And their bulk can help with satiety with significantly less total protein and fat making a net win for weight loss.
Clearly fruit such as tomatoes have an unfavorable keto profile with too high a ratio of carbs, especially sugar and are a bad choice if one is trying to maximize weight loss or ketosis. I only eat our home grown tomatoes which probably have no better a macro profile then commercial tomatoes but they have an amazingly better taste and a small amount greatly increases my enjoyment and satisfaction. It’s often been said “The best diet is the one you can keep.”