Two Vietnamese men, who came into the country illegally, helped run a commercial cannabis factory from a house in Hemel Hempstead.
Thanh Vu, 35, and Duong Le, 33, will face deportation once they have served prison sentences for their part in the operation that could have produced nearly £250,000 worth of powerful skunk.
Peter Shaw, prosecuting at St Albans Crown Court on Monday, said the men were arrested in March last year when police checked a silver Audi that was parked in Long Chaulden, Hemel. Vu, who was the driver, had no insurance and £540 on him.
Documents and a key Le had thrown onto the floor led the officers to 292 Belswains Lane in Hemel.
The door had been locked from the inside and the officers had to force their way in. Once inside they found 202 cannabis plants in an infant stage of growth in the loft. In one bedroom there were 56 mature plants and in a second room were 36 more.
According to a police expert, the 294 plants would have produced skunk valued at between £82,000 and £247,000.
Both men, who were aided by a Vietnamese interpreter, pleaded guilty to cultivating cannabis. Vu also admitted having no insurance.
Francis McGrath said Vu had come to the UK four years ago in the back of a lorry from France. He had wanted to send money back to his relatives.
Andrew Horsell said Le had borrowed money to get to the UK via Russia and Europe. He had been working in a kitchen, but lost his job in 2013 and was sofa surfing with friends when he was offered the chance to water the cannabis plants.
Judge Andrew Bright QC said: “It was a substantial cannabis factory. They were manufacturing cannabis on a commercial scale.”
He told them he accepted they were not the brains of the operation and sentenced Vu to 20 months and Le to 16 months.
The judge told them: “The border agency will automatically consider deportation when you have completed your sentence.”
The £540 found on Vu was forefeit.