As San Francisco officials continue to scout locations for a factory that can churn out modular housing units, Mayor London Breed is lining up the city to be the first customer.

Breed is expected to announce Monday that the city is prepared to spend $100 million on hundreds of modular apartments that would grow the city’s stock of affordable housing.

Who will run the modular housing factory won’t be known for some time, though the leading plan is to seek a private operator on city-owned or city-leased property. And even after a site is selected, it will take years to get a factory up and running.

But Breed and other officials hope the early — and sizable — promise to buy will entice interested operators to set up shop in San Francisco.

“We are in a crisis. We need more housing in San Francisco, so we have to be open to exploring every opportunity to produce more, and produce more faster,” Breed said. “We’re going to use every opportunity to find creative solutions to build more housing in San Francisco. Everything is on the table.”

Modular housing is widely seen as a potential breakthrough in San Francisco’s protracted struggle to combat its dual housing shortage and affordability crisis by swiftly building more below-market-rate units, many of which would be reserved for formerly homeless people.

With modular construction, the components of a housing development are built in one place, shipped to a construction site and then assembled. Using the efficiencies of a factory assembly line, the individual parts can be built more quickly — and cheaply.

“Right now (modular construction) for sure delivers speed. It’s very efficient in terms of getting materials in place with design certainty,” said Kate Hartley, director of the Mayor’s Office of Housing and Community Development, the agency expected to put up the money for the modular units.

Over time, Hartley said, modular construction could also bring construction costs down by as much as 10 percent “as the industry grows and as technology improves.”

Today, it usually costs $750,000 to $800,000 to build a single affordable unit within a housing development in San Francisco, including the cost of buying land. Funding from federal and state housing programs, fees from developers, and other sources typically pay for just over half of that cost. The city generally picks up the remaining $300,000 to $350,000 for each unit, Hartley said.

With modular construction, she thinks the city can shave around $50,000 off the cost of each unit.

Now Playing:

“If we can achieve those kinds of savings — even $50,000 per unit — that makes a huge difference over time as we strive to build more affordable housing,” she said. “Any savings we can achieve with modular development is more money we would reinvest right back into more affordable housing.”

Hartley estimates that the city’s initial $100 million purchase could help build around 400 affordable apartment units. Once the factory is operational, she said the city would look to deploy that money over “a short time frame,” probably one or two years.

The city wouldn’t be the factory’s only client, Hartley said. Other cities in the Bay Area facing their own punishing housing shortages could buy modular units, as could market-rate developers. Modular units are already being built in San Francisco, but they use components trucked in from other parts of the country.

Because a substantial portion of the work needed to build modular apartments happens in factories, not on construction sites, the advent of more modular housing in San Francisco initially met stiff resistance from the city’s powerful building trades unions, who feared their members would lose out on job opportunities.

But modular supporters cleared a big hurdle in January, when Breed, then serving as acting mayor, announced that the unions were on board and willing to partner with the city in the plan to bring the factory to San Francisco. In return for the unions’ support, the city provided assurances that workers would participate in planning, developing and, eventually, operating the factory.

“If we decided to do this on our own, without (the building trades), most likely it would fail because they wouldn’t be included,” Breed said. “So instead of bringing them along on the back end, we’re bringing them along on the front end to get their support and work with them so we do it right.”

Jennifer Friedenbach, executive director of San Francisco’s Coalition on Homelessness, said the prospect of adding to the city’s affordable housing stock while creating unionized jobs locally was “really exciting.”

“If they produce the modular units in San Francisco, it’s a win-win for everyone,” she said.

An ongoing study by the design firm Nelson Worldwide exploring what it will take to bring the modular factory to San Francisco is expected to wrap up by the end of the year. That study is looking into everything from the cost of building the factory to potential locations to how supplies could be efficiently moved in and out.

“We have not done what I believe is enough housing production in San Francisco as a whole,” Breed said. “This could be an incredible opportunity for the city and for housing production in the future.”

Dominic Fracassa is a San Francisco Chronicle staff writer. Email: dfracassa@sfchronicle.com Twitter: @dominicfracassa