Franklin's slam, Seattle's fifth this season, came off Jordan Lyles (4-4) in a seven-run second.
Hernandez (11-4) scattered four hits with seven strikeouts over six innings to lower his AL-leading ERA to 2.43. He is 6-0 in his last 10 starts and hasn't lost since May 25.
Brad Miller, Dustin Ackley and Michael Saunders drove in two runs each to help the Mariners wrap up a three-game sweep.
Lyles yielded eight hits and 10 runs, with a career-high nine earned, in four-plus innings to lose his third consecutive decision.
The Mariners piled up 13 hits, a day after managing just one in a 4-2 win.
Hernandez didn't allow a runner past first base until the fifth when Justin Maxwell reached on an error by Miller at shortstop and went to second on a wild pitch. Maxwell advanced to third on a one-out single by Jake Elmore, but Hernandez left Houston empty-handed when Jose Altuve grounded into a double play.
Kendrys Morales singled to open the Seattle second and Kyle Seager reached on an error at shortstop by Elmore.
Michael Saunders drew a one-out walk to load the bases before an infield single by Ackley made it 1-0. A second run came home when Lyles plunked Henry Blanco with a pitch.
Miller's RBI single pushed the lead to 3-0 before the grand slam by Franklin, off to an impressive start in his rookie season.
Lyles retired Raul Ibanez before finally escaping the inning when Morales came up again and grounded out.
Lyles settled down after that and retired six of his next seven batters. Things started going awry again in the fifth when Ibanez led off with a double before an RBI single by Morales made it 8-0. Lyles hit Seager with a pitch and was chased by Justin Smoak's single.
Saunders grounded into a force out to add another run and the Mariners went up 10-0 on a sacrifice fly by Ackley.
Miller pushed the lead to 11-0 with an RBI single in the seventh and Saunders extended his career-best hitting streak to 10 games with an RBI double in the eighth.
The Astros got a run-scoring single from Altuve in the seventh and tacked on four runs in the ninth to make it 12-5.
NOTES: Houston opens a series with the Athletics on Monday when Dallas Keuchel (4-5) opposes Tommy Milone (8-8). ... The Mariners return home to begin a series against Cleveland, with Aaron Harang (4-8) scheduled to pitch against Ubaldo Jimenez (7-4). ... It was the fourth time this season the Mariners scored 10 runs or more and the second in this series.