I would not put those materials directly in the compost. But one way you could pre-treat them would be to put them in a plastic bag and leave the bag in direct sun to solarlize -- kill with heat of the sun.
I'm not sure how many hours per day or how many days would do the trick though. I hope someone else has a better idea.
When I have done this, I just left it for a week or so -- with some luck and depending on the material, they will dessicate rather than turning into goop, making them easier to handle when putting in the compost pile. If the plant matter is infested with lively/mobile pests, be sure the bag has no holes

and to securely tie the bag closed
With branches and such, your best bet might be to burn them, then you can put the ashes in the compost.