One of the pair, 30-year-old Sokrat Sinjari, had previously been deported after his asylum application was refused but had returned.
Both Sinjari and 22-year-old Sheme Selman have now been jailed.
Bradford Crown Court heard how Sinjari and Selman were arrested after police raided a house on Woodhall View in Bradford on May 17 this year.
Officers who forced entry found Selman on the first-floor landing. Sinjari was hiding behind a bedroom door.
The loft had been converted into a cannabis grow with LED lights, an extraction unit, and other equipment.
Keys were discovered to the front and back doors as well as bank cards, smart phones, £75 in cash, and receipts showing that cash had been paid into a Monza account the day before the pair were arrested.
A total of 46 plants, capable of producing 4kg of cannabis, were found on site as well as 6kg of vacuum-packed dried cannabis.
Both men pleaded guilty to production of Class B drugs with intent to supply.
The court heard that Sinjari was in a breach of a deportation order.
He came to the UK from the Netherlands in the back of a lorry in February 2023.
He was refused leave to enter and returned to Rotterdam.
Just over 18 months later Sinjari, who was again in the UK, was served with illegal entry papers and told he would be deported.
The following month, at Bradford Crown Court, he was jailed for 12 months for production of cannabis.
An asylum claim was ongoing at the time, but it was refused and a deportation order was made.
Sinjari was removed back to Albania on February 3 this year but some time after that he returned to the UK, putting him in breach of the deportation order.
Selmen, who had no previous convictions, was said to have come to the UK illegally in 2023 when he was 19 having borrowed £10,000 from persons in Albania.
Between November last year and January this year he was held in an immigration centre, and his asylum claim was refused on January 8.
The court heard that Sinjari also owed a debt to the people that had carried him and there had been a suggestion that, if he did not do what he was told, his family back in Albania would be harmed.
Both men appeared in court via video link from HMP Leeds.
Mr Recorder Shufqat Khan told Selmen: “You knew you would have to work in a grow house for about a year in order to pay off the debt.”
Addressing Sinjari’s limited education and history of unskilled work, he said: “The lack of opportunities for you back home [in Albania], because of those factors, led to your decision to come to the United Kingdom.
“You also appear to have borrowed a sum of £10,000 and like your co-defendant you were in fear of repercussions if the sum … was not worked off.”
Recorder Khan said both men had some awareness of the scale of the operation, which was capable of producing significant quantities of cannabis, and that they played a significant role.
He said the “likely yield” was around 10kg of the drug.
He sentenced Sinjari to 20 months for cannabis production plus eight months for breaching the deportation order – a total of 28 months.
Selmen was handed 18 months’ imprisonment.
Both men were told they would serve “in the region of 40 per cent” of their sentences in custody before being released on licence.
Recorder Khan ordered the forfeiture and destruction of the drugs seized and all paraphernalia including mobile phones, plus the forfeiture of the cash.