Tearful Eridon Hoxha was handed a two-year sentence after he admitted producing the drug at a property on Main Street in South Hiendley, but claims he was only ordered to look after the crop by a drugs gang in return for free accommodation.
Prosecutor Carmel Pearson told Leeds Crown Court that police targeted the terraced property on April 14 and found more than 100 baby plants across two rooms, along with the usual growing paraphernalia, including transformers and lights.
Dried cannabis weighing 9.1kg was also bagged up, and the electricity had been bypassed.
There was no sign of Hoxha, but immigration documents addressed to him were found. Police were able to arrest him a short time later.
Mitigating for the 27-year-old, Richard Canning said: "He came to this country unlawfully and does not expect to be able to stay.
"He was initially working as a photographer but found money hard to come by and became homeless.
"He was offered the opportunity for free accommodation if he tended to those plants, and he agreed to do that.
"Neither the cannabis or the profits were his."
However, Judge Tom Bayliss QC, said that Hoxha had played a "significant role" and would be sentenced as such, causing the defendant - who appeared via video link from HMP Leeds - to break down in tears.
Judge Bayliss said: "In my judgement, this set up was capable of producing significant quantities of cannabis for commercial use.
"You were caught nearby and you had keys to the property. It's clear to me you had a significant role in this operation.
"You plainly had an awareness of the scale of the operation."
Hoxha, of no fixed address, was told he is likely to be released after serving half of the two-year sentence, and sent back to Albania.
Under government legislation, foreign nationals sentence to more than one year in prison will be deported after being released.