After comments, this answer is an addendum to MonkeyZeus' post, based on the same method, but with a twist.
It's impossible to tell from your pictures whether those rafters have purlins to prevent spread, or whether they're just 'plonked on top' of the ceiling joists.
As an unsupported roof sags, it can push the walls out from the vertical as it drops.
Imagine a roof as a simple inverted V thus ∧ rather than a correctly-braced A. If you push down on the top the sides have no option but to spread out - pushing the wall with it.
Depending on how far this has all managed to move over the years, you may have to consider pulling the walls back in as part of the process.
I've done this before as very much a 'wing & a prayer' DIY task to save the many thousands it would have cost to strip the roof entirely & rebuild it all correctly.
We started with two 10-ton boat winches & 4 heavy steel plates. You may have seen these on old buildings & thought they were decorational. Known as patress plates, they were most definitely functional - see https://www.redgwick.co.uk - though we didn't go for pretty we went for functional, as they weren't going to be permanent.
Though these are perfect for holding a wall in place permanently, they're not so good at dragging one back into line if it's gone a bit far.
That's where the boat winches come into play. They're ratcheted, so you pull them in a click at a time & they won't slip back. The idea is that you drag the walls in very slowly so they have time to get used to the idea, not try to wind it all back in in one go. We spent 6 months gradually pulling in - this was on a Victorian brick build. The winches were then left in place a further two years after completion.
You combine this slow, careful action with one or two 'portable' steel girders placed across the tops of the walls, spanning the roof space in the same way as your rafters. You then use pit props, scaffold jacks; or whatever they're called in your territory - basically two pipes, one inside the other with a method of screwing them up to support a vertical.
The jacks go on the girders, pushing up at the centre of the roof. The winches wind in the walls. Once everything is back in correct position [not quite as simple as it sounds], you then brace it all in properly - either turning the ∧ into an A or set trusses as in MonkeyZeus' image.
30 years later, the old Victorian pile still has vertical walls & its original roof, now correctly braced.