Klodian Sulovari and Eldison Kalemi, who are both from Albania, put themselves and police officers at risk when they fled an abandoned restaurant, where 533 cannabis plants were growing, via the roof.
Newcastle Crown Court heard police had gone to the Riverside Lodge building in Morpeth, Northumberland, last October to search for drugs and the men were both arrested on the rooftop, without any injuries being caused.
But prosecutor David Robinson-Young told the court: “The officers and the defendants themselves were put at risk.”
Mr Robinson-Young said the 533 cannabis plants that were found growing inside had a potential value of between £57,000 and £240,000 and it was a “well established, industrial sized grow”.
The officers also found 224 cuttings and evidence of an earlier crop.
Mr Robinson-Young said Sulovari, 45, and Kalemi, 27, are both from Albania and entered the UK illegally.
Both men, who are of no fixed address, admitted producing cannabis.
Kalemi has a previous conviction for a similar offence in Manchester in 2022.
The court heard both men travelled to the UK in a bid to find legal work to support their families.
Andrew Walker, defending Sulovari, said: “The origin was down to the simple desire of a family man to seek work and earn for his family.”
Liam O’Brien, defending Kalemi, said the former plumber lost his job due to the economic situation in his home country and had wanted to work in the construction industry in the UK.
Sulovari was jailed for 20 months and Kalemi for 24 months.